[FFmpeg-cvslog] ffv1: inject sentinels for RC->VLC transitions begining with 1.3

Michael Niedermayer git at videolan.org
Tue Sep 25 03:49:03 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep 24 04:54:26 2012 +0200| [d8676140decd42dc6b8fa2e693ba7d2fd79c1578] | committer: Michael Niedermayer

ffv1: inject sentinels for RC->VLC transitions begining with 1.3

This breaks bitstream compatibility of 1.3 VLC streams
This fixes very rare errors in the RC stream at the transition point
to VLC.

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

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

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

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 5e74f17..210400b 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -817,7 +817,7 @@ static int write_extra_header(FFV1Context *f){
     put_symbol(c, state, f->version, 0);
     if(f->version > 2) {
         if(f->version == 3)
-            f->minor_version = 1;
+            f->minor_version = 2;
         put_symbol(c, state, f->minor_version, 0);
     }
     put_symbol(c, state, f->ac, 0);
@@ -1241,6 +1241,8 @@ static int encode_slice(AVCodecContext *c, void *arg){
         encode_slice_header(f, fs);
     }
     if(!fs->ac){
+        if(f->version > 2)
+            put_rac(&fs->c, (int[]){129}, 0);
         fs->ac_byte_count = f->version > 2 || (!x&&!y) ? ff_rac_terminate(&fs->c) : 0;
         init_put_bits(&fs->pb, fs->c.bytestream_start + fs->ac_byte_count, fs->c.bytestream_end - fs->c.bytestream_start - fs->ac_byte_count);
     }
@@ -1675,6 +1677,8 @@ static int decode_slice(AVCodecContext *c, void *arg){
     y= fs->slice_y;
 
     if(!fs->ac){
+        if (f->version > 2)
+            get_rac(&fs->c, (int[]){129});
         fs->ac_byte_count = f->version > 2 || (!x&&!y) ? fs->c.bytestream - fs->c.bytestream_start - 1 : 0;
         init_get_bits(&fs->gb,
                       fs->c.bytestream_start + fs->ac_byte_count,



More information about the ffmpeg-cvslog mailing list