diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-05-14 17:05:18 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2015-05-14 17:05:18 -0400 |
commit | 1e4a77d0018e9d083423dc289b302d02eaeabe65 (patch) | |
tree | d8d6303c0c3de92e01508ab4ed0b6ac391e77ee3 /libavcodec/vp9.c | |
parent | dc96c0f9fc96bf4167633befc074394062793322 (diff) | |
download | ffmpeg-1e4a77d0018e9d083423dc289b302d02eaeabe65.tar.gz |
vp9: apply mv scaling workaround only when subsampling is enabled.
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r-- | libavcodec/vp9.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 6982eefd47..c90059e87f 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; |