[FFmpeg-cvslog] ffv1: fix plane_count at version 1.4

Michael Niedermayer git at videolan.org
Thu Aug 15 13:42:43 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Aug 15 13:03:32 2013 +0200| [c387c45e8301bc49d5b233e890839cdc0f8b3752] | committer: Michael Niedermayer

ffv1: fix plane_count at version 1.4

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c387c45e8301bc49d5b233e890839cdc0f8b3752
---

 libavcodec/ffv1dec.c |    2 +-
 libavcodec/ffv1enc.c |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 7722507..fba01b9 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -499,7 +499,7 @@ static int read_extra_header(FFV1Context *f)
     f->chroma_h_shift             = get_symbol(c, state, 0);
     f->chroma_v_shift             = get_symbol(c, state, 0);
     f->transparency               = get_rac(c, state);
-    f->plane_count                = 2 + f->transparency;
+    f->plane_count                = 1 + (f->chroma_planes || f->version<4) + f->transparency;
     f->num_h_slices               = 1 + get_symbol(c, state, 0);
     f->num_v_slices               = 1 + get_symbol(c, state, 0);
 
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 128eeb2..032375a 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -797,6 +797,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
 
     if (!s->transparency)
         s->plane_count = 2;
+    if (!s->chroma_planes && s->version > 3)
+        s->plane_count--;
+
     avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
     s->picture_number = 0;
 



More information about the ffmpeg-cvslog mailing list