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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h

Issue 1193513006: In screenshare mode, suppress VP8 bitrate overshoot and increase quality (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years, 6 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 unified diff | Download patch
OLDNEW
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 WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ 12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_
13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ 13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_
14 14
15 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" 15 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
16 16
17 namespace webrtc { 17 namespace webrtc {
18 18
19 class DefaultTemporalLayers : public TemporalLayers { 19 class DefaultTemporalLayers : public TemporalLayers {
20 public: 20 public:
21 DefaultTemporalLayers(int number_of_temporal_layers, 21 DefaultTemporalLayers(int number_of_temporal_layers,
22 uint8_t initial_tl0_pic_idx); 22 uint8_t initial_tl0_pic_idx);
23 virtual ~DefaultTemporalLayers() {} 23 virtual ~DefaultTemporalLayers() {}
24 24
25 // Returns the recommended VP8 encode flags needed. May refresh the decoder 25 // Returns the recommended VP8 encode flags needed. May refresh the decoder
26 // and/or update the reference buffers. 26 // and/or update the reference buffers.
27 virtual int EncodeFlags(uint32_t timestamp); 27 int EncodeFlags(uint32_t timestamp) override;
28 28
29 virtual bool ConfigureBitrates(int bitrate_kbit, 29 bool ConfigureBitrates(int bitrate_kbit,
30 int max_bitrate_kbit, 30 int max_bitrate_kbit,
31 int framerate, 31 int framerate,
32 vpx_codec_enc_cfg_t* cfg); 32 vpx_codec_enc_cfg_t* cfg) override;
33 33
34 virtual void PopulateCodecSpecific(bool base_layer_sync, 34 void PopulateCodecSpecific(bool base_layer_sync,
35 CodecSpecificInfoVP8* vp8_info, 35 CodecSpecificInfoVP8* vp8_info,
36 uint32_t timestamp); 36 uint32_t timestamp) override;
37 37
38 virtual void FrameEncoded(unsigned int size, uint32_t timestamp) {} 38 void FrameEncoded(unsigned int size, uint32_t timestamp, int qp) override {}
39 39
40 virtual int CurrentLayerId() const; 40 bool UpdateConfiguration(vpx_codec_enc_cfg_t* cfg) override { return false; }
41
42 int CurrentLayerId() const override;
41 43
42 private: 44 private:
43 enum TemporalReferences { 45 enum TemporalReferences {
44 // For 1 layer case: reference all (last, golden, and alt ref), but only 46 // For 1 layer case: reference all (last, golden, and alt ref), but only
45 // update last. 47 // update last.
46 kTemporalUpdateLastRefAll = 12, 48 kTemporalUpdateLastRefAll = 12,
47 // First base layer frame for 3 temporal layers, which updates last and 49 // First base layer frame for 3 temporal layers, which updates last and
48 // golden with alt ref dependency. 50 // golden with alt ref dependency.
49 kTemporalUpdateLastAndGoldenRefAltRef = 11, 51 kTemporalUpdateLastAndGoldenRefAltRef = 11,
50 // First enhancement layer with alt ref dependency. 52 // First enhancement layer with alt ref dependency.
(...skipping 30 matching lines...) Expand all
81 int temporal_pattern_length_; 83 int temporal_pattern_length_;
82 TemporalReferences temporal_pattern_[kMaxTemporalPattern]; 84 TemporalReferences temporal_pattern_[kMaxTemporalPattern];
83 uint8_t tl0_pic_idx_; 85 uint8_t tl0_pic_idx_;
84 uint8_t pattern_idx_; 86 uint8_t pattern_idx_;
85 uint32_t timestamp_; 87 uint32_t timestamp_;
86 bool last_base_layer_sync_; 88 bool last_base_layer_sync_;
87 }; 89 };
88 90
89 } // namespace webrtc 91 } // namespace webrtc
90 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_ 92 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_DEFAULT_TEMPORAL_LAYERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698