@ -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 ) ;