* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
*/
/**
* TIFF image encoder
- * @file tiffenc.c
+ * @file libavcodec/tiffenc.c
* @author Bartlomiej Wolowiec
*/
#include "avcodec.h"
-#ifdef CONFIG_ZLIB
+#if CONFIG_ZLIB
#include <zlib.h>
#endif
#include "bytestream.h"
enum TiffTags tag, enum TiffTypes type, int val){
uint16_t w = val;
uint32_t dw= val;
- add_entry(s, tag, type, 1, type == TIFF_SHORT ? &w : &dw);
+ add_entry(s, tag, type, 1, type == TIFF_SHORT ? (void *)&w : (void *)&dw);
}
/**
{
switch (compr) {
-#ifdef CONFIG_ZLIB
+#if CONFIG_ZLIB
case TIFF_DEFLATE:
case TIFF_ADOBE_DEFLATE:
{
*p = *pict;
p->pict_type = FF_I_TYPE;
p->key_frame = 1;
+ avctx->coded_frame= &s->picture;
s->compr = TIFF_PACKBITS;
if (avctx->compression_level == 0) {
s->compr = TIFF_RAW;
} else if(avctx->compression_level == 2) {
s->compr = TIFF_LZW;
-#ifdef CONFIG_ZLIB
+#if CONFIG_ZLIB
} else if ((avctx->compression_level >= 3)) {
s->compr = TIFF_DEFLATE;
#endif
}
}
-#ifdef CONFIG_ZLIB
+#if CONFIG_ZLIB
if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) {
uint8_t *zbuf;
int zlen, zn;
add_entry(s, TIFF_XRES, TIFF_RATIONAL, 1, res);
add_entry(s, TIFF_YRES, TIFF_RATIONAL, 1, res);
add_entry1(s,TIFF_RES_UNIT, TIFF_SHORT, 2);
+
+ if(!(avctx->flags & CODEC_FLAG_BITEXACT))
add_entry(s, TIFF_SOFTWARE_NAME, TIFF_STRING,
strlen(LIBAVCODEC_IDENT) + 1, LIBAVCODEC_IDENT);
PIX_FMT_MONOBLACK, PIX_FMT_MONOWHITE,
PIX_FMT_YUV420P, PIX_FMT_YUV422P,
PIX_FMT_YUV444P, PIX_FMT_YUV410P,
- PIX_FMT_YUV411P
- -1}
-
+ PIX_FMT_YUV411P,
+ PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
};