[FFmpeg-cvslog] avcodec/huffyuvenc: fix -context 1 encoding

Michael Niedermayer git at videolan.org
Wed Jan 8 12:59:12 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan  8 12:38:57 2014 +0100| [5d4541007f1dad20866458176ac7f63d9eb21d94] | committer: Michael Niedermayer

avcodec/huffyuvenc: fix -context 1 encoding

Fixes Ticket3281

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

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

 libavcodec/huffyuvenc.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index f825fe3..dc9d770 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -554,7 +554,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         return ret;
 
     if (s->context) {
-        for (i = 0; i < 4; i++) {
+        int count = 3;
+
+        if (s->version > 2)
+            count = 1 + s->alpha + 2*s->chroma;
+
+        for (i = 0; i < count; i++) {
             ff_huff_gen_len_table(s->len[i], s->stats[i]);
             if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0)
                 return -1;



More information about the ffmpeg-cvslog mailing list