From d5bc05a47bd35a722297290211b266f98c24de7c Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Tue, 8 Mar 2011 18:47:08 -0800 Subject: [PATCH] make the filtering process match libvpx and ffvp8 libvpx (and ffvp8) implementations are completely skipping the deblocking step if loop_filter_level is 0, which is _not_ equivalent to performing the loop-filtering with a 0 value for loop_filter_level. In the latter case (which we followed), few pixels were modified here and there and you could observe off-by-1 errors on few places. This patch will reconcile the 3 implementations (since the difference is minor, skipping the deblocking step will save CPU for virtually no visible difference). The spec will be made clearer about the expected behaviour: * if the global loop_filter_level is 0, turn deblocking off. * if it's not 0 but the local loop_filter_level ends up being 0 for whatever reason (lf_delta, mode delta, ref delta, etc.) on a particular macroblock, skip the deblocking too. Change-Id: I157f1f8de463b8a76caddb3f347b7fbc7bd527d2 --- src/dec/frame.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dec/frame.c b/src/dec/frame.c index beae6fc6..1aade887 100644 --- a/src/dec/frame.c +++ b/src/dec/frame.c @@ -126,6 +126,9 @@ static void DoFilter(VP8Decoder* const dec, int mb_x, int mb_y) { const int level = mb->f_level_; const int ilevel = mb->f_ilevel_; const int limit = 2 * level + ilevel; + if (level == 0) { + return; + } if (dec->filter_type_ == 1) { // simple if (mb_x > 0) { VP8SimpleHFilter16(y_dst, y_bps, limit + 4);