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_L1T3_H_ 11 #define MODULES_VIDEO_CODING_CODECS_AV1_SCALABILITY_STRUCTURE_L1T3_H_ 12 13 #include <vector> 14 15 #include "absl/types/optional.h" 16 #include "api/transport/rtp/dependency_descriptor.h" 17 #include "common_video/generic_frame_descriptor/generic_frame_info.h" 18 #include "modules/video_coding/codecs/av1/scalable_video_controller.h" 19 20 namespace webrtc { 21 22 // T2 0 0 0 0 23 // | / | / 24 // T1 / 0 / 0 ... 25 // |_/ |_/ 26 // T0 0-------0------ 27 // Time-> 0 1 2 3 4 5 6 7 28 class ScalabilityStructureL1T3 : public ScalableVideoController { 29 public: 30 ~ScalabilityStructureL1T3() override; 31 32 StreamLayersConfig StreamConfig() const override; 33 FrameDependencyStructure DependencyStructure() const override; 34 35 std::vector<LayerFrameConfig> NextFrameConfig(bool restart) override; 36 absl::optional<GenericFrameInfo> OnEncodeDone( 37 LayerFrameConfig config) override; 38 39 private: 40 enum FramePattern { 41 kKeyFrame, 42 kDeltaFrameT2A, 43 kDeltaFrameT1, 44 kDeltaFrameT2B, 45 kDeltaFrameT0, 46 }; 47 48 FramePattern next_pattern_ = kKeyFrame; 49 }; 50 51 } // namespace webrtc 52 53 #endif // MODULES_VIDEO_CODING_CODECS_AV1_SCALABILITY_STRUCTURE_L1T3_H_ 54