2014-10-16 14:38:46 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014 The WebM project authors. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
|
|
|
2015-08-04 18:24:52 +02:00
|
|
|
#include "./vpx_config.h"
|
|
|
|
#include "./vpx_dsp_rtcd.h"
|
2017-08-02 19:24:19 +02:00
|
|
|
#include "./vp9_rtcd.h"
|
2014-10-16 14:38:46 +02:00
|
|
|
#include "test/acm_random.h"
|
2017-07-13 18:14:37 +02:00
|
|
|
#include "test/buffer.h"
|
2014-10-16 14:38:46 +02:00
|
|
|
#include "test/clear_system_state.h"
|
|
|
|
#include "test/register_state_check.h"
|
|
|
|
#include "test/util.h"
|
|
|
|
#include "vp9/common/vp9_entropy.h"
|
2015-05-22 20:19:51 +02:00
|
|
|
#include "vp9/common/vp9_scan.h"
|
|
|
|
#include "vpx/vpx_codec.h"
|
2014-10-16 14:38:46 +02:00
|
|
|
#include "vpx/vpx_integer.h"
|
2017-07-27 23:14:20 +02:00
|
|
|
#include "vpx_ports/vpx_timer.h"
|
2014-10-16 14:38:46 +02:00
|
|
|
|
|
|
|
using libvpx_test::ACMRandom;
|
2017-07-13 18:14:37 +02:00
|
|
|
using libvpx_test::Buffer;
|
2014-10-16 14:38:46 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
const int number_of_iterations = 100;
|
|
|
|
|
|
|
|
typedef void (*QuantizeFunc)(const tran_low_t *coeff, intptr_t count,
|
|
|
|
int skip_block, const int16_t *zbin,
|
|
|
|
const int16_t *round, const int16_t *quant,
|
2016-07-26 07:50:48 +02:00
|
|
|
const int16_t *quant_shift, tran_low_t *qcoeff,
|
|
|
|
tran_low_t *dqcoeff, const int16_t *dequant,
|
2014-10-16 14:38:46 +02:00
|
|
|
uint16_t *eob, const int16_t *scan,
|
|
|
|
const int16_t *iscan);
|
2017-08-02 19:24:19 +02:00
|
|
|
typedef std::tr1::tuple<QuantizeFunc, QuantizeFunc, vpx_bit_depth_t,
|
|
|
|
int /*max_size*/>
|
2014-10-16 14:38:46 +02:00
|
|
|
QuantizeParam;
|
|
|
|
|
2017-08-02 19:24:19 +02:00
|
|
|
class VP9QuantizeBase {
|
2014-10-16 14:38:46 +02:00
|
|
|
public:
|
2017-08-02 19:24:19 +02:00
|
|
|
VP9QuantizeBase(vpx_bit_depth_t bit_depth, int max_size)
|
|
|
|
: bit_depth_(bit_depth), max_size_(max_size) {
|
2017-07-13 18:14:37 +02:00
|
|
|
max_value_ = (1 << bit_depth_) - 1;
|
2017-08-02 19:24:19 +02:00
|
|
|
zbin_ptr_ =
|
|
|
|
reinterpret_cast<int16_t *>(vpx_memalign(16, 8 * sizeof(*zbin_ptr_)));
|
|
|
|
round_ptr_ =
|
|
|
|
reinterpret_cast<int16_t *>(vpx_memalign(16, 8 * sizeof(*round_ptr_)));
|
|
|
|
quant_ptr_ =
|
|
|
|
reinterpret_cast<int16_t *>(vpx_memalign(16, 8 * sizeof(*quant_ptr_)));
|
|
|
|
quant_shift_ptr_ = reinterpret_cast<int16_t *>(
|
|
|
|
vpx_memalign(16, 8 * sizeof(*quant_shift_ptr_)));
|
|
|
|
dequant_ptr_ = reinterpret_cast<int16_t *>(
|
|
|
|
vpx_memalign(16, 8 * sizeof(*dequant_ptr_)));
|
2014-10-16 14:38:46 +02:00
|
|
|
}
|
|
|
|
|
2017-08-02 19:24:19 +02:00
|
|
|
~VP9QuantizeBase() {
|
|
|
|
vpx_free(zbin_ptr_);
|
|
|
|
vpx_free(round_ptr_);
|
|
|
|
vpx_free(quant_ptr_);
|
|
|
|
vpx_free(quant_shift_ptr_);
|
|
|
|
vpx_free(dequant_ptr_);
|
|
|
|
zbin_ptr_ = NULL;
|
|
|
|
round_ptr_ = NULL;
|
|
|
|
quant_ptr_ = NULL;
|
|
|
|
quant_shift_ptr_ = NULL;
|
|
|
|
dequant_ptr_ = NULL;
|
|
|
|
libvpx_test::ClearSystemState();
|
|
|
|
}
|
2014-10-16 14:38:46 +02:00
|
|
|
|
|
|
|
protected:
|
2017-08-02 19:24:19 +02:00
|
|
|
int16_t *zbin_ptr_;
|
|
|
|
int16_t *round_ptr_;
|
|
|
|
int16_t *quant_ptr_;
|
|
|
|
int16_t *quant_shift_ptr_;
|
|
|
|
int16_t *dequant_ptr_;
|
|
|
|
const vpx_bit_depth_t bit_depth_;
|
2017-07-13 18:14:37 +02:00
|
|
|
int max_value_;
|
2017-08-02 19:24:19 +02:00
|
|
|
const int max_size_;
|
2014-10-16 14:38:46 +02:00
|
|
|
};
|
|
|
|
|
2017-08-02 19:24:19 +02:00
|
|
|
class VP9QuantizeTest : public VP9QuantizeBase,
|
|
|
|
public ::testing::TestWithParam<QuantizeParam> {
|
2014-10-16 14:38:46 +02:00
|
|
|
public:
|
2017-08-02 19:24:19 +02:00
|
|
|
VP9QuantizeTest()
|
|
|
|
: VP9QuantizeBase(GET_PARAM(2), GET_PARAM(3)), quantize_op_(GET_PARAM(0)),
|
|
|
|
ref_quantize_op_(GET_PARAM(1)) {}
|
2014-10-16 14:38:46 +02:00
|
|
|
|
|
|
|
protected:
|
2017-08-02 19:24:19 +02:00
|
|
|
const QuantizeFunc quantize_op_;
|
|
|
|
const QuantizeFunc ref_quantize_op_;
|
2014-10-16 14:38:46 +02:00
|
|
|
};
|
|
|
|
|
2017-08-02 19:24:19 +02:00
|
|
|
void GenerateHelperArrays(ACMRandom *rnd, int16_t *zbin, int16_t *round,
|
|
|
|
int16_t *quant, int16_t *quant_shift,
|
|
|
|
int16_t *dequant) {
|
|
|
|
for (int j = 0; j < 2; j++) {
|
|
|
|
// Values determined by deconstructing vp9_init_quantizer().
|
|
|
|
// zbin may be up to 1143 for 8 and 10 bit Y values, or 1200 for 12 bit Y
|
|
|
|
// values or U/V values of any bit depth. This is because y_delta is not
|
|
|
|
// factored into the vp9_ac_quant() call.
|
|
|
|
zbin[j] = rnd->RandRange(1200);
|
|
|
|
// round may be up to 685 for Y values or 914 for U/V.
|
|
|
|
round[j] = rnd->RandRange(914);
|
|
|
|
// quant ranges from 1 to -32703
|
|
|
|
quant[j] = static_cast<int>(rnd->RandRange(32704)) - 32703;
|
|
|
|
// quant_shift goes up to 1 << 16.
|
|
|
|
quant_shift[j] = rnd->RandRange(16384);
|
|
|
|
// dequant maxes out at 1828 for all cases.
|
|
|
|
dequant[j] = rnd->RandRange(1828);
|
|
|
|
}
|
|
|
|
for (int j = 2; j < 8; j++) {
|
|
|
|
zbin[j] = zbin[1];
|
|
|
|
round[j] = round[1];
|
|
|
|
quant[j] = quant[1];
|
|
|
|
quant_shift[j] = quant_shift[1];
|
|
|
|
dequant[j] = dequant[1];
|
2014-10-16 14:38:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-02 19:24:19 +02:00
|
|
|
TEST_P(VP9QuantizeTest, OperationCheck) {
|
2014-10-16 14:38:46 +02:00
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> coeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 16);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(coeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> qcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 32);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(qcoeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> dqcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 32);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(dqcoeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> ref_qcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(ref_qcoeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> ref_dqcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(ref_dqcoeff.Init());
|
|
|
|
uint16_t eob, ref_eob;
|
|
|
|
|
2014-10-16 14:38:46 +02:00
|
|
|
for (int i = 0; i < number_of_iterations; ++i) {
|
|
|
|
const int skip_block = i == 0;
|
2017-08-02 19:24:19 +02:00
|
|
|
TX_SIZE sz;
|
|
|
|
if (max_size_ == 16) {
|
|
|
|
sz = (TX_SIZE)(i % 3); // TX_4X4, TX_8X8 TX_16X16
|
|
|
|
} else {
|
|
|
|
sz = TX_32X32;
|
|
|
|
}
|
|
|
|
const TX_TYPE tx_type = (TX_TYPE)((i >> 2) % 3);
|
2014-10-16 14:38:46 +02:00
|
|
|
const scan_order *scan_order = &vp9_scan_orders[sz][tx_type];
|
2017-08-02 19:24:19 +02:00
|
|
|
const int count = (4 << sz) * (4 << sz); // 16, 64, 256
|
2017-07-13 18:14:37 +02:00
|
|
|
coeff.Set(&rnd, 0, max_value_);
|
2017-08-02 19:24:19 +02:00
|
|
|
GenerateHelperArrays(&rnd, zbin_ptr_, round_ptr_, quant_ptr_,
|
|
|
|
quant_shift_ptr_, dequant_ptr_);
|
|
|
|
|
|
|
|
ref_quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_,
|
|
|
|
round_ptr_, quant_ptr_, quant_shift_ptr_,
|
|
|
|
ref_qcoeff.TopLeftPixel(), ref_dqcoeff.TopLeftPixel(),
|
|
|
|
dequant_ptr_, &ref_eob, scan_order->scan,
|
|
|
|
scan_order->iscan);
|
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_,
|
|
|
|
round_ptr_, quant_ptr_, quant_shift_ptr_,
|
|
|
|
qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(),
|
|
|
|
dequant_ptr_, &eob, scan_order->scan, scan_order->iscan));
|
2017-07-13 18:14:37 +02:00
|
|
|
|
|
|
|
EXPECT_TRUE(qcoeff.CheckValues(ref_qcoeff));
|
|
|
|
EXPECT_TRUE(dqcoeff.CheckValues(ref_dqcoeff));
|
|
|
|
|
|
|
|
EXPECT_EQ(eob, ref_eob);
|
|
|
|
|
|
|
|
if (HasFailure()) {
|
|
|
|
printf("Failure on iteration %d.\n", i);
|
|
|
|
qcoeff.PrintDifference(ref_qcoeff);
|
|
|
|
dqcoeff.PrintDifference(ref_dqcoeff);
|
|
|
|
return;
|
2014-10-16 14:38:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_P(VP9QuantizeTest, EOBCheck) {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> coeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 16);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(coeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> qcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 32);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(qcoeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> dqcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 32);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(dqcoeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> ref_qcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(ref_qcoeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> ref_dqcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0);
|
2017-07-13 18:14:37 +02:00
|
|
|
ASSERT_TRUE(ref_dqcoeff.Init());
|
|
|
|
uint16_t eob, ref_eob;
|
|
|
|
|
2014-10-16 14:38:46 +02:00
|
|
|
for (int i = 0; i < number_of_iterations; ++i) {
|
|
|
|
int skip_block = i == 0;
|
2017-08-02 19:24:19 +02:00
|
|
|
TX_SIZE sz;
|
|
|
|
if (max_size_ == 16) {
|
|
|
|
sz = (TX_SIZE)(i % 3); // TX_4X4, TX_8X8 TX_16X16
|
|
|
|
} else {
|
|
|
|
sz = TX_32X32;
|
|
|
|
}
|
2014-10-16 14:38:46 +02:00
|
|
|
TX_TYPE tx_type = (TX_TYPE)((i >> 2) % 3);
|
|
|
|
const scan_order *scan_order = &vp9_scan_orders[sz][tx_type];
|
|
|
|
int count = (4 << sz) * (4 << sz); // 16, 64, 256
|
|
|
|
// Two random entries
|
2017-07-13 18:14:37 +02:00
|
|
|
coeff.Set(0);
|
|
|
|
coeff.TopLeftPixel()[rnd(count)] = rnd.RandRange(max_value_);
|
|
|
|
coeff.TopLeftPixel()[rnd(count)] = rnd.RandRange(max_value_);
|
2017-08-02 19:24:19 +02:00
|
|
|
GenerateHelperArrays(&rnd, zbin_ptr_, round_ptr_, quant_ptr_,
|
|
|
|
quant_shift_ptr_, dequant_ptr_);
|
|
|
|
|
|
|
|
ref_quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_,
|
|
|
|
round_ptr_, quant_ptr_, quant_shift_ptr_,
|
|
|
|
ref_qcoeff.TopLeftPixel(), ref_dqcoeff.TopLeftPixel(),
|
|
|
|
dequant_ptr_, &ref_eob, scan_order->scan,
|
|
|
|
scan_order->iscan);
|
|
|
|
ASM_REGISTER_STATE_CHECK(
|
|
|
|
quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_,
|
|
|
|
round_ptr_, quant_ptr_, quant_shift_ptr_,
|
|
|
|
qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(),
|
|
|
|
dequant_ptr_, &eob, scan_order->scan, scan_order->iscan));
|
2014-10-16 14:38:46 +02:00
|
|
|
|
2017-07-13 18:14:37 +02:00
|
|
|
EXPECT_TRUE(qcoeff.CheckValues(ref_qcoeff));
|
|
|
|
EXPECT_TRUE(dqcoeff.CheckValues(ref_dqcoeff));
|
|
|
|
|
|
|
|
EXPECT_EQ(eob, ref_eob);
|
|
|
|
|
|
|
|
if (HasFailure()) {
|
|
|
|
printf("Failure on iteration %d.\n", i);
|
|
|
|
qcoeff.PrintDifference(ref_qcoeff);
|
|
|
|
dqcoeff.PrintDifference(ref_dqcoeff);
|
|
|
|
return;
|
2014-10-16 14:38:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-07-27 23:14:20 +02:00
|
|
|
|
|
|
|
TEST_P(VP9QuantizeTest, DISABLED_Speed) {
|
|
|
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> coeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 16);
|
2017-07-27 23:14:20 +02:00
|
|
|
ASSERT_TRUE(coeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> qcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 32);
|
2017-07-27 23:14:20 +02:00
|
|
|
ASSERT_TRUE(qcoeff.Init());
|
2017-08-02 19:24:19 +02:00
|
|
|
Buffer<tran_low_t> dqcoeff = Buffer<tran_low_t>(max_size_, max_size_, 0, 32);
|
2017-07-27 23:14:20 +02:00
|
|
|
ASSERT_TRUE(dqcoeff.Init());
|
|
|
|
uint16_t eob;
|
2017-08-02 19:24:19 +02:00
|
|
|
int starting_sz, ending_sz;
|
|
|
|
|
|
|
|
if (max_size_ == 16) {
|
|
|
|
// TX_4X4, TX_8X8 TX_16X16
|
|
|
|
starting_sz = 0;
|
|
|
|
ending_sz = 2;
|
|
|
|
} else {
|
|
|
|
// TX_32X32
|
|
|
|
starting_sz = 3;
|
|
|
|
ending_sz = 3;
|
|
|
|
}
|
2017-07-27 23:14:20 +02:00
|
|
|
|
2017-08-02 19:24:19 +02:00
|
|
|
for (TX_SIZE sz = starting_sz; sz <= ending_sz; ++sz) {
|
2017-07-27 23:14:20 +02:00
|
|
|
// skip_block, zbin > coeff, zbin < coeff.
|
|
|
|
for (int i = 0; i < 3; ++i) {
|
|
|
|
const int skip_block = i == 0;
|
|
|
|
// TX_TYPE defines the scan order. That is not relevant to the speed test.
|
|
|
|
// Pick the first one.
|
|
|
|
const TX_TYPE tx_type = DCT_DCT;
|
|
|
|
const scan_order *scan_order = &vp9_scan_orders[sz][tx_type];
|
|
|
|
const int count = (4 << sz) * (4 << sz); // 16, 64, 256
|
2017-08-02 19:24:19 +02:00
|
|
|
|
|
|
|
GenerateHelperArrays(&rnd, zbin_ptr_, round_ptr_, quant_ptr_,
|
|
|
|
quant_shift_ptr_, dequant_ptr_);
|
|
|
|
|
2017-07-27 23:14:20 +02:00
|
|
|
if (i == 0) {
|
|
|
|
// zbin values are unused when skip_block == 1.
|
2017-08-02 19:24:19 +02:00
|
|
|
zbin_ptr_[0] = zbin_ptr_[1] = 0;
|
2017-07-27 23:14:20 +02:00
|
|
|
coeff.Set(0);
|
|
|
|
} else if (i == 1) {
|
|
|
|
// When |coeff values| are less than zbin the results are 0.
|
2017-08-02 19:24:19 +02:00
|
|
|
zbin_ptr_[0] = zbin_ptr_[1] = 100;
|
2017-07-27 23:14:20 +02:00
|
|
|
coeff.Set(&rnd, -99, 99);
|
|
|
|
} else if (i == 2) {
|
2017-08-02 19:24:19 +02:00
|
|
|
zbin_ptr_[0] = zbin_ptr_[1] = 50;
|
2017-07-27 23:14:20 +02:00
|
|
|
coeff.Set(&rnd, -500, 500);
|
|
|
|
}
|
|
|
|
|
|
|
|
vpx_usec_timer timer;
|
|
|
|
vpx_usec_timer_start(&timer);
|
|
|
|
for (int j = 0; j < 100000000 / count; ++j) {
|
2017-08-02 19:24:19 +02:00
|
|
|
quantize_op_(coeff.TopLeftPixel(), count, skip_block, zbin_ptr_,
|
|
|
|
round_ptr_, quant_ptr_, quant_shift_ptr_,
|
|
|
|
qcoeff.TopLeftPixel(), dqcoeff.TopLeftPixel(),
|
|
|
|
dequant_ptr_, &eob, scan_order->scan, scan_order->iscan);
|
2017-07-27 23:14:20 +02:00
|
|
|
}
|
|
|
|
vpx_usec_timer_mark(&timer);
|
|
|
|
const int elapsed_time = static_cast<int>(vpx_usec_timer_elapsed(&timer));
|
|
|
|
if (i == 0) printf("Skip block.\n");
|
|
|
|
if (i == 1) printf("Bypass calculations.\n");
|
|
|
|
if (i == 2) printf("Full calculations.\n");
|
|
|
|
printf("Quantize %dx%d time: %5d ms\n", 4 << sz, 4 << sz,
|
|
|
|
elapsed_time / 1000);
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-16 14:38:46 +02:00
|
|
|
using std::tr1::make_tuple;
|
|
|
|
|
|
|
|
#if HAVE_SSE2
|
2017-07-18 19:06:23 +02:00
|
|
|
#if CONFIG_VP9_HIGHBITDEPTH
|
2017-07-19 23:20:13 +02:00
|
|
|
// TODO(johannkoenig): Fix vpx_quantize_b_sse2 in highbitdepth builds.
|
|
|
|
// make_tuple(&vpx_quantize_b_sse2, &vpx_highbd_quantize_b_c, VPX_BITS_8),
|
2014-10-16 14:38:46 +02:00
|
|
|
INSTANTIATE_TEST_CASE_P(
|
|
|
|
SSE2, VP9QuantizeTest,
|
2017-08-02 19:24:19 +02:00
|
|
|
::testing::Values(
|
|
|
|
make_tuple(&vpx_highbd_quantize_b_sse2, &vpx_highbd_quantize_b_c,
|
|
|
|
VPX_BITS_8, 16),
|
|
|
|
make_tuple(&vpx_highbd_quantize_b_sse2, &vpx_highbd_quantize_b_c,
|
|
|
|
VPX_BITS_10, 16),
|
|
|
|
make_tuple(&vpx_highbd_quantize_b_sse2, &vpx_highbd_quantize_b_c,
|
|
|
|
VPX_BITS_12, 16),
|
|
|
|
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
|
|
|
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_8, 32),
|
|
|
|
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
|
|
|
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_10, 32),
|
|
|
|
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
|
|
|
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_12, 32)));
|
2017-07-18 19:06:23 +02:00
|
|
|
#else
|
|
|
|
INSTANTIATE_TEST_CASE_P(SSE2, VP9QuantizeTest,
|
|
|
|
::testing::Values(make_tuple(&vpx_quantize_b_sse2,
|
|
|
|
&vpx_quantize_b_c,
|
2017-08-02 19:24:19 +02:00
|
|
|
VPX_BITS_8, 16)));
|
2014-10-16 14:38:46 +02:00
|
|
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
2017-07-18 19:06:23 +02:00
|
|
|
#endif // HAVE_SSE2
|
|
|
|
|
|
|
|
// TODO(johannkoenig): SSSE3 optimizations do not yet pass these tests.
|
|
|
|
#if HAVE_SSSE3 && ARCH_X86_64
|
|
|
|
INSTANTIATE_TEST_CASE_P(
|
2017-08-02 19:24:19 +02:00
|
|
|
DISABLED_SSSE3, VP9QuantizeTest,
|
|
|
|
::testing::Values(make_tuple(&vpx_quantize_b_ssse3, &vpx_quantize_b_c,
|
|
|
|
VPX_BITS_8, 16),
|
|
|
|
make_tuple(&vpx_quantize_b_32x32_ssse3,
|
|
|
|
&vpx_quantize_b_32x32_c, VPX_BITS_8, 32)));
|
2017-07-18 19:06:23 +02:00
|
|
|
#endif // HAVE_SSSE3 && ARCH_X86_64
|
|
|
|
|
2017-07-19 23:20:13 +02:00
|
|
|
// TODO(johannkoenig): AVX optimizations do not yet pass the 32x32 test or
|
|
|
|
// highbitdepth configurations.
|
|
|
|
#if HAVE_AVX && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH
|
2017-07-18 19:06:23 +02:00
|
|
|
INSTANTIATE_TEST_CASE_P(AVX, VP9QuantizeTest,
|
|
|
|
::testing::Values(make_tuple(&vpx_quantize_b_avx,
|
|
|
|
&vpx_quantize_b_c,
|
2017-08-02 19:24:19 +02:00
|
|
|
VPX_BITS_8, 16)));
|
|
|
|
INSTANTIATE_TEST_CASE_P(DISABLED_AVX, VP9QuantizeTest,
|
2017-07-18 19:06:23 +02:00
|
|
|
::testing::Values(make_tuple(&vpx_quantize_b_32x32_avx,
|
|
|
|
&vpx_quantize_b_32x32_c,
|
2017-08-02 19:24:19 +02:00
|
|
|
VPX_BITS_8, 32)));
|
2017-07-19 23:20:13 +02:00
|
|
|
#endif // HAVE_AVX && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH
|
2017-07-27 22:25:38 +02:00
|
|
|
|
|
|
|
// TODO(webm:1448): dqcoeff is not handled correctly in HBD builds.
|
|
|
|
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH
|
|
|
|
INSTANTIATE_TEST_CASE_P(NEON, VP9QuantizeTest,
|
|
|
|
::testing::Values(make_tuple(&vpx_quantize_b_neon,
|
|
|
|
&vpx_quantize_b_c,
|
2017-08-02 19:24:19 +02:00
|
|
|
VPX_BITS_8, 16)));
|
2017-07-27 22:25:38 +02:00
|
|
|
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH
|
2017-07-27 23:14:20 +02:00
|
|
|
|
|
|
|
// Only useful to compare "Speed" test results.
|
|
|
|
INSTANTIATE_TEST_CASE_P(DISABLED_C, VP9QuantizeTest,
|
|
|
|
::testing::Values(make_tuple(&vpx_quantize_b_c,
|
|
|
|
&vpx_quantize_b_c,
|
2017-08-02 19:24:19 +02:00
|
|
|
VPX_BITS_8, 16)));
|
2014-10-16 14:38:46 +02:00
|
|
|
} // namespace
|