OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 */ | 10 */ |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // - optimal_buffer_size : Optimal buffer size | 100 // - optimal_buffer_size : Optimal buffer size |
101 // Return Value : Max target size for Intra frames represented as | 101 // Return Value : Max target size for Intra frames represented as |
102 // percentage of the per frame bandwidth | 102 // percentage of the per frame bandwidth |
103 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size); | 103 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size); |
104 | 104 |
105 EncodedImage encoded_image_; | 105 EncodedImage encoded_image_; |
106 EncodedImageCallback* encoded_complete_callback_; | 106 EncodedImageCallback* encoded_complete_callback_; |
107 VideoCodec codec_; | 107 VideoCodec codec_; |
108 bool inited_; | 108 bool inited_; |
109 int64_t timestamp_; | 109 int64_t timestamp_; |
110 uint16_t picture_id_; | |
111 int cpu_speed_; | 110 int cpu_speed_; |
112 uint32_t rc_max_intra_target_; | 111 uint32_t rc_max_intra_target_; |
113 vpx_codec_ctx_t* encoder_; | 112 vpx_codec_ctx_t* encoder_; |
114 vpx_codec_enc_cfg_t* config_; | 113 vpx_codec_enc_cfg_t* config_; |
115 vpx_image_t* raw_; | 114 vpx_image_t* raw_; |
116 vpx_svc_extra_cfg_t svc_params_; | 115 vpx_svc_extra_cfg_t svc_params_; |
117 const VideoFrame* input_image_; | 116 const VideoFrame* input_image_; |
118 GofInfoVP9 gof_; // Contains each frame's temporal information for | 117 GofInfoVP9 gof_; // Contains each frame's temporal information for |
119 // non-flexible mode. | 118 // non-flexible mode. |
120 uint8_t tl0_pic_idx_; // Only used in non-flexible mode. | |
121 size_t frames_since_kf_; | 119 size_t frames_since_kf_; |
122 uint8_t num_temporal_layers_; | 120 uint8_t num_temporal_layers_; |
123 uint8_t num_spatial_layers_; | 121 uint8_t num_spatial_layers_; |
124 | 122 |
125 // Used for flexible mode. | 123 // Used for flexible mode. |
126 bool is_flexible_mode_; | 124 bool is_flexible_mode_; |
127 int64_t buffer_updated_at_frame_[kNumVp9Buffers]; | 125 int64_t buffer_updated_at_frame_[kNumVp9Buffers]; |
128 int64_t frames_encoded_; | 126 int64_t frames_encoded_; |
129 uint8_t num_ref_pics_[kMaxVp9NumberOfSpatialLayers]; | 127 uint8_t num_ref_pics_[kMaxVp9NumberOfSpatialLayers]; |
130 uint8_t p_diff_[kMaxVp9NumberOfSpatialLayers][kMaxVp9RefPics]; | 128 uint8_t p_diff_[kMaxVp9NumberOfSpatialLayers][kMaxVp9RefPics]; |
131 std::unique_ptr<ScreenshareLayersVP9> spatial_layer_; | 129 std::unique_ptr<ScreenshareLayersVP9> spatial_layer_; |
| 130 |
| 131 // RTP state. |
| 132 uint16_t picture_id_; |
| 133 uint8_t tl0_pic_idx_; // Only used in non-flexible mode. |
132 }; | 134 }; |
133 | 135 |
134 class VP9DecoderImpl : public VP9Decoder { | 136 class VP9DecoderImpl : public VP9Decoder { |
135 public: | 137 public: |
136 VP9DecoderImpl(); | 138 VP9DecoderImpl(); |
137 | 139 |
138 virtual ~VP9DecoderImpl(); | 140 virtual ~VP9DecoderImpl(); |
139 | 141 |
140 int InitDecode(const VideoCodec* inst, int number_of_cores) override; | 142 int InitDecode(const VideoCodec* inst, int number_of_cores) override; |
141 | 143 |
(...skipping 19 matching lines...) Expand all Loading... |
161 Vp9FrameBufferPool frame_buffer_pool_; | 163 Vp9FrameBufferPool frame_buffer_pool_; |
162 DecodedImageCallback* decode_complete_callback_; | 164 DecodedImageCallback* decode_complete_callback_; |
163 bool inited_; | 165 bool inited_; |
164 vpx_codec_ctx_t* decoder_; | 166 vpx_codec_ctx_t* decoder_; |
165 VideoCodec codec_; | 167 VideoCodec codec_; |
166 bool key_frame_required_; | 168 bool key_frame_required_; |
167 }; | 169 }; |
168 } // namespace webrtc | 170 } // namespace webrtc |
169 | 171 |
170 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_IMPL_H_ | 172 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP9_VP9_IMPL_H_ |
OLD | NEW |