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 7ea594e5c1baab029c48b2c9308138ac8a066b8f..ee6c2f20e73fc882968d11cb8697d0ee742e3be7 100644 |
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
@@ -17,6 +17,8 @@ namespace { |
// In these correctness tests, we only consider SW codecs. |
const bool kHwCodec = false; |
+const bool kBatchMode = false; |
+const bool kVerboseLogging = false; |
// Only allow encoder/decoder to use single core, for predictability. |
const bool kUseSingleCore = true; |
@@ -24,6 +26,11 @@ const bool kUseSingleCore = true; |
// Default codec setting is on. |
const bool kResilienceOn = true; |
+// Default sequence is foreman (CIF): may be better to use VGA for resize test. |
+const int kCifWidth = 352; |
+const int kCifHeight = 288; |
+const char kForemanCif[] = "foreman_cif"; |
+ |
} // namespace |
#if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) |
@@ -40,9 +47,10 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecH264, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, false, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecH264, 1, false, false, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 35.0, 25.0, 0.93, 0.70); |
@@ -69,9 +77,10 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, false, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 37.0, 36.0, 0.93, 0.92); |
@@ -91,9 +100,10 @@ TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
- 0.05f, -1, 1, false, false, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.05f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 17.0, 14.0, 0.45, 0.36); |
@@ -117,9 +127,10 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, false, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 35.5, 30.0, 0.90, 0.85); |
@@ -150,9 +161,10 @@ TEST_F(VideoProcessorIntegrationTest, |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, false, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 31.5, 18.0, 0.80, 0.43); |
@@ -173,9 +185,10 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, true, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 36.8, 35.8, 0.92, 0.91); |
@@ -198,9 +211,10 @@ TEST_F(VideoProcessorIntegrationTest, |
rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, false, true, true, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP9, 1, false, false, |
+ true, true, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 24.0, 13.0, 0.65, 0.37); |
@@ -226,9 +240,10 @@ TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, true, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 34.95, 33.0, 0.90, 0.89); |
@@ -248,9 +263,10 @@ TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
- 0.05f, -1, 1, false, true, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.05f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 20.0, 16.0, 0.60, 0.40); |
@@ -270,9 +286,10 @@ TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
- 0.1f, -1, 1, false, true, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.1f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 19.0, 16.0, 0.50, 0.35); |
@@ -294,11 +311,11 @@ TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) { |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, true, true, false, kResilienceOn, 352, 288, |
- "foreman_cif", false /* verbose_logging */, |
- true /* batch_mode */); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, |
+ true /* batch_mode */); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 34.95, 33.0, 0.90, 0.89); |
@@ -340,9 +357,10 @@ TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, true, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 34.0, 32.0, 0.85, 0.80); |
@@ -381,9 +399,10 @@ TEST_F(VideoProcessorIntegrationTest, |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 1, false, true, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 1, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 31.0, 22.0, 0.80, 0.65); |
@@ -417,9 +436,10 @@ TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { |
rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecParams process_settings; |
- SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
- 0.0f, -1, 3, false, true, true, false, kResilienceOn); |
+ ProcessParams process_settings(kHwCodec, kUseSingleCore, 0.0f, -1, |
+ kForemanCif, kVerboseLogging, kBatchMode); |
+ SetCodecSettings(&config_, &codec_settings_, kVideoCodecVP8, 3, false, true, |
+ true, false, kResilienceOn, kCifWidth, kCifHeight); |
// Thresholds for expected quality. |
QualityThresholds quality_thresholds; |
SetQualityThresholds(&quality_thresholds, 32.5, 30.0, 0.85, 0.80); |