diff options
Diffstat (limited to 'third_party/aom/test/scan_test.cc')
-rw-r--r-- | third_party/aom/test/scan_test.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/third_party/aom/test/scan_test.cc b/third_party/aom/test/scan_test.cc index 16c831c8e..2b11bd1fb 100644 --- a/third_party/aom/test/scan_test.cc +++ b/third_party/aom/test/scan_test.cc @@ -43,6 +43,7 @@ TEST(ScanTest, av1_augment_prob) { } } +#if USE_TOPOLOGICAL_SORT TEST(ScanTest, av1_update_sort_order) { const TX_SIZE tx_size = TX_4X4; const TX_TYPE tx_type = DCT_DCT; @@ -54,7 +55,9 @@ TEST(ScanTest, av1_update_sort_order) { av1_update_sort_order(tx_size, tx_type, prob, sort_order); for (int i = 0; i < 16; ++i) EXPECT_EQ(ref_sort_order[i], sort_order[i]); } +#endif +#if USE_TOPOLOGICAL_SORT TEST(ScanTest, av1_update_scan_order) { TX_SIZE tx_size = TX_4X4; const TX_TYPE tx_type = DCT_DCT; @@ -74,6 +77,7 @@ TEST(ScanTest, av1_update_scan_order) { EXPECT_EQ(i, scan[ref_iscan[i]]); } } +#endif TEST(ScanTest, av1_update_neighbors) { TX_SIZE tx_size = TX_4X4; @@ -94,4 +98,33 @@ TEST(ScanTest, av1_update_neighbors) { } } +#if USE_2X2_PROB +TEST(ScanTest, av1_down_sample_scan_count) { + const uint32_t non_zero_count[256] = { + 13, 12, 11, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 9, 10, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 13, 9, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + const uint32_t ref_non_zero_count_ds[64] = { + 13, 11, 0, 0, 0, 0, 0, 0, 11, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + uint32_t non_zero_count_ds[64]; + av1_down_sample_scan_count(non_zero_count_ds, non_zero_count, TX_16X16); + for (int i = 0; i < 64; ++i) { + EXPECT_EQ(ref_non_zero_count_ds[i], non_zero_count_ds[i]); + } +} +#endif + } // namespace |