summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhdenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-25 13:06:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-25 13:06:04 +0200
commitb8bad984ef45ddce8b356bc1bf15066f4134f10d (patch)
treebb3a9c3c7ee94aef2b0acd429ceec4825fc76f20 /libavcodec/dnxhdenc.c
parentba9d174851e172cf315dd8ddc0993361c300f021 (diff)
dnxhdenc: optimize whats left of dnxhd_switch_matrix()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r--libavcodec/dnxhdenc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 1461222110..008742e49f 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -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)