diff --git a/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc b/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc index 9a0a744f44..4aeed569a4 100644 --- a/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc +++ b/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc @@ -28,7 +28,6 @@ const bool kDenoisingOn = false; const bool kErrorConcealmentOn = false; const bool kSpatialResizeOn = false; const bool kFrameDropperOn = false; -const int kKeyFrameInterval = -1; // Test settings. const bool kBatchMode = true; @@ -69,8 +68,8 @@ class PlotVideoProcessorIntegrationTest rate_profile.num_frames = kNumFrames; // Codec/network settings. - SetProcessParams(&config_, hw_codec_, kUseSingleCore, kPacketLoss, - kKeyFrameInterval, filename, kVerboseLogging, kBatchMode); + SetTestConfig(&config_, hw_codec_, kUseSingleCore, kPacketLoss, filename, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, codec_type_, kNumTemporalLayers, kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, kSpatialResizeOn, kResilienceOn, width, height); diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc index 1ccf278b63..2dab008822 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc @@ -50,8 +50,8 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -70,8 +70,7 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { #if !defined(RTC_DISABLE_VP9) // 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. +// One key frame (first frame only) in sequence. TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { // Bit rate and frame rate profile. RateProfile rate_profile; @@ -79,8 +78,8 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -101,8 +100,8 @@ TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -127,8 +126,8 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; rate_profile.num_frames = kNumFramesLong; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -159,8 +158,8 @@ TEST_F(VideoProcessorIntegrationTest, rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; rate_profile.num_frames = kNumFramesLong; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -182,8 +181,8 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -206,8 +205,8 @@ TEST_F(VideoProcessorIntegrationTest, rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; rate_profile.num_frames = kNumFramesLong; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -234,8 +233,8 @@ TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -256,8 +255,8 @@ TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -278,8 +277,8 @@ TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.1f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.1f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -302,8 +301,8 @@ TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) { rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; rate_profile.num_frames = kNumFramesShort; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, true /* batch_mode */); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, true /* batch_mode */); SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -346,8 +345,8 @@ TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; rate_profile.num_frames = kNumFramesLong; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -386,8 +385,8 @@ TEST_F(VideoProcessorIntegrationTest, rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; rate_profile.num_frames = kNumFramesLong; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. @@ -421,8 +420,8 @@ TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; rate_profile.num_frames = kNumFramesLong; // Codec/network settings. - SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, - kVerboseLogging, kBatchMode); + SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, + kVerboseLogging, kBatchMode); SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, kResilienceOn, kCifWidth, kCifHeight); // Thresholds for expected quality. diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h index 80ad28c907..ab1223bc82 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h @@ -581,25 +581,22 @@ class VideoProcessorIntegrationTest : public testing::Test { } } - static void SetProcessParams(TestConfig* config, - bool hw_codec, - bool use_single_core, - float packet_loss_probability, - int key_frame_interval, - std::string filename, - bool verbose_logging, - bool batch_mode) { - // Configure input filename. + static void SetTestConfig(TestConfig* config, + bool hw_codec, + bool use_single_core, + float packet_loss_probability, + std::string filename, + bool verbose_logging, + bool batch_mode) { config->filename = filename; config->input_filename = ResourcePath(filename, "yuv"); // Generate an output filename in a safe way. config->output_filename = TempFilename(OutputPath(), "videoprocessor_integrationtest"); - config->hw_codec = hw_codec; - config->use_single_core = use_single_core; - config->keyframe_interval = key_frame_interval; config->networking_config.packet_loss_probability = packet_loss_probability; + config->use_single_core = use_single_core; config->verbose = verbose_logging; + config->hw_codec = hw_codec; config->batch_mode = batch_mode; } @@ -617,30 +614,30 @@ class VideoProcessorIntegrationTest : public testing::Test { config->codec_settings.width = width; config->codec_settings.height = height; switch (config->codec_settings.codecType) { + case kVideoCodecVP8: + config->codec_settings.VP8()->resilience = + resilience_on ? kResilientStream : kResilienceOff; + config->codec_settings.VP8()->numberOfTemporalLayers = + num_temporal_layers; + config->codec_settings.VP8()->denoisingOn = denoising_on; + config->codec_settings.VP8()->errorConcealmentOn = error_concealment_on; + config->codec_settings.VP8()->automaticResizeOn = spatial_resize_on; + config->codec_settings.VP8()->frameDroppingOn = frame_dropper_on; + config->codec_settings.VP8()->keyFrameInterval = kBaseKeyFrameInterval; + break; + case kVideoCodecVP9: + config->codec_settings.VP9()->resilienceOn = resilience_on; + config->codec_settings.VP9()->numberOfTemporalLayers = + num_temporal_layers; + config->codec_settings.VP9()->denoisingOn = denoising_on; + config->codec_settings.VP9()->frameDroppingOn = frame_dropper_on; + config->codec_settings.VP9()->keyFrameInterval = kBaseKeyFrameInterval; + config->codec_settings.VP9()->automaticResizeOn = spatial_resize_on; + break; case kVideoCodecH264: config->codec_settings.H264()->frameDroppingOn = frame_dropper_on; config->codec_settings.H264()->keyFrameInterval = kBaseKeyFrameInterval; break; - case kVideoCodecVP8: - config->codec_settings.VP8()->errorConcealmentOn = error_concealment_on; - config->codec_settings.VP8()->denoisingOn = denoising_on; - config->codec_settings.VP8()->numberOfTemporalLayers = - num_temporal_layers; - config->codec_settings.VP8()->frameDroppingOn = frame_dropper_on; - config->codec_settings.VP8()->automaticResizeOn = spatial_resize_on; - config->codec_settings.VP8()->keyFrameInterval = kBaseKeyFrameInterval; - config->codec_settings.VP8()->resilience = - resilience_on ? kResilientStream : kResilienceOff; - break; - case kVideoCodecVP9: - config->codec_settings.VP9()->denoisingOn = denoising_on; - config->codec_settings.VP9()->numberOfTemporalLayers = - num_temporal_layers; - config->codec_settings.VP9()->frameDroppingOn = frame_dropper_on; - config->codec_settings.VP9()->automaticResizeOn = spatial_resize_on; - config->codec_settings.VP9()->keyFrameInterval = kBaseKeyFrameInterval; - config->codec_settings.VP9()->resilienceOn = resilience_on; - break; default: RTC_NOTREACHED(); break;