Combine idct and reconstruction steps

This moves the prediction step before the idct and combines the idct and
reconstruction steps into a single step. Combining them seems to give an
overall decoder performance improvement of about 1%.

Change-Id: I90d8b167ec70d79c7ba2ee484106a78b3d16e318
This commit is contained in:
Jeff Muizelaar
2010-05-28 14:28:12 -04:00
committed by Fritz Koenig
parent 0ce3901282
commit b2fa74ac18
15 changed files with 218 additions and 210 deletions

View File

@@ -32,8 +32,12 @@ void vp8_dequantize_b_c(BLOCKD *d)
}
}
void vp8_dequant_idct_c(short *input, short *dq, short *output, int pitch)
void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride)
{
// output needs to be at least pitch * 4 for vp8_short_idct4x4llm_c to work properly
short output[16*4];
short *diff_ptr = output;
int r, c;
int i;
for (i = 0; i < 16; i++)
@@ -41,13 +45,38 @@ void vp8_dequant_idct_c(short *input, short *dq, short *output, int pitch)
input[i] = dq[i] * input[i];
}
vp8_short_idct4x4llm_c(input, output, pitch);
vp8_short_idct4x4llm_c(input, output, pitch*2);
vpx_memset(input, 0, 32);
for (r = 0; r < 4; r++)
{
for (c = 0; c < 4; c++)
{
int a = diff_ptr[c] + pred[c];
if (a < 0)
a = 0;
if (a > 255)
a = 255;
dest[c] = (unsigned char) a;
}
dest += stride;
diff_ptr += pitch;
pred += pitch;
}
}
void vp8_dequant_dc_idct_c(short *input, short *dq, short *output, int pitch, int Dc)
void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, int Dc)
{
int i;
// output needs to be at least pitch * 4 for vp8_short_idct4x4llm_c to work properly
short output[16*4];
short *diff_ptr = output;
int r, c;
input[0] = (short)Dc;
@@ -56,6 +85,27 @@ void vp8_dequant_dc_idct_c(short *input, short *dq, short *output, int pitch, in
input[i] = dq[i] * input[i];
}
vp8_short_idct4x4llm_c(input, output, pitch);
vp8_short_idct4x4llm_c(input, output, pitch*2);
vpx_memset(input, 0, 32);
for (r = 0; r < 4; r++)
{
for (c = 0; c < 4; c++)
{
int a = diff_ptr[c] + pred[c];
if (a < 0)
a = 0;
if (a > 255)
a = 255;
dest[c] = (unsigned char) a;
}
dest += stride;
diff_ptr += pitch;
pred += pitch;
}
}