aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tiffenc.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-11-05 04:43:17 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-11-05 04:43:17 +0100
commitc673ef12885fdc007b21b9f52cdd50211d452d97 (patch)
tree7ece690bf87fe203eb45229312ba785bb982a380 /libavcodec/tiffenc.c
parentb015cd7eda9f1cdaf92f5275eb3bb3822b0b34cf (diff)
downloadffmpeg-c673ef12885fdc007b21b9f52cdd50211d452d97.tar.gz
Write tiff tag YCbCrPositioning if chroma_sample_location is top-left.
Diffstat (limited to 'libavcodec/tiffenc.c')
-rw-r--r--libavcodec/tiffenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index dae9147e4e..d4402859f0 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -471,6 +471,8 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
/** according to CCIR Recommendation 601.1 */
uint32_t refbw[12] = {15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1};
add_entry(s, TIFF_YCBCR_SUBSAMPLING, TIFF_SHORT, 2, s->subsampling);
+ if (avctx->chroma_sample_location == AVCHROMA_LOC_TOPLEFT)
+ add_entry1(s, TIFF_YCBCR_POSITIONING, TIFF_SHORT, 2);
add_entry(s, TIFF_REFERENCE_BW, TIFF_RATIONAL, 6, refbw);
}
bytestream_put_le32(&offset, ptr - pkt->data); // write offset to dir