OLD | NEW |
---|---|
1 /* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 1 /* Copyright (c) 2011 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 the interface for doing temporal layers with VP8. | 10 * This file defines the interface for doing temporal layers with VP8. |
11 */ | 11 */ |
12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ | 12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ |
13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ | 13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ |
14 | 14 |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/common_video/include/video_image.h" | 17 #include "webrtc/common_video/include/video_image.h" |
18 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
19 | 19 |
20 struct vpx_codec_enc_cfg; | 20 struct vpx_codec_enc_cfg; |
21 typedef struct vpx_codec_enc_cfg vpx_codec_enc_cfg_t; | 21 typedef struct vpx_codec_enc_cfg vpx_codec_enc_cfg_t; |
22 | 22 |
23 namespace webrtc { | 23 namespace webrtc { |
24 | 24 |
25 struct CodecSpecificInfoVP8; | 25 struct CodecSpecificInfoVP8; |
26 | 26 |
27 // TODO(pbos): Remove along with layer_sync and freeze_entropy, they are | |
28 // derivable from picture_idx and should be exposed with | |
29 // TL::IsLayerSync(TL::FrameConfig). | |
30 enum TemporalFlags { kLayerSync = 1, kFreezeEntropy = 2 }; | |
31 | |
32 class TemporalLayers { | 27 class TemporalLayers { |
33 public: | 28 public: |
34 enum BufferFlags { | 29 enum BufferFlags { |
35 kNone = 0, | 30 kNone = 0, |
36 kReference = 1, | 31 kReference = 1, |
37 kUpdate = 2, | 32 kUpdate = 2, |
38 kReferenceAndUpdate = kReference | kUpdate, | 33 kReferenceAndUpdate = kReference | kUpdate, |
39 }; | 34 }; |
35 enum FreezeEntropy { kFreezeEntropy }; | |
40 | 36 |
41 struct FrameConfig { | 37 struct FrameConfig { |
42 FrameConfig(); | 38 FrameConfig(); |
43 | 39 |
44 FrameConfig(BufferFlags last, BufferFlags golden, BufferFlags arf); | 40 FrameConfig(BufferFlags last, BufferFlags golden, BufferFlags arf); |
45 FrameConfig(BufferFlags last, | 41 FrameConfig(BufferFlags last, |
46 BufferFlags golden, | 42 BufferFlags golden, |
47 BufferFlags arf, | 43 BufferFlags arf, |
48 int extra_flags); | 44 FreezeEntropy); |
sprang_webrtc
2017/05/04 12:32:55
This one was confused me. Makes the usage more rea
pbos-webrtc
2017/05/04 13:11:59
I'd like to not have kNoFreezeEntropy, so keeping
| |
49 | 45 |
50 bool drop_frame; | 46 bool drop_frame; |
51 BufferFlags last_buffer_flags; | 47 BufferFlags last_buffer_flags; |
52 BufferFlags golden_buffer_flags; | 48 BufferFlags golden_buffer_flags; |
53 BufferFlags arf_buffer_flags; | 49 BufferFlags arf_buffer_flags; |
54 | 50 |
55 // TODO(pbos): Consider breaking these out of here and returning only a | 51 // TODO(pbos): Consider breaking these out of here and returning only a |
56 // pattern index that needs to be returned to fill CodecSpecificInfoVP8 or | 52 // pattern index that needs to be returned to fill CodecSpecificInfoVP8 or |
57 // EncodeFlags. | 53 // EncodeFlags. |
58 bool layer_sync; | 54 bool layer_sync; |
59 bool freeze_entropy; | 55 bool freeze_entropy; |
60 | 56 |
61 int pattern_idx; | 57 int pattern_idx; |
62 | 58 |
63 private: | 59 private: |
64 FrameConfig(BufferFlags last, | 60 FrameConfig(BufferFlags last, |
65 BufferFlags golden, | 61 BufferFlags golden, |
66 BufferFlags arf, | 62 BufferFlags arf, |
67 bool layer_sync, | |
68 bool freeze_entropy); | 63 bool freeze_entropy); |
69 }; | 64 }; |
70 | 65 |
71 // Factory for TemporalLayer strategy. Default behavior is a fixed pattern | 66 // Factory for TemporalLayer strategy. Default behavior is a fixed pattern |
72 // of temporal layers. See default_temporal_layers.cc | 67 // of temporal layers. See default_temporal_layers.cc |
73 virtual ~TemporalLayers() {} | 68 virtual ~TemporalLayers() {} |
74 | 69 |
75 // Returns the recommended VP8 encode flags needed. May refresh the decoder | 70 // Returns the recommended VP8 encode flags needed. May refresh the decoder |
76 // and/or update the reference buffers. | 71 // and/or update the reference buffers. |
77 virtual FrameConfig UpdateLayerConfig(uint32_t timestamp) = 0; | 72 virtual FrameConfig UpdateLayerConfig(uint32_t timestamp) = 0; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 public: | 124 public: |
130 TemporalLayersListener() {} | 125 TemporalLayersListener() {} |
131 virtual ~TemporalLayersListener() {} | 126 virtual ~TemporalLayersListener() {} |
132 | 127 |
133 virtual void OnTemporalLayersCreated(int simulcast_id, | 128 virtual void OnTemporalLayersCreated(int simulcast_id, |
134 TemporalLayers* layers) = 0; | 129 TemporalLayers* layers) = 0; |
135 }; | 130 }; |
136 | 131 |
137 } // namespace webrtc | 132 } // namespace webrtc |
138 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ | 133 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_TEMPORAL_LAYERS_H_ |
OLD | NEW |