img2enc: support 16bit per sample yuv in split planes.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-06 02:27:04 +01:00
parent 52c40a0e52
commit 2a0dfc51ea
1 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if(img->split_planes){ if(img->split_planes){
int ysize = codec->width * codec->height; int ysize = codec->width * codec->height;
int usize = ((-codec->width)>>desc->log2_chroma_w) * ((-codec->height)>>desc->log2_chroma_h); 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[0], pkt->data , ysize);
avio_write(pb[1], pkt->data + ysize , usize); avio_write(pb[1], pkt->data + ysize , usize);
avio_write(pb[2], pkt->data + ysize + usize, usize); avio_write(pb[2], pkt->data + ysize + usize, usize);