[FFmpeg-cvslog] ffv1: set the range coder state in decode_slice_header

Luca Barbato git at videolan.org
Fri Oct 26 15:26:50 CEST 2012


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Thu Oct 25 15:42:08 2012 +0200| [22f7942fe7d7349e3562ac68fa101d9efec522df] | committer: Luca Barbato

ffv1: set the range coder state in decode_slice_header

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

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

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index f5f7a8f..c5329b4 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -273,7 +273,12 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
     unsigned ps, i, context_count;
     memset(state, 128, sizeof(state));
 
-    av_assert0(f->version > 2);
+    if (fs->ac > 1) {
+        for (i = 1; i < 256; i++) {
+            fs->c.one_state[i]        = f->state_transition[i];
+            fs->c.zero_state[256 - i] = 256 - fs->c.one_state[i];
+        }
+    }
 
     fs->slice_x      = get_symbol(c, state, 0) * f->width;
     fs->slice_y      = get_symbol(c, state, 0) * f->height;



More information about the ffmpeg-cvslog mailing list