OLD | NEW |
1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
2 * | 2 * |
3 * Use of this source code is governed by a BSD-style license | 3 * Use of this source code is governed by a BSD-style license |
4 * that can be found in the LICENSE file in the root of the source | 4 * that can be found in the LICENSE file in the root of the source |
5 * tree. An additional intellectual property rights grant can be found | 5 * tree. An additional intellectual property rights grant can be found |
6 * in the file PATENTS. All contributing project authors may | 6 * in the file PATENTS. All contributing project authors may |
7 * be found in the AUTHORS file in the root of the source tree. | 7 * be found in the AUTHORS file in the root of the source tree. |
8 */ | 8 */ |
9 /* | 9 /* |
10 * This file defines classes for doing temporal layers with VP8. | 10 * This file defines classes for doing temporal layers with VP8. |
11 */ | 11 */ |
12 #ifndef MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ | 12 #ifndef MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ |
13 #define MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ | 13 #define MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ |
14 | 14 |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "modules/video_coding/codecs/vp8/temporal_layers.h" | 17 #include "modules/video_coding/codecs/vp8/temporal_layers.h" |
18 | 18 |
19 #include "api/optional.h" | 19 #include "api/optional.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
(...skipping 30 matching lines...) Expand all Loading... |
52 const std::vector<unsigned int> temporal_ids_; | 52 const std::vector<unsigned int> temporal_ids_; |
53 const std::vector<bool> temporal_layer_sync_; | 53 const std::vector<bool> temporal_layer_sync_; |
54 const std::vector<TemporalLayers::FrameConfig> temporal_pattern_; | 54 const std::vector<TemporalLayers::FrameConfig> temporal_pattern_; |
55 | 55 |
56 uint8_t tl0_pic_idx_; | 56 uint8_t tl0_pic_idx_; |
57 uint8_t pattern_idx_; | 57 uint8_t pattern_idx_; |
58 bool last_base_layer_sync_; | 58 bool last_base_layer_sync_; |
59 rtc::Optional<std::vector<uint32_t>> new_bitrates_kbps_; | 59 rtc::Optional<std::vector<uint32_t>> new_bitrates_kbps_; |
60 }; | 60 }; |
61 | 61 |
| 62 class DefaultTemporalLayersChecker : public TemporalLayersChecker { |
| 63 public: |
| 64 DefaultTemporalLayersChecker(int number_of_temporal_layers, |
| 65 uint8_t initial_tl0_pic_idx); |
| 66 bool CheckOnFrameEncoded(bool frame_is_keyframe, |
| 67 CodecSpecificInfoVP8& codec_specific, |
| 68 TemporalLayers::FrameConfig& frame_config) override; |
| 69 |
| 70 private: |
| 71 struct BufferState { |
| 72 BufferState() |
| 73 : is_updated_this_cycle(false), is_keyframe(false), pattern_idx(0) {} |
| 74 |
| 75 bool is_updated_this_cycle; |
| 76 bool is_keyframe; |
| 77 uint8_t pattern_idx; |
| 78 }; |
| 79 const size_t num_layers_; |
| 80 const std::vector<unsigned int> temporal_ids_; |
| 81 const std::vector<std::vector<uint8_t>> temporal_dependencies_; |
| 82 BufferState last_; |
| 83 BufferState arf_; |
| 84 BufferState golden_; |
| 85 uint8_t tl0_pic_idx_; |
| 86 uint8_t pattern_idx_; |
| 87 }; |
| 88 |
62 } // namespace webrtc | 89 } // namespace webrtc |
63 #endif // MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ | 90 #endif // MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ |
OLD | NEW |