]> git.sesse.net Git - ffmpeg/commitdiff
dnxhdenc: optimize whats left of dnxhd_switch_matrix()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 25 Sep 2011 11:06:04 +0000 (13:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 25 Sep 2011 11:06:04 +0000 (13:06 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dnxhdenc.c

index 146122211099a71275d0949d4c3573f30bbd1512..008742e49f769eb1f2b0663e353bd33cab7ae93a 100644 (file)
@@ -502,11 +502,8 @@ static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, in
 
 static av_always_inline int dnxhd_switch_matrix(DNXHDEncContext *ctx, int i)
 {
-    if (i&2) {
-        return 1 + (i&1);
-    } else {
-        return 0;
-    }
+    const static uint8_t component[8]={0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2};
+    return component[i];
 }
 
 static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)