Save unwrapped tl0_pic_idx for inserted VP9 frames.

As stashed frames are retried their `tl0_pic_idx` are again unwrapped which can lead to the `tl0_unwrapper_` to unwrap the `tl0_pic_idx` of newer frames backwards. Instead unwrap the `tl0_pid_idx` only once and save it with the frame if necessary.

In this CL
  - Only unwrap the TL0 once in ManageFrame.
  - Split ManageFrameInternal into ManageFrameFlexible and ManageFrameGof.
  - Save the unwrapped TL0 with the stashed frame.

Bug: none
Change-Id: I56e6b071c0082682e010c049c537d66060635567
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253844
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36146}
This commit is contained in:
philipel
2022-03-07 18:12:26 +01:00
committed by WebRTC LUCI CQ
parent 10ab697dcb
commit 773205dfb2
3 changed files with 85 additions and 47 deletions

View File

@ -23,6 +23,7 @@ using ::testing::Matches;
using ::testing::MatchResultListener;
using ::testing::Pointee;
using ::testing::Property;
using ::testing::SizeIs;
using ::testing::UnorderedElementsAreArray;
namespace webrtc {
@ -702,4 +703,17 @@ TEST_F(RtpVp9RefFinderTest, SpatialIndex) {
Contains(Pointee(Property(&EncodedFrame::SpatialIndex, 2))));
}
TEST_F(RtpVp9RefFinderTest, StashedFramesDoNotWrapTl0Backwards) {
GofInfoVP9 ss;
ss.SetGofInfoVP9(kTemporalStructureMode1);
Insert(Frame().Pid(0).SidAndTid(0, 0).Tl0(0));
EXPECT_THAT(frames_, SizeIs(0));
Insert(Frame().Pid(128).SidAndTid(0, 0).Tl0(128).AsKeyFrame().Gof(&ss));
EXPECT_THAT(frames_, SizeIs(1));
Insert(Frame().Pid(129).SidAndTid(0, 0).Tl0(129));
EXPECT_THAT(frames_, SizeIs(2));
}
} // namespace webrtc