ffv1dec: PIX_FMT_YUVA420P support

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Paul B Mahol 2012-01-31 20:18:22 +00:00 committed by Michael Niedermayer
parent 7054629f04
commit ab7da16ea4
1 changed files with 10 additions and 1 deletions

View File

@ -1435,6 +1435,8 @@ static int decode_slice(AVCodecContext *c, void *arg){
decode_plane(fs, p->data[1] + ps*cx+cy*p->linesize[1], chroma_width, chroma_height, p->linesize[1], 1);
decode_plane(fs, p->data[2] + ps*cx+cy*p->linesize[1], chroma_width, chroma_height, p->linesize[2], 1);
if (fs->transparency)
decode_plane(fs, p->data[3] + ps*x + y*p->linesize[3], width, height, p->linesize[3], 2);
}else{
decode_rgb_frame(fs, (uint32_t*)p->data[0] + ps*x + y*(p->linesize[0]/4), width, height, p->linesize[0]/4);
}
@ -1571,7 +1573,7 @@ static int read_header(FFV1Context *f){
}
if(f->colorspace==0){
if(f->avctx->bits_per_raw_sample<=8){
if(f->avctx->bits_per_raw_sample<=8 && !f->transparency){
switch(16*f->chroma_h_shift + f->chroma_v_shift){
case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break;
case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break;
@ -1582,6 +1584,13 @@ static int read_header(FFV1Context *f){
av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
return -1;
}
}else if(f->avctx->bits_per_raw_sample<=8 && f->transparency){
switch(16*f->chroma_h_shift + f->chroma_v_shift){
case 0x11: f->avctx->pix_fmt= PIX_FMT_YUVA420P; break;
default:
av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
return -1;
}
}else if(f->avctx->bits_per_raw_sample==9) {
switch(16*f->chroma_h_shift + f->chroma_v_shift){
case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break;