Revert of Turn off error resilience for VP9 if no spatial or temporal layers are configured and NACK is enabl… (patchset #1 id:40001 of https://codereview.webrtc.org/2532053002/ )

Reason for revert:
Increase in encode time larger than expected.

Original issue's description:
> Turn off error resilience for VP9 if no spatial or temporal layers are configured and NACK is enabled.
>
> Error resilience is currently always enabled for VP9 which reduces quality.
>
> BUG=webrtc:6783
>
> Committed: https://crrev.com/4eb03c76fa2320534d669fda2aabf800e7a6f579
> Cr-Commit-Position: refs/heads/master@{#15390}

TBR=stefan@webrtc.org,marpan@webrtc.org,mflodman@webrtc.org,marpan@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6783

Review-Url: https://codereview.webrtc.org/2554403006
Cr-Commit-Position: refs/heads/master@{#15501}
This commit is contained in:
asapersson
2016-12-09 02:35:20 -08:00
committed by Commit bot
parent 1cd0a0ab43
commit a90799d5fb
5 changed files with 13 additions and 122 deletions

View File

@ -21,15 +21,6 @@
#include "webrtc/system_wrappers/include/clock.h"
namespace webrtc {
namespace {
bool TemporalLayersConfigured(const std::vector<VideoStream>& streams) {
for (const VideoStream& stream : streams) {
if (stream.temporal_layer_thresholds_bps.size() > 0)
return true;
}
return false;
}
} // namespace
bool VideoCodecInitializer::SetupCodec(
const VideoEncoderConfig& config,
@ -128,8 +119,12 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
*video_codec.VP8() = VideoEncoder::GetDefaultVp8Settings();
video_codec.VP8()->numberOfTemporalLayers = static_cast<unsigned char>(
streams.back().temporal_layer_thresholds_bps.size() + 1);
if (nack_enabled && !TemporalLayersConfigured(streams)) {
bool temporal_layers_configured = false;
for (const VideoStream& stream : streams) {
if (stream.temporal_layer_thresholds_bps.size() > 0)
temporal_layers_configured = true;
}
if (nack_enabled && !temporal_layers_configured) {
LOG(LS_INFO) << "No temporal layers and nack enabled -> resilience off";
video_codec.VP8()->resilience = kResilienceOff;
}
@ -147,13 +142,6 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
}
video_codec.VP9()->numberOfTemporalLayers = static_cast<unsigned char>(
streams.back().temporal_layer_thresholds_bps.size() + 1);
if (nack_enabled && !TemporalLayersConfigured(streams) &&
video_codec.VP9()->numberOfSpatialLayers == 1) {
LOG(LS_INFO) << "No temporal or spatial layers and nack enabled -> "
<< "resilience off";
video_codec.VP9()->resilienceOn = false;
}
break;
}
case kVideoCodecH264: {