Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h

Issue 2747123005: Simplify default temporal layers. (Closed)
Patch Set: move GetTemporalPattern out of class Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8d94008f3b1484b6c3b639572d4a723e4289b8cb 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,40 @@
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;
pbos-webrtc 2017/03/17 18:03:44 The idea is that these bools here are easier to un
+ const bool update_last;
+ const bool reference_golden;
+ const bool update_golden;
brandtr 2017/03/21 12:20:09 I like these names instead of "buffer 0, 1, 2". Wh
pbos-webrtc 2017/03/21 17:37:46 Potentially that the buffer used doesn't really ma
+ const bool reference_arf;
+ const bool update_arf;
+ 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 +81,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_;

Powered by Google App Engine
This is Rietveld 408576698