summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-05-14 17:11:33 +0200
committerChristian König <[email protected]>2011-05-14 17:11:33 +0200
commit6c731191c08561ea247cb2fcfacdf08f6b842363 (patch)
tree107abd08cd212554433e66439712aecc1886d55f /src
parentce31aaec02de0ef509dcee9d641c39623017a638 (diff)
[g3dvl] fix fi_frame mb increment
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c21
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 7723d487d84..a7aa5cdd073 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);
}