ref: 5359ae810cdbb974060297ecf935183baf7b009b
parent: e59f78b4842ee46fe5c0d64a47212a0ea5472585
author: Jingning Han <jingning@google.com>
date: Mon Mar 25 11:35:35 EDT 2019
Allow macroblock_plane to have its own rounding buffer Add 8 bytes buffer to macroblock_plane to support rounding factor. Change-Id: I3751689e4449c0caea28d3acf6cd17d7f39508ed
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -34,8 +34,8 @@
struct buf_2d src;
// Quantizer setings
+ DECLARE_ALIGNED(16, int16_t, round_fp[8]);
int16_t *quant_fp;
- int16_t *round_fp;
int16_t *quant;
int16_t *quant_shift;
int16_t *zbin;
--- a/vp9/encoder/vp9_quantize.c
+++ b/vp9/encoder/vp9_quantize.c
@@ -288,12 +288,12 @@
// Y
x->plane[0].quant = quants->y_quant[qindex];
x->plane[0].quant_fp = quants->y_quant_fp[qindex];
- x->plane[0].round_fp = quants->y_round_fp[qindex];
+ memcpy(x->plane[0].round_fp, quants->y_round_fp[qindex],
+ 8 * sizeof(*(x->plane[0].round_fp)));
x->plane[0].quant_shift = quants->y_quant_shift[qindex];
x->plane[0].zbin = quants->y_zbin[qindex];
x->plane[0].round = quants->y_round[qindex];
xd->plane[0].dequant = cpi->y_dequant[qindex];
-
x->plane[0].quant_thred[0] = x->plane[0].zbin[0] * x->plane[0].zbin[0];
x->plane[0].quant_thred[1] = x->plane[0].zbin[1] * x->plane[0].zbin[1];
@@ -301,12 +301,12 @@
for (i = 1; i < 3; i++) {
x->plane[i].quant = quants->uv_quant[qindex];
x->plane[i].quant_fp = quants->uv_quant_fp[qindex];
- x->plane[i].round_fp = quants->uv_round_fp[qindex];
+ memcpy(x->plane[i].round_fp, quants->uv_round_fp[qindex],
+ 8 * sizeof(*(x->plane[i].round_fp)));
x->plane[i].quant_shift = quants->uv_quant_shift[qindex];
x->plane[i].zbin = quants->uv_zbin[qindex];
x->plane[i].round = quants->uv_round[qindex];
xd->plane[i].dequant = cpi->uv_dequant[qindex];
-
x->plane[i].quant_thred[0] = x->plane[i].zbin[0] * x->plane[i].zbin[0];
x->plane[i].quant_thred[1] = x->plane[i].zbin[1] * x->plane[i].zbin[1];
}