summaryrefslogtreecommitdiffstats
path: root/libvpx/test/svc_test.cc
diff options
context:
space:
mode:
authorVignesh Venkatasubramanian <vigneshv@google.com>2014-03-20 16:30:56 -0700
committerVignesh Venkatasubramanian <vigneshv@google.com>2014-03-20 17:21:16 -0700
commita72801d7d92ababb50eecf27a36bd222d031d2fe (patch)
tree6dcc67ce169123cb59ecb46e6948a561b1e20448 /libvpx/test/svc_test.cc
parenta052f366468cde7dd95c0ec8c5a22fa1a004d0f8 (diff)
downloadandroid_external_libvpx-a72801d7d92ababb50eecf27a36bd222d031d2fe.tar.gz
android_external_libvpx-a72801d7d92ababb50eecf27a36bd222d031d2fe.tar.bz2
android_external_libvpx-a72801d7d92ababb50eecf27a36bd222d031d2fe.zip
libvpx: Roll latest libvpx
Pulling changes related to fixing a rare bitstream issue on video upscaling. Upstream Hash: 8e9c9f118cda45013f14cce7961dcc8df78ffebf Change-Id: I8639e6ef48f0309efaf6bdf745719beb71f7a58d
Diffstat (limited to 'libvpx/test/svc_test.cc')
-rw-r--r--libvpx/test/svc_test.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/libvpx/test/svc_test.cc b/libvpx/test/svc_test.cc
index 2e56534..dff2ec7 100644
--- a/libvpx/test/svc_test.cc
+++ b/libvpx/test/svc_test.cc
@@ -362,4 +362,39 @@ TEST_F(SvcTest, GetLayerResolution) {
EXPECT_EQ(kHeight * 8 / 16, layer_height);
}
+TEST_F(SvcTest, FirstPassEncode) {
+ svc_.spatial_layers = 2;
+ codec_enc_.g_pass = VPX_RC_FIRST_PASS;
+ vpx_svc_set_scale_factors(&svc_, "4/16,16/16");
+ vpx_svc_set_quantizers(&svc_, "40,30", 0);
+
+ vpx_codec_err_t res =
+ vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ codec_initialized_ = true;
+
+ libvpx_test::I420VideoSource video(test_file_name_, kWidth, kHeight,
+ codec_enc_.g_timebase.den,
+ codec_enc_.g_timebase.num, 0, 30);
+ // FRAME 0
+ video.Begin();
+ res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
+ video.duration(), VPX_DL_GOOD_QUALITY);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ EXPECT_GT(vpx_svc_get_rc_stats_buffer_size(&svc_), 0U);
+
+ // FRAME 1
+ video.Next();
+ res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
+ video.duration(), VPX_DL_GOOD_QUALITY);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ EXPECT_GT(vpx_svc_get_rc_stats_buffer_size(&svc_), 0U);
+
+ // Flush encoder and test EOS packet
+ res = vpx_svc_encode(&svc_, &codec_, NULL, video.pts(),
+ video.duration(), VPX_DL_GOOD_QUALITY);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ EXPECT_GT(vpx_svc_get_rc_stats_buffer_size(&svc_), 0U);
+}
+
} // namespace