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
committerMartin Storsjö <martin@martin.st>2013-04-10 11:03:06 +0300
commit62844c3fd66940c7747e9b2bb7804e265319f43f (patch)
treeb0e5a05644457aa5d7598d1fefa1a41f83550753 /libavcodec/h264pred_template.c
parente8cafd2773bc56455c8816593cbd9368f2d69a80 (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: Martin Storsjö <martin@martin.st>
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 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++)