Moved zbin_over_quant to macroblock struct
Change-Id: I76fe20ade099573997404b8733cf7f79e82fb21e
WIP: Fixing unsafe threading in VP8 encoder.
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index d2b7872..a399a38 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -1124,9 +1124,9 @@
projected_size_based_on_q = (int)(((.5 + rate_correction_factor * vp8_bits_per_mb[cpi->common.frame_type][Q]) * cpi->common.MBs) / (1 << BPER_MB_NORMBITS));
/* Make some allowance for cpi->zbin_over_quant */
- if (cpi->zbin_over_quant > 0)
+ if (cpi->mb.zbin_over_quant > 0)
{
- int Z = cpi->zbin_over_quant;
+ int Z = cpi->mb.zbin_over_quant;
double Factor = 0.99;
double factor_adjustment = 0.01 / 256.0;
@@ -1203,7 +1203,7 @@
int Q = cpi->active_worst_quality;
/* Reset Zbin OQ value */
- cpi->zbin_over_quant = 0;
+ cpi->mb.zbin_over_quant = 0;
if (cpi->oxcf.fixed_q >= 0)
{
@@ -1318,12 +1318,12 @@
* normal maximum by expanding the zero bin and hence
* decreasing the number of low magnitude non zero coefficients.
*/
- while (cpi->zbin_over_quant < zbin_oqmax)
+ while (cpi->mb.zbin_over_quant < zbin_oqmax)
{
- cpi->zbin_over_quant ++;
+ cpi->mb.zbin_over_quant ++;
- if (cpi->zbin_over_quant > zbin_oqmax)
- cpi->zbin_over_quant = zbin_oqmax;
+ if (cpi->mb.zbin_over_quant > zbin_oqmax)
+ cpi->mb.zbin_over_quant = zbin_oqmax;
/* Adjust bits_per_mb_at_this_q estimate */
bits_per_mb_at_this_q = (int)(Factor * bits_per_mb_at_this_q);