diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/convolve_test.cc | 176 | ||||
-rw-r--r-- | test/decode_perf_test.cc | 163 | ||||
-rw-r--r-- | test/fdct8x8_test.cc | 58 | ||||
-rw-r--r-- | test/lpf_8_test.cc | 31 | ||||
-rw-r--r-- | test/partial_idct_test.cc | 4 | ||||
-rw-r--r-- | test/test-data.mk | 4 | ||||
-rw-r--r-- | test/test.mk | 3 |
7 files changed, 393 insertions, 46 deletions
diff --git a/test/convolve_test.cc b/test/convolve_test.cc index b0f60529a..e30ccf92e 100644 --- a/test/convolve_test.cc +++ b/test/convolve_test.cc @@ -10,12 +10,14 @@ #include <string.h> #include "test/acm_random.h" +#include "test/clear_system_state.h" #include "test/register_state_check.h" #include "test/util.h" #include "third_party/googletest/src/include/gtest/gtest.h" #include "./vpx_config.h" #include "./vp9_rtcd.h" +#include "vp9/common/vp9_common.h" #include "vp9/common/vp9_filter.h" #include "vpx_mem/vpx_mem.h" #include "vpx_ports/mem.h" @@ -31,13 +33,16 @@ typedef void (*ConvolveFunc)(const uint8_t *src, ptrdiff_t src_stride, int w, int h); struct ConvolveFunctions { - ConvolveFunctions(ConvolveFunc h8, ConvolveFunc h8_avg, + ConvolveFunctions(ConvolveFunc copy, ConvolveFunc avg, + ConvolveFunc h8, ConvolveFunc h8_avg, ConvolveFunc v8, ConvolveFunc v8_avg, ConvolveFunc hv8, ConvolveFunc hv8_avg, int bd) - : h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg), v8_avg_(v8_avg), - hv8_avg_(hv8_avg), use_highbd_(bd) {} + : copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg), + v8_avg_(v8_avg), hv8_avg_(hv8_avg), use_highbd_(bd) {} + ConvolveFunc copy_; + ConvolveFunc avg_; ConvolveFunc h8_; ConvolveFunc v8_; ConvolveFunc hv8_; @@ -298,25 +303,35 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1; output_ = reinterpret_cast<uint8_t*>( vpx_memalign(kDataAlignment, kOutputBufferSize)); + output_ref_ = reinterpret_cast<uint8_t*>( + vpx_memalign(kDataAlignment, kOutputBufferSize)); #if CONFIG_VP9_HIGHBITDEPTH input16_ = reinterpret_cast<uint16_t*>( vpx_memalign(kDataAlignment, (kInputBufferSize + 1) * sizeof(uint16_t))) + 1; output16_ = reinterpret_cast<uint16_t*>( vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t))); + output16_ref_ = reinterpret_cast<uint16_t*>( + vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t))); #endif } + virtual void TearDown() { libvpx_test::ClearSystemState(); } + static void TearDownTestCase() { vpx_free(input_ - 1); input_ = NULL; vpx_free(output_); output_ = NULL; + vpx_free(output_ref_); + output_ref_ = NULL; #if CONFIG_VP9_HIGHBITDEPTH vpx_free(input16_ - 1); input16_ = NULL; vpx_free(output16_); output16_ = NULL; + vpx_free(output16_ref_); + output16_ref_ = NULL; #endif } @@ -382,6 +397,13 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { #endif } + void CopyOutputToRef() { + vpx_memcpy(output_ref_, output_, kOutputBufferSize); +#if CONFIG_VP9_HIGHBITDEPTH + vpx_memcpy(output16_ref_, output16_, kOutputBufferSize); +#endif + } + void CheckGuardBlocks() { for (int i = 0; i < kOutputBufferSize; ++i) { if (IsIndexInBorder(i)) @@ -415,6 +437,19 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { #endif } + uint8_t *output_ref() const { +#if CONFIG_VP9_HIGHBITDEPTH + if (UUT_->use_highbd_ == 0) { + return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft(); + } else { + return CONVERT_TO_BYTEPTR(output16_ref_ + BorderTop() * kOuterBlockSize + + BorderLeft()); + } +#else + return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft(); +#endif + } + uint16_t lookup(uint8_t *list, int index) const { #if CONFIG_VP9_HIGHBITDEPTH if (UUT_->use_highbd_ == 0) { @@ -493,24 +528,65 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { const ConvolveFunctions* UUT_; static uint8_t* input_; static uint8_t* output_; + static uint8_t* output_ref_; #if CONFIG_VP9_HIGHBITDEPTH static uint16_t* input16_; static uint16_t* output16_; + static uint16_t* output16_ref_; int mask_; #endif }; uint8_t* ConvolveTest::input_ = NULL; uint8_t* ConvolveTest::output_ = NULL; +uint8_t* ConvolveTest::output_ref_ = NULL; #if CONFIG_VP9_HIGHBITDEPTH uint16_t* ConvolveTest::input16_ = NULL; uint16_t* ConvolveTest::output16_ = NULL; +uint16_t* ConvolveTest::output16_ref_ = NULL; #endif TEST_P(ConvolveTest, GuardBlocks) { CheckGuardBlocks(); } +TEST_P(ConvolveTest, Copy) { + uint8_t* const in = input(); + uint8_t* const out = output(); + + ASM_REGISTER_STATE_CHECK( + UUT_->copy_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0, + Width(), Height())); + + CheckGuardBlocks(); + + for (int y = 0; y < Height(); ++y) + for (int x = 0; x < Width(); ++x) + ASSERT_EQ(lookup(out, y * kOutputStride + x), + lookup(in, y * kInputStride + x)) + << "(" << x << "," << y << ")"; +} + +TEST_P(ConvolveTest, Avg) { + uint8_t* const in = input(); + uint8_t* const out = output(); + uint8_t* const out_ref = output_ref(); + CopyOutputToRef(); + + ASM_REGISTER_STATE_CHECK( + UUT_->avg_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0, + Width(), Height())); + + CheckGuardBlocks(); + + for (int y = 0; y < Height(); ++y) + for (int x = 0; x < Width(); ++x) + ASSERT_EQ(lookup(out, y * kOutputStride + x), + ROUND_POWER_OF_TWO(lookup(in, y * kInputStride + x) + + lookup(out_ref, y * kOutputStride + x), 1)) + << "(" << x << "," << y << ")"; +} + TEST_P(ConvolveTest, CopyHoriz) { uint8_t* const in = input(); uint8_t* const out = output(); @@ -1188,6 +1264,30 @@ void wrap_convolve8_avg_sse2_12(const uint8_t *src, ptrdiff_t src_stride, } #endif // HAVE_SSE2 && ARCH_X86_64 +void wrap_convolve_copy_c_8(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const int16_t *filter_x, + int filter_x_stride, + const int16_t *filter_y, + int filter_y_stride, + int w, int h) { + vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, + filter_x, filter_x_stride, + filter_y, filter_y_stride, w, h, 8); +} + +void wrap_convolve_avg_c_8(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const int16_t *filter_x, + int filter_x_stride, + const int16_t *filter_y, + int filter_y_stride, + int w, int h) { + vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, + filter_x, filter_x_stride, + filter_y, filter_y_stride, w, h, 8); +} + void wrap_convolve8_horiz_c_8(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, @@ -1260,6 +1360,30 @@ void wrap_convolve8_avg_c_8(const uint8_t *src, ptrdiff_t src_stride, filter_y, filter_y_stride, w, h, 8); } +void wrap_convolve_copy_c_10(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const int16_t *filter_x, + int filter_x_stride, + const int16_t *filter_y, + int filter_y_stride, + int w, int h) { + vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, + filter_x, filter_x_stride, + filter_y, filter_y_stride, w, h, 10); +} + +void wrap_convolve_avg_c_10(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const int16_t *filter_x, + int filter_x_stride, + const int16_t *filter_y, + int filter_y_stride, + int w, int h) { + vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, + filter_x, filter_x_stride, + filter_y, filter_y_stride, w, h, 10); +} + void wrap_convolve8_horiz_c_10(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, @@ -1332,6 +1456,30 @@ void wrap_convolve8_avg_c_10(const uint8_t *src, ptrdiff_t src_stride, filter_y, filter_y_stride, w, h, 10); } +void wrap_convolve_copy_c_12(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const int16_t *filter_x, + int filter_x_stride, + const int16_t *filter_y, + int filter_y_stride, + int w, int h) { + vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, + filter_x, filter_x_stride, + filter_y, filter_y_stride, w, h, 12); +} + +void wrap_convolve_avg_c_12(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const int16_t *filter_x, + int filter_x_stride, + const int16_t *filter_y, + int filter_y_stride, + int w, int h) { + vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, + filter_x, filter_x_stride, + filter_y, filter_y_stride, w, h, 12); +} + void wrap_convolve8_horiz_c_12(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, @@ -1405,6 +1553,7 @@ void wrap_convolve8_avg_c_12(const uint8_t *src, ptrdiff_t src_stride, } const ConvolveFunctions convolve8_c( + wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8, wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8, wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8); @@ -1423,6 +1572,7 @@ INSTANTIATE_TEST_CASE_P(C_8, ConvolveTest, ::testing::Values( make_tuple(32, 64, &convolve8_c), make_tuple(64, 64, &convolve8_c))); const ConvolveFunctions convolve10_c( + wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10, wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10, wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10); @@ -1441,6 +1591,7 @@ INSTANTIATE_TEST_CASE_P(C_10, ConvolveTest, ::testing::Values( make_tuple(32, 64, &convolve10_c), make_tuple(64, 64, &convolve10_c))); const ConvolveFunctions convolve12_c( + wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12, wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12, wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12); @@ -1462,6 +1613,7 @@ INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values( #else const ConvolveFunctions convolve8_c( + vp9_convolve_copy_c, vp9_convolve_avg_c, vp9_convolve8_horiz_c, vp9_convolve8_avg_horiz_c, vp9_convolve8_vert_c, vp9_convolve8_avg_vert_c, vp9_convolve8_c, vp9_convolve8_avg_c, 0); @@ -1485,14 +1637,17 @@ INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values( #if HAVE_SSE2 && ARCH_X86_64 #if CONFIG_VP9_HIGHBITDEPTH const ConvolveFunctions convolve8_sse2( + wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8, wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8, wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8, 8); const ConvolveFunctions convolve10_sse2( + wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10, wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10, wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10, 10); const ConvolveFunctions convolve12_sse2( + wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12, wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12, wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12); @@ -1538,6 +1693,7 @@ INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values( make_tuple(64, 64, &convolve12_sse2))); #else const ConvolveFunctions convolve8_sse2( + vp9_convolve_copy_sse2, vp9_convolve_avg_sse2, vp9_convolve8_horiz_sse2, vp9_convolve8_avg_horiz_sse2, vp9_convolve8_vert_sse2, vp9_convolve8_avg_vert_sse2, vp9_convolve8_sse2, vp9_convolve8_avg_sse2, 0); @@ -1561,6 +1717,7 @@ INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values( #if HAVE_SSSE3 const ConvolveFunctions convolve8_ssse3( + vp9_convolve_copy_c, vp9_convolve_avg_c, vp9_convolve8_horiz_ssse3, vp9_convolve8_avg_horiz_ssse3, vp9_convolve8_vert_ssse3, vp9_convolve8_avg_vert_ssse3, vp9_convolve8_ssse3, vp9_convolve8_avg_ssse3, 0); @@ -1583,6 +1740,7 @@ INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values( #if HAVE_AVX2 && HAVE_SSSE3 const ConvolveFunctions convolve8_avx2( + vp9_convolve_copy_c, vp9_convolve_avg_c, vp9_convolve8_horiz_avx2, vp9_convolve8_avg_horiz_ssse3, vp9_convolve8_vert_avx2, vp9_convolve8_avg_vert_ssse3, vp9_convolve8_avx2, vp9_convolve8_avg_ssse3, 0); @@ -1603,11 +1761,20 @@ INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values( make_tuple(64, 64, &convolve8_avx2))); #endif // HAVE_AVX2 && HAVE_SSSE3 +#if HAVE_NEON #if HAVE_NEON_ASM const ConvolveFunctions convolve8_neon( + vp9_convolve_copy_neon, vp9_convolve_avg_neon, + vp9_convolve8_horiz_neon, vp9_convolve8_avg_horiz_neon, + vp9_convolve8_vert_neon, vp9_convolve8_avg_vert_neon, + vp9_convolve8_neon, vp9_convolve8_avg_neon, 0); +#else // HAVE_NEON +const ConvolveFunctions convolve8_neon( + vp9_convolve_copy_neon, vp9_convolve_avg_neon, vp9_convolve8_horiz_neon, vp9_convolve8_avg_horiz_neon, vp9_convolve8_vert_neon, vp9_convolve8_avg_vert_neon, vp9_convolve8_neon, vp9_convolve8_avg_neon, 0); +#endif // HAVE_NEON_ASM INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values( make_tuple(4, 4, &convolve8_neon), @@ -1623,10 +1790,11 @@ INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values( make_tuple(64, 32, &convolve8_neon), make_tuple(32, 64, &convolve8_neon), make_tuple(64, 64, &convolve8_neon))); -#endif +#endif // HAVE_NEON #if HAVE_DSPR2 const ConvolveFunctions convolve8_dspr2( + vp9_convolve_copy_dspr2, vp9_convolve_avg_dspr2, vp9_convolve8_horiz_dspr2, vp9_convolve8_avg_horiz_dspr2, vp9_convolve8_vert_dspr2, vp9_convolve8_avg_vert_dspr2, vp9_convolve8_dspr2, vp9_convolve8_avg_dspr2, 0); diff --git a/test/decode_perf_test.cc b/test/decode_perf_test.cc index 5a7114022..0a0713ab5 100644 --- a/test/decode_perf_test.cc +++ b/test/decode_perf_test.cc @@ -8,13 +8,17 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include <string> #include "test/codec_factory.h" #include "test/decode_test_driver.h" +#include "test/encode_test_driver.h" +#include "test/i420_video_source.h" #include "test/ivf_video_source.h" #include "test/md5_helper.h" #include "test/util.h" #include "test/webm_video_source.h" #include "vpx_ports/vpx_timer.h" +#include "./ivfenc.h" #include "./vpx_version.h" using std::tr1::make_tuple; @@ -24,7 +28,9 @@ namespace { #define VIDEO_NAME 0 #define THREADS 1 +const int kMaxPsnr = 100; const double kUsecsInSec = 1000000.0; +static const char *kNewEncodeOutputFile = "new_encode.ivf"; /* DecodePerfTest takes a tuple of filename + number of threads to decode with @@ -105,4 +111,161 @@ TEST_P(DecodePerfTest, PerfTest) { INSTANTIATE_TEST_CASE_P(VP9, DecodePerfTest, ::testing::ValuesIn(kVP9DecodePerfVectors)); +class VP9NewEncodeDecodePerfTest : public ::libvpx_test::EncoderTest, + public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> { + protected: + VP9NewEncodeDecodePerfTest() + : EncoderTest(GET_PARAM(0)), + encoding_mode_(GET_PARAM(1)), + speed_(0), + outfile_(0), + out_frames_(0) { + } + + virtual ~VP9NewEncodeDecodePerfTest() {} + + virtual void SetUp() { + InitializeConfig(); + SetMode(encoding_mode_); + + cfg_.g_lag_in_frames = 25; + cfg_.rc_min_quantizer = 2; + cfg_.rc_max_quantizer = 56; + cfg_.rc_dropframe_thresh = 0; + cfg_.rc_undershoot_pct = 50; + cfg_.rc_overshoot_pct = 50; + cfg_.rc_buf_sz = 1000; + cfg_.rc_buf_initial_sz = 500; + cfg_.rc_buf_optimal_sz = 600; + cfg_.rc_resize_allowed = 0; + cfg_.rc_end_usage = VPX_VBR; + } + + virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video, + ::libvpx_test::Encoder *encoder) { + if (video->frame() == 1) { + encoder->Control(VP8E_SET_CPUUSED, speed_); + encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, 1); + encoder->Control(VP9E_SET_TILE_COLUMNS, 2); + } + } + + virtual void BeginPassHook(unsigned int /*pass*/) { + const std::string data_path = getenv("LIBVPX_TEST_DATA_PATH"); + const std::string path_to_source = data_path + "/" + kNewEncodeOutputFile; + outfile_ = fopen(path_to_source.c_str(), "wb"); + } + + virtual void EndPassHook() { + if (outfile_) { + if (!fseek(outfile_, 0, SEEK_SET)) + ivf_write_file_header(outfile_, &cfg_, VP9_FOURCC, out_frames_); + fclose(outfile_); + outfile_ = NULL; + } + } + + virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) { + ++out_frames_; + + // Write initial file header if first frame. + if (pkt->data.frame.pts == 0) + ivf_write_file_header(outfile_, &cfg_, VP9_FOURCC, out_frames_); + + // Write frame header and data. + ivf_write_frame_header(outfile_, out_frames_, pkt->data.frame.sz); + (void)fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz, outfile_); + } + + virtual bool DoDecode() { return 0; } + + void set_speed(unsigned int speed) { + speed_ = speed; + } + + private: + libvpx_test::TestMode encoding_mode_; + uint32_t speed_; + FILE *outfile_; + uint32_t out_frames_; +}; + + +struct EncodePerfTestVideo { + EncodePerfTestVideo(const char *name_, uint32_t width_, uint32_t height_, + uint32_t bitrate_, int frames_) + : name(name_), + width(width_), + height(height_), + bitrate(bitrate_), + frames(frames_) {} + const char *name; + uint32_t width; + uint32_t height; + uint32_t bitrate; + int frames; +}; + +const EncodePerfTestVideo kVP9EncodePerfTestVectors[] = { + EncodePerfTestVideo("niklas_1280_720_30.yuv", 1280, 720, 600, 470), +}; + +TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) { + SetUp(); + + // TODO(JBB): Make this work by going through the set of given files. + const int i = 0; + const vpx_rational timebase = { 33333333, 1000000000 }; + cfg_.g_timebase = timebase; + cfg_.rc_target_bitrate = kVP9EncodePerfTestVectors[i].bitrate; + + init_flags_ = VPX_CODEC_USE_PSNR; + + const char *video_name = kVP9EncodePerfTestVectors[i].name; + libvpx_test::I420VideoSource video( + video_name, + kVP9EncodePerfTestVectors[i].width, + kVP9EncodePerfTestVectors[i].height, + timebase.den, timebase.num, 0, + kVP9EncodePerfTestVectors[i].frames); + set_speed(2); + + ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); + + const uint32_t threads = 4; + + libvpx_test::IVFVideoSource decode_video(kNewEncodeOutputFile); + decode_video.Init(); + + vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t(); + cfg.threads = threads; + libvpx_test::VP9Decoder decoder(cfg, 0); + + vpx_usec_timer t; + vpx_usec_timer_start(&t); + + for (decode_video.Begin(); decode_video.cxdata() != NULL; + decode_video.Next()) { + decoder.DecodeFrame(decode_video.cxdata(), decode_video.frame_size()); + } + + vpx_usec_timer_mark(&t); + const double elapsed_secs = + double(vpx_usec_timer_elapsed(&t)) / kUsecsInSec; + const unsigned decode_frames = decode_video.frame_number(); + const double fps = double(decode_frames) / elapsed_secs; + + printf("{\n"); + printf("\t\"type\" : \"decode_perf_test\",\n"); + printf("\t\"version\" : \"%s\",\n", VERSION_STRING_NOSP); + printf("\t\"videoName\" : \"%s\",\n", kNewEncodeOutputFile); + printf("\t\"threadCount\" : %u,\n", threads); + printf("\t\"decodeTimeSecs\" : %f,\n", elapsed_secs); + printf("\t\"totalFrames\" : %u,\n", decode_frames); + printf("\t\"framesPerSecond\" : %f\n", fps); + printf("}\n"); +} + +VP9_INSTANTIATE_TEST_CASE( + VP9NewEncodeDecodePerfTest, ::testing::Values(::libvpx_test::kTwoPassGood)); } // namespace diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index 110c9c3c9..01abca5fa 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -62,6 +62,10 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs], using libvpx_test::ACMRandom; namespace { + +const int kSignBiasMaxDiff255 = 1500; +const int kSignBiasMaxDiff15 = 10000; + typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride); typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, @@ -160,7 +164,7 @@ class FwdTrans8x8TestBase { for (int j = 0; j < 64; ++j) { const int diff = abs(count_sign_block[j][0] - count_sign_block[j][1]); - const int max_diff = 1125; + const int max_diff = kSignBiasMaxDiff255; EXPECT_LT(diff, max_diff << (bit_depth_ - 8)) << "Error: 8x8 FDCT/FHT has a sign bias > " << 1. * max_diff / count_test_block * 100 << "%" @@ -190,9 +194,9 @@ class FwdTrans8x8TestBase { for (int j = 0; j < 64; ++j) { const int diff = abs(count_sign_block[j][0] - count_sign_block[j][1]); - const int max_diff = 10000; + const int max_diff = kSignBiasMaxDiff15; EXPECT_LT(diff, max_diff << (bit_depth_ - 8)) - << "Error: 4x4 FDCT/FHT has a sign bias > " + << "Error: 8x8 FDCT/FHT has a sign bias > " << 1. * max_diff / count_test_block * 100 << "%" << " for input range [-15, 15] at index " << j << " count0: " << count_sign_block[j][0] @@ -646,36 +650,24 @@ TEST_P(InvTrans8x8DCT, CompareReference) { using std::tr1::make_tuple; #if CONFIG_VP9_HIGHBITDEPTH -// TODO(jingning): re-enable after this handles the expanded range [0, 65535] -// returned from Rand16(). -INSTANTIATE_TEST_CASE_P( - DISABLED_C, FwdTrans8x8DCT, - ::testing::Values( - make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8))); INSTANTIATE_TEST_CASE_P( C, FwdTrans8x8DCT, ::testing::Values( + make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8), make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10), make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12))); #else -// TODO(jingning): re-enable after this handles the expanded range [0, 65535] -// returned from Rand16(). INSTANTIATE_TEST_CASE_P( - DISABLED_C, FwdTrans8x8DCT, + C, FwdTrans8x8DCT, ::testing::Values( make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8))); #endif // CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH -// TODO(jingning): re-enable after this handles the expanded range [0, 65535] -// returned from Rand16(). -INSTANTIATE_TEST_CASE_P( - DISABLED_C, FwdTrans8x8HT, - ::testing::Values( - make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 0, VPX_BITS_8))); INSTANTIATE_TEST_CASE_P( C, FwdTrans8x8HT, ::testing::Values( + make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 0, VPX_BITS_8), make_tuple(&vp9_highbd_fht8x8_c, &iht8x8_10, 0, VPX_BITS_10), make_tuple(&vp9_highbd_fht8x8_c, &iht8x8_10, 1, VPX_BITS_10), make_tuple(&vp9_highbd_fht8x8_c, &iht8x8_10, 2, VPX_BITS_10), @@ -691,12 +683,9 @@ INSTANTIATE_TEST_CASE_P( // TODO(jingning): re-enable after this handles the expanded range [0, 65535] // returned from Rand16(). INSTANTIATE_TEST_CASE_P( - DISABLED_C, FwdTrans8x8HT, - ::testing::Values( - make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 0, VPX_BITS_8))); -INSTANTIATE_TEST_CASE_P( C, FwdTrans8x8HT, ::testing::Values( + make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 0, VPX_BITS_8), make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 1, VPX_BITS_8), make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 2, VPX_BITS_8), make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 3, VPX_BITS_8))); @@ -706,12 +695,12 @@ INSTANTIATE_TEST_CASE_P( // TODO(jingning): re-enable after this handles the expanded range [0, 65535] // returned from Rand16(). INSTANTIATE_TEST_CASE_P( - DISABLED_NEON, FwdTrans8x8DCT, + NEON, FwdTrans8x8DCT, ::testing::Values( make_tuple(&vp9_fdct8x8_neon, &vp9_idct8x8_64_add_neon, 0, VPX_BITS_8))); INSTANTIATE_TEST_CASE_P( - DISABLED_NEON, FwdTrans8x8HT, + NEON, FwdTrans8x8HT, ::testing::Values( make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 0, VPX_BITS_8), make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 1, VPX_BITS_8), @@ -723,32 +712,24 @@ INSTANTIATE_TEST_CASE_P( // TODO(jingning): re-enable after these handle the expanded range [0, 65535] // returned from Rand16(). INSTANTIATE_TEST_CASE_P( - DISABLED_SSE2, FwdTrans8x8DCT, + SSE2, FwdTrans8x8DCT, ::testing::Values( make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_sse2, 0, VPX_BITS_8))); INSTANTIATE_TEST_CASE_P( - DISABLED_SSE2, FwdTrans8x8HT, - ::testing::Values( - make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 0, VPX_BITS_8))); -INSTANTIATE_TEST_CASE_P( SSE2, FwdTrans8x8HT, ::testing::Values( + make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 0, VPX_BITS_8), make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 1, VPX_BITS_8), make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 2, VPX_BITS_8), make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 3, VPX_BITS_8))); #endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE #if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE -// TODO(jingning): re-enable after these handle the expanded range [0, 65535] -// returned from Rand16(). -INSTANTIATE_TEST_CASE_P( - DISABLED_SSE2, FwdTrans8x8DCT, - ::testing::Values( - make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8))); INSTANTIATE_TEST_CASE_P( SSE2, FwdTrans8x8DCT, ::testing::Values( + make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8), make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_64_add_10_sse2, 12, VPX_BITS_10), make_tuple(&vp9_highbd_fdct8x8_sse2, @@ -761,12 +742,9 @@ INSTANTIATE_TEST_CASE_P( // TODO(jingning): re-enable after these handle the expanded range [0, 65535] // returned from Rand16(). INSTANTIATE_TEST_CASE_P( - DISABLED_SSE2, FwdTrans8x8HT, - ::testing::Values( - make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_c, 0, VPX_BITS_8))); -INSTANTIATE_TEST_CASE_P( SSE2, FwdTrans8x8HT, ::testing::Values( + make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_c, 0, VPX_BITS_8), make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_c, 1, VPX_BITS_8), make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_c, 2, VPX_BITS_8), make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_c, 3, VPX_BITS_8))); @@ -791,7 +769,7 @@ INSTANTIATE_TEST_CASE_P( // TODO(jingning): re-enable after this handles the expanded range [0, 65535] // returned from Rand16(). INSTANTIATE_TEST_CASE_P( - DISABLED_SSSE3, FwdTrans8x8DCT, + SSSE3, FwdTrans8x8DCT, ::testing::Values( make_tuple(&vp9_fdct8x8_ssse3, &vp9_idct8x8_64_add_ssse3, 0, VPX_BITS_8))); diff --git a/test/lpf_8_test.cc b/test/lpf_8_test.cc index 0f335e2e4..e1be80baa 100644 --- a/test/lpf_8_test.cc +++ b/test/lpf_8_test.cc @@ -594,4 +594,35 @@ INSTANTIATE_TEST_CASE_P( #endif // CONFIG_VP9_HIGHBITDEPTH #endif +#if HAVE_NEON && (!CONFIG_VP9_HIGHBITDEPTH) +INSTANTIATE_TEST_CASE_P( + NEON, Loop8Test6Param, + ::testing::Values( +#if HAVE_NEON_ASM + make_tuple(&vp9_lpf_horizontal_16_neon, + &vp9_lpf_horizontal_16_c, 8), +#endif // HAVE_NEON_ASM + make_tuple(&vp9_lpf_horizontal_4_neon, + &vp9_lpf_horizontal_4_c, 8), + make_tuple(&vp9_lpf_horizontal_8_neon, + &vp9_lpf_horizontal_8_c, 8), + make_tuple(&vp9_lpf_vertical_4_neon, + &vp9_lpf_vertical_4_c, 8), + make_tuple(&vp9_lpf_vertical_8_neon, + &vp9_lpf_vertical_8_c, 8))); +INSTANTIATE_TEST_CASE_P( + NEON, Loop8Test9Param, + ::testing::Values( +#if HAVE_NEON_ASM + make_tuple(&vp9_lpf_horizontal_4_dual_neon, + &vp9_lpf_horizontal_4_dual_c, 8), +#endif // HAVE_NEON_ASM + make_tuple(&vp9_lpf_horizontal_8_dual_neon, + &vp9_lpf_horizontal_8_dual_c, 8), + make_tuple(&vp9_lpf_vertical_4_dual_neon, + &vp9_lpf_vertical_4_dual_c, 8), + make_tuple(&vp9_lpf_vertical_8_dual_neon, + &vp9_lpf_vertical_8_dual_c, 8))); +#endif // HAVE_NEON && (!CONFIG_VP9_HIGHBITDEPTH) + } // namespace diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc index 536273e3e..ba82da4e1 100644 --- a/test/partial_idct_test.cc +++ b/test/partial_idct_test.cc @@ -230,7 +230,7 @@ INSTANTIATE_TEST_CASE_P( &vp9_idct4x4_1_add_c, TX_4X4, 1))); -#if HAVE_NEON_ASM +#if HAVE_NEON INSTANTIATE_TEST_CASE_P( NEON, PartialIDctTest, ::testing::Values( @@ -258,7 +258,7 @@ INSTANTIATE_TEST_CASE_P( &vp9_idct4x4_16_add_c, &vp9_idct4x4_1_add_neon, TX_4X4, 1))); -#endif +#endif // HAVE_NEON #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE INSTANTIATE_TEST_CASE_P( diff --git a/test/test-data.mk b/test/test-data.mk index 157d1bc34..d07ca3295 100644 --- a/test/test-data.mk +++ b/test/test-data.mk @@ -714,6 +714,8 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp91-2-mixedrefcsp-444to420.iv LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp91-2-mixedrefcsp-444to420.ivf.res ifeq ($(CONFIG_DECODE_PERF_TESTS),yes) +# NewEncode Test +LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += niklas_1280_720_30.yuv # BBB VP9 streams LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_426x240_tile_1x1_180kbps.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_640x360_tile_1x2_337kbps.webm @@ -743,7 +745,9 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += desktop_640_360_30.yuv LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += kirland_640_480_30.yuv LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += macmarcomoving_640_480_30.yuv LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += macmarcostationary_640_480_30.yuv +ifneq ($(CONFIG_DECODE_PERF_TESTS),yes) LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += niklas_1280_720_30.yuv +endif LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += niklas_640_480_30.yuv LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += tacomanarrows_640_480_30.yuv LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += tacomasmallcameramovement_640_480_30.yuv diff --git a/test/test.mk b/test/test.mk index 4b12a7693..d94329924 100644 --- a/test/test.mk +++ b/test/test.mk @@ -46,6 +46,9 @@ LIBVPX_TEST_SRCS-yes += decode_test_driver.h LIBVPX_TEST_SRCS-yes += encode_test_driver.cc LIBVPX_TEST_SRCS-yes += encode_test_driver.h +## IVF writing. +LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += ../ivfenc.c ../ivfenc.h + ## Y4m parsing. LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_test.cc ../y4menc.c ../y4menc.h |