From a62fa7378f26025cbcaa7684c6d71d21ef487ac0 Mon Sep 17 00:00:00 2001 From: philipel Date: Tue, 24 Nov 2020 13:16:25 +0100 Subject: [PATCH] Removed unused H264 specific code from RtpFrameReferenceFinder. Bug: webrtc:12221 Change-Id: I238ad9c0cb53720a91e0722d61d1704586b56398 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195005 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Philip Eliasson Cr-Commit-Position: refs/heads/master@{#32684} --- .../rtp_frame_reference_finder.cc | 63 ------------------- .../video_coding/rtp_frame_reference_finder.h | 16 ----- 2 files changed, 79 deletions(-) diff --git a/modules/video_coding/rtp_frame_reference_finder.cc b/modules/video_coding/rtp_frame_reference_finder.cc index 669cc9c1af..98751c0404 100644 --- a/modules/video_coding/rtp_frame_reference_finder.cc +++ b/modules/video_coding/rtp_frame_reference_finder.cc @@ -710,68 +710,5 @@ void RtpFrameReferenceFinder::UnwrapPictureIds(RtpFrameObject* frame) { frame->id.picture_id = unwrapper_.Unwrap(frame->id.picture_id); } -void RtpFrameReferenceFinder::UpdateLastPictureIdWithPaddingH264() { - auto seq_num_it = last_seq_num_gop_.begin(); - - // Check if next sequence number is in a stashed padding packet. - uint16_t next_padded_seq_num = seq_num_it->second.second + 1; - auto padding_seq_num_it = stashed_padding_.lower_bound(next_padded_seq_num); - - // Check for more consecutive padding packets to increment - // the "last-picture-id-with-padding" and remove the stashed packets. - while (padding_seq_num_it != stashed_padding_.end() && - *padding_seq_num_it == next_padded_seq_num) { - seq_num_it->second.second = next_padded_seq_num; - ++next_padded_seq_num; - padding_seq_num_it = stashed_padding_.erase(padding_seq_num_it); - } -} - -void RtpFrameReferenceFinder::UpdateLayerInfoH264(RtpFrameObject* frame, - int64_t unwrapped_tl0, - uint8_t temporal_idx) { - auto layer_info_it = layer_info_.find(unwrapped_tl0); - - // Update this layer info and newer. - while (layer_info_it != layer_info_.end()) { - if (layer_info_it->second[temporal_idx] != -1 && - AheadOf(layer_info_it->second[temporal_idx], - frame->id.picture_id)) { - // Not a newer frame. No subsequent layer info needs update. - break; - } - - layer_info_it->second[temporal_idx] = frame->id.picture_id; - ++unwrapped_tl0; - layer_info_it = layer_info_.find(unwrapped_tl0); - } - - for (size_t i = 0; i < frame->num_references; ++i) - frame->references[i] = rtp_seq_num_unwrapper_.Unwrap(frame->references[i]); - frame->id.picture_id = rtp_seq_num_unwrapper_.Unwrap(frame->id.picture_id); -} - -void RtpFrameReferenceFinder::UpdateDataH264(RtpFrameObject* frame, - int64_t unwrapped_tl0, - uint8_t temporal_idx) { - // Update last_seq_num_gop_ entry for last picture id. - auto seq_num_it = last_seq_num_gop_.begin(); - uint16_t last_pic_id = seq_num_it->second.first; - if (AheadOf(frame->id.picture_id, last_pic_id)) { - seq_num_it->second.first = frame->id.picture_id; - seq_num_it->second.second = frame->id.picture_id; - } - UpdateLastPictureIdWithPaddingH264(); - - UpdateLayerInfoH264(frame, unwrapped_tl0, temporal_idx); - - // Remove any current packets from |not_yet_received_seq_num_|. - uint16_t last_seq_num_padded = seq_num_it->second.second; - for (uint16_t n = frame->first_seq_num(); AheadOrAt(last_seq_num_padded, n); - ++n) { - not_yet_received_seq_num_.erase(n); - } -} - } // namespace video_coding } // namespace webrtc diff --git a/modules/video_coding/rtp_frame_reference_finder.h b/modules/video_coding/rtp_frame_reference_finder.h index ed67b91fed..8be051c8bc 100644 --- a/modules/video_coding/rtp_frame_reference_finder.h +++ b/modules/video_coding/rtp_frame_reference_finder.h @@ -128,22 +128,6 @@ class RtpFrameReferenceFinder { // Unwrap |frame|s picture id and its references to 16 bits. void UnwrapPictureIds(RtpFrameObject* frame); - // Find references for H264 frames - FrameDecision ManageFrameH264(RtpFrameObject* frame); - - // Update "last-picture-id-with-padding" sequence number for H264. - void UpdateLastPictureIdWithPaddingH264(); - - // Update H264 layer info state used to determine frame references. - void UpdateLayerInfoH264(RtpFrameObject* frame, - int64_t unwrapped_tl0, - uint8_t temporal_idx); - - // Update H264 state for decodeable frames. - void UpdateDataH264(RtpFrameObject* frame, - int64_t unwrapped_tl0, - uint8_t temporal_idx); - // For every group of pictures, hold two sequence numbers. The first being // the sequence number of the last packet of the last completed frame, and // the second being the sequence number of the last packet of the last