| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 
| 3  * | 3  * | 
| 4  *  Use of this source code is governed by a BSD-style license | 4  *  Use of this source code is governed by a BSD-style license | 
| 5  *  that can be found in the LICENSE file in the root of the source | 5  *  that can be found in the LICENSE file in the root of the source | 
| 6  *  tree. An additional intellectual property rights grant can be found | 6  *  tree. An additional intellectual property rights grant can be found | 
| 7  *  in the file PATENTS.  All contributing project authors may | 7  *  in the file PATENTS.  All contributing project authors may | 
| 8  *  be found in the AUTHORS file in the root of the source tree. | 8  *  be found in the AUTHORS file in the root of the source tree. | 
| 9  */ | 9  */ | 
| 10 | 10 | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 34     tmp = (tmp * quant) >> 16; | 34     tmp = (tmp * quant) >> 16; | 
| 35     qcoeff_ptr[rc]  = (tmp ^ coeff_sign) - coeff_sign; | 35     qcoeff_ptr[rc]  = (tmp ^ coeff_sign) - coeff_sign; | 
| 36     dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr; | 36     dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr; | 
| 37     if (tmp) | 37     if (tmp) | 
| 38       eob = 0; | 38       eob = 0; | 
| 39   } | 39   } | 
| 40   *eob_ptr = eob + 1; | 40   *eob_ptr = eob + 1; | 
| 41 } | 41 } | 
| 42 | 42 | 
| 43 #if CONFIG_VP9_HIGHBITDEPTH | 43 #if CONFIG_VP9_HIGHBITDEPTH | 
| 44 void vp9_high_quantize_dc(const tran_low_t *coeff_ptr, int skip_block, | 44 void vp9_highbd_quantize_dc(const tran_low_t *coeff_ptr, int skip_block, | 
| 45                           const int16_t *round_ptr, const int16_t quant, | 45                             const int16_t *round_ptr, const int16_t quant, | 
| 46                           tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, | 46                             tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, | 
| 47                           const int16_t dequant_ptr, uint16_t *eob_ptr) { | 47                             const int16_t dequant_ptr, uint16_t *eob_ptr) { | 
| 48   int eob = -1; | 48   int eob = -1; | 
| 49 | 49 | 
| 50   if (!skip_block) { | 50   if (!skip_block) { | 
| 51     const int rc = 0; | 51     const int rc = 0; | 
| 52     const int coeff = coeff_ptr[rc]; | 52     const int coeff = coeff_ptr[rc]; | 
| 53     const int coeff_sign = (coeff >> 31); | 53     const int coeff_sign = (coeff >> 31); | 
| 54     const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; | 54     const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; | 
| 55 | 55 | 
| 56     const int64_t tmp = | 56     const int64_t tmp = | 
| 57         (clamp(abs_coeff + round_ptr[rc != 0], INT32_MIN, INT32_MAX) * | 57         (clamp(abs_coeff + round_ptr[rc != 0], INT32_MIN, INT32_MAX) * | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 81     tmp = (tmp * quant) >> 15; | 81     tmp = (tmp * quant) >> 15; | 
| 82     qcoeff_ptr[rc]  = (tmp ^ coeff_sign) - coeff_sign; | 82     qcoeff_ptr[rc]  = (tmp ^ coeff_sign) - coeff_sign; | 
| 83     dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr / 2; | 83     dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr / 2; | 
| 84     if (tmp) | 84     if (tmp) | 
| 85       eob = 0; | 85       eob = 0; | 
| 86   } | 86   } | 
| 87   *eob_ptr = eob + 1; | 87   *eob_ptr = eob + 1; | 
| 88 } | 88 } | 
| 89 | 89 | 
| 90 #if CONFIG_VP9_HIGHBITDEPTH | 90 #if CONFIG_VP9_HIGHBITDEPTH | 
| 91 void vp9_high_quantize_dc_32x32(const tran_low_t *coeff_ptr, int skip_block, | 91 void vp9_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr, | 
| 92                                 const int16_t *round_ptr, const int16_t quant, | 92                                   int skip_block, | 
| 93                                 tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, | 93                                   const int16_t *round_ptr, | 
| 94                                 const int16_t dequant_ptr, uint16_t *eob_ptr) { | 94                                   const int16_t quant, | 
|  | 95                                   tran_low_t *qcoeff_ptr, | 
|  | 96                                   tran_low_t *dqcoeff_ptr, | 
|  | 97                                   const int16_t dequant_ptr, | 
|  | 98                                   uint16_t *eob_ptr) { | 
| 95   int eob = -1; | 99   int eob = -1; | 
| 96 | 100 | 
| 97   if (!skip_block) { | 101   if (!skip_block) { | 
| 98     const int rc = 0; | 102     const int rc = 0; | 
| 99     const int coeff = coeff_ptr[rc]; | 103     const int coeff = coeff_ptr[rc]; | 
| 100     const int coeff_sign = (coeff >> 31); | 104     const int coeff_sign = (coeff >> 31); | 
| 101     const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; | 105     const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign; | 
| 102 | 106 | 
| 103     const int64_t tmp = | 107     const int64_t tmp = | 
| 104         (clamp(abs_coeff + round_ptr[rc != 0], INT32_MIN, INT32_MAX) * | 108         (clamp(abs_coeff + round_ptr[rc != 0], INT32_MIN, INT32_MAX) * | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 147       dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; | 151       dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; | 
| 148 | 152 | 
| 149       if (tmp) | 153       if (tmp) | 
| 150         eob = i; | 154         eob = i; | 
| 151     } | 155     } | 
| 152   } | 156   } | 
| 153   *eob_ptr = eob + 1; | 157   *eob_ptr = eob + 1; | 
| 154 } | 158 } | 
| 155 | 159 | 
| 156 #if CONFIG_VP9_HIGHBITDEPTH | 160 #if CONFIG_VP9_HIGHBITDEPTH | 
| 157 void vp9_high_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t count, | 161 void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, | 
| 158                             int skip_block, const int16_t *zbin_ptr, | 162                               intptr_t count, | 
| 159                             const int16_t *round_ptr, const int16_t *quant_ptr, | 163                               int skip_block, | 
| 160                             const int16_t *quant_shift_ptr, | 164                               const int16_t *zbin_ptr, | 
| 161                             tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, | 165                               const int16_t *round_ptr, | 
| 162                             const int16_t *dequant_ptr, | 166                               const int16_t *quant_ptr, | 
| 163                             int zbin_oq_value, uint16_t *eob_ptr, | 167                               const int16_t *quant_shift_ptr, | 
| 164                             const int16_t *scan, const int16_t *iscan) { | 168                               tran_low_t *qcoeff_ptr, | 
|  | 169                               tran_low_t *dqcoeff_ptr, | 
|  | 170                               const int16_t *dequant_ptr, | 
|  | 171                               int zbin_oq_value, | 
|  | 172                               uint16_t *eob_ptr, | 
|  | 173                               const int16_t *scan, | 
|  | 174                               const int16_t *iscan) { | 
| 165   int i; | 175   int i; | 
| 166   int eob = -1; | 176   int eob = -1; | 
| 167   // TODO(jingning) Decide the need of these arguments after the | 177   // TODO(jingning) Decide the need of these arguments after the | 
| 168   // quantization process is completed. | 178   // quantization process is completed. | 
| 169   (void)zbin_ptr; | 179   (void)zbin_ptr; | 
| 170   (void)quant_shift_ptr; | 180   (void)quant_shift_ptr; | 
| 171   (void)zbin_oq_value; | 181   (void)zbin_oq_value; | 
| 172   (void)iscan; | 182   (void)iscan; | 
| 173 | 183 | 
| 174   vpx_memset(qcoeff_ptr, 0, count * sizeof(*qcoeff_ptr)); | 184   vpx_memset(qcoeff_ptr, 0, count * sizeof(*qcoeff_ptr)); | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 235       } | 245       } | 
| 236 | 246 | 
| 237       if (tmp) | 247       if (tmp) | 
| 238         eob = i; | 248         eob = i; | 
| 239     } | 249     } | 
| 240   } | 250   } | 
| 241   *eob_ptr = eob + 1; | 251   *eob_ptr = eob + 1; | 
| 242 } | 252 } | 
| 243 | 253 | 
| 244 #if CONFIG_VP9_HIGHBITDEPTH | 254 #if CONFIG_VP9_HIGHBITDEPTH | 
| 245 void vp9_high_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, | 255 void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, | 
| 246                                   intptr_t n_coeffs, int skip_block, | 256                                     intptr_t n_coeffs, int skip_block, | 
| 247                                   const int16_t *zbin_ptr, | 257                                     const int16_t *zbin_ptr, | 
| 248                                   const int16_t *round_ptr, | 258                                     const int16_t *round_ptr, | 
| 249                                   const int16_t *quant_ptr, | 259                                     const int16_t *quant_ptr, | 
| 250                                   const int16_t *quant_shift_ptr, | 260                                     const int16_t *quant_shift_ptr, | 
| 251                                   tran_low_t *qcoeff_ptr, | 261                                     tran_low_t *qcoeff_ptr, | 
| 252                                   tran_low_t *dqcoeff_ptr, | 262                                     tran_low_t *dqcoeff_ptr, | 
| 253                                   const int16_t *dequant_ptr, | 263                                     const int16_t *dequant_ptr, | 
| 254                                   int zbin_oq_value, uint16_t *eob_ptr, | 264                                     int zbin_oq_value, uint16_t *eob_ptr, | 
| 255                                   const int16_t *scan, const int16_t *iscan) { | 265                                     const int16_t *scan, const int16_t *iscan) { | 
| 256   int i, eob = -1; | 266   int i, eob = -1; | 
| 257   (void)zbin_ptr; | 267   (void)zbin_ptr; | 
| 258   (void)quant_shift_ptr; | 268   (void)quant_shift_ptr; | 
| 259   (void)zbin_oq_value; | 269   (void)zbin_oq_value; | 
| 260   (void)iscan; | 270   (void)iscan; | 
| 261 | 271 | 
| 262   vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); | 272   vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); | 
| 263   vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); | 273   vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); | 
| 264 | 274 | 
| 265   if (!skip_block) { | 275   if (!skip_block) { | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 333 | 343 | 
| 334         if (tmp) | 344         if (tmp) | 
| 335           eob = i; | 345           eob = i; | 
| 336       } | 346       } | 
| 337     } | 347     } | 
| 338   } | 348   } | 
| 339   *eob_ptr = eob + 1; | 349   *eob_ptr = eob + 1; | 
| 340 } | 350 } | 
| 341 | 351 | 
| 342 #if CONFIG_VP9_HIGHBITDEPTH | 352 #if CONFIG_VP9_HIGHBITDEPTH | 
| 343 void vp9_high_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, | 353 void vp9_highbd_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, | 
| 344                            int skip_block, const int16_t *zbin_ptr, | 354                              int skip_block, const int16_t *zbin_ptr, | 
| 345                            const int16_t *round_ptr, const int16_t *quant_ptr, | 355                              const int16_t *round_ptr, const int16_t *quant_ptr, | 
| 346                            const int16_t *quant_shift_ptr, | 356                              const int16_t *quant_shift_ptr, | 
| 347                            tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, | 357                              tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, | 
| 348                            const int16_t *dequant_ptr, int zbin_oq_value, | 358                              const int16_t *dequant_ptr, int zbin_oq_value, | 
| 349                            uint16_t *eob_ptr, const int16_t *scan, | 359                              uint16_t *eob_ptr, const int16_t *scan, | 
| 350                            const int16_t *iscan) { | 360                              const int16_t *iscan) { | 
| 351   int i, non_zero_count = (int)n_coeffs, eob = -1; | 361   int i, non_zero_count = (int)n_coeffs, eob = -1; | 
| 352   const int zbins[2] = { zbin_ptr[0] + zbin_oq_value, | 362   const int zbins[2] = { zbin_ptr[0] + zbin_oq_value, | 
| 353                          zbin_ptr[1] + zbin_oq_value }; | 363                          zbin_ptr[1] + zbin_oq_value }; | 
| 354   const int nzbins[2] = { zbins[0] * -1, | 364   const int nzbins[2] = { zbins[0] * -1, | 
| 355                           zbins[1] * -1 }; | 365                           zbins[1] * -1 }; | 
| 356   (void)iscan; | 366   (void)iscan; | 
| 357 | 367 | 
| 358   vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); | 368   vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); | 
| 359   vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); | 369   vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); | 
| 360 | 370 | 
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 445       dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; | 455       dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; | 
| 446 | 456 | 
| 447       if (tmp) | 457       if (tmp) | 
| 448         eob = idx_arr[i]; | 458         eob = idx_arr[i]; | 
| 449     } | 459     } | 
| 450   } | 460   } | 
| 451   *eob_ptr = eob + 1; | 461   *eob_ptr = eob + 1; | 
| 452 } | 462 } | 
| 453 | 463 | 
| 454 #if CONFIG_VP9_HIGHBITDEPTH | 464 #if CONFIG_VP9_HIGHBITDEPTH | 
| 455 void vp9_high_quantize_b_32x32_c(const tran_low_t *coeff_ptr, | 465 void vp9_highbd_quantize_b_32x32_c(const tran_low_t *coeff_ptr, | 
| 456                                  intptr_t n_coeffs, int skip_block, | 466                                    intptr_t n_coeffs, int skip_block, | 
| 457                                  const int16_t *zbin_ptr, | 467                                    const int16_t *zbin_ptr, | 
| 458                                  const int16_t *round_ptr, | 468                                    const int16_t *round_ptr, | 
| 459                                  const int16_t *quant_ptr, | 469                                    const int16_t *quant_ptr, | 
| 460                                  const int16_t *quant_shift_ptr, | 470                                    const int16_t *quant_shift_ptr, | 
| 461                                  tran_low_t *qcoeff_ptr, | 471                                    tran_low_t *qcoeff_ptr, | 
| 462                                  tran_low_t *dqcoeff_ptr, | 472                                    tran_low_t *dqcoeff_ptr, | 
| 463                                  const int16_t *dequant_ptr, | 473                                    const int16_t *dequant_ptr, | 
| 464                                  int zbin_oq_value, uint16_t *eob_ptr, | 474                                    int zbin_oq_value, uint16_t *eob_ptr, | 
| 465                                  const int16_t *scan, const int16_t *iscan) { | 475                                    const int16_t *scan, const int16_t *iscan) { | 
| 466   const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0] + zbin_oq_value, 1), | 476   const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0] + zbin_oq_value, 1), | 
| 467                          ROUND_POWER_OF_TWO(zbin_ptr[1] + zbin_oq_value, 1) }; | 477                          ROUND_POWER_OF_TWO(zbin_ptr[1] + zbin_oq_value, 1) }; | 
| 468   const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 }; | 478   const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 }; | 
| 469 | 479 | 
| 470   int idx = 0; | 480   int idx = 0; | 
| 471   int idx_arr[1024]; | 481   int idx_arr[1024]; | 
| 472   int i, eob = -1; | 482   int i, eob = -1; | 
| 473   (void)iscan; | 483   (void)iscan; | 
| 474 | 484 | 
| 475   vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); | 485   vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 512 #endif | 522 #endif | 
| 513 | 523 | 
| 514 void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block, | 524 void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block, | 
| 515                                 const int16_t *scan, const int16_t *iscan) { | 525                                 const int16_t *scan, const int16_t *iscan) { | 
| 516   MACROBLOCKD *const xd = &x->e_mbd; | 526   MACROBLOCKD *const xd = &x->e_mbd; | 
| 517   struct macroblock_plane *p = &x->plane[plane]; | 527   struct macroblock_plane *p = &x->plane[plane]; | 
| 518   struct macroblockd_plane *pd = &xd->plane[plane]; | 528   struct macroblockd_plane *pd = &xd->plane[plane]; | 
| 519 | 529 | 
| 520 #if CONFIG_VP9_HIGHBITDEPTH | 530 #if CONFIG_VP9_HIGHBITDEPTH | 
| 521   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { | 531   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { | 
| 522     vp9_high_quantize_b(BLOCK_OFFSET(p->coeff, block), | 532     vp9_highbd_quantize_b(BLOCK_OFFSET(p->coeff, block), | 
| 523                         16, x->skip_block, | 533                         16, x->skip_block, | 
| 524                         p->zbin, p->round, p->quant, p->quant_shift, | 534                         p->zbin, p->round, p->quant, p->quant_shift, | 
| 525                         BLOCK_OFFSET(p->qcoeff, block), | 535                         BLOCK_OFFSET(p->qcoeff, block), | 
| 526                         BLOCK_OFFSET(pd->dqcoeff, block), | 536                         BLOCK_OFFSET(pd->dqcoeff, block), | 
| 527                         pd->dequant, p->zbin_extra, &p->eobs[block], | 537                         pd->dequant, p->zbin_extra, &p->eobs[block], | 
| 528                         scan, iscan); | 538                         scan, iscan); | 
| 529     return; | 539     return; | 
| 530   } | 540   } | 
| 531 #endif | 541 #endif | 
| 532   vp9_quantize_b(BLOCK_OFFSET(p->coeff, block), | 542   vp9_quantize_b(BLOCK_OFFSET(p->coeff, block), | 
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 634   const int zbin = cpi->zbin_mode_boost; | 644   const int zbin = cpi->zbin_mode_boost; | 
| 635   int i; | 645   int i; | 
| 636 | 646 | 
| 637   // Y | 647   // Y | 
| 638   x->plane[0].quant = quants->y_quant[qindex]; | 648   x->plane[0].quant = quants->y_quant[qindex]; | 
| 639   x->plane[0].quant_fp = quants->y_quant_fp[qindex]; | 649   x->plane[0].quant_fp = quants->y_quant_fp[qindex]; | 
| 640   x->plane[0].round_fp = quants->y_round_fp[qindex]; | 650   x->plane[0].round_fp = quants->y_round_fp[qindex]; | 
| 641   x->plane[0].quant_shift = quants->y_quant_shift[qindex]; | 651   x->plane[0].quant_shift = quants->y_quant_shift[qindex]; | 
| 642   x->plane[0].zbin = quants->y_zbin[qindex]; | 652   x->plane[0].zbin = quants->y_zbin[qindex]; | 
| 643   x->plane[0].round = quants->y_round[qindex]; | 653   x->plane[0].round = quants->y_round[qindex]; | 
| 644   x->plane[0].quant_thred[0] = cm->y_dequant[qindex][0] * |  | 
| 645                                   cm->y_dequant[qindex][0]; |  | 
| 646   x->plane[0].quant_thred[1] = cm->y_dequant[qindex][1] * |  | 
| 647                                   cm->y_dequant[qindex][1]; |  | 
| 648   x->plane[0].zbin_extra = (int16_t)((cm->y_dequant[qindex][1] * zbin) >> 7); | 654   x->plane[0].zbin_extra = (int16_t)((cm->y_dequant[qindex][1] * zbin) >> 7); | 
| 649   xd->plane[0].dequant = cm->y_dequant[qindex]; | 655   xd->plane[0].dequant = cm->y_dequant[qindex]; | 
| 650 | 656 | 
|  | 657   x->plane[0].quant_thred[0] = (x->plane[0].zbin[0] + x->plane[0].zbin_extra) * | 
|  | 658       (x->plane[0].zbin[0] + x->plane[0].zbin_extra); | 
|  | 659   x->plane[0].quant_thred[1] = (x->plane[0].zbin[1] + x->plane[0].zbin_extra) * | 
|  | 660       (x->plane[0].zbin[1] + x->plane[0].zbin_extra); | 
|  | 661 | 
| 651   // UV | 662   // UV | 
| 652   for (i = 1; i < 3; i++) { | 663   for (i = 1; i < 3; i++) { | 
| 653     x->plane[i].quant = quants->uv_quant[qindex]; | 664     x->plane[i].quant = quants->uv_quant[qindex]; | 
| 654     x->plane[i].quant_fp = quants->uv_quant_fp[qindex]; | 665     x->plane[i].quant_fp = quants->uv_quant_fp[qindex]; | 
| 655     x->plane[i].round_fp = quants->uv_round_fp[qindex]; | 666     x->plane[i].round_fp = quants->uv_round_fp[qindex]; | 
| 656     x->plane[i].quant_shift = quants->uv_quant_shift[qindex]; | 667     x->plane[i].quant_shift = quants->uv_quant_shift[qindex]; | 
| 657     x->plane[i].zbin = quants->uv_zbin[qindex]; | 668     x->plane[i].zbin = quants->uv_zbin[qindex]; | 
| 658     x->plane[i].round = quants->uv_round[qindex]; | 669     x->plane[i].round = quants->uv_round[qindex]; | 
| 659     x->plane[i].quant_thred[0] = cm->y_dequant[qindex][0] * |  | 
| 660                                     cm->y_dequant[qindex][0]; |  | 
| 661     x->plane[i].quant_thred[1] = cm->y_dequant[qindex][1] * |  | 
| 662                                     cm->y_dequant[qindex][1]; |  | 
| 663     x->plane[i].zbin_extra = (int16_t)((cm->uv_dequant[qindex][1] * zbin) >> 7); | 670     x->plane[i].zbin_extra = (int16_t)((cm->uv_dequant[qindex][1] * zbin) >> 7); | 
| 664     xd->plane[i].dequant = cm->uv_dequant[qindex]; | 671     xd->plane[i].dequant = cm->uv_dequant[qindex]; | 
|  | 672 | 
|  | 673     x->plane[i].quant_thred[0] = | 
|  | 674         (x->plane[i].zbin[0] + x->plane[i].zbin_extra) * | 
|  | 675         (x->plane[i].zbin[0] + x->plane[i].zbin_extra); | 
|  | 676     x->plane[i].quant_thred[1] = | 
|  | 677         (x->plane[i].zbin[1] + x->plane[i].zbin_extra) * | 
|  | 678         (x->plane[i].zbin[1] + x->plane[i].zbin_extra); | 
| 665   } | 679   } | 
| 666 | 680 | 
| 667   x->skip_block = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP); | 681   x->skip_block = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP); | 
| 668   x->q_index = qindex; | 682   x->q_index = qindex; | 
| 669 | 683 | 
| 670   x->errorperbit = rdmult >> 6; | 684   x->errorperbit = rdmult >> 6; | 
| 671   x->errorperbit += (x->errorperbit == 0); | 685   x->errorperbit += (x->errorperbit == 0); | 
| 672 | 686 | 
| 673   vp9_initialize_me_consts(cpi, x->q_index); | 687   vp9_initialize_me_consts(cpi, x->q_index); | 
| 674 } | 688 } | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 718 | 732 | 
| 719 int vp9_qindex_to_quantizer(int qindex) { | 733 int vp9_qindex_to_quantizer(int qindex) { | 
| 720   int quantizer; | 734   int quantizer; | 
| 721 | 735 | 
| 722   for (quantizer = 0; quantizer < 64; ++quantizer) | 736   for (quantizer = 0; quantizer < 64; ++quantizer) | 
| 723     if (quantizer_to_qindex[quantizer] >= qindex) | 737     if (quantizer_to_qindex[quantizer] >= qindex) | 
| 724       return quantizer; | 738       return quantizer; | 
| 725 | 739 | 
| 726   return 63; | 740   return 63; | 
| 727 } | 741 } | 
| OLD | NEW | 
|---|