summaryrefslogtreecommitdiff
path: root/libavcodec/mips
diff options
context:
space:
mode:
authorJerome Borsboom <jerome.borsboom@carpalis.nl>2018-06-20 13:11:07 +0200
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-06-29 01:18:44 +0200
commit975a1a81b28dc632d7c4bee99d5eccf09b9603d8 (patch)
treece277ae7d5fa07da76935cb4a8cb8096b8889457 /libavcodec/mips
parentf92e95e9b5afd7d4a28db53d086876aa0df8625b (diff)
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/mips')
-rw-r--r--libavcodec/mips/vc1dsp_mmi.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/mips/vc1dsp_mmi.c b/libavcodec/mips/vc1dsp_mmi.c
index 01e7f9f32c..ec2fdca987 100644
--- a/libavcodec/mips/vc1dsp_mmi.c
+++ b/libavcodec/mips/vc1dsp_mmi.c
@@ -1019,12 +1019,13 @@ void ff_vc1_h_overlap_mmi(uint8_t *src, int stride)
}
}
-void ff_vc1_h_s_overlap_mmi(int16_t *left, int16_t *right)
+void ff_vc1_h_s_overlap_mmi(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];
@@ -1038,10 +1039,12 @@ void ff_vc1_h_s_overlap_mmi(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;
+ }
}
}