]> granicus.if.org Git - libvpx/blobdiff - test/quantize_test.cc
Merge "endian_inl.h: fix mips32 android build"
[libvpx] / test / quantize_test.cc
index 329227b6b97b97b5dc3ed8fe1daf3f5ee2f19e7b..69da8994ca1d3b876195eac13fc0fac74bf5f348 100644 (file)
 #include <string.h>
 
 #include "third_party/googletest/src/include/gtest/gtest.h"
+
+#include "./vpx_config.h"
+#include "./vp8_rtcd.h"
 #include "test/acm_random.h"
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-
-#include "./vpx_config.h"
-#include "./vp8_rtcd.h"
 #include "vp8/common/blockd.h"
 #include "vp8/common/onyx.h"
 #include "vp8/encoder/block.h"
@@ -55,10 +55,10 @@ class QuantizeTestBase {
     rnd_.Reset(ACMRandom::DeterministicSeed());
 
     // The full configuration is necessary to generate the quantization tables.
-    VP8_CONFIG *const vp8_config =
-        reinterpret_cast<VP8_CONFIG *>(vpx_calloc(sizeof(*vp8_config), 1));
+    VP8_CONFIG vp8_config;
+    memset(&vp8_config, 0, sizeof(vp8_config));
 
-    vp8_comp_ = vp8_create_compressor(vp8_config);
+    vp8_comp_ = vp8_create_compressor(&vp8_config);
 
     // Set the tables based on a quantizer of 0.
     vp8_set_quantizer(vp8_comp_, 0);
@@ -69,8 +69,7 @@ class QuantizeTestBase {
     // Copy macroblockd from the reference to get pre-set-up dequant values.
     macroblockd_dst_ = reinterpret_cast<MACROBLOCKD *>(
         vpx_memalign(32, sizeof(*macroblockd_dst_)));
-    vpx_memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd,
-               sizeof(*macroblockd_dst_));
+    memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_));
     // Fix block pointers - currently they point to the blocks in the reference
     // structure.
     vp8_setup_block_dptrs(macroblockd_dst_);
@@ -79,8 +78,7 @@ class QuantizeTestBase {
   void UpdateQuantizer(int q) {
     vp8_set_quantizer(vp8_comp_, q);
 
-    vpx_memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd,
-               sizeof(*macroblockd_dst_));
+    memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_));
     vp8_setup_block_dptrs(macroblockd_dst_);
   }
 
@@ -194,4 +192,12 @@ INSTANTIATE_TEST_CASE_P(NEON, QuantizeTest,
                         ::testing::Values(make_tuple(&vp8_fast_quantize_b_neon,
                                                      &vp8_fast_quantize_b_c)));
 #endif  // HAVE_NEON
+
+#if HAVE_MSA
+INSTANTIATE_TEST_CASE_P(
+    MSA, QuantizeTest,
+    ::testing::Values(
+        make_tuple(&vp8_fast_quantize_b_msa, &vp8_fast_quantize_b_c),
+        make_tuple(&vp8_regular_quantize_b_msa, &vp8_regular_quantize_b_c)));
+#endif  // HAVE_MSA
 }  // namespace