summaryrefslogtreecommitdiffstats
path: root/third_party/aom/test/binary_codes_test.cc
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-19 21:52:15 -0500
committertrav90 <travawine@palemoon.org>2018-10-19 21:52:20 -0500
commitbbcc64772580c8a979288791afa02d30bc476d2e (patch)
tree437ce94c3fdd7497508e5b55de06c6d011678597 /third_party/aom/test/binary_codes_test.cc
parent14805f6ddbfb173c327768fff9f81f40ce5e81b0 (diff)
downloadUXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.gz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.lz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.xz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.zip
Update aom to v1.0.0
Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0.
Diffstat (limited to 'third_party/aom/test/binary_codes_test.cc')
-rw-r--r--third_party/aom/test/binary_codes_test.cc58
1 files changed, 4 insertions, 54 deletions
diff --git a/third_party/aom/test/binary_codes_test.cc b/third_party/aom/test/binary_codes_test.cc
index 41efec781..45660cf85 100644
--- a/third_party/aom/test/binary_codes_test.cc
+++ b/third_party/aom/test/binary_codes_test.cc
@@ -7,7 +7,7 @@
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
-*/
+ */
#include <math.h>
#include <stdlib.h>
@@ -15,7 +15,8 @@
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
-#include "./aom_config.h"
+#include "config/aom_config.h"
+
#include "test/acm_random.h"
#include "aom/aom_integer.h"
#include "aom_dsp/bitreader.h"
@@ -29,57 +30,6 @@ using libaom_test::ACMRandom;
namespace {
-// Test for Bilevel code with reference
-TEST(AV1, TestPrimitiveRefbilivel) {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- const int kBufferSize = 65536;
- aom_writer bw;
- uint8_t bw_buffer[kBufferSize];
- const uint16_t kRanges = 8;
- const uint16_t kNearRanges = 8;
- const uint16_t kReferences = 8;
- const uint16_t kValues = 16;
- const uint16_t range_vals[kRanges] = { 1, 13, 64, 120, 230, 420, 1100, 8000 };
- uint16_t enc_values[kRanges][kNearRanges][kReferences][kValues][4];
- aom_start_encode(&bw, bw_buffer);
- for (int n = 0; n < kRanges; ++n) {
- const uint16_t range = range_vals[n];
- for (int p = 0; p < kNearRanges; ++p) {
- const uint16_t near_range = 1 + rnd(range);
- for (int r = 0; r < kReferences; ++r) {
- const uint16_t ref = rnd(range);
- for (int v = 0; v < kValues; ++v) {
- const uint16_t value = rnd(range);
- enc_values[n][p][r][v][0] = range;
- enc_values[n][p][r][v][1] = near_range;
- enc_values[n][p][r][v][2] = ref;
- enc_values[n][p][r][v][3] = value;
- aom_write_primitive_refbilevel(&bw, range, near_range, ref, value);
- }
- }
- }
- }
- aom_stop_encode(&bw);
- aom_reader br;
- aom_reader_init(&br, bw_buffer, bw.pos, NULL, NULL);
- GTEST_ASSERT_GE(aom_reader_tell(&br), 0u);
- GTEST_ASSERT_LE(aom_reader_tell(&br), 1u);
- for (int n = 0; n < kRanges; ++n) {
- for (int p = 0; p < kNearRanges; ++p) {
- for (int r = 0; r < kReferences; ++r) {
- for (int v = 0; v < kValues; ++v) {
- const uint16_t range = enc_values[n][p][r][v][0];
- const uint16_t near_range = enc_values[n][p][r][v][1];
- const uint16_t ref = enc_values[n][p][r][v][2];
- const uint16_t value = aom_read_primitive_refbilevel(
- &br, range, near_range, ref, ACCT_STR);
- GTEST_ASSERT_EQ(value, enc_values[n][p][r][v][3]);
- }
- }
- }
- }
-}
-
// Test for Finite subexponential code with reference
TEST(AV1, TestPrimitiveRefsubexpfin) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
@@ -111,7 +61,7 @@ TEST(AV1, TestPrimitiveRefsubexpfin) {
}
aom_stop_encode(&bw);
aom_reader br;
- aom_reader_init(&br, bw_buffer, bw.pos, NULL, NULL);
+ aom_reader_init(&br, bw_buffer, bw.pos);
GTEST_ASSERT_GE(aom_reader_tell(&br), 0u);
GTEST_ASSERT_LE(aom_reader_tell(&br), 1u);
for (int n = 0; n < kRanges; ++n) {