From: Johann Date: Tue, 18 Jul 2017 16:55:45 +0000 (-0700) Subject: quantize test: extend arrays X-Git-Tag: v1.7.0~303^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7ebe8225334d0b057505df0f76ee3db74da054b;p=libvpx quantize test: extend arrays Officially the quant structures are 8 elements, with one dc element and 7 repeated ac elements. The low bit depth optimizations take advantage of this to fill the xmm registers. The high bit depth version manually duplicates the values. If all the optimizations were unified, the structure sizes could be greatly reduced. Change-Id: Ibd7a0337a7832ce2a1a05ee433c310077e1059ae --- diff --git a/test/vp9_quantize_test.cc b/test/vp9_quantize_test.cc index 125c39b79..04cd10dda 100644 --- a/test/vp9_quantize_test.cc +++ b/test/vp9_quantize_test.cc @@ -85,10 +85,11 @@ TEST_P(VP9QuantizeTest, OperationCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); Buffer coeff = Buffer(16, 16, 0, 16); ASSERT_TRUE(coeff.Init()); - DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); - DECLARE_ALIGNED(16, int16_t, round_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[8]); + DECLARE_ALIGNED(16, int16_t, round_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[8]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[8]); // These will need to be aligned to 32 when avx code is tested. Buffer qcoeff = Buffer(16, 16, 0, 16); ASSERT_TRUE(qcoeff.Init()); @@ -98,7 +99,6 @@ TEST_P(VP9QuantizeTest, OperationCheck) { ASSERT_TRUE(ref_qcoeff.Init()); Buffer ref_dqcoeff = Buffer(16, 16, 0); ASSERT_TRUE(ref_dqcoeff.Init()); - DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); uint16_t eob, ref_eob; for (int i = 0; i < number_of_iterations; ++i) { @@ -125,6 +125,14 @@ TEST_P(VP9QuantizeTest, OperationCheck) { // dequant maxes out at 1828 for all cases. dequant_ptr[j] = rnd.RandRange(1828); } + for (int j = 2; j < 8; j++) { + zbin_ptr[j] = zbin_ptr[1]; + round_ptr[j] = round_ptr[1]; + quant_ptr[j] = quant_ptr[1]; + quant_shift_ptr[j] = quant_shift_ptr[1]; + dequant_ptr[j] = dequant_ptr[1]; + } + ref_quantize_op_( coeff.TopLeftPixel(), count, skip_block, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, ref_qcoeff.TopLeftPixel(), ref_dqcoeff.TopLeftPixel(), @@ -152,10 +160,11 @@ TEST_P(VP9Quantize32Test, OperationCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); Buffer coeff = Buffer(32, 32, 0, 16); ASSERT_TRUE(coeff.Init()); - DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); - DECLARE_ALIGNED(16, int16_t, round_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[8]); + DECLARE_ALIGNED(16, int16_t, round_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[8]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[8]); Buffer qcoeff = Buffer(32, 32, 0, 16); ASSERT_TRUE(qcoeff.Init()); Buffer dqcoeff = Buffer(32, 32, 0, 16); @@ -164,7 +173,6 @@ TEST_P(VP9Quantize32Test, OperationCheck) { ASSERT_TRUE(ref_qcoeff.Init()); Buffer ref_dqcoeff = Buffer(32, 32, 0); ASSERT_TRUE(ref_dqcoeff.Init()); - DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); uint16_t eob, ref_eob; for (int i = 0; i < number_of_iterations; ++i) { @@ -183,6 +191,14 @@ TEST_P(VP9Quantize32Test, OperationCheck) { quant_shift_ptr[j] = rnd.RandRange(16384); dequant_ptr[j] = rnd.RandRange(1828); } + for (int j = 2; j < 8; j++) { + zbin_ptr[j] = zbin_ptr[1]; + round_ptr[j] = round_ptr[1]; + quant_ptr[j] = quant_ptr[1]; + quant_shift_ptr[j] = quant_shift_ptr[1]; + dequant_ptr[j] = dequant_ptr[1]; + } + ref_quantize_op_( coeff.TopLeftPixel(), count, skip_block, zbin_ptr, round_ptr, quant_ptr, quant_shift_ptr, ref_qcoeff.TopLeftPixel(), ref_dqcoeff.TopLeftPixel(), @@ -210,10 +226,11 @@ TEST_P(VP9QuantizeTest, EOBCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); Buffer coeff = Buffer(16, 16, 0, 16); ASSERT_TRUE(coeff.Init()); - DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); - DECLARE_ALIGNED(16, int16_t, round_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[8]); + DECLARE_ALIGNED(16, int16_t, round_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[8]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[8]); Buffer qcoeff = Buffer(16, 16, 0, 16); ASSERT_TRUE(qcoeff.Init()); Buffer dqcoeff = Buffer(16, 16, 0, 16); @@ -222,7 +239,6 @@ TEST_P(VP9QuantizeTest, EOBCheck) { ASSERT_TRUE(ref_qcoeff.Init()); Buffer ref_dqcoeff = Buffer(16, 16, 0); ASSERT_TRUE(ref_dqcoeff.Init()); - DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); uint16_t eob, ref_eob; for (int i = 0; i < number_of_iterations; ++i) { @@ -244,6 +260,13 @@ TEST_P(VP9QuantizeTest, EOBCheck) { quant_shift_ptr[j] = rnd.RandRange(16384); dequant_ptr[j] = rnd.RandRange(1828); } + for (int j = 2; j < 8; j++) { + zbin_ptr[j] = zbin_ptr[1]; + round_ptr[j] = round_ptr[1]; + quant_ptr[j] = quant_ptr[1]; + quant_shift_ptr[j] = quant_shift_ptr[1]; + dequant_ptr[j] = dequant_ptr[1]; + } ref_quantize_op_( coeff.TopLeftPixel(), count, skip_block, zbin_ptr, round_ptr, quant_ptr, @@ -272,10 +295,11 @@ TEST_P(VP9Quantize32Test, EOBCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); Buffer coeff = Buffer(32, 32, 0, 16); ASSERT_TRUE(coeff.Init()); - DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); - DECLARE_ALIGNED(16, int16_t, round_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); - DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); + DECLARE_ALIGNED(16, int16_t, zbin_ptr[8]); + DECLARE_ALIGNED(16, int16_t, round_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_ptr[8]); + DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[8]); + DECLARE_ALIGNED(16, int16_t, dequant_ptr[8]); Buffer qcoeff = Buffer(32, 32, 0, 16); ASSERT_TRUE(qcoeff.Init()); Buffer dqcoeff = Buffer(32, 32, 0, 16); @@ -284,7 +308,6 @@ TEST_P(VP9Quantize32Test, EOBCheck) { ASSERT_TRUE(ref_qcoeff.Init()); Buffer ref_dqcoeff = Buffer(32, 32, 0); ASSERT_TRUE(ref_dqcoeff.Init()); - DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); uint16_t eob, ref_eob; for (int i = 0; i < number_of_iterations; ++i) { @@ -306,6 +329,13 @@ TEST_P(VP9Quantize32Test, EOBCheck) { quant_shift_ptr[j] = rnd.RandRange(16384); dequant_ptr[j] = rnd.RandRange(1828); } + for (int j = 2; j < 8; j++) { + zbin_ptr[j] = zbin_ptr[1]; + round_ptr[j] = round_ptr[1]; + quant_ptr[j] = quant_ptr[1]; + quant_shift_ptr[j] = quant_shift_ptr[1]; + dequant_ptr[j] = dequant_ptr[1]; + } ref_quantize_op_( coeff.TopLeftPixel(), count, skip_block, zbin_ptr, round_ptr, quant_ptr,