diff mbox

[FFmpeg-devel,1/4] avcodec/vc1: fix overlap filtering for Simple and Main profile

Message ID 0cededb4-5b59-8eb7-0c0c-f104e7ea2fff@carpalis.nl
State New
Headers show

Commit Message

Jerome Borsboom June 6, 2018, 6:47 p.m. UTC
Overlap filtering I and BI frames for Simple and Main profile is only
dependent on PQUANT. Restrict testing for CONDOVER and OVERFLAGS to
advanced profile.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
---
This patch set should fix decoding of the SSL0015.rcv test file to make it
bit-equal to the reference decoder.

 libavcodec/vc1_loopfilter.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

Comments

Carl Eugen Hoyos June 6, 2018, 7:20 p.m. UTC | #1
2018-06-06 20:47 GMT+02:00, Jerome Borsboom <jerome.borsboom@carpalis.nl>:
> Overlap filtering I and BI frames for Simple and Main profile is only
> dependent on PQUANT. Restrict testing for CONDOVER and OVERFLAGS to
> advanced profile.
>
> Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
> ---
> This patch set should fix decoding of the SSL0015.rcv test file to make it
> bit-equal to the reference decoder.

I can confirm that this patchset fixes the file.

The following three files all seem to have the same issues both
with software and hardware decoder, frame re-ordering?
SA10125.vc1, SA10126.vc1, SA10127.vc1

Thank you, Carl Eugen
Carl Eugen Hoyos June 16, 2018, 5:53 p.m. UTC | #2
2018-06-06 21:20 GMT+02:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:
> 2018-06-06 20:47 GMT+02:00, Jerome Borsboom <jerome.borsboom@carpalis.nl>:
>> Overlap filtering I and BI frames for Simple and Main profile is only
>> dependent on PQUANT. Restrict testing for CONDOVER and OVERFLAGS to
>> advanced profile.
>>
>> Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
>> ---
>> This patch set should fix decoding of the SSL0015.rcv test file to make
>> it
>> bit-equal to the reference decoder.
>
> I can confirm that this patchset fixes the file.

Patchset applied, thank you!

> The following three files all seem to have the same issues both
> with software and hardware decoder, frame re-ordering?
> SA10125.vc1, SA10126.vc1, SA10127.vc1

I believe this affects some more reference samples, also
reproducible with hardware decoding, may be the last known
"bug", other issues like "pan-scan" and "Luma scaling, chroma
scaling" are reported as missing features on the console.

Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/vc1_loopfilter.c b/libavcodec/vc1_loopfilter.c
index aceb1f77ff..39b298cd28 100644
--- a/libavcodec/vc1_loopfilter.c
+++ b/libavcodec/vc1_loopfilter.c
@@ -108,8 +108,10 @@  void ff_vc1_i_overlap_filter(VC1Context *v)
         if (s->mb_x == 0 && (i & 5) != 1)
             continue;
 
-        if (v->pq >= 9 || v->condover == CONDOVER_ALL ||
-            (v->over_flags_plane[mb_pos] && ((i & 5) == 1 || v->over_flags_plane[mb_pos - 1])))
+        if (v->pq >= 9 || (v->profile == PROFILE_ADVANCED &&
+                           (v->condover == CONDOVER_ALL ||
+                            (v->over_flags_plane[mb_pos] &&
+                             ((i & 5) == 1 || v->over_flags_plane[mb_pos - 1])))))
             vc1_h_overlap_filter(v, s->mb_x ? left_blk : cur_blk, cur_blk, i);
     }
 
@@ -118,15 +120,18 @@  void ff_vc1_i_overlap_filter(VC1Context *v)
             if (s->first_slice_line && !(i & 2))
                 continue;
 
-            if (s->mb_x && (v->pq >= 9 || v->condover == CONDOVER_ALL ||
-                (v->over_flags_plane[mb_pos - 1] &&
-                 ((i & 2) || v->over_flags_plane[mb_pos - 1 - s->mb_stride]))))
+            if (s->mb_x &&
+                (v->pq >= 9 || (v->profile == PROFILE_ADVANCED &&
+                                (v->condover == CONDOVER_ALL ||
+                                 (v->over_flags_plane[mb_pos - 1] &&
+                                  ((i & 2) || v->over_flags_plane[mb_pos - 1 - s->mb_stride]))))))
                 vc1_v_overlap_filter(v, s->first_slice_line ? left_blk : topleft_blk, left_blk, i);
-            if (s->mb_x == s->mb_width - 1)
-                if (v->pq >= 9 || v->condover == CONDOVER_ALL ||
-                    (v->over_flags_plane[mb_pos] &&
-                     ((i & 2) || v->over_flags_plane[mb_pos - s->mb_stride])))
-                    vc1_v_overlap_filter(v, s->first_slice_line ? cur_blk : top_blk, cur_blk, i);
+            if (s->mb_x == s->mb_width - 1 &&
+                (v->pq >= 9 || (v->profile == PROFILE_ADVANCED &&
+                                (v->condover == CONDOVER_ALL ||
+                                 (v->over_flags_plane[mb_pos] &&
+                                  ((i & 2) || v->over_flags_plane[mb_pos - s->mb_stride]))))))
+                vc1_v_overlap_filter(v, s->first_slice_line ? cur_blk : top_blk, cur_blk, i);
         }
 }