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 b818fa50d21d98f6ab6be6e37384da211ea0cef9..1849326e52c1d341e4c292f78e94d346eb049faa 100644 |
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc |
@@ -31,23 +31,23 @@ const bool kUseSingleCore = true; |
// with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have |
// not been added. |
TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 500, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecH264, kHwCodec, |
- kUseSingleCore, 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, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecH264, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, false, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 35.0, 25.0, 0.93, 0.70); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 2, 60, 20, 10, 20, 0, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
#endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) |
@@ -60,45 +60,45 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { |
// One key frame (first frame only) in sequence. Setting |key_frame_interval| |
// to -1 below means no periodic key frames in test. |
TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 500, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, false, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[1]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, false, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 37.0, 36.0, 0.93, 0.92); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
// lower. One key frame (first frame only) in sequence. |
TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 500, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |
- kUseSingleCore, 0.05f, -1, 1, false, false, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[1]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
+ 0.05f, -1, 1, false, false, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 17.0, 14.0, 0.45, 0.36); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP9: Run with no packet loss, with varying bitrate (3 rate updates): |
@@ -106,27 +106,27 @@ TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { |
// target rate/per-frame bandwidth (for each rate update) is within limits. |
// One key frame (first frame only) in sequence. |
TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |
- SetRateProfilePars(&rate_profile, 1, 700, 30, 100); |
- SetRateProfilePars(&rate_profile, 2, 500, 30, 200); |
+ SetRateProfile(&rate_profile, 0, 200, 30, 0); |
+ SetRateProfile(&rate_profile, 1, 700, 30, 100); |
+ SetRateProfile(&rate_profile, 2, 500, 30, 200); |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, false, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[3]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); |
- SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0); |
- SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, false, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 35.5, 30.0, 0.90, 0.85); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[3]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 30, 20, 20, 30, 0, 1); |
+ SetRateControlThresholds(rc_thresholds, 1, 2, 0, 20, 20, 60, 0, 0); |
+ SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 20, 40, 0, 0); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP9: Run with no packet loss, with an update (decrease) in frame rate. |
@@ -139,48 +139,48 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |
TEST_F(VideoProcessorIntegrationTest, |
ProcessNoLossChangeFrameRateFrameDropVP9) { |
config_.networking_config.packet_loss_probability = 0; |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 100, 24, 0); |
- SetRateProfilePars(&rate_profile, 1, 100, 15, 100); |
- SetRateProfilePars(&rate_profile, 2, 100, 10, 200); |
+ SetRateProfile(&rate_profile, 0, 100, 24, 0); |
+ SetRateProfile(&rate_profile, 1, 100, 15, 100); |
+ SetRateProfile(&rate_profile, 2, 100, 10, 200); |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, false, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[3]; |
- SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); |
- SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); |
- SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, false, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 31.5, 18.0, 0.80, 0.43); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[3]; |
+ SetRateControlThresholds(rc_thresholds, 0, 38, 50, 75, 15, 45, 0, 1); |
+ SetRateControlThresholds(rc_thresholds, 1, 10, 0, 40, 10, 30, 0, 0); |
+ SetRateControlThresholds(rc_thresholds, 2, 5, 0, 30, 5, 20, 0, 0); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP9: Run with no packet loss and denoiser on. One key frame (first frame). |
TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 500, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[1]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, true, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 36.8, 35.8, 0.92, 0.91); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// Run with no packet loss, at low bitrate. |
@@ -189,23 +189,23 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |
TEST_F(VideoProcessorIntegrationTest, |
DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |
config_.networking_config.packet_loss_probability = 0; |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 50, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 50, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, false, true, true); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[1]; |
- SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, false, true, true); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 24.0, 13.0, 0.65, 0.37); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 228, 70, 160, 15, 80, 1, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// TODO(marpan): Add temporal layer test for VP9, once changes are in |
@@ -217,67 +217,67 @@ TEST_F(VideoProcessorIntegrationTest, |
// One key frame (first frame only) in sequence. Setting |key_frame_interval| |
// to -1 below means no periodic key frames in test. |
TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 500, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[1]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, true, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 34.95, 33.0, 0.90, 0.89); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
// lower. One key frame (first frame only) in sequence. |
TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 500, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |
- kUseSingleCore, 0.05f, -1, 1, false, true, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[1]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
+ 0.05f, -1, 1, false, true, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 20.0, 16.0, 0.60, 0.40); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. |
// One key frame (first frame only) in sequence. |
TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
+ SetRateProfile(&rate_profile, 0, 500, 30, 0); |
rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
rate_profile.num_frames = kNumFramesShort; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |
- kUseSingleCore, 0.1f, -1, 1, false, true, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[1]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
+ 0.1f, -1, 1, false, true, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 19.0, 16.0, 0.50, 0.35); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[1]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
#endif // !defined(WEBRTC_IOS) |
@@ -303,27 +303,27 @@ TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { |
#define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 |
#endif |
TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |
- SetRateProfilePars(&rate_profile, 1, 800, 30, 100); |
- SetRateProfilePars(&rate_profile, 2, 500, 30, 200); |
+ SetRateProfile(&rate_profile, 0, 200, 30, 0); |
+ SetRateProfile(&rate_profile, 1, 800, 30, 100); |
+ SetRateProfile(&rate_profile, 2, 500, 30, 200); |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[3]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); |
- SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0); |
- SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, true, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 34.0, 32.0, 0.85, 0.80); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[3]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 45, 20, 10, 15, 0, 1); |
+ SetRateControlThresholds(rc_thresholds, 1, 0, 0, 25, 20, 10, 0, 0); |
+ SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 15, 10, 0, 0); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP8: Run with no packet loss, with an update (decrease) in frame rate. |
@@ -344,27 +344,27 @@ TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { |
TEST_F(VideoProcessorIntegrationTest, |
MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { |
config_.networking_config.packet_loss_probability = 0; |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 80, 24, 0); |
- SetRateProfilePars(&rate_profile, 1, 80, 15, 100); |
- SetRateProfilePars(&rate_profile, 2, 80, 10, 200); |
+ SetRateProfile(&rate_profile, 0, 80, 24, 0); |
+ SetRateProfile(&rate_profile, 1, 80, 15, 100); |
+ SetRateProfile(&rate_profile, 2, 80, 10, 200); |
rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 1, false, true, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[3]; |
- SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); |
- SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0); |
- SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 1, false, true, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 31.0, 22.0, 0.80, 0.65); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[3]; |
+ SetRateControlThresholds(rc_thresholds, 0, 40, 20, 75, 15, 60, 0, 1); |
+ SetRateControlThresholds(rc_thresholds, 1, 10, 0, 25, 10, 35, 0, 0); |
+ SetRateControlThresholds(rc_thresholds, 2, 0, 0, 20, 10, 15, 0, 0); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
// VP8: Run with no packet loss, with 3 temporal layers, with a rate update in |
@@ -381,25 +381,25 @@ TEST_F(VideoProcessorIntegrationTest, |
#endif |
TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { |
config_.networking_config.packet_loss_probability = 0; |
- // Bitrate and frame rate profile. |
+ // Bit rate and frame rate profile. |
RateProfile rate_profile; |
- SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |
- SetRateProfilePars(&rate_profile, 1, 400, 30, 150); |
+ SetRateProfile(&rate_profile, 0, 200, 30, 0); |
+ SetRateProfile(&rate_profile, 1, 400, 30, 150); |
rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
rate_profile.num_frames = kNumFramesLong; |
// Codec/network settings. |
- CodecConfigPars process_settings; |
- SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, |
- kUseSingleCore, 0.0f, -1, 3, false, true, true, false); |
- // Metrics for expected quality. |
- QualityMetrics quality_metrics; |
- SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); |
- // Metrics for rate control. |
- RateControlMetrics rc_metrics[2]; |
- SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); |
- SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); |
- ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
- rc_metrics, nullptr /* visualization_params */); |
+ CodecParams process_settings; |
+ SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore, |
+ 0.0f, -1, 3, false, true, true, false); |
+ // Thresholds for expected quality. |
+ QualityThresholds quality_thresholds; |
+ SetQualityThresholds(&quality_thresholds, 32.5, 30.0, 0.85, 0.80); |
+ // Thresholds for rate control. |
+ RateControlThresholds rc_thresholds[2]; |
+ SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1); |
+ SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0); |
+ ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
+ rc_thresholds, nullptr /* visualization_params */); |
} |
} // namespace test |
} // namespace webrtc |