Cleanup H.265 TODOs.
Cleanup some of the TODOs for H.265. They are either invalid or their handling should be merged with other codec types. Bug: chromium:41480904 Change-Id: I76263354b1b87035e240d77283b21a9a26dcb45b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366044 Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43359}
This commit is contained in:
parent
1a93080b8d
commit
faef5de87c
@ -111,11 +111,10 @@ void PopulateRtpWithCodecSpecifics(const CodecSpecificInfo& info,
|
|||||||
info.codecSpecific.H264.packetization_mode;
|
info.codecSpecific.H264.packetization_mode;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// These codec types do not have codec-specifics.
|
||||||
case kVideoCodecGeneric:
|
case kVideoCodecGeneric:
|
||||||
rtp->codec = kVideoCodecGeneric;
|
case kVideoCodecH265:
|
||||||
return;
|
case kVideoCodecAV1:
|
||||||
// TODO(bugs.webrtc.org/13485): Implement H265 codec specific info
|
|
||||||
default:
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -353,7 +352,8 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case VideoCodecType::kVideoCodecAV1:
|
case VideoCodecType::kVideoCodecAV1:
|
||||||
// TODO(philipel): Implement AV1 to generic descriptor.
|
// Codec-specifics is not supported for AV1. We convert from the
|
||||||
|
// generic_frame_info.
|
||||||
return;
|
return;
|
||||||
case VideoCodecType::kVideoCodecH264:
|
case VideoCodecType::kVideoCodecH264:
|
||||||
if (codec_specific_info) {
|
if (codec_specific_info) {
|
||||||
@ -362,7 +362,8 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case VideoCodecType::kVideoCodecH265:
|
case VideoCodecType::kVideoCodecH265:
|
||||||
// TODO(bugs.webrtc.org/13485): Implement H265 to generic descriptor.
|
// Codec-specifics is not supported for H.265. We convert from the
|
||||||
|
// generic_frame_info.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RTC_DCHECK_NOTREACHED() << "Unsupported codec.";
|
RTC_DCHECK_NOTREACHED() << "Unsupported codec.";
|
||||||
|
|||||||
@ -102,6 +102,12 @@ bool MinimizeDescriptor(RTPVideoHeader* video_header) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsBaseLayer(const RTPVideoHeader& video_header) {
|
bool IsBaseLayer(const RTPVideoHeader& video_header) {
|
||||||
|
// For AV1 & H.265 we fetch temporal index from the generic descriptor.
|
||||||
|
if (video_header.generic) {
|
||||||
|
const auto& generic = video_header.generic.value();
|
||||||
|
return (generic.temporal_index == 0 ||
|
||||||
|
generic.temporal_index == kNoTemporalIdx);
|
||||||
|
}
|
||||||
switch (video_header.codec) {
|
switch (video_header.codec) {
|
||||||
case kVideoCodecVP8: {
|
case kVideoCodecVP8: {
|
||||||
const auto& vp8 =
|
const auto& vp8 =
|
||||||
@ -117,11 +123,11 @@ bool IsBaseLayer(const RTPVideoHeader& video_header) {
|
|||||||
// TODO(kron): Implement logic for H264 once WebRTC supports temporal
|
// TODO(kron): Implement logic for H264 once WebRTC supports temporal
|
||||||
// layers for H264.
|
// layers for H264.
|
||||||
break;
|
break;
|
||||||
|
// These codecs do not have codec-specifics, from which we can fetch
|
||||||
|
// temporal index.
|
||||||
case kVideoCodecH265:
|
case kVideoCodecH265:
|
||||||
// TODO(bugs.webrtc.org/13485): Implement logic for H265 once WebRTC
|
case kVideoCodecAV1:
|
||||||
// supports temporal layers for H265.
|
case kVideoCodecGeneric:
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -59,11 +59,10 @@ VideoFrameMetadata RTPVideoHeader::GetAsMetadata() const {
|
|||||||
metadata.SetRTPVideoHeaderCodecSpecifics(
|
metadata.SetRTPVideoHeaderCodecSpecifics(
|
||||||
absl::get<RTPVideoHeaderH264>(video_type_header));
|
absl::get<RTPVideoHeaderH264>(video_type_header));
|
||||||
break;
|
break;
|
||||||
|
// These codec types do not have codec-specifics.
|
||||||
case VideoCodecType::kVideoCodecH265:
|
case VideoCodecType::kVideoCodecH265:
|
||||||
// TODO(bugs.webrtc.org/13485)
|
case VideoCodecType::kVideoCodecAV1:
|
||||||
break;
|
case VideoCodecType::kVideoCodecGeneric:
|
||||||
default:
|
|
||||||
// Codec-specifics are not supported for this codec.
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return metadata;
|
return metadata;
|
||||||
|
|||||||
@ -105,10 +105,11 @@ int SimulcastUtility::NumberOfTemporalLayers(const VideoCodec& codec,
|
|||||||
case kVideoCodecH264:
|
case kVideoCodecH264:
|
||||||
num_temporal_layers = codec.H264().numberOfTemporalLayers;
|
num_temporal_layers = codec.H264().numberOfTemporalLayers;
|
||||||
break;
|
break;
|
||||||
|
// For AV1 and H.265 we get temporal layer count from scalability mode,
|
||||||
|
// instead of from codec-specifics.
|
||||||
|
case kVideoCodecAV1:
|
||||||
case kVideoCodecH265:
|
case kVideoCodecH265:
|
||||||
// TODO(bugs.webrtc.org/13485)
|
case kVideoCodecGeneric:
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,9 +43,9 @@ std::unique_ptr<VideoDecoder> CreateDecoder(const Environment& env,
|
|||||||
case VideoCodecType::kVideoCodecAV1:
|
case VideoCodecType::kVideoCodecAV1:
|
||||||
return CreateDav1dDecoder();
|
return CreateDav1dDecoder();
|
||||||
case VideoCodecType::kVideoCodecH265:
|
case VideoCodecType::kVideoCodecH265:
|
||||||
// TODO: bugs.webrtc.org/13485 - implement H265 decoder
|
// No H.265 SW decoder implementation will be provided.
|
||||||
return nullptr;
|
return nullptr;
|
||||||
default:
|
case VideoCodecType::kVideoCodecGeneric:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -151,7 +151,7 @@ bool RequiresEncoderReset(const VideoCodec& prev_send_codec,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kVideoCodecH265:
|
case kVideoCodecH265:
|
||||||
// TODO(bugs.webrtc.org/13485): Implement new send codec H265
|
// No H.265 specific handling needed.
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -1169,7 +1169,11 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
env_.field_trials(), encoder_config_, streams);
|
env_.field_trials(), encoder_config_, streams);
|
||||||
|
|
||||||
if (encoder_config_.codec_type == kVideoCodecVP9 ||
|
if (encoder_config_.codec_type == kVideoCodecVP9 ||
|
||||||
encoder_config_.codec_type == kVideoCodecAV1) {
|
encoder_config_.codec_type == kVideoCodecAV1
|
||||||
|
#ifdef RTC_ENABLE_H265
|
||||||
|
|| encoder_config_.codec_type == kVideoCodecH265
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
// Spatial layers configuration might impose some parity restrictions,
|
// Spatial layers configuration might impose some parity restrictions,
|
||||||
// thus some cropping might be needed.
|
// thus some cropping might be needed.
|
||||||
RTC_CHECK_GE(last_frame_info_->width, codec.width);
|
RTC_CHECK_GE(last_frame_info_->width, codec.width);
|
||||||
@ -1205,7 +1209,11 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (encoder_config_.codec_type == kVideoCodecVP9 ||
|
if (encoder_config_.codec_type == kVideoCodecVP9 ||
|
||||||
encoder_config_.codec_type == kVideoCodecAV1) {
|
encoder_config_.codec_type == kVideoCodecAV1
|
||||||
|
#ifdef RTC_ENABLE_H265
|
||||||
|
|| encoder_config_.codec_type == kVideoCodecH265
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
log_stream << ", spatial layers: ";
|
log_stream << ", spatial layers: ";
|
||||||
for (int i = 0; i < GetNumSpatialLayers(codec); ++i) {
|
for (int i = 0; i < GetNumSpatialLayers(codec); ++i) {
|
||||||
log_stream << "{" << i << ": " << codec.spatialLayers[i].width << "x"
|
log_stream << "{" << i << ": " << codec.spatialLayers[i].width << "x"
|
||||||
@ -1336,7 +1344,8 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
num_layers = codec.VP8()->numberOfTemporalLayers;
|
num_layers = codec.VP8()->numberOfTemporalLayers;
|
||||||
} else if (codec.codecType == kVideoCodecVP9) {
|
} else if (codec.codecType == kVideoCodecVP9) {
|
||||||
num_layers = codec.VP9()->numberOfTemporalLayers;
|
num_layers = codec.VP9()->numberOfTemporalLayers;
|
||||||
} else if (codec.codecType == kVideoCodecAV1 &&
|
} else if ((codec.codecType == kVideoCodecAV1 ||
|
||||||
|
codec.codecType == kVideoCodecH265) &&
|
||||||
codec.GetScalabilityMode().has_value()) {
|
codec.GetScalabilityMode().has_value()) {
|
||||||
num_layers =
|
num_layers =
|
||||||
ScalabilityModeToNumTemporalLayers(*(codec.GetScalabilityMode()));
|
ScalabilityModeToNumTemporalLayers(*(codec.GetScalabilityMode()));
|
||||||
@ -1348,7 +1357,6 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
// TODO(sprang): Add a better way to disable frame dropping.
|
// TODO(sprang): Add a better way to disable frame dropping.
|
||||||
num_layers = codec.simulcastStream[0].numberOfTemporalLayers;
|
num_layers = codec.simulcastStream[0].numberOfTemporalLayers;
|
||||||
} else {
|
} else {
|
||||||
// TODO(bugs.webrtc.org/13485): Implement H265 temporal layer
|
|
||||||
num_layers = 1;
|
num_layers = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1392,9 +1400,14 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set min_bitrate_bps, max_bitrate_bps, and max padding bit rate for VP9
|
// Set min_bitrate_bps, max_bitrate_bps, and max padding bit rate for VP9,
|
||||||
// and AV1 and leave only one stream containing all necessary information.
|
// AV1 and H.265, and leave only one stream containing all necessary
|
||||||
if ((encoder_config_.codec_type == kVideoCodecVP9 ||
|
// information.
|
||||||
|
if ((
|
||||||
|
#ifdef RTC_ENABLE_H265
|
||||||
|
encoder_config_.codec_type == kVideoCodecH265 ||
|
||||||
|
#endif
|
||||||
|
encoder_config_.codec_type == kVideoCodecVP9 ||
|
||||||
encoder_config_.codec_type == kVideoCodecAV1) &&
|
encoder_config_.codec_type == kVideoCodecAV1) &&
|
||||||
single_stream_or_non_first_inactive) {
|
single_stream_or_non_first_inactive) {
|
||||||
// Lower max bitrate to the level codec actually can produce.
|
// Lower max bitrate to the level codec actually can produce.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user