@@ -601,7 +601,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n)
if (ctx->divx_version == 500 && ctx->divx_build == 413 && a >= s->quarter_sample)
sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample));
else
- sum = RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a);
+ sum = ROUNDED_RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a);
} else {
dx = s->sprite_delta[n][0];
dy = s->sprite_delta[n][1];
@@ -623,7 +623,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n)
v += dx;
}
}
- sum = RSHIFT(sum, a + 8 - s->quarter_sample);
+ sum = ROUNDED_RSHIFT(sum, a + 8 - s->quarter_sample);
}
if (sum < -len)
@@ -861,10 +861,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
if (s->chroma_y_shift) {
if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
- motion_x[0] = RSHIFT(motion_x[0] + motion_x[1] +
- motion_x[2] + motion_x[3], 2);
- motion_y[0] = RSHIFT(motion_y[0] + motion_y[1] +
- motion_y[2] + motion_y[3], 2);
+ motion_x[0] = ROUNDED_RSHIFT(motion_x[0] + motion_x[1] +
+ motion_x[2] + motion_x[3], 2);
+ motion_y[0] = ROUNDED_RSHIFT(motion_y[0] + motion_y[1] +
+ motion_y[2] + motion_y[3], 2);
}
motion_x[0] = (motion_x[0] >> 1) | (motion_x[0] & 1);
motion_y[0] = (motion_y[0] >> 1) | (motion_y[0] & 1);
@@ -873,10 +873,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
s->motion_val[1][frag][1] = motion_y[0];
} else if (s->chroma_x_shift) {
if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
- motion_x[0] = RSHIFT(motion_x[0] + motion_x[1], 1);
- motion_y[0] = RSHIFT(motion_y[0] + motion_y[1], 1);
- motion_x[1] = RSHIFT(motion_x[2] + motion_x[3], 1);
- motion_y[1] = RSHIFT(motion_y[2] + motion_y[3], 1);
+ motion_x[0] = ROUNDED_RSHIFT(motion_x[0] + motion_x[1], 1);
+ motion_y[0] = ROUNDED_RSHIFT(motion_y[0] + motion_y[1], 1);
+ motion_x[1] = ROUNDED_RSHIFT(motion_x[2] + motion_x[3], 1);
+ motion_y[1] = ROUNDED_RSHIFT(motion_y[2] + motion_y[3], 1);
} else {
motion_x[1] = motion_x[0];
motion_y[1] = motion_y[0];
@@ -197,8 +197,8 @@ static void vp56_decode_4mv(VP56Context *s, int row, int col)
/* chroma vectors are average luma vectors */
if (s->avctx->codec->id == AV_CODEC_ID_VP5) {
- s->mv[4].x = s->mv[5].x = RSHIFT(mv.x,2);
- s->mv[4].y = s->mv[5].y = RSHIFT(mv.y,2);
+ s->mv[4].x = s->mv[5].x = ROUNDED_RSHIFT(mv.x,2);
+ s->mv[4].y = s->mv[5].y = ROUNDED_RSHIFT(mv.y,2);
} else {
s->mv[4] = s->mv[5] = (VP56mv) {mv.x/4, mv.y/4};
}
Three files in libavcodec/ use the RSHIFT macro from libavutil: - mpeg4videodec.c - vp3.c - vp56.c All instances of RSHIFT are updated to follow the name-change in libavutil/common.h (previous commit). Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com> --- libavcodec/mpeg4videodec.c | 4 ++-- libavcodec/vp3.c | 16 ++++++++-------- libavcodec/vp56.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-)