[FFmpeg-cvslog] vp9: apply mv scaling workaround only when subsampling is enabled.
Ronald S. Bultje
git at videolan.org
Mon May 18 02:44:27 CEST 2015
ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Thu May 14 17:05:18 2015 -0400| [1e4a77d0018e9d083423dc289b302d02eaeabe65] | committer: Ronald S. Bultje
vp9: apply mv scaling workaround only when subsampling is enabled.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e4a77d0018e9d083423dc289b302d02eaeabe65
---
libavcodec/vp9.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 6982eef..c90059e 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2782,13 +2782,23 @@ static av_always_inline void mc_chroma_scaled(VP9Context *s, vp9_scaled_mc_func
int bw, int bh, int w, int h, int bytesperpixel,
const uint16_t *scale, const uint8_t *step)
{
- // BUG https://code.google.com/p/webm/issues/detail?id=820
- int mx = scale_mv(mv->x << !s->ss_h, 0) + (scale_mv(x * 16, 0) & ~15) + (scale_mv(x * 32, 0) & 15);
- int my = scale_mv(mv->y << !s->ss_v, 1) + (scale_mv(y * 16, 1) & ~15) + (scale_mv(y * 32, 1) & 15);
-#undef scale_mv
+ int mx, my;
int refbw_m1, refbh_m1;
int th;
+ if (s->ss_h) {
+ // BUG https://code.google.com/p/webm/issues/detail?id=820
+ mx = scale_mv(mv->x, 0) + (scale_mv(x * 16, 0) & ~15) + (scale_mv(x * 32, 0) & 15);
+ } else {
+ mx = scale_mv(mv->x << 1, 0) + scale_mv(x * 16, 0);
+ }
+ if (s->ss_v) {
+ // BUG https://code.google.com/p/webm/issues/detail?id=820
+ my = scale_mv(mv->y, 1) + (scale_mv(y * 16, 1) & ~15) + (scale_mv(y * 32, 1) & 15);
+ } else {
+ my = scale_mv(mv->y << 1, 1) + scale_mv(y * 16, 1);
+ }
+#undef scale_mv
y = my >> 4;
x = mx >> 4;
ref_u += y * src_stride_u + x * bytesperpixel;
More information about the ffmpeg-cvslog
mailing list