aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tiffenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-13 03:45:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-13 03:45:45 +0200
commitb9b2f9d218bad3001edc64704865987fd7cf7dca (patch)
tree2fa210c6ef3eba82b0e1cf67ae315903f81098fb /libavcodec/tiffenc.c
parent75b4e4013796b26c8cc22fd9f9bec0cc8672c767 (diff)
parenta9b046fb0ae5395c4d1d8a82cd0d3e354b5034ed (diff)
downloadffmpeg-b9b2f9d218bad3001edc64704865987fd7cf7dca.tar.gz
Merge commit 'a9b046fb0ae5395c4d1d8a82cd0d3e354b5034ed'
* commit 'a9b046fb0ae5395c4d1d8a82cd0d3e354b5034ed': tiff: use a better name and enum values for PhotometricInterpretation Conflicts: libavcodec/tiff.c libavcodec/tiff.h libavcodec/tiffenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tiffenc.c')
-rw-r--r--libavcodec/tiffenc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index 67229a93b1..456b3bf54a 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -58,7 +58,7 @@ typedef struct TiffEncoderContext {
unsigned int bpp; ///< bits per pixel
int compr; ///< compression level
int bpp_tab_size; ///< bpp_tab size
- int photometric_interpretation; ///< photometric interpretation
+ enum TiffPhotometric photometric_interpretation; ///< photometric interpretation
int strips; ///< number of strips
uint32_t *strip_sizes;
unsigned int strip_sizes_size;
@@ -254,7 +254,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
alpha = 1;
case AV_PIX_FMT_RGB48LE:
case AV_PIX_FMT_RGB24:
- s->photometric_interpretation = 2;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_RGB;
break;
case AV_PIX_FMT_GRAY8:
avctx->bits_per_coded_sample = 0x28;
@@ -262,13 +262,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
alpha = avctx->pix_fmt == AV_PIX_FMT_GRAY8A;
case AV_PIX_FMT_GRAY16LE:
case AV_PIX_FMT_MONOBLACK:
- s->photometric_interpretation = 1;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_BLACK_IS_ZERO;
break;
case AV_PIX_FMT_PAL8:
- s->photometric_interpretation = 3;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_PALETTE;
break;
case AV_PIX_FMT_MONOWHITE:
- s->photometric_interpretation = 0;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_WHITE_IS_ZERO;
break;
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV422P:
@@ -277,7 +277,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
case AV_PIX_FMT_YUV410P:
case AV_PIX_FMT_YUV411P:
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &shift_h, &shift_v);
- s->photometric_interpretation = 6;
+ s->photometric_interpretation = TIFF_PHOTOMETRIC_YCBCR;
s->subsampling[0] = 1 << shift_h;
s->subsampling[1] = 1 << shift_v;
is_yuv = 1;
@@ -426,9 +426,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (s->bpp_tab_size)
add_entry(s, TIFF_BPP, TIFF_SHORT, s->bpp_tab_size, bpp_tab);
- add_entry1(s, TIFF_COMPR, TIFF_SHORT, s->compr);
- add_entry1(s, TIFF_INVERT, TIFF_SHORT, s->photometric_interpretation);
- add_entry(s, TIFF_STRIP_OFFS, TIFF_LONG, strips, s->strip_offsets);
+ add_entry1(s, TIFF_COMPR, TIFF_SHORT, s->compr);
+ add_entry1(s, TIFF_PHOTOMETRIC, TIFF_SHORT, s->photometric_interpretation);
+ add_entry(s, TIFF_STRIP_OFFS, TIFF_LONG, strips, s->strip_offsets);
if (s->bpp_tab_size)
add_entry1(s, TIFF_SAMPLES_PER_PIXEL, TIFF_SHORT, s->bpp_tab_size);