In Vp8 temporal layering fix generic info at non-first key frame

Bug: b/149907566
Change-Id: I5df5dea1680e95f15c38240df98f4acc3b5daf8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168954
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30601}
This commit is contained in:
Danil Chapovalov
2020-02-25 10:35:48 +01:00
committed by Commit Bot
parent 02956feb2d
commit 2c35da4c00
2 changed files with 16 additions and 3 deletions

View File

@ -554,10 +554,14 @@ void DefaultTemporalLayers::OnEncodeDone(size_t stream_index,
// subsequent frames.
if (is_keyframe) {
info->template_structure = GetTemplateStructure(num_layers_);
generic_frame_info.decode_target_indications =
temporal_pattern_.front().decode_target_indications;
generic_frame_info.temporal_id = 0;
} else {
generic_frame_info.decode_target_indications =
frame.dependency_info.decode_target_indications;
generic_frame_info.temporal_id = frame_config.packetizer_temporal_idx;
}
generic_frame_info.decode_target_indications =
frame.dependency_info.decode_target_indications;
generic_frame_info.temporal_id = frame_config.packetizer_temporal_idx;
if (!frame.expired) {
for (Vp8BufferReference buffer : kAllBuffers) {

View File

@ -20,6 +20,7 @@
#include "modules/video_coding/include/video_codec_interface.h"
#include "modules/video_coding/utility/simulcast_rate_allocator.h"
#include "test/field_trial.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "vpx/vp8cx.h"
@ -28,6 +29,9 @@
namespace webrtc {
namespace test {
namespace {
using ::testing::Each;
enum {
kTemporalUpdateLast = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF,
@ -674,6 +678,11 @@ TEST_F(TemporalLayersTest, KeyFrame) {
<< "Key frame should be marked layer sync.";
EXPECT_EQ(0, info.codecSpecific.VP8.temporalIdx)
<< "Key frame should always be packetized as layer 0";
EXPECT_EQ(0, info.generic_frame_info->temporal_id)
<< "Key frame should always be packetized as layer 0";
EXPECT_THAT(info.generic_frame_info->decode_target_indications,
Each(DecodeTargetIndication::kSwitch))
<< "Key frame is universal switch";
EXPECT_TRUE(checker.CheckTemporalConfig(true, tl_config));
}
}