[FFmpeg-devel] [PATCH 2/4] ffv1dec: PIX_FMT_YUVA420P support
Paul B Mahol
onemda at gmail.com
Tue Jan 31 21:18:22 CET 2012
Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
libavcodec/ffv1.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 2ba8845..e496de4 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -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;
--
1.7.7
More information about the ffmpeg-devel
mailing list