aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rv34.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2011-08-02 13:45:28 +0200
committerRonald S. Bultje <rsbultje@gmail.com>2011-08-02 08:23:47 -0700
commit6f7fe4723b9bfbb52341568906e6168966f486b3 (patch)
tree0def9f082e0bebc7ac85e274bd702e960a21adb8 /libavcodec/rv34.c
parent73e8e8dbf969b9a0bc1591abcfeba474a42e47bc (diff)
downloadffmpeg-6f7fe4723b9bfbb52341568906e6168966f486b3.tar.gz
Correct chroma vector calculation for RealVideo 3.
Old version divided it wrong, which resulted in chroma drift (visible on FATE sample too as dirty trails left by clouds). Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/rv34.c')
-rw-r--r--libavcodec/rv34.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 9162da5194..1aec571ad3 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -737,8 +737,8 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type,
my = (s->current_picture_ptr->f.motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24);
lx = (s->current_picture_ptr->f.motion_val[dir][mv_pos][0] + (3 << 24)) % 3;
ly = (s->current_picture_ptr->f.motion_val[dir][mv_pos][1] + (3 << 24)) % 3;
- chroma_mx = (s->current_picture_ptr->f.motion_val[dir][mv_pos][0] + 1) >> 1;
- chroma_my = (s->current_picture_ptr->f.motion_val[dir][mv_pos][1] + 1) >> 1;
+ chroma_mx = s->current_picture_ptr->f.motion_val[dir][mv_pos][0] / 2;
+ chroma_my = s->current_picture_ptr->f.motion_val[dir][mv_pos][1] / 2;
umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24);
umy = (chroma_my + (3 << 24)) / 3 - (1 << 24);
uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3];