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

@ -17,9 +17,9 @@
#include "webrtc/base/optional.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/codecs/test/video_codec_test.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/test/frame_utils.h"
#include "webrtc/test/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
@ -309,6 +309,18 @@ TEST_F(TestVp8Impl, DecodedQpEqualsEncodedQp) {
EXPECT_EQ(encoded_frame_.qp_, *decoded_qp_);
}
TEST_F(TestVp8Impl, ParserQpEqualsEncodedQp) {
SetUpEncodeDecode();
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
encoder_->Encode(*input_frame_, nullptr, nullptr));
EXPECT_GT(WaitForEncodedFrame(), 0u);
int qp = 0;
ASSERT_TRUE(vp8::GetQp(encoded_frame_._buffer, encoded_frame_._length, &qp));
EXPECT_EQ(encoded_frame_.qp_, qp);
}
#if defined(WEBRTC_ANDROID)
#define MAYBE_AlignedStrideEncodeDecode DISABLED_AlignedStrideEncodeDecode
#else