Index: webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h |
diff --git a/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h b/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h |
index 0cd0b06451045560b55a235dff4f89d39902510c..446d162c3e8ce9a4370cacfda0e14405e5f9915a 100644 |
--- a/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h |
+++ b/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h |
@@ -20,6 +20,44 @@ |
namespace webrtc { |
+enum TemporalBufferUsage { |
+ kNone = 0, |
+ kReference = 1, |
+ kUpdate = 2, |
+ kReferenceAndUpdate = kReference | kUpdate, |
+}; |
+enum TemporalFlags { kLayerSync = 1, kFreezeEntropy = 2 }; |
+ |
+struct TemporalReferences { |
+ TemporalReferences(TemporalBufferUsage last, |
+ TemporalBufferUsage golden, |
+ TemporalBufferUsage arf); |
+ TemporalReferences(TemporalBufferUsage last, |
+ TemporalBufferUsage golden, |
+ TemporalBufferUsage arf, |
+ int extra_flags); |
+ |
+ const bool reference_last; |
+ const bool update_last; |
+ const bool reference_golden; |
+ const bool update_golden; |
+ const bool reference_arf; |
+ const bool update_arf; |
+ |
+ // TODO(pbos): Consider breaking these out of here and returning only a |
+ // pattern index that needs to be returned to fill CodecSpecificInfoVP8 or |
+ // EncodeFlags. |
+ const bool layer_sync; |
+ const bool freeze_entropy; |
+ |
+ private: |
+ TemporalReferences(TemporalBufferUsage last, |
+ TemporalBufferUsage golden, |
+ TemporalBufferUsage arf, |
+ bool layer_sync, |
+ bool freeze_entropy); |
+}; |
+ |
class DefaultTemporalLayers : public TemporalLayers { |
public: |
DefaultTemporalLayers(int number_of_temporal_layers, |
@@ -47,46 +85,10 @@ class DefaultTemporalLayers : public TemporalLayers { |
int CurrentLayerId() const override; |
private: |
- enum TemporalReferences { |
- // For 1 layer case: reference all (last, golden, and alt ref), but only |
- // update last. |
- kTemporalUpdateLastRefAll = 12, |
- // First base layer frame for 3 temporal layers, which updates last and |
- // golden with alt ref dependency. |
- kTemporalUpdateLastAndGoldenRefAltRef = 11, |
- // First enhancement layer with alt ref dependency. |
- kTemporalUpdateGoldenRefAltRef = 10, |
- // First enhancement layer with alt ref dependency. |
- kTemporalUpdateGoldenWithoutDependencyRefAltRef = 9, |
- // Base layer with alt ref dependency. |
- kTemporalUpdateLastRefAltRef = 8, |
- // Highest enhacement layer without dependency on golden with alt ref |
- // dependency. |
- kTemporalUpdateNoneNoRefGoldenRefAltRef = 7, |
- // Second layer and last frame in cycle, for 2 layers. |
- kTemporalUpdateNoneNoRefAltref = 6, |
- // Highest enhancement layer. |
- kTemporalUpdateNone = 5, |
- // Second enhancement layer. |
- kTemporalUpdateAltref = 4, |
- // Second enhancement layer without dependency on previous frames in |
- // the second enhancement layer. |
- kTemporalUpdateAltrefWithoutDependency = 3, |
- // First enhancement layer. |
- kTemporalUpdateGolden = 2, |
- // First enhancement layer without dependency on previous frames in |
- // the first enhancement layer. |
- kTemporalUpdateGoldenWithoutDependency = 1, |
- // Base layer. |
- kTemporalUpdateLast = 0, |
- }; |
- enum { kMaxTemporalPattern = 16 }; |
- |
- const int number_of_temporal_layers_; |
- int temporal_ids_length_; |
- int temporal_ids_[kMaxTemporalPattern]; |
- int temporal_pattern_length_; |
- TemporalReferences temporal_pattern_[kMaxTemporalPattern]; |
+ const size_t num_layers_; |
+ const std::vector<unsigned int> temporal_ids_; |
+ const std::vector<TemporalReferences> temporal_pattern_; |
+ |
uint8_t tl0_pic_idx_; |
uint8_t pattern_idx_; |
uint32_t timestamp_; |