vc1: Fix intensity compensation performance regression
authorMason Carter <void.main.argc.argv@gmail.com>
Sun, 22 Dec 2013 01:27:18 +0000 (17:27 -0800)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 22 Dec 2013 17:31:44 +0000 (18:31 +0100)
Introduced by 28243b0d35b47bbf9abbd454fc444a6e0a9e7b71

Intensity compensation is always used once it was encountered, because
v->next_use_ic is never set back to zero.

Reset v->next_use_ic, when resetting v->next_luty/uv.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/vc1.c

index 6d89e71..319230a 100644 (file)
@@ -614,6 +614,10 @@ static void rotate_luts(VC1Context *v)
     INIT_LUT(32, 0, v->curr_luty[0], v->curr_lutuv[0], 0);
     INIT_LUT(32, 0, v->curr_luty[1], v->curr_lutuv[1], 0);
     v->curr_use_ic = 0;
+    if (v->curr_luty == v->next_luty) {
+        // If we just initialized next_lut, clear next_use_ic to match.
+        v->next_use_ic = 0;
+    }
 }
 
 int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)