1 /* 2 * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 #ifndef MODULES_VIDEO_CODING_CODECS_AV1_SCALABILITY_STRUCTURE_L2T2_H_ 11 #define MODULES_VIDEO_CODING_CODECS_AV1_SCALABILITY_STRUCTURE_L2T2_H_ 12 13 #include <vector> 14 15 #include "api/transport/rtp/dependency_descriptor.h" 16 #include "common_video/generic_frame_descriptor/generic_frame_info.h" 17 #include "modules/video_coding/codecs/av1/scalable_video_controller.h" 18 19 namespace webrtc { 20 21 // S1T1 0 0 22 // /| /| / 23 // S1T0 0-+-0-+-0 24 // | | | | | ... 25 // S0T1 | 0 | 0 | 26 // |/ |/ |/ 27 // S0T0 0---0---0-- 28 // Time-> 0 1 2 3 4 29 class ScalabilityStructureL2T2 : public ScalableVideoController { 30 public: 31 ~ScalabilityStructureL2T2() override; 32 33 StreamLayersConfig StreamConfig() const override; 34 FrameDependencyStructure DependencyStructure() const override; 35 36 std::vector<LayerFrameConfig> NextFrameConfig(bool restart) override; 37 absl::optional<GenericFrameInfo> OnEncodeDone( 38 LayerFrameConfig config) override; 39 40 private: 41 enum FramePattern { 42 kKey, 43 kDeltaT1, 44 kDeltaT0, 45 }; 46 LayerFrameConfig KeyFrameConfig() const; 47 48 FramePattern next_pattern_ = kKey; 49 }; 50 51 } // namespace webrtc 52 53 #endif // MODULES_VIDEO_CODING_CODECS_AV1_SCALABILITY_STRUCTURE_L2T2_H_ 54