[FFmpeg-cvslog] thp: Fix handling of restart interval

Michael Niedermayer git at videolan.org
Sun Jan 15 00:57:36 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 14 23:30:01 2012 +0100| [1843e6c8aa9752aa7d500f8a2a0f072cf3a3aee0] | committer: Michael Niedermayer

thp: Fix handling of restart interval

Fixes Ticket903

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

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

 libavcodec/mjpegdec.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 64e5839..d3bcb6f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1048,6 +1048,12 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
 
             if (s->restart_interval) {
                 s->restart_count--;
+                if(s->restart_count == 0 && s->avctx->codec_id == CODEC_ID_THP){
+                    align_get_bits(&s->gb);
+                    for (i = 0; i < nb_components; i++) /* reset dc */
+                        s->last_dc[i] = 1024;
+                }
+
                 i = 8 + ((-get_bits_count(&s->gb)) & 7);
                 /* skip RSTn */
                 if (show_bits(&s->gb, i) == (1 << i) - 1) {



More information about the ffmpeg-cvslog mailing list