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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 vpx_codec_control(encoder_, VP9E_SET_TILE_COLUMNS, (config_->g_threads >> 1)); | 395 vpx_codec_control(encoder_, VP9E_SET_TILE_COLUMNS, (config_->g_threads >> 1)); |
396 #if !defined(WEBRTC_ARCH_ARM) && !defined(WEBRTC_ARCH_ARM64) | 396 #if !defined(WEBRTC_ARCH_ARM) && !defined(WEBRTC_ARCH_ARM64) |
397 // Note denoiser is still off by default until further testing/optimization, | 397 // Note denoiser is still off by default until further testing/optimization, |
398 // i.e., codecSpecific.VP9.denoisingOn == 0. | 398 // i.e., codecSpecific.VP9.denoisingOn == 0. |
399 vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, | 399 vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, |
400 inst->codecSpecific.VP9.denoisingOn ? 1 : 0); | 400 inst->codecSpecific.VP9.denoisingOn ? 1 : 0); |
401 #endif | 401 #endif |
402 if (codec_.mode == kScreensharing) { | 402 if (codec_.mode == kScreensharing) { |
403 // Adjust internal parameters to screen content. | 403 // Adjust internal parameters to screen content. |
404 vpx_codec_control(encoder_, VP9E_SET_TUNE_CONTENT, 1); | 404 vpx_codec_control(encoder_, VP9E_SET_TUNE_CONTENT, 1); |
405 // Let the encoder skip the encoding of very flat/low content blocks. | |
406 vpx_codec_control(encoder_, VP8E_SET_STATIC_THRESHOLD, 1); | |
407 } | 405 } |
408 | 406 // Enable encoder skip of static/low content blocks. |
| 407 vpx_codec_control(encoder_, VP8E_SET_STATIC_THRESHOLD, 1); |
409 inited_ = true; | 408 inited_ = true; |
410 return WEBRTC_VIDEO_CODEC_OK; | 409 return WEBRTC_VIDEO_CODEC_OK; |
411 } | 410 } |
412 | 411 |
413 uint32_t VP9EncoderImpl::MaxIntraTarget(uint32_t optimal_buffer_size) { | 412 uint32_t VP9EncoderImpl::MaxIntraTarget(uint32_t optimal_buffer_size) { |
414 // Set max to the optimal buffer level (normalized by target BR), | 413 // Set max to the optimal buffer level (normalized by target BR), |
415 // and scaled by a scale_par. | 414 // and scaled by a scale_par. |
416 // Max target size = scale_par * optimal_buffer_size * targetBR[Kbps]. | 415 // Max target size = scale_par * optimal_buffer_size * targetBR[Kbps]. |
417 // This value is presented in percentage of perFrameBw: | 416 // This value is presented in percentage of perFrameBw: |
418 // perFrameBw = targetBR[Kbps] * 1000 / framerate. | 417 // perFrameBw = targetBR[Kbps] * 1000 / framerate. |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 decoder_ = NULL; | 779 decoder_ = NULL; |
781 } | 780 } |
782 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers | 781 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers |
783 // still referenced externally are deleted once fully released, not returning | 782 // still referenced externally are deleted once fully released, not returning |
784 // to the pool. | 783 // to the pool. |
785 frame_buffer_pool_.ClearPool(); | 784 frame_buffer_pool_.ClearPool(); |
786 inited_ = false; | 785 inited_ = false; |
787 return WEBRTC_VIDEO_CODEC_OK; | 786 return WEBRTC_VIDEO_CODEC_OK; |
788 } | 787 } |
789 } // namespace webrtc | 788 } // namespace webrtc |
OLD | NEW |