diff options
author | Jerome Borsboom <jerome.borsboom@carpalis.nl> | 2018-06-20 13:11:07 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2018-06-29 01:18:44 +0200 |
commit | 975a1a81b28dc632d7c4bee99d5eccf09b9603d8 (patch) | |
tree | ce277ae7d5fa07da76935cb4a8cb8096b8889457 /libavcodec/vc1dsp.c | |
parent | f92e95e9b5afd7d4a28db53d086876aa0df8625b (diff) | |
download | ffmpeg-975a1a81b28dc632d7c4bee99d5eccf09b9603d8.tar.gz |
avcodec/vc1: fix overlap filter for frame interlaced pictures
The overlap filter is not correct for vertical edges in frame interlaced
I and P pictures. When filtering macroblocks with different FIELDTX values,
we have to match the lines at both sides of the vertical border. In addition,
we have to use the correct rounding values, depending on the line we are
filtering.
Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Diffstat (limited to 'libavcodec/vc1dsp.c')
-rw-r--r-- | libavcodec/vc1dsp.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 9239a4a1f5..778b811f1a 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -107,12 +107,13 @@ static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom) } } -static void vc1_h_s_overlap_c(int16_t *left, int16_t *right) +static void vc1_h_s_overlap_c(int16_t *left, int16_t *right, int left_stride, int right_stride, int flags) { int i; int a, b, c, d; int d1, d2; - int rnd1 = 4, rnd2 = 3; + int rnd1 = flags & 2 ? 3 : 4; + int rnd2 = 7 - rnd1; for (i = 0; i < 8; i++) { a = left[6]; b = left[7]; @@ -126,10 +127,12 @@ static void vc1_h_s_overlap_c(int16_t *left, int16_t *right) right[0] = ((c << 3) + d2 + rnd1) >> 3; right[1] = ((d << 3) + d1 + rnd2) >> 3; - right += 8; - left += 8; - rnd2 = 7 - rnd2; - rnd1 = 7 - rnd1; + right += right_stride; + left += left_stride; + if (flags & 1) { + rnd2 = 7 - rnd2; + rnd1 = 7 - rnd1; + } } } |