summaryrefslogtreecommitdiff
path: root/vp8/encoder
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2012-01-06 11:59:06 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-01-06 11:59:06 -0800
commit66da859e5e738f1a1d2026d8d0f535718697fd38 (patch)
treef2c89bc7c22951d96ab2287130ac0f02d3335cfb /vp8/encoder
parent70a5104eada4058524c3ce43754731f0c9e239a2 (diff)
parent5f25d4c1752a40bafec3334bd0e4a1a0047c1d9d (diff)
downloadlibvpx-66da859e5e738f1a1d2026d8d0f535718697fd38.tar
libvpx-66da859e5e738f1a1d2026d8d0f535718697fd38.tar.gz
libvpx-66da859e5e738f1a1d2026d8d0f535718697fd38.tar.bz2
libvpx-66da859e5e738f1a1d2026d8d0f535718697fd38.zip
Merge "Reduced the size of Y1Dequant and friends to [128][2]"
Diffstat (limited to 'vp8/encoder')
-rw-r--r--vp8/encoder/encodeframe.c4
-rw-r--r--vp8/encoder/ethreading.c20
-rw-r--r--vp8/encoder/quantize.c34
3 files changed, 46 insertions, 12 deletions
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c
index 6a9ba291d..b5c5c7445 100644
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -1120,7 +1120,7 @@ int vp8cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
vp8_inverse_transform_mby(xd, IF_RTCD(&cpi->common.rtcd));
DEQUANT_INVOKE (&cpi->common.rtcd.dequant, idct_add_uv_block)
- (xd->qcoeff+16*16, xd->block[16].dequant,
+ (xd->qcoeff+16*16, xd->dequant_uv,
xd->dst.u_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs+16);
return rate;
@@ -1305,7 +1305,7 @@ int vp8cx_encode_inter_macroblock
vp8_inverse_transform_mby(xd, IF_RTCD(&cpi->common.rtcd));
DEQUANT_INVOKE (&cpi->common.rtcd.dequant, idct_add_uv_block)
- (xd->qcoeff+16*16, xd->block[16].dequant,
+ (xd->qcoeff+16*16, xd->dequant_uv,
xd->dst.u_buffer, xd->dst.v_buffer,
xd->dst.uv_stride, xd->eobs+16);
}
diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c
index 69655989d..24339a5e0 100644
--- a/vp8/encoder/ethreading.c
+++ b/vp8/encoder/ethreading.c
@@ -384,10 +384,22 @@ static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc)
zd->mb_segement_abs_delta = xd->mb_segement_abs_delta;
vpx_memcpy(zd->segment_feature_data, xd->segment_feature_data, sizeof(xd->segment_feature_data));
- for (i = 0; i < 25; i++)
- {
- zd->block[i].dequant = xd->block[i].dequant;
- }
+ vpx_memcpy(zd->dequant_y1_dc, xd->dequant_y1_dc, sizeof(xd->dequant_y1_dc));
+ vpx_memcpy(zd->dequant_y1, xd->dequant_y1, sizeof(xd->dequant_y1));
+ vpx_memcpy(zd->dequant_y2, xd->dequant_y2, sizeof(xd->dequant_y2));
+ vpx_memcpy(zd->dequant_uv, xd->dequant_uv, sizeof(xd->dequant_uv));
+
+#if 1
+ /*TODO: Remove dequant from BLOCKD. This is a temporary solution until
+ * the quantizer code uses a passed in pointer to the dequant constants.
+ * This will also require modifications to the x86 and neon assembly.
+ * */
+ for (i = 0; i < 16; i++)
+ zd->block[i].dequant = zd->dequant_y1;
+ for (i = 16; i < 24; i++)
+ zd->block[i].dequant = zd->dequant_uv;
+ zd->block[24].dequant = zd->dequant_y2;
+#endif
}
}
diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c
index ce04212e6..d2aa7fe72 100644
--- a/vp8/encoder/quantize.c
+++ b/vp8/encoder/quantize.c
@@ -504,7 +504,6 @@ void vp8cx_init_quantizer(VP8_COMP *cpi)
cpi->Y1quant_shift[Q][i] = cpi->Y1quant_shift[Q][1];
cpi->Y1zbin[Q][i] = cpi->Y1zbin[Q][1];
cpi->Y1round[Q][i] = cpi->Y1round[Q][1];
- cpi->common.Y1dequant[Q][i] = cpi->common.Y1dequant[Q][1];
cpi->zrun_zbin_boost_y1[Q][i] = (cpi->common.Y1dequant[Q][1] *
zbin_boost[i]) >> 7;
@@ -513,7 +512,6 @@ void vp8cx_init_quantizer(VP8_COMP *cpi)
cpi->Y2quant_shift[Q][i] = cpi->Y2quant_shift[Q][1];
cpi->Y2zbin[Q][i] = cpi->Y2zbin[Q][1];
cpi->Y2round[Q][i] = cpi->Y2round[Q][1];
- cpi->common.Y2dequant[Q][i] = cpi->common.Y2dequant[Q][1];
cpi->zrun_zbin_boost_y2[Q][i] = (cpi->common.Y2dequant[Q][1] *
zbin_boost[i]) >> 7;
@@ -522,7 +520,6 @@ void vp8cx_init_quantizer(VP8_COMP *cpi)
cpi->UVquant_shift[Q][i] = cpi->UVquant_shift[Q][1];
cpi->UVzbin[Q][i] = cpi->UVzbin[Q][1];
cpi->UVround[Q][i] = cpi->UVround[Q][1];
- cpi->common.UVdequant[Q][i] = cpi->common.UVdequant[Q][1];
cpi->zrun_zbin_boost_uv[Q][i] = (cpi->common.UVdequant[Q][1] *
zbin_boost[i]) >> 7;
}
@@ -641,6 +638,31 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip)
*/
if (!ok_to_skip || QIndex != x->q_index)
{
+
+ xd->dequant_y1_dc[0] = 1;
+ xd->dequant_y1[0] = cpi->common.Y1dequant[QIndex][0];
+ xd->dequant_y2[0] = cpi->common.Y2dequant[QIndex][0];
+ xd->dequant_uv[0] = cpi->common.UVdequant[QIndex][0];
+
+ for (i = 1; i < 16; i++)
+ {
+ xd->dequant_y1_dc[i] =
+ xd->dequant_y1[i] = cpi->common.Y1dequant[QIndex][1];
+ xd->dequant_y2[i] = cpi->common.Y2dequant[QIndex][1];
+ xd->dequant_uv[i] = cpi->common.UVdequant[QIndex][1];
+ }
+#if 1
+ /*TODO: Remove dequant from BLOCKD. This is a temporary solution until
+ * the quantizer code uses a passed in pointer to the dequant constants.
+ * This will also require modifications to the x86 and neon assembly.
+ * */
+ for (i = 0; i < 16; i++)
+ x->e_mbd.block[i].dequant = xd->dequant_y1; //cpi->common.Y1dequant[QIndex];
+ for (i = 16; i < 24; i++)
+ x->e_mbd.block[i].dequant = xd->dequant_uv; //cpi->common.UVdequant[QIndex];
+ x->e_mbd.block[24].dequant = xd->dequant_y2; //cpi->common.Y2dequant[QIndex];
+#endif
+
// Y
zbin_extra = ZBIN_EXTRA_Y;
@@ -651,7 +673,6 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip)
x->block[i].quant_shift = cpi->Y1quant_shift[QIndex];
x->block[i].zbin = cpi->Y1zbin[QIndex];
x->block[i].round = cpi->Y1round[QIndex];
- x->e_mbd.block[i].dequant = cpi->common.Y1dequant[QIndex];
x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_y1[QIndex];
x->block[i].zbin_extra = (short)zbin_extra;
}
@@ -666,7 +687,6 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip)
x->block[i].quant_shift = cpi->UVquant_shift[QIndex];
x->block[i].zbin = cpi->UVzbin[QIndex];
x->block[i].round = cpi->UVround[QIndex];
- x->e_mbd.block[i].dequant = cpi->common.UVdequant[QIndex];
x->block[i].zrun_zbin_boost = cpi->zrun_zbin_boost_uv[QIndex];
x->block[i].zbin_extra = (short)zbin_extra;
}
@@ -679,7 +699,6 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip)
x->block[24].quant_shift = cpi->Y2quant_shift[QIndex];
x->block[24].zbin = cpi->Y2zbin[QIndex];
x->block[24].round = cpi->Y2round[QIndex];
- x->e_mbd.block[24].dequant = cpi->common.Y2dequant[QIndex];
x->block[24].zrun_zbin_boost = cpi->zrun_zbin_boost_y2[QIndex];
x->block[24].zbin_extra = (short)zbin_extra;
@@ -689,6 +708,9 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip)
cpi->last_zbin_over_quant = cpi->zbin_over_quant;
cpi->last_zbin_mode_boost = cpi->zbin_mode_boost;
x->last_act_zbin_adj = x->act_zbin_adj;
+
+
+
}
else if(cpi->last_zbin_over_quant != cpi->zbin_over_quant
|| cpi->last_zbin_mode_boost != cpi->zbin_mode_boost