From 62844c3fd66940c7747e9b2bb7804e265319f43f Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 18 Feb 2013 21:03:02 -0800 Subject: h264: Integrate clear_blocks calls with IDCT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The non-intra-pcm branch in hl_decode_mb (simple, 8bpp) goes from 700 to 672 cycles, and the complete loop of decode_mb_cabac and hl_decode_mb (in the decode_slice loop) goes from 1759 to 1733 cycles on the clip tested (cathedral), i.e. almost 30 cycles per mb faster. Signed-off-by: Martin Storsjö --- libavcodec/h264pred_template.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'libavcodec/h264pred_template.c') diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c index 8e97d11104..e15c76c849 100644 --- a/libavcodec/h264pred_template.c +++ b/libavcodec/h264pred_template.c @@ -1131,7 +1131,7 @@ static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft, #undef PL #undef SRC -static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block, +static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, int16_t *_block, ptrdiff_t stride) { int i; @@ -1148,9 +1148,11 @@ static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block, pix++; block++; } + + memset(_block, 0, sizeof(dctcoef) * 16); } -static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const int16_t *_block, +static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, int16_t *_block, ptrdiff_t stride) { int i; @@ -1166,9 +1168,11 @@ static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const int16_t *_block, pix+= stride; block+= 4; } + + memset(_block, 0, sizeof(dctcoef) * 16); } -static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const int16_t *_block, +static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, int16_t *_block, ptrdiff_t stride) { int i; @@ -1189,9 +1193,11 @@ static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const int16_t *_block, pix++; block++; } + + memset(_block, 0, sizeof(dctcoef) * 64); } -static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const int16_t *_block, +static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, int16_t *_block, ptrdiff_t stride) { int i; @@ -1211,10 +1217,12 @@ static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const int16_t *_block, pix+= stride; block+= 8; } + + memset(_block, 0, sizeof(dctcoef) * 64); } static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, - const int16_t *block, + int16_t *block, ptrdiff_t stride) { int i; @@ -1224,7 +1232,7 @@ static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, const int *block_offset, - const int16_t *block, + int16_t *block, ptrdiff_t stride) { int i; @@ -1233,7 +1241,7 @@ static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, } static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, - const int16_t *block, ptrdiff_t stride) + int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<4; i++) @@ -1241,7 +1249,7 @@ static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, } static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, - const int16_t *block, ptrdiff_t stride) + int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<4; i++) @@ -1251,7 +1259,7 @@ static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, } static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, - const int16_t *block, + int16_t *block, ptrdiff_t stride) { int i; @@ -1261,7 +1269,7 @@ static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, const int *block_offset, - const int16_t *block, ptrdiff_t stride) + int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<4; i++) -- cgit v1.2.3