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

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

Issue 2769263002: Base screenshare layers on TemporalReferences. (Closed)
Patch Set: 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/temporal_layers.h
diff --git a/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h b/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h
index bf3e49aed6618f3aaf447bf4909e42303910e114..df683e52503eab88a765a96eb94427ed10d221ec 100644
--- a/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h
+++ b/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h
@@ -24,6 +24,46 @@ namespace webrtc {
struct CodecSpecificInfoVP8;
+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 drop_frame;
+ const bool reference_last;
+ const bool update_last;
+ const bool reference_golden;
+ const bool update_golden;
+ const bool reference_arf;
+ const bool update_arf;
sprang_webrtc 2017/03/26 12:20:08 Would it make sense to only store TemporalBufferUs
pbos-webrtc 2017/03/27 16:31:07 Yes, since they can be checked as a bitmask we hav
+
+ // 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 TemporalLayers {
public:
// Factory for TemporalLayer strategy. Default behavior is a fixed pattern
@@ -32,7 +72,9 @@ class TemporalLayers {
// Returns the recommended VP8 encode flags needed. May refresh the decoder
// and/or update the reference buffers.
- virtual int EncodeFlags(uint32_t timestamp) = 0;
+ virtual TemporalReferences GetLayerConfig(uint32_t timestamp) = 0;
+
+ int EncodeFlags(uint32_t timestamp);
// Update state based on new bitrate target and incoming framerate.
// Returns the bitrate allocation for the active temporal layers.
@@ -44,11 +86,11 @@ class TemporalLayers {
// Returns true iff the configuration was actually modified.
virtual bool UpdateConfiguration(vpx_codec_enc_cfg_t* cfg) = 0;
- virtual void PopulateCodecSpecific(bool base_layer_sync,
+ virtual void PopulateCodecSpecific(bool is_keyframe,
CodecSpecificInfoVP8* vp8_info,
uint32_t timestamp) = 0;
- virtual void FrameEncoded(unsigned int size, uint32_t timestamp, int qp) = 0;
+ virtual void FrameEncoded(unsigned int size, int qp) = 0;
virtual int CurrentLayerId() const = 0;
};

Powered by Google App Engine
This is Rietveld 408576698