| 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 9f8ff49bee6a2450a3ccfa3b394ce87839562fd2..c76284aa5aaa97ec0a9c7a7df332bc1719f017aa 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/codecs/interface/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/main/interface/video_coding.h"
|
| #include "webrtc/test/testsupport/fileutils.h"
|
| #include "webrtc/test/testsupport/frame_reader.h"
|
| @@ -153,7 +154,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_);
|
| @@ -188,6 +193,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_;
|
| @@ -217,7 +228,7 @@ class VideoProcessorIntegrationTest: public testing::Test {
|
| default:
|
| assert(false);
|
| break;
|
| - }
|
| + }
|
| frame_reader_ =
|
| new webrtc::test::FrameReaderImpl(config_.input_filename,
|
| config_.frame_length_in_bytes);
|
| @@ -589,6 +600,37 @@ void SetRateControlMetrics(RateControlMetrics* rc_metrics,
|
| rc_metrics[update_index].num_key_frames = num_key_frames;
|
| }
|
|
|
| +#if defined(WEBRTC_OPENH264)
|
| +
|
| +// 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_OPENH264)
|
| +
|
| // 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.
|
|
|