Mesa (pipe-video): [g3dvl] fix fi_frame mb increment

Christian König deathsimple at kemper.freedesktop.org
Sun May 15 17:24:33 UTC 2011


Module: Mesa
Branch: pipe-video
Commit: 6c731191c08561ea247cb2fcfacdf08f6b842363
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c731191c08561ea247cb2fcfacdf08f6b842363

Author: Christian König <deathsimple at vodafone.de>
Date:   Sat May 14 17:11:33 2011 +0200

[g3dvl] fix fi_frame mb increment

---

 src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
index 7723d48..a7aa5cd 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
@@ -1534,8 +1534,6 @@ do {							\
 
 #define NEXT_MACROBLOCK		                \
 do {				                \
-   bs->mv_stream[0][x+y*bs->width] = mv_fwd;    \
-   bs->mv_stream[1][x+y*bs->width] = mv_bwd;    \
    ++x;				                \
    if (x == bs->width) {	                \
       ++y;                                      \
@@ -1545,6 +1543,22 @@ do {				                \
    }                                            \
 } while (0)
 
+static inline void
+store_motionvectors(struct vl_mpg12_bs *bs, int x, int y,
+                    struct pipe_motionvector *mv_fwd,
+                    struct pipe_motionvector *mv_bwd)
+{
+   bs->mv_stream[0][x+y*bs->width].top = mv_fwd->top;
+   bs->mv_stream[0][x+y*bs->width].bottom =
+      mv_fwd->top.field_select == PIPE_VIDEO_FRAME ?
+      mv_fwd->top : mv_fwd->bottom;
+
+   bs->mv_stream[1][x+y*bs->width].top = mv_bwd->top;
+   bs->mv_stream[1][x+y*bs->width].bottom =
+      mv_bwd->top.field_select == PIPE_VIDEO_FRAME ?
+      mv_bwd->top : mv_bwd->bottom;
+}
+
 static inline bool
 slice_init(struct vl_mpg12_bs *bs, struct pipe_mpeg12_picture_desc * picture,
            int *quantizer_scale, int *x, int *y)
@@ -1771,6 +1785,7 @@ decode_slice(struct vl_mpg12_bs *bs, struct pipe_mpeg12_picture_desc *picture, c
          dc_dct_pred[0] = dc_dct_pred[1] = dc_dct_pred[2] = 0;
       }
 
+      store_motionvectors(bs, x, y, &mv_fwd, &mv_bwd);
       NEXT_MACROBLOCK;
 
       vl_vlc_needbits(&bs->vlc);
@@ -1807,7 +1822,9 @@ decode_slice(struct vl_mpg12_bs *bs, struct pipe_mpeg12_picture_desc *picture, c
             mv_fwd.top.x = mv_fwd.top.y = mv_fwd.bottom.x = mv_fwd.bottom.y = 0;
             mv_fwd.top.weight = mv_fwd.bottom.weight = PIPE_VIDEO_MV_WEIGHT_MAX;
          }
+
          do {
+            store_motionvectors(bs, x, y, &mv_fwd, &mv_bwd);
             NEXT_MACROBLOCK;
          } while (--mba_inc);
       }




More information about the mesa-commit mailing list