Add unit tests for qp parser.

Add test for vp8/vp9 qp parser in both videoprocessor_integrationtest.
Check the qp from parser equal to that from the encoder
on every frame in every test.

Add test for vp8/vp9 qp parser in vp8/vp9_impl_test.
Check the qp parser on a single key frame.

BUG=None

Review-Url: https://codereview.webrtc.org/2903163002
Cr-Commit-Position: refs/heads/master@{#18334}
This commit is contained in:
jianj
2017-05-30 10:57:25 -07:00
committed by Commit Bot
parent 6c4bbfa06f
commit b5f5bdba77
6 changed files with 74 additions and 3 deletions

View File

@ -104,6 +104,19 @@ TEST_F(TestVp9Impl, DecodedQpEqualsEncodedQp) {
EXPECT_EQ(encoded_frame.qp_, *decoded_qp);
}
TEST_F(TestVp9Impl, ParserQpEqualsEncodedQp) {
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
encoder_->Encode(*input_frame_, nullptr, nullptr));
EncodedImage encoded_frame;
CodecSpecificInfo codec_specific_info;
ASSERT_TRUE(WaitForEncodedFrame(&encoded_frame, &codec_specific_info));
int qp = 0;
ASSERT_TRUE(vp9::GetQp(encoded_frame._buffer, encoded_frame._length, &qp));
EXPECT_EQ(encoded_frame.qp_, qp);
}
TEST_F(TestVp9Impl, EncoderRetainsRtpStateAfterRelease) {
// Override default settings.
codec_settings_.VP9()->numberOfTemporalLayers = 2;