aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/img2enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-06 02:27:04 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-06 02:27:04 +0100
commit2a0dfc51ea9c8e9df2aac56a98512a9dbbcc06cf (patch)
tree27bc33a6f26fb44c789fc235e2adf76385d9daf1 /libavformat/img2enc.c
parent52c40a0e52ea4ce70e0acd2e649ccaeb5330ee19 (diff)
downloadffmpeg-2a0dfc51ea9c8e9df2aac56a98512a9dbbcc06cf.tar.gz
img2enc: support 16bit per sample yuv in split planes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/img2enc.c')
-rw-r--r--libavformat/img2enc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index e0d6c99b49..58236eb1d5 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -100,6 +100,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if(img->split_planes){
int ysize = codec->width * codec->height;
int usize = ((-codec->width)>>desc->log2_chroma_w) * ((-codec->height)>>desc->log2_chroma_h);
+ if (desc->comp[0].depth_minus1 >= 8) {
+ ysize *= 2;
+ usize *= 2;
+ }
avio_write(pb[0], pkt->data , ysize);
avio_write(pb[1], pkt->data + ysize , usize);
avio_write(pb[2], pkt->data + ysize + usize, usize);