summaryrefslogtreecommitdiff
path: root/libavcodec/h264pred_template.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-02-18 21:03:02 -0800
committerMichael Niedermayer <michaelni@gmx.at>2013-02-19 16:25:50 +0100
commit1acd7d594c15aa491729c837ad3519d3469e620a (patch)
tree4a515aa31c7483d8a2fdfa1d4399c9a9d2b29cae /libavcodec/h264pred_template.c
parenta1f1ca96b42698002920467c0aab9e636893088a (diff)
h264: integrate clear_blocks calls with IDCT.
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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264pred_template.c')
-rw-r--r--libavcodec/h264pred_template.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c
index e78f2d423c..8d8d62e0b6 100644
--- a/libavcodec/h264pred_template.c
+++ b/libavcodec/h264pred_template.c
@@ -1132,7 +1132,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;
@@ -1149,9 +1149,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;
@@ -1167,9 +1169,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;
@@ -1190,9 +1194,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;
@@ -1212,10 +1218,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;
@@ -1225,7 +1233,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;
@@ -1234,7 +1242,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++)
@@ -1242,7 +1250,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++)
@@ -1252,7 +1260,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;
@@ -1262,7 +1270,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++)