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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // (actual memory is not allocated). | 291 // (actual memory is not allocated). |
292 raw_ = vpx_img_wrap(NULL, VPX_IMG_FMT_I420, codec_.width, codec_.height, 1, | 292 raw_ = vpx_img_wrap(NULL, VPX_IMG_FMT_I420, codec_.width, codec_.height, 1, |
293 NULL); | 293 NULL); |
294 // Populate encoder configuration with default values. | 294 // Populate encoder configuration with default values. |
295 if (vpx_codec_enc_config_default(vpx_codec_vp9_cx(), config_, 0)) { | 295 if (vpx_codec_enc_config_default(vpx_codec_vp9_cx(), config_, 0)) { |
296 return WEBRTC_VIDEO_CODEC_ERROR; | 296 return WEBRTC_VIDEO_CODEC_ERROR; |
297 } | 297 } |
298 config_->g_w = codec_.width; | 298 config_->g_w = codec_.width; |
299 config_->g_h = codec_.height; | 299 config_->g_h = codec_.height; |
300 config_->rc_target_bitrate = inst->startBitrate; // in kbit/s | 300 config_->rc_target_bitrate = inst->startBitrate; // in kbit/s |
301 config_->g_error_resilient = 1; | 301 config_->g_error_resilient = inst->VP9().resilienceOn ? 1 : 0; |
302 // Setting the time base of the codec. | 302 // Setting the time base of the codec. |
303 config_->g_timebase.num = 1; | 303 config_->g_timebase.num = 1; |
304 config_->g_timebase.den = 90000; | 304 config_->g_timebase.den = 90000; |
305 config_->g_lag_in_frames = 0; // 0- no frame lagging | 305 config_->g_lag_in_frames = 0; // 0- no frame lagging |
306 config_->g_threads = 1; | 306 config_->g_threads = 1; |
307 // Rate control settings. | 307 // Rate control settings. |
308 config_->rc_dropframe_thresh = inst->VP9().frameDroppingOn ? 30 : 0; | 308 config_->rc_dropframe_thresh = inst->VP9().frameDroppingOn ? 30 : 0; |
309 config_->rc_end_usage = VPX_CBR; | 309 config_->rc_end_usage = VPX_CBR; |
310 config_->g_pass = VPX_RC_ONE_PASS; | 310 config_->g_pass = VPX_RC_ONE_PASS; |
311 config_->rc_min_quantizer = 2; | 311 config_->rc_min_quantizer = 2; |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 frame_buffer_pool_.ClearPool(); | 999 frame_buffer_pool_.ClearPool(); |
1000 inited_ = false; | 1000 inited_ = false; |
1001 return WEBRTC_VIDEO_CODEC_OK; | 1001 return WEBRTC_VIDEO_CODEC_OK; |
1002 } | 1002 } |
1003 | 1003 |
1004 const char* VP9DecoderImpl::ImplementationName() const { | 1004 const char* VP9DecoderImpl::ImplementationName() const { |
1005 return "libvpx"; | 1005 return "libvpx"; |
1006 } | 1006 } |
1007 | 1007 |
1008 } // namespace webrtc | 1008 } // namespace webrtc |
OLD | NEW |