Chromium Code Reviews| 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 // log2 unit: e.g., 0 = 1 tile column, 1 = 2 tile columns, 2 = 4 tile columns. | 397 // log2 unit: e.g., 0 = 1 tile column, 1 = 2 tile columns, 2 = 4 tile columns. |
| 398 // The number tile columns will be capped by the encoder based on image size | 398 // The number tile columns will be capped by the encoder based on image size |
| 399 // (minimum width of tile column is 256 pixels, maximum is 4096). | 399 // (minimum width of tile column is 256 pixels, maximum is 4096). |
| 400 vpx_codec_control(encoder_, VP9E_SET_TILE_COLUMNS, (config_->g_threads >> 1)); | 400 vpx_codec_control(encoder_, VP9E_SET_TILE_COLUMNS, (config_->g_threads >> 1)); |
| 401 #if !defined(WEBRTC_ARCH_ARM) && !defined(WEBRTC_ARCH_ARM64) | 401 #if !defined(WEBRTC_ARCH_ARM) && !defined(WEBRTC_ARCH_ARM64) |
| 402 // Note denoiser is still off by default until further testing/optimization, | 402 // Note denoiser is still off by default until further testing/optimization, |
| 403 // i.e., codecSpecific.VP9.denoisingOn == 0. | 403 // i.e., codecSpecific.VP9.denoisingOn == 0. |
| 404 vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, | 404 vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, |
| 405 inst->codecSpecific.VP9.denoisingOn ? 1 : 0); | 405 inst->codecSpecific.VP9.denoisingOn ? 1 : 0); |
| 406 #endif | 406 #endif |
| 407 if (codec_.mode == kScreensharing) { | |
| 408 // Adjust internal parameters to screen content. | |
| 409 vpx_codec_control(encoder_, VP9E_SET_TUNE_CONTENT, 1); | |
| 410 // Let the encoder skip the encoding of very flat/low content blocks. | |
|
stefan-webrtc
2015/09/04 09:31:51
As you say, we probably want to do this for regula
ivica
2015/09/04 09:40:41
marpan@ told me to add this, and only for screensh
| |
| 411 vpx_codec_control(encoder_, VP8E_SET_STATIC_THRESHOLD, 1); | |
| 412 } | |
| 413 | |
| 407 inited_ = true; | 414 inited_ = true; |
| 408 return WEBRTC_VIDEO_CODEC_OK; | 415 return WEBRTC_VIDEO_CODEC_OK; |
| 409 } | 416 } |
| 410 | 417 |
| 411 uint32_t VP9EncoderImpl::MaxIntraTarget(uint32_t optimal_buffer_size) { | 418 uint32_t VP9EncoderImpl::MaxIntraTarget(uint32_t optimal_buffer_size) { |
| 412 // Set max to the optimal buffer level (normalized by target BR), | 419 // Set max to the optimal buffer level (normalized by target BR), |
| 413 // and scaled by a scale_par. | 420 // and scaled by a scale_par. |
| 414 // Max target size = scale_par * optimal_buffer_size * targetBR[Kbps]. | 421 // Max target size = scale_par * optimal_buffer_size * targetBR[Kbps]. |
| 415 // This value is presented in percentage of perFrameBw: | 422 // This value is presented in percentage of perFrameBw: |
| 416 // perFrameBw = targetBR[Kbps] * 1000 / framerate. | 423 // perFrameBw = targetBR[Kbps] * 1000 / framerate. |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 776 decoder_ = NULL; | 783 decoder_ = NULL; |
| 777 } | 784 } |
| 778 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers | 785 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers |
| 779 // still referenced externally are deleted once fully released, not returning | 786 // still referenced externally are deleted once fully released, not returning |
| 780 // to the pool. | 787 // to the pool. |
| 781 frame_buffer_pool_.ClearPool(); | 788 frame_buffer_pool_.ClearPool(); |
| 782 inited_ = false; | 789 inited_ = false; |
| 783 return WEBRTC_VIDEO_CODEC_OK; | 790 return WEBRTC_VIDEO_CODEC_OK; |
| 784 } | 791 } |
| 785 } // namespace webrtc | 792 } // namespace webrtc |
| OLD | NEW |