This c version uses the shortcuts found in the x86 vp9_quantize_fp functions. The test was updated to use the correct quant/round range.
Unified · Split
| @@ -14,9 +14,9 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | #include "third_party/googletest/src/include/gtest/gtest.h" |
| 16 | 16 | |
| 17 | +#include "./vp9_rtcd.h" | |
| 17 | 18 | #include "./vpx_config.h" |
| 18 | 19 | #include "./vpx_dsp_rtcd.h" |
| 19 | −#include "./vp9_rtcd.h" | |
| 20 | 20 | #include "test/acm_random.h" |
| 21 | 21 | #include "test/buffer.h" |
| 22 | 22 | #include "test/clear_system_state.h" |
| @@ -42,7 +42,7 @@ typedef void (*QuantizeFunc)(const tran_low_t *coeff, intptr_t count, · 19 unmodified lines | ||
| 42 | 42 | uint16_t *eob, const int16_t *scan, |
| 43 | 43 | const int16_t *iscan); |
| 44 | 44 | typedef std::tr1::tuple<QuantizeFunc, QuantizeFunc, vpx_bit_depth_t, |
| 45 | − int /*max_size*/> | |
| 45 | + int /*max_size*/, bool /*is_fp*/> | |
| 46 | 46 | QuantizeParam; |
| 47 | 47 | |
| 48 | 48 | // Wrapper for FP version which does not use zbin or quant_shift. |
| @@ -69,11 +69,15 @@ void QuantFPWrapper(const tran_low_t *coeff, intptr_t count, int skip_block, · 20 unmodified lines | ||
| 69 | 69 | |
| 70 | 70 | class VP9QuantizeBase { |
| 71 | 71 | public: |
| 72 | − VP9QuantizeBase(vpx_bit_depth_t bit_depth, int max_size) | |
| 73 | − : bit_depth_(bit_depth), max_size_(max_size) { | |
| 72 | + VP9QuantizeBase(vpx_bit_depth_t bit_depth, int max_size, bool is_fp) | |
| 73 | + : bit_depth_(bit_depth), max_size_(max_size), is_fp_(is_fp) { | |
| 74 | 74 | max_value_ = (1 << bit_depth_) - 1; |
| 75 | 75 | zbin_ptr_ = |
| 76 | 76 | reinterpret_cast<int16_t *>(vpx_memalign(16, 8 * sizeof(*zbin_ptr_))); |
| 77 | + round_fp_ptr_ = reinterpret_cast<int16_t *>( | |
| 78 | + vpx_memalign(16, 8 * sizeof(*round_fp_ptr_))); | |
| 79 | + quant_fp_ptr_ = reinterpret_cast<int16_t *>( | |
| 80 | + vpx_memalign(16, 8 * sizeof(*quant_fp_ptr_))); | |
| 77 | 81 | round_ptr_ = |
| 78 | 82 | reinterpret_cast<int16_t *>(vpx_memalign(16, 8 * sizeof(*round_ptr_))); |
| 79 | 83 | quant_ptr_ = |
| @@ -86,11 +90,15 @@ class VP9QuantizeBase { · 6 unmodified lines | ||
| 86 | 90 | |
| 87 | 91 | ~VP9QuantizeBase() { |
| 88 | 92 | vpx_free(zbin_ptr_); |
| 93 | + vpx_free(round_fp_ptr_); | |
| 94 | + vpx_free(quant_fp_ptr_); | |
| 89 | 95 | vpx_free(round_ptr_); |
| 90 | 96 | vpx_free(quant_ptr_); |
| 91 | 97 | vpx_free(quant_shift_ptr_); |
| 92 | 98 | vpx_free(dequant_ptr_); |
| 93 | 99 | zbin_ptr_ = NULL; |
| 100 | + round_fp_ptr_ = NULL; | |
| 101 | + quant_fp_ptr_ = NULL; | |
| 94 | 102 | round_ptr_ = NULL; |
| 95 | 103 | quant_ptr_ = NULL; |
| 96 | 104 | quant_shift_ptr_ = NULL; |
| @@ -100,6 +108,8 @@ class VP9QuantizeBase { · 3 unmodified lines | ||
| 100 | 108 | |
| 101 | 109 | protected: |
| 102 | 110 | int16_t *zbin_ptr_; |
| 111 | + int16_t *round_fp_ptr_; | |
| 112 | + int16_t *quant_fp_ptr_; | |
| 103 | 113 | int16_t *round_ptr_; |
| 104 | 114 | int16_t *quant_ptr_; |
| 105 | 115 | int16_t *quant_shift_ptr_; |
| @@ -107,29 +117,103 @@ class VP9QuantizeBase { · 1 unmodified line | ||
| 107 | 117 | const vpx_bit_depth_t bit_depth_; |
| 108 | 118 | int max_value_; |
| 109 | 119 | const int max_size_; |
| 120 | + const bool is_fp_; | |
| 110 | 121 | }; |
| 111 | 122 | |
| 112 | 123 | class VP9QuantizeTest : public VP9QuantizeBase, |
| 113 | 124 | public ::testing::TestWithParam<QuantizeParam> { |
| 114 | 125 | public: |
| 115 | 126 | VP9QuantizeTest() |
| 116 | − : VP9QuantizeBase(GET_PARAM(2), GET_PARAM(3)), quantize_op_(GET_PARAM(0)), | |
| 117 | − ref_quantize_op_(GET_PARAM(1)) {} | |
| 127 | + : VP9QuantizeBase(GET_PARAM(2), GET_PARAM(3), GET_PARAM(4)), | |
| 128 | + quantize_op_(GET_PARAM(0)), ref_quantize_op_(GET_PARAM(1)) {} | |
| 118 | 129 | |
| 119 | 130 | protected: |
| 120 | 131 | const QuantizeFunc quantize_op_; |
| 121 | 132 | const QuantizeFunc ref_quantize_op_; |
| 122 | 133 | }; |
| 123 | 134 | |
| 135 | +// This quantizer compares the AC coefficients to the quantization step size to | |
| 136 | +// determine if further multiplication operations are needed. | |
| 137 | +// Based on vp9_quantize_fp_sse2(). | |
| 138 | +void quantize_fp_nz_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, | |
| 139 | + int skip_block, const int16_t *round_ptr, | |
| 140 | + const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, | |
| 141 | + tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, | |
| 142 | + uint16_t *eob_ptr, const int16_t *scan, | |
| 143 | + const int16_t *iscan) { | |
| 144 | + int i, eob = -1; | |
| 145 | + const int thr = dequant_ptr[1] >> 1; | |
| 146 | + (void)iscan; | |
| 147 | + (void)skip_block; | |
| 148 | + assert(!skip_block); | |
| 149 | + | |
| 150 | + // Quantization pass: All coefficients with index >= zero_flag are | |
| 151 | + // skippable. Note: zero_flag can be zero. | |
| 152 | + for (i = 0; i < n_coeffs; i += 16) { | |
| 153 | + int y; | |
| 154 | + int nzflag_cnt = 0; | |
| 155 | + int abs_coeff[16]; | |
| 156 | + int coeff_sign[16]; | |
| 157 | + | |
| 158 | + // count nzflag for each row (16 tran_low_t) | |
| 159 | + for (y = 0; y < 16; ++y) { | |
| 160 | + const int rc = i + y; | |
| 161 | + const int coeff = coeff_ptr[rc]; | |
| 162 | + coeff_sign[y] = (coeff >> 31); | |
| 163 | + abs_coeff[y] = (coeff ^ coeff_sign[y]) - coeff_sign[y]; | |
| 164 | + // The first 16 are skipped in the sse2 code. Do the same here to match. | |
| 165 | + if (i >= 16 && (abs_coeff[y] <= thr)) { | |
| 166 | + nzflag_cnt++; | |
| 167 | + } | |
| 168 | + } | |
| 169 | + | |
| 170 | + for (y = 0; y < 16; ++y) { | |
| 171 | + const int rc = i + y; | |
| 172 | + // If all of the AC coeffs in a row has magnitude less than the | |
| 173 | + // quantization step_size/2, quantize to zero. | |
| 174 | + if (nzflag_cnt < 16) { | |
| 175 | + int tmp = | |
| 176 | + clamp(abs_coeff[y] + round_ptr[rc != 0], INT16_MIN, INT16_MAX); | |
| 177 | + tmp = (tmp * quant_ptr[rc != 0]) >> 16; | |
| 178 | + qcoeff_ptr[rc] = (tmp ^ coeff_sign[y]) - coeff_sign[y]; | |
| 179 | + dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0]; | |
| 180 | + } else { | |
| 181 | + qcoeff_ptr[rc] = 0; | |
| 182 | + dqcoeff_ptr[rc] = 0; | |
| 183 | + } | |
| 184 | + } | |
| 185 | + } | |
| 186 | + | |
| 187 | + // Scan for eob. | |
| 188 | + for (i = 0; i < n_coeffs; i++) { | |
| 189 | + // Use the scan order to find the correct eob. | |
| 190 | + const int rc = scan[i]; | |
| 191 | + if (qcoeff_ptr[rc]) { | |
| 192 | + eob = i; | |
| 193 | + } | |
| 194 | + } | |
| 195 | + *eob_ptr = eob + 1; | |
| 196 | +} | |
| 197 | + | |
| 124 | 198 | void GenerateHelperArrays(ACMRandom *rnd, int16_t *zbin, int16_t *round, |
| 125 | 199 | int16_t *quant, int16_t *quant_shift, |
| 126 | − int16_t *dequant) { | |
| 200 | + int16_t *dequant, int16_t *round_fp, | |
| 201 | + int16_t *quant_fp) { | |
| 202 | + // Max when q == 0. Otherwise, it is 48 for Y and 42 for U/V. | |
| 203 | + const int max_qrounding_factor_fp = 64; | |
| 204 | + | |
| 127 | 205 | for (int j = 0; j < 2; j++) { |
| 206 | + // The range is 4 to 1828 in the VP9 tables. | |
| 207 | + const int qlookup = rnd->RandRange(1825) + 4; | |
| 208 | + round_fp[j] = (max_qrounding_factor_fp * qlookup) >> 7; | |
| 209 | + quant_fp[j] = (1 << 16) / qlookup; | |
| 210 | + | |
| 128 | 211 | // Values determined by deconstructing vp9_init_quantizer(). |
| 129 | 212 | // zbin may be up to 1143 for 8 and 10 bit Y values, or 1200 for 12 bit Y |
| 130 | 213 | // values or U/V values of any bit depth. This is because y_delta is not |
| 131 | 214 | // factored into the vp9_ac_quant() call. |
| 132 | 215 | zbin[j] = rnd->RandRange(1200); |
| 216 | + | |
| 133 | 217 | // round may be up to 685 for Y values or 914 for U/V. |
| 134 | 218 | round[j] = rnd->RandRange(914); |
| 135 | 219 | // quant ranges from 1 to -32703 |
| @@ -141,6 +225,8 @@ void GenerateHelperArrays(ACMRandom *rnd, int16_t *zbin, int16_t *round, · 5 unmodified lines | ||
| 141 | 225 | } |
| 142 | 226 | for (int j = 2; j < 8; j++) { |
| 143 | 227 | zbin[j] = zbin[1]; |
| 228 | + round_fp[j] = round_fp[1]; | |
| 229 | + quant_fp[j] = quant_fp[1]; | |
| 144 | 230 | round[j] = round[1]; |
| 145 | 231 | quant[j] = quant[1]; |
| 146 | 232 | quant_shift[j] = quant_shift[1]; |
| @@ -179,19 +265,19 @@ TEST_P(VP9QuantizeTest, OperationCheck) { · 32 unmodified lines | ||
| 179 | 265 | const int count = (4 << sz) * (4 << sz); |
| 180 | 266 | coeff.Set(&rnd, -max_value_, max_value_); |
| 181 | 267 | GenerateHelperArrays(&rnd, zbin_ptr_, round_ptr_, quant_ptr_, |
| 182 | − quant_shift_ptr_, dequant_ptr_); | |
| 183 | − | |
| 184 | − ref_quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, | |
| 185 | − round_ptr_, quant_ptr_, quant_shift_ptr_, | |
| 186 | − ref_qcoeff.TopLeftPixel(), ref_dqcoeff.TopLeftPixel(), | |
| 187 | − dequant_ptr_, &ref_eob, scan_order->scan, | |
| 188 | − scan_order->iscan); | |
| 189 | − | |
| 190 | − ASM_REGISTER_STATE_CHECK( | |
| 191 | − quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, | |
| 192 | − round_ptr_, quant_ptr_, quant_shift_ptr_, | |
| 193 | − qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(), | |
| 194 | − dequant_ptr_, &eob, scan_order->scan, scan_order->iscan)); | |
| 268 | + quant_shift_ptr_, dequant_ptr_, round_fp_ptr_, | |
| 269 | + quant_fp_ptr_); | |
| 270 | + int16_t *r_ptr = (is_fp_) ? round_fp_ptr_ : round_ptr_; | |
| 271 | + int16_t *q_ptr = (is_fp_) ? quant_fp_ptr_ : quant_ptr_; | |
| 272 | + ref_quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, r_ptr, | |
| 273 | + q_ptr, quant_shift_ptr_, ref_qcoeff.TopLeftPixel(), | |
| 274 | + ref_dqcoeff.TopLeftPixel(), dequant_ptr_, &ref_eob, | |
| 275 | + scan_order->scan, scan_order->iscan); | |
| 276 | + | |
| 277 | + ASM_REGISTER_STATE_CHECK(quantize_op_( | |
| 278 | + coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, r_ptr, q_ptr, | |
| 279 | + quant_shift_ptr_, qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(), | |
| 280 | + dequant_ptr_, &eob, scan_order->scan, scan_order->iscan)); | |
| 195 | 281 | |
| 196 | 282 | EXPECT_TRUE(qcoeff.CheckValues(ref_qcoeff)); |
| 197 | 283 | EXPECT_TRUE(dqcoeff.CheckValues(ref_dqcoeff)); |
| @@ -241,19 +327,19 @@ TEST_P(VP9QuantizeTest, EOBCheck) { · 43 unmodified lines | ||
| 241 | 327 | coeff.TopLeftPixel()[rnd(count)] = |
| 242 | 328 | static_cast<int>(rnd.RandRange(max_value_ * 2)) - max_value_; |
| 243 | 329 | GenerateHelperArrays(&rnd, zbin_ptr_, round_ptr_, quant_ptr_, |
| 244 | − quant_shift_ptr_, dequant_ptr_); | |
| 245 | − | |
| 246 | − ref_quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, | |
| 247 | − round_ptr_, quant_ptr_, quant_shift_ptr_, | |
| 248 | − ref_qcoeff.TopLeftPixel(), ref_dqcoeff.TopLeftPixel(), | |
| 249 | − dequant_ptr_, &ref_eob, scan_order->scan, | |
| 250 | − scan_order->iscan); | |
| 251 | − | |
| 252 | − ASM_REGISTER_STATE_CHECK( | |
| 253 | − quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, | |
| 254 | − round_ptr_, quant_ptr_, quant_shift_ptr_, | |
| 255 | − qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(), | |
| 256 | − dequant_ptr_, &eob, scan_order->scan, scan_order->iscan)); | |
| 330 | + quant_shift_ptr_, dequant_ptr_, round_fp_ptr_, | |
| 331 | + quant_fp_ptr_); | |
| 332 | + int16_t *r_ptr = (is_fp_) ? round_fp_ptr_ : round_ptr_; | |
| 333 | + int16_t *q_ptr = (is_fp_) ? quant_fp_ptr_ : quant_ptr_; | |
| 334 | + ref_quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, r_ptr, | |
| 335 | + q_ptr, quant_shift_ptr_, ref_qcoeff.TopLeftPixel(), | |
| 336 | + ref_dqcoeff.TopLeftPixel(), dequant_ptr_, &ref_eob, | |
| 337 | + scan_order->scan, scan_order->iscan); | |
| 338 | + | |
| 339 | + ASM_REGISTER_STATE_CHECK(quantize_op_( | |
| 340 | + coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, r_ptr, q_ptr, | |
| 341 | + quant_shift_ptr_, qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(), | |
| 342 | + dequant_ptr_, &eob, scan_order->scan, scan_order->iscan)); | |
| 257 | 343 | |
| 258 | 344 | EXPECT_TRUE(qcoeff.CheckValues(ref_qcoeff)); |
| 259 | 345 | EXPECT_TRUE(dqcoeff.CheckValues(ref_dqcoeff)); |
| @@ -299,7 +385,10 @@ TEST_P(VP9QuantizeTest, DISABLED_Speed) { · 39 unmodified lines | ||
| 299 | 385 | const int count = (4 << sz) * (4 << sz); |
| 300 | 386 | |
| 301 | 387 | GenerateHelperArrays(&rnd, zbin_ptr_, round_ptr_, quant_ptr_, |
| 302 | − quant_shift_ptr_, dequant_ptr_); | |
| 388 | + quant_shift_ptr_, dequant_ptr_, round_fp_ptr_, | |
| 389 | + quant_fp_ptr_); | |
| 390 | + int16_t *r_ptr = (is_fp_) ? round_fp_ptr_ : round_ptr_; | |
| 391 | + int16_t *q_ptr = (is_fp_) ? quant_fp_ptr_ : quant_ptr_; | |
| 303 | 392 | |
| 304 | 393 | if (i == 0) { |
| 305 | 394 | // When |coeff values| are less than zbin the results are 0. |
| @@ -319,10 +408,10 @@ TEST_P(VP9QuantizeTest, DISABLED_Speed) { · 13 unmodified lines | ||
| 319 | 408 | vpx_usec_timer timer; |
| 320 | 409 | vpx_usec_timer_start(&timer); |
| 321 | 410 | for (int j = 0; j < 100000000 / count; ++j) { |
| 322 | − quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, | |
| 323 | − round_ptr_, quant_ptr_, quant_shift_ptr_, | |
| 324 | − qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(), | |
| 325 | − dequant_ptr_, &eob, scan_order->scan, scan_order->iscan); | |
| 411 | + quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_, r_ptr, | |
| 412 | + q_ptr, quant_shift_ptr_, qcoeff.TopLeftPixel(), | |
| 413 | + dqcoeff.TopLeftPixel(), dequant_ptr_, &eob, | |
| 414 | + scan_order->scan, scan_order->iscan); | |
| 326 | 415 | } |
| 327 | 416 | vpx_usec_timer_mark(&timer); |
| 328 | 417 | const int elapsed_time = static_cast<int>(vpx_usec_timer_elapsed(&timer)); |
| @@ -345,50 +434,55 @@ INSTANTIATE_TEST_CASE_P( · 16 unmodified lines | ||
| 345 | 434 | SSE2, VP9QuantizeTest, |
| 346 | 435 | ::testing::Values( |
| 347 | 436 | make_tuple(&vpx_highbd_quantize_b_sse2, &vpx_highbd_quantize_b_c, |
| 348 | − VPX_BITS_8, 16), | |
| 437 | + VPX_BITS_8, 16, false), | |
| 349 | 438 | make_tuple(&vpx_highbd_quantize_b_sse2, &vpx_highbd_quantize_b_c, |
| 350 | − VPX_BITS_10, 16), | |
| 439 | + VPX_BITS_10, 16, false), | |
| 351 | 440 | make_tuple(&vpx_highbd_quantize_b_sse2, &vpx_highbd_quantize_b_c, |
| 352 | − VPX_BITS_12, 16), | |
| 441 | + VPX_BITS_12, 16, false), | |
| 353 | 442 | make_tuple(&vpx_highbd_quantize_b_32x32_sse2, |
| 354 | − &vpx_highbd_quantize_b_32x32_c, VPX_BITS_8, 32), | |
| 443 | + &vpx_highbd_quantize_b_32x32_c, VPX_BITS_8, 32, false), | |
| 355 | 444 | make_tuple(&vpx_highbd_quantize_b_32x32_sse2, |
| 356 | − &vpx_highbd_quantize_b_32x32_c, VPX_BITS_10, 32), | |
| 445 | + &vpx_highbd_quantize_b_32x32_c, VPX_BITS_10, 32, false), | |
| 357 | 446 | make_tuple(&vpx_highbd_quantize_b_32x32_sse2, |
| 358 | − &vpx_highbd_quantize_b_32x32_c, VPX_BITS_12, 32))); | |
| 447 | + &vpx_highbd_quantize_b_32x32_c, VPX_BITS_12, 32, false))); | |
| 359 | 448 | |
| 360 | 449 | #else |
| 361 | −INSTANTIATE_TEST_CASE_P(SSE2, VP9QuantizeTest, | |
| 362 | − ::testing::Values(make_tuple(&vpx_quantize_b_sse2, | |
| 363 | − &vpx_quantize_b_c, | |
| 364 | − VPX_BITS_8, 16))); | |
| 365 | −#endif // CONFIG_VP9_HIGHBITDEPTH | |
| 366 | − | |
| 367 | 450 | INSTANTIATE_TEST_CASE_P( |
| 368 | − DISABLED_SSE2, VP9QuantizeTest, | |
| 369 | − ::testing::Values(make_tuple(&QuantFPWrapper<vp9_quantize_fp_sse2>, | |
| 370 | − &QuantFPWrapper<vp9_quantize_fp_c>, VPX_BITS_8, | |
| 371 | − 16))); | |
| 451 | + SSE2, VP9QuantizeTest, | |
| 452 | + ::testing::Values(make_tuple(&vpx_quantize_b_sse2, &vpx_quantize_b_c, | |
| 453 | + VPX_BITS_8, 16, false), | |
| 454 | + make_tuple(&QuantFPWrapper<vp9_quantize_fp_sse2>, | |
| 455 | + &QuantFPWrapper<quantize_fp_nz_c>, VPX_BITS_8, | |
| 456 | + 16, true))); | |
| 457 | +#endif // CONFIG_VP9_HIGHBITDEPTH | |
| 372 | 458 | #endif // HAVE_SSE2 |
| 373 | 459 | |
| 374 | 460 | #if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH |
| 461 | +#if ARCH_X86_64 | |
| 462 | +INSTANTIATE_TEST_CASE_P( | |
| 463 | + SSSE3, VP9QuantizeTest, | |
| 464 | + ::testing::Values(make_tuple(&vpx_quantize_b_ssse3, &vpx_quantize_b_c, | |
| 465 | + VPX_BITS_8, 16, false), | |
| 466 | + make_tuple(&QuantFPWrapper<vp9_quantize_fp_ssse3>, | |
| 467 | + &QuantFPWrapper<quantize_fp_nz_c>, VPX_BITS_8, | |
| 468 | + 16, true))); | |
| 469 | +#else | |
| 375 | 470 | INSTANTIATE_TEST_CASE_P(SSSE3, VP9QuantizeTest, |
| 376 | 471 | ::testing::Values(make_tuple(&vpx_quantize_b_ssse3, |
| 377 | 472 | &vpx_quantize_b_c, |
| 378 | − VPX_BITS_8, 16))); | |
| 473 | + VPX_BITS_8, 16, false))); | |
| 474 | +#endif | |
| 379 | 475 | |
| 380 | 476 | #if ARCH_X86_64 |
| 381 | 477 | // TODO(johannkoenig): SSSE3 optimizations do not yet pass this test. |
| 382 | 478 | INSTANTIATE_TEST_CASE_P( |
| 383 | 479 | DISABLED_SSSE3, VP9QuantizeTest, |
| 384 | 480 | ::testing::Values(make_tuple(&vpx_quantize_b_32x32_ssse3, |
| 385 | − &vpx_quantize_b_32x32_c, VPX_BITS_8, 32), | |
| 386 | − make_tuple(&QuantFPWrapper<vp9_quantize_fp_ssse3>, | |
| 387 | − &QuantFPWrapper<vp9_quantize_fp_c>, VPX_BITS_8, | |
| 388 | − 16), | |
| 481 | + &vpx_quantize_b_32x32_c, VPX_BITS_8, 32, | |
| 482 | + false), | |
| 389 | 483 | make_tuple(&QuantFPWrapper<vp9_quantize_fp_32x32_ssse3>, |
| 390 | 484 | &QuantFPWrapper<vp9_quantize_fp_32x32_c>, |
| 391 | − VPX_BITS_8, 32))); | |
| 485 | + VPX_BITS_8, 32, true))); | |
| 392 | 486 | #endif // ARCH_X86_64 |
| 393 | 487 | #endif // HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH |
| 394 | 488 | |
| @@ -398,36 +492,43 @@ INSTANTIATE_TEST_CASE_P( · 3 unmodified lines | ||
| 398 | 492 | INSTANTIATE_TEST_CASE_P( |
| 399 | 493 | AVX, VP9QuantizeTest, |
| 400 | 494 | ::testing::Values(make_tuple(&vpx_quantize_b_avx, &vpx_quantize_b_c, |
| 401 | − VPX_BITS_8, 16), | |
| 495 | + VPX_BITS_8, 16, false), | |
| 402 | 496 | // Even though SSSE3 and AVX do not match the reference |
| 403 | 497 | // code, we can keep them in sync with each other. |
| 404 | 498 | make_tuple(&vpx_quantize_b_32x32_avx, |
| 405 | − &vpx_quantize_b_32x32_ssse3, VPX_BITS_8, 32))); | |
| 499 | + &vpx_quantize_b_32x32_ssse3, VPX_BITS_8, 32, | |
| 500 | + false))); | |
| 406 | 501 | #endif // HAVE_AVX && !CONFIG_VP9_HIGHBITDEPTH |
| 407 | 502 | |
| 408 | 503 | // TODO(webm:1448): dqcoeff is not handled correctly in HBD builds. |
| 409 | 504 | #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH |
| 410 | 505 | INSTANTIATE_TEST_CASE_P( |
| 411 | 506 | NEON, VP9QuantizeTest, |
| 412 | − ::testing::Values( | |
| 413 | − make_tuple(&vpx_quantize_b_neon, &vpx_quantize_b_c, VPX_BITS_8, 16), | |
| 414 | − make_tuple(&vpx_quantize_b_32x32_neon, &vpx_quantize_b_32x32_c, | |
| 415 | − VPX_BITS_8, 32), | |
| 416 | − make_tuple(&QuantFPWrapper<vp9_quantize_fp_neon>, | |
| 417 | − &QuantFPWrapper<vp9_quantize_fp_c>, VPX_BITS_8, 16), | |
| 418 | − make_tuple(&QuantFPWrapper<vp9_quantize_fp_32x32_neon>, | |
| 419 | − &QuantFPWrapper<vp9_quantize_fp_32x32_c>, VPX_BITS_8, 32))); | |
| 507 | + ::testing::Values(make_tuple(&vpx_quantize_b_neon, &vpx_quantize_b_c, | |
| 508 | + VPX_BITS_8, 16, false), | |
| 509 | + make_tuple(&vpx_quantize_b_32x32_neon, | |
| 510 | + &vpx_quantize_b_32x32_c, VPX_BITS_8, 32, | |
| 511 | + false), | |
| 512 | + make_tuple(&QuantFPWrapper<vp9_quantize_fp_neon>, | |
| 513 | + &QuantFPWrapper<vp9_quantize_fp_c>, VPX_BITS_8, | |
| 514 | + 16, true), | |
| 515 | + make_tuple(&QuantFPWrapper<vp9_quantize_fp_32x32_neon>, | |
| 516 | + &QuantFPWrapper<vp9_quantize_fp_32x32_c>, | |
| 517 | + VPX_BITS_8, 32, true))); | |
| 420 | 518 | #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH |
| 421 | 519 | |
| 422 | 520 | // Only useful to compare "Speed" test results. |
| 423 | 521 | INSTANTIATE_TEST_CASE_P( |
| 424 | 522 | DISABLED_C, VP9QuantizeTest, |
| 425 | 523 | ::testing::Values( |
| 426 | − make_tuple(&vpx_quantize_b_c, &vpx_quantize_b_c, VPX_BITS_8, 16), | |
| 524 | + make_tuple(&vpx_quantize_b_c, &vpx_quantize_b_c, VPX_BITS_8, 16, false), | |
| 427 | 525 | make_tuple(&vpx_quantize_b_32x32_c, &vpx_quantize_b_32x32_c, VPX_BITS_8, |
| 428 | − 32), | |
| 526 | + 32, false), | |
| 429 | 527 | make_tuple(&QuantFPWrapper<vp9_quantize_fp_c>, |
| 430 | − &QuantFPWrapper<vp9_quantize_fp_c>, VPX_BITS_8, 16), | |
| 528 | + &QuantFPWrapper<vp9_quantize_fp_c>, VPX_BITS_8, 16, true), | |
| 529 | + make_tuple(&QuantFPWrapper<quantize_fp_nz_c>, | |
| 530 | + &QuantFPWrapper<quantize_fp_nz_c>, VPX_BITS_8, 16, true), | |
| 431 | 531 | make_tuple(&QuantFPWrapper<vp9_quantize_fp_32x32_c>, |
| 432 | − &QuantFPWrapper<vp9_quantize_fp_32x32_c>, VPX_BITS_8, 32))); | |
| 532 | + &QuantFPWrapper<vp9_quantize_fp_32x32_c>, VPX_BITS_8, 32, | |
| 533 | + true))); | |
| 433 | 534 | } // namespace |