Make error resilience configurable through VideoCodecVP9 resilience setting (removes hard coded value in vp9_impl.cc).
Make resilience configurable in video processor integration tests. BUG=webrtc:6783 Review-Url: https://codereview.webrtc.org/2919803002 Cr-Commit-Position: refs/heads/master@{#18493}
This commit is contained in:
@ -21,6 +21,7 @@ const bool kErrorConcealmentOn = false;
|
||||
const bool kDenoisingOn = false;
|
||||
const bool kFrameDropperOn = true;
|
||||
const bool kSpatialResizeOn = false;
|
||||
const bool kResilienceOn = false;
|
||||
const VideoCodecType kVideoCodecType[] = {kVideoCodecVP8};
|
||||
const bool kHwCodec = false;
|
||||
const bool kUseSingleCore = true;
|
||||
@ -70,7 +71,7 @@ class PlotVideoProcessorIntegrationTest
|
||||
-1, // key_frame_interval
|
||||
1, // num_temporal_layers
|
||||
kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, kSpatialResizeOn,
|
||||
width, height, filename, kVerboseLogging, kBatchMode);
|
||||
kResilienceOn, width, height, filename, kVerboseLogging, kBatchMode);
|
||||
|
||||
// Use default thresholds for quality (PSNR and SSIM).
|
||||
QualityThresholds quality_thresholds;
|
||||
|
||||
@ -74,7 +74,7 @@ void PrintCodecSettings(const VideoCodec* config) {
|
||||
} else if (config->codecType == kVideoCodecVP9) {
|
||||
printf(" Denoising : %d\n", config->VP9().denoisingOn);
|
||||
printf(" Frame dropping : %d\n", config->VP9().frameDroppingOn);
|
||||
printf(" Resilience : %d\n", config->VP9().resilience);
|
||||
printf(" Resilience : %d\n", config->VP9().resilienceOn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -21,6 +21,9 @@ const bool kHwCodec = false;
|
||||
// Only allow encoder/decoder to use single core, for predictability.
|
||||
const bool kUseSingleCore = true;
|
||||
|
||||
// Default codec setting is on.
|
||||
const bool kResilienceOn = true;
|
||||
|
||||
} // namespace
|
||||
|
||||
#if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
|
||||
@ -39,7 +42,7 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecH264, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, false, true, false);
|
||||
0.0f, -1, 1, false, false, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 35.0, 25.0, 0.93, 0.70);
|
||||
@ -68,7 +71,7 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, false, true, false);
|
||||
0.0f, -1, 1, false, false, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 37.0, 36.0, 0.93, 0.92);
|
||||
@ -90,7 +93,7 @@ TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore,
|
||||
0.05f, -1, 1, false, false, true, false);
|
||||
0.05f, -1, 1, false, false, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 17.0, 14.0, 0.45, 0.36);
|
||||
@ -116,7 +119,7 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, false, true, false);
|
||||
0.0f, -1, 1, false, false, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 35.5, 30.0, 0.90, 0.85);
|
||||
@ -149,7 +152,7 @@ TEST_F(VideoProcessorIntegrationTest,
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, false, true, false);
|
||||
0.0f, -1, 1, false, false, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 31.5, 18.0, 0.80, 0.43);
|
||||
@ -172,7 +175,7 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, true, true, false);
|
||||
0.0f, -1, 1, false, true, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 36.8, 35.8, 0.92, 0.91);
|
||||
@ -197,7 +200,7 @@ TEST_F(VideoProcessorIntegrationTest,
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, false, true, true);
|
||||
0.0f, -1, 1, false, false, true, true, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 24.0, 13.0, 0.65, 0.37);
|
||||
@ -225,7 +228,7 @@ TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, true, true, false);
|
||||
0.0f, -1, 1, false, true, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 34.95, 33.0, 0.90, 0.89);
|
||||
@ -247,7 +250,7 @@ TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore,
|
||||
0.05f, -1, 1, false, true, true, false);
|
||||
0.05f, -1, 1, false, true, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 20.0, 16.0, 0.60, 0.40);
|
||||
@ -269,7 +272,7 @@ TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore,
|
||||
0.1f, -1, 1, false, true, true, false);
|
||||
0.1f, -1, 1, false, true, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 19.0, 16.0, 0.50, 0.35);
|
||||
@ -293,8 +296,9 @@ TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, true, true, false, 352, 288, "foreman_cif",
|
||||
false /* verbose_logging */, true /* batch_mode */);
|
||||
0.0f, -1, 1, false, true, true, false, kResilienceOn, 352, 288,
|
||||
"foreman_cif", false /* verbose_logging */,
|
||||
true /* batch_mode */);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 34.95, 33.0, 0.90, 0.89);
|
||||
@ -338,7 +342,7 @@ TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, true, true, false);
|
||||
0.0f, -1, 1, false, true, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 34.0, 32.0, 0.85, 0.80);
|
||||
@ -379,7 +383,7 @@ TEST_F(VideoProcessorIntegrationTest,
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 1, false, true, true, false);
|
||||
0.0f, -1, 1, false, true, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 31.0, 22.0, 0.80, 0.65);
|
||||
@ -415,7 +419,7 @@ TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) {
|
||||
// Codec/network settings.
|
||||
CodecParams process_settings;
|
||||
SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, kUseSingleCore,
|
||||
0.0f, -1, 3, false, true, true, false);
|
||||
0.0f, -1, 3, false, true, true, false, kResilienceOn);
|
||||
// Thresholds for expected quality.
|
||||
QualityThresholds quality_thresholds;
|
||||
SetQualityThresholds(&quality_thresholds, 32.5, 30.0, 0.85, 0.80);
|
||||
|
||||
@ -81,6 +81,7 @@ struct CodecParams {
|
||||
bool denoising_on;
|
||||
bool frame_dropper_on;
|
||||
bool spatial_resize_on;
|
||||
bool resilience_on;
|
||||
|
||||
float packet_loss_probability; // [0.0, 1.0].
|
||||
|
||||
@ -282,6 +283,8 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
config_.codec_settings->VP8()->automaticResizeOn =
|
||||
process.spatial_resize_on;
|
||||
config_.codec_settings->VP8()->keyFrameInterval = kBaseKeyFrameInterval;
|
||||
config_.codec_settings->VP8()->resilience =
|
||||
process.resilience_on ? kResilientStream : kResilienceOff;
|
||||
break;
|
||||
case kVideoCodecVP9:
|
||||
config_.codec_settings->VP9()->denoisingOn = process.denoising_on;
|
||||
@ -292,6 +295,7 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
config_.codec_settings->VP9()->automaticResizeOn =
|
||||
process.spatial_resize_on;
|
||||
config_.codec_settings->VP9()->keyFrameInterval = kBaseKeyFrameInterval;
|
||||
config_.codec_settings->VP9()->resilienceOn = process.resilience_on;
|
||||
break;
|
||||
default:
|
||||
RTC_NOTREACHED();
|
||||
@ -696,6 +700,7 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
bool denoising_on,
|
||||
bool frame_dropper_on,
|
||||
bool spatial_resize_on,
|
||||
bool resilience_on,
|
||||
int width,
|
||||
int height,
|
||||
const std::string& filename,
|
||||
@ -711,6 +716,7 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
process_settings->denoising_on = denoising_on;
|
||||
process_settings->frame_dropper_on = frame_dropper_on;
|
||||
process_settings->spatial_resize_on = spatial_resize_on;
|
||||
process_settings->resilience_on = resilience_on;
|
||||
process_settings->width = width;
|
||||
process_settings->height = height;
|
||||
process_settings->filename = filename;
|
||||
@ -728,13 +734,14 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
bool error_concealment_on,
|
||||
bool denoising_on,
|
||||
bool frame_dropper_on,
|
||||
bool spatial_resize_on) {
|
||||
bool spatial_resize_on,
|
||||
bool resilience_on) {
|
||||
SetCodecParams(process_settings, codec_type, hw_codec, use_single_core,
|
||||
packet_loss_probability, key_frame_interval,
|
||||
num_temporal_layers, error_concealment_on, denoising_on,
|
||||
frame_dropper_on, spatial_resize_on, kCifWidth, kCifHeight,
|
||||
kFilenameForemanCif, false /* verbose_logging */,
|
||||
false /* batch_mode */);
|
||||
frame_dropper_on, spatial_resize_on, resilience_on,
|
||||
kCifWidth, kCifHeight, kFilenameForemanCif,
|
||||
false /* verbose_logging */, false /* batch_mode */);
|
||||
}
|
||||
|
||||
static void SetQualityThresholds(QualityThresholds* quality_thresholds,
|
||||
|
||||
@ -297,7 +297,7 @@ int VP9EncoderImpl::InitEncode(const VideoCodec* inst,
|
||||
config_->g_w = codec_.width;
|
||||
config_->g_h = codec_.height;
|
||||
config_->rc_target_bitrate = inst->startBitrate; // in kbit/s
|
||||
config_->g_error_resilient = 1;
|
||||
config_->g_error_resilient = inst->VP9().resilienceOn ? 1 : 0;
|
||||
// Setting the time base of the codec.
|
||||
config_->g_timebase.num = 1;
|
||||
config_->g_timebase.den = 90000;
|
||||
|
||||
Reference in New Issue
Block a user