[FFmpeg-cvslog] cinepak: More correct Cinepak decoder.

u-bo1b@0w.se git at videolan.org
Wed Feb 20 04:15:17 CET 2013


ffmpeg | branch: master | u-bo1b at 0w.se <u-bo1b at 0w.se> | Mon Feb 18 20:47:45 2013 +0100| [8d1dd5bd5040bdea9770bd3f5ceb5aab670655d9] | committer: Michael Niedermayer

cinepak: More correct Cinepak decoder.

change the treatment of the strip y coordinates which previously did
not follow the description (nor did it behave like the binary decoder
on files with absolute strip offsets).

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

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

 libavcodec/cinepak.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index a88469a..5bd3f13 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -366,10 +366,13 @@ static int cinepak_decode (CinepakContext *s)
             return AVERROR_INVALIDDATA;
 
         s->strips[i].id = s->data[0];
-        s->strips[i].y1 = y0;
-        s->strips[i].x1 = 0;
-        s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]);
-        s->strips[i].x2 = s->avctx->width;
+/* zero y1 means "relative to the previous stripe" */
+        if (!(s->strips[i].y1 = AV_RB16 (&s->data[4])))
+            s->strips[i].y2 = (s->strips[i].y1 = y0) + AV_RB16 (&s->data[8]);
+        else
+            s->strips[i].y2 = AV_RB16 (&s->data[8]);
+        s->strips[i].x1 = AV_RB16 (&s->data[6]);
+        s->strips[i].x2 = AV_RB16 (&s->data[10]);
 
         if (s->strips[i].id == 0x10)
             s->frame.key_frame = 1;



More information about the ffmpeg-cvslog mailing list