| Index: source/libvpx/vp9/encoder/vp9_quantize.c
|
| ===================================================================
|
| --- source/libvpx/vp9/encoder/vp9_quantize.c (revision 290053)
|
| +++ source/libvpx/vp9/encoder/vp9_quantize.c (working copy)
|
| @@ -23,15 +23,14 @@
|
| const int16_t *round_ptr, const int16_t quant,
|
| int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr,
|
| const int16_t dequant_ptr, uint16_t *eob_ptr) {
|
| - int eob = -1;
|
| + const int rc = 0;
|
| + const int coeff = coeff_ptr[rc];
|
| + const int coeff_sign = (coeff >> 31);
|
| + const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
|
| + int tmp, eob = -1;
|
|
|
| if (!skip_block) {
|
| - const int rc = 0;
|
| - const int coeff = coeff_ptr[rc];
|
| - const int coeff_sign = (coeff >> 31);
|
| - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
|
| -
|
| - int tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX);
|
| + tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX);
|
| tmp = (tmp * quant) >> 16;
|
| qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign;
|
| dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr;
|
| @@ -45,15 +44,15 @@
|
| const int16_t *round_ptr, const int16_t quant,
|
| int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr,
|
| const int16_t dequant_ptr, uint16_t *eob_ptr) {
|
| - int eob = -1;
|
| + const int rc = 0;
|
| + const int coeff = coeff_ptr[rc];
|
| + const int coeff_sign = (coeff >> 31);
|
| + const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
|
| + int tmp, eob = -1;
|
|
|
| if (!skip_block) {
|
| - const int rc = 0;
|
| - const int coeff = coeff_ptr[rc];
|
| - const int coeff_sign = (coeff >> 31);
|
| - const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
|
|
|
| - int tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX);
|
| + tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX);
|
| tmp = (tmp * quant) >> 15;
|
| qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign;
|
| dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr / 2;
|
| @@ -354,6 +353,10 @@
|
| 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];
|
| + x->plane[0].quant_thred[0] = cm->y_dequant[qindex][0] *
|
| + cm->y_dequant[qindex][0];
|
| + x->plane[0].quant_thred[1] = cm->y_dequant[qindex][1] *
|
| + cm->y_dequant[qindex][1];
|
| x->plane[0].zbin_extra = (int16_t)((cm->y_dequant[qindex][1] * zbin) >> 7);
|
| xd->plane[0].dequant = cm->y_dequant[qindex];
|
|
|
| @@ -365,6 +368,10 @@
|
| 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];
|
| + x->plane[i].quant_thred[0] = cm->y_dequant[qindex][0] *
|
| + cm->y_dequant[qindex][0];
|
| + x->plane[i].quant_thred[1] = cm->y_dequant[qindex][1] *
|
| + cm->y_dequant[qindex][1];
|
| x->plane[i].zbin_extra = (int16_t)((cm->uv_dequant[qindex][1] * zbin) >> 7);
|
| xd->plane[i].dequant = cm->uv_dequant[qindex];
|
| }
|
|
|