Unwrap TL0 pic index to avoid having to work with a wrapped number.

This is to avoid clearing the |gof_info_| map when there are jumps in the
tl0 pic index.

Bug: chromium:855211
Change-Id: I762557070d65b3c535cb9a49498975bcd9c2c485
Reviewed-on: https://webrtc-review.googlesource.com/86943
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23872}
This commit is contained in:
philipel
2018-07-03 18:09:32 +02:00
committed by Commit Bot
parent d39ce8d45b
commit 57ec685446
3 changed files with 51 additions and 43 deletions

View File

@ -100,7 +100,8 @@ class RtpFrameReferenceFinder {
// Updates necessary layer info state used to determine frame references for
// Vp8.
void UpdateLayerInfoVp8(RtpFrameObject* frame,
const RTPVideoHeaderVP8& codec_header)
int64_t unwrapped_tl0,
uint8_t temporal_idx)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Find references for Vp9 frames
@ -162,11 +163,9 @@ class RtpFrameReferenceFinder {
RTC_GUARDED_BY(crit_);
// Holds the information about the last completed frame for a given temporal
// layer given a Tl0 picture index.
std::map<uint8_t,
std::array<int16_t, kMaxTemporalLayers>,
DescendingSeqNumComp<uint8_t>>
layer_info_ RTC_GUARDED_BY(crit_);
// layer given an unwrapped Tl0 picture index.
std::map<int64_t, std::array<int16_t, kMaxTemporalLayers>> layer_info_
RTC_GUARDED_BY(crit_);
// Where the current scalability structure is in the
// |scalability_structures_| array.
@ -176,9 +175,8 @@ class RtpFrameReferenceFinder {
std::array<GofInfoVP9, kMaxGofSaved> scalability_structures_
RTC_GUARDED_BY(crit_);
// Holds the the Gof information for a given TL0 picture index.
std::map<uint8_t, GofInfo, DescendingSeqNumComp<uint8_t>> gof_info_
RTC_GUARDED_BY(crit_);
// Holds the the Gof information for a given unwrapped TL0 picture index.
std::map<int64_t, GofInfo> gof_info_ RTC_GUARDED_BY(crit_);
// Keep track of which picture id and which temporal layer that had the
// up switch flag set.
@ -204,6 +202,8 @@ class RtpFrameReferenceFinder {
// Unwrapper used to unwrap VP8/VP9 streams which have their picture id
// specified.
SeqNumUnwrapper<uint16_t, kPicIdLength> unwrapper_ RTC_GUARDED_BY(crit_);
SeqNumUnwrapper<uint8_t> tl0_unwrapper_ RTC_GUARDED_BY(crit_);
};
} // namespace video_coding