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

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

Issue 2510583002: Reland #2 of Issue 2434073003: Extract bitrate allocation ... (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 * 9 *
10 * WEBRTC VP8 wrapper interface 10 * WEBRTC VP8 wrapper interface
(...skipping 14 matching lines...) Expand all
25 25
26 #include "webrtc/common_video/include/i420_buffer_pool.h" 26 #include "webrtc/common_video/include/i420_buffer_pool.h"
27 #include "webrtc/modules/video_coding/include/video_codec_interface.h" 27 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
28 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" 28 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
29 #include "webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h" 29 #include "webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h"
30 #include "webrtc/modules/video_coding/utility/quality_scaler.h" 30 #include "webrtc/modules/video_coding/utility/quality_scaler.h"
31 #include "webrtc/video_frame.h" 31 #include "webrtc/video_frame.h"
32 32
33 namespace webrtc { 33 namespace webrtc {
34 34
35 class SimulcastRateAllocator;
36 class TemporalLayers; 35 class TemporalLayers;
37 36
38 class VP8EncoderImpl : public VP8Encoder { 37 class VP8EncoderImpl : public VP8Encoder {
39 public: 38 public:
40 VP8EncoderImpl(); 39 VP8EncoderImpl();
41 40
42 virtual ~VP8EncoderImpl(); 41 virtual ~VP8EncoderImpl();
43 42
44 int Release() override; 43 int Release() override;
45 44
46 int InitEncode(const VideoCodec* codec_settings, 45 int InitEncode(const VideoCodec* codec_settings,
47 int number_of_cores, 46 int number_of_cores,
48 size_t max_payload_size) override; 47 size_t max_payload_size) override;
49 48
50 int Encode(const VideoFrame& input_image, 49 int Encode(const VideoFrame& input_image,
51 const CodecSpecificInfo* codec_specific_info, 50 const CodecSpecificInfo* codec_specific_info,
52 const std::vector<FrameType>* frame_types) override; 51 const std::vector<FrameType>* frame_types) override;
53 52
54 int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override; 53 int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
55 54
56 int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; 55 int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
57 56
58 int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate) override; 57 int SetRateAllocation(const BitrateAllocation& bitrate,
58 uint32_t new_framerate) override;
59 59
60 void OnDroppedFrame() override; 60 void OnDroppedFrame() override;
61 61
62 const char* ImplementationName() const override; 62 const char* ImplementationName() const override;
63 63
64 private: 64 private:
65 void SetupTemporalLayers(int num_streams, 65 void SetupTemporalLayers(int num_streams,
66 int num_temporal_layers, 66 int num_temporal_layers,
67 const VideoCodec& codec); 67 const VideoCodec& codec);
68 68
(...skipping 18 matching lines...) Expand all
87 int GetEncodedPartitions(const VideoFrame& input_image, 87 int GetEncodedPartitions(const VideoFrame& input_image,
88 bool only_predicting_from_key_frame); 88 bool only_predicting_from_key_frame);
89 89
90 // Set the stream state for stream |stream_idx|. 90 // Set the stream state for stream |stream_idx|.
91 void SetStreamState(bool send_stream, int stream_idx); 91 void SetStreamState(bool send_stream, int stream_idx);
92 92
93 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size); 93 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size);
94 94
95 EncodedImageCallback* encoded_complete_callback_; 95 EncodedImageCallback* encoded_complete_callback_;
96 VideoCodec codec_; 96 VideoCodec codec_;
97 std::unique_ptr<SimulcastRateAllocator> rate_allocator_;
98 bool inited_; 97 bool inited_;
99 int64_t timestamp_; 98 int64_t timestamp_;
100 bool feedback_mode_; 99 bool feedback_mode_;
101 int qp_max_; 100 int qp_max_;
102 int cpu_speed_default_; 101 int cpu_speed_default_;
103 int number_of_cores_; 102 int number_of_cores_;
104 uint32_t rc_max_intra_target_; 103 uint32_t rc_max_intra_target_;
105 int token_partitions_; 104 int token_partitions_;
106 ReferencePictureSelection rps_; 105 ReferencePictureSelection rps_;
107 std::vector<TemporalLayers*> temporal_layers_; 106 std::vector<TemporalLayers*> temporal_layers_;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 int image_format_; 161 int image_format_;
163 vpx_ref_frame_t* ref_frame_; 162 vpx_ref_frame_t* ref_frame_;
164 int propagation_cnt_; 163 int propagation_cnt_;
165 int last_frame_width_; 164 int last_frame_width_;
166 int last_frame_height_; 165 int last_frame_height_;
167 bool key_frame_required_; 166 bool key_frame_required_;
168 }; // end of VP8DecoderImpl class 167 }; // end of VP8DecoderImpl class
169 } // namespace webrtc 168 } // namespace webrtc
170 169
171 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_VP8_IMPL_H_ 170 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_VP8_IMPL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc ('k') | webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698