AMV video decoder.
[ffmpeg.git] / libavcodec / mjpegdec.c
index 7dc0616a8f73c6cd86c54e2ef3a8326d18365de4..d1d81d34939cde600099ef2f79c037fa135b23cd 100644 (file)
@@ -669,6 +669,11 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int ss, i
         int c = s->comp_index[i];
         data[c] = s->picture.data[c];
         linesize[c]=s->linesize[c];
+        if(s->avctx->codec->id==CODEC_ID_AMV) {
+            //picture should be flipped upside-down for this codec
+            data[c] += (linesize[c] * (s->v_scount[i] * 8 * s->mb_height - 1));
+            linesize[c] *= -1;
+        }
     }
 
     for(mb_y = 0; mb_y < s->mb_height; mb_y++) {