| Index: webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
|
| diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
|
| index 7b92616e1be305f6c10e9e0a2f3d2e171141855c..79d75c903bedadba4407be60e8a1de507e180441 100644
|
| --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
|
| +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
|
| @@ -15,9 +15,10 @@
|
| #include "webrtc/modules/video_coding/include/video_codec_interface.h"
|
| #include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h"
|
| #include "webrtc/modules/video_coding/codecs/test/videoprocessor.h"
|
| +#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
|
| #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
|
| -#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
|
| #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h"
|
| +#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
|
| #include "webrtc/modules/video_coding/include/video_coding.h"
|
| #include "webrtc/test/testsupport/fileutils.h"
|
| #include "webrtc/test/testsupport/frame_reader.h"
|
| @@ -150,7 +151,11 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
| virtual ~VideoProcessorIntegrationTest() {}
|
|
|
| void SetUpCodecConfig() {
|
| - if (codec_type_ == kVideoCodecVP8) {
|
| + if (codec_type_ == kVideoCodecH264) {
|
| + encoder_ = H264Encoder::Create();
|
| + decoder_ = H264Decoder::Create();
|
| + VideoCodingModule::Codec(kVideoCodecH264, &codec_settings_);
|
| + } else if (codec_type_ == kVideoCodecVP8) {
|
| encoder_ = VP8Encoder::Create();
|
| decoder_ = VP8Decoder::Create();
|
| VideoCodingModule::Codec(kVideoCodecVP8, &codec_settings_);
|
| @@ -184,6 +189,12 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
|
|
| // These features may be set depending on the test.
|
| switch (config_.codec_settings->codecType) {
|
| + case kVideoCodecH264:
|
| + config_.codec_settings->codecSpecific.H264.frameDroppingOn =
|
| + frame_dropper_on_;
|
| + config_.codec_settings->codecSpecific.H264.keyFrameInterval =
|
| + kBaseKeyFrameInterval;
|
| + break;
|
| case kVideoCodecVP8:
|
| config_.codec_settings->codecSpecific.VP8.errorConcealmentOn =
|
| error_concealment_on_;
|
| @@ -579,6 +590,37 @@ void SetRateControlMetrics(RateControlMetrics* rc_metrics,
|
| rc_metrics[update_index].num_key_frames = num_key_frames;
|
| }
|
|
|
| +#if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
|
| +
|
| +// H264: Run with no packet loss and fixed bitrate. Quality should be very high.
|
| +// Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in
|
| +// these unittests appears to drop "packets" in a way that is not compatible
|
| +// with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have
|
| +// not been added.
|
| +TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) {
|
| + // Bitrate and frame rate profile.
|
| + RateProfile rate_profile;
|
| + SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
|
| + rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1;
|
| + rate_profile.num_frames = kNbrFramesShort;
|
| + // Codec/network settings.
|
| + CodecConfigPars process_settings;
|
| + SetCodecParameters(&process_settings, kVideoCodecH264, 0.0f, -1, 1, false,
|
| + false, true, false);
|
| + // Metrics for expected quality.
|
| + QualityMetrics quality_metrics;
|
| + SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70);
|
| + // Metrics for rate control.
|
| + RateControlMetrics rc_metrics[1];
|
| + SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1);
|
| + ProcessFramesAndVerify(quality_metrics,
|
| + rate_profile,
|
| + process_settings,
|
| + rc_metrics);
|
| +}
|
| +
|
| +#endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
|
| +
|
| // VP9: Run with no packet loss and fixed bitrate. Quality should be very high.
|
| // One key frame (first frame only) in sequence. Setting |key_frame_interval|
|
| // to -1 below means no periodic key frames in test.
|
|
|