utvideo: Fix interlaced prediction for RGB utvideo.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 21 Jun 2012 21:11:23 +0000 (21:11 +0000)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Fri, 22 Jun 2012 15:45:25 +0000 (11:45 -0400)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
libavcodec/utvideo.c

index a3b0d7c..e5efa4a 100644 (file)
@@ -439,10 +439,17 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
                                plane_start[i], c->frame_pred == PRED_LEFT);
             if (ret)
                 return ret;
-            if (c->frame_pred == PRED_MEDIAN)
-                restore_median(c->pic.data[0] + rgb_order[i], c->planes,
-                               c->pic.linesize[0], avctx->width, avctx->height,
-                               c->slices, 0);
+            if (c->frame_pred == PRED_MEDIAN) {
+                if (!c->interlaced) {
+                    restore_median(c->pic.data[0] + rgb_order[i], c->planes,
+                                   c->pic.linesize[0], avctx->width,
+                                   avctx->height, c->slices, 0);
+                } else {
+                    restore_median_il(c->pic.data[0] + rgb_order[i], c->planes,
+                                      c->pic.linesize[0], avctx->width,
+                                      avctx->height, c->slices, 0);
+                }
+            }
         }
         restore_rgb_planes(c->pic.data[0], c->planes, c->pic.linesize[0],
                            avctx->width, avctx->height);