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 17 matching lines...) Expand all Loading... |
28 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 28 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
29 #include "webrtc/modules/include/module_common_types.h" | 29 #include "webrtc/modules/include/module_common_types.h" |
30 #include "webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h" | 30 #include "webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h" |
31 #include "webrtc/system_wrappers/include/tick_util.h" | 31 #include "webrtc/system_wrappers/include/tick_util.h" |
32 | 32 |
33 namespace webrtc { | 33 namespace webrtc { |
34 | 34 |
35 // Only positive speeds, range for real-time coding currently is: 5 - 8. | 35 // Only positive speeds, range for real-time coding currently is: 5 - 8. |
36 // Lower means slower/better quality, higher means fastest/lower quality. | 36 // Lower means slower/better quality, higher means fastest/lower quality. |
37 int GetCpuSpeed(int width, int height) { | 37 int GetCpuSpeed(int width, int height) { |
38 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) | 38 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) || defined(ANDROID) |
39 return 8; | 39 return 8; |
40 #else | 40 #else |
41 // For smaller resolutions, use lower speed setting (get some coding gain at | 41 // For smaller resolutions, use lower speed setting (get some coding gain at |
42 // the cost of increased encoding complexity). | 42 // the cost of increased encoding complexity). |
43 if (width * height <= 352 * 288) | 43 if (width * height <= 352 * 288) |
44 return 5; | 44 return 5; |
45 else | 45 else |
46 return 7; | 46 return 7; |
47 #endif | 47 #endif |
48 } | 48 } |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 VP9EncoderImpl::EncoderOutputCodedPacketCallback, | 433 VP9EncoderImpl::EncoderOutputCodedPacketCallback, |
434 reinterpret_cast<void*>(this)}; | 434 reinterpret_cast<void*>(this)}; |
435 vpx_codec_control(encoder_, VP9E_REGISTER_CX_CALLBACK, | 435 vpx_codec_control(encoder_, VP9E_REGISTER_CX_CALLBACK, |
436 reinterpret_cast<void*>(&cbp)); | 436 reinterpret_cast<void*>(&cbp)); |
437 | 437 |
438 // Control function to set the number of column tiles in encoding a frame, in | 438 // Control function to set the number of column tiles in encoding a frame, in |
439 // log2 unit: e.g., 0 = 1 tile column, 1 = 2 tile columns, 2 = 4 tile columns. | 439 // log2 unit: e.g., 0 = 1 tile column, 1 = 2 tile columns, 2 = 4 tile columns. |
440 // The number tile columns will be capped by the encoder based on image size | 440 // The number tile columns will be capped by the encoder based on image size |
441 // (minimum width of tile column is 256 pixels, maximum is 4096). | 441 // (minimum width of tile column is 256 pixels, maximum is 4096). |
442 vpx_codec_control(encoder_, VP9E_SET_TILE_COLUMNS, (config_->g_threads >> 1)); | 442 vpx_codec_control(encoder_, VP9E_SET_TILE_COLUMNS, (config_->g_threads >> 1)); |
443 #if !defined(WEBRTC_ARCH_ARM) && !defined(WEBRTC_ARCH_ARM64) | 443 #if !defined(WEBRTC_ARCH_ARM) && !defined(WEBRTC_ARCH_ARM64) && \ |
| 444 !defined(ANDROID) |
444 // Note denoiser is still off by default until further testing/optimization, | 445 // Note denoiser is still off by default until further testing/optimization, |
445 // i.e., codecSpecific.VP9.denoisingOn == 0. | 446 // i.e., codecSpecific.VP9.denoisingOn == 0. |
446 vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, | 447 vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, |
447 inst->codecSpecific.VP9.denoisingOn ? 1 : 0); | 448 inst->codecSpecific.VP9.denoisingOn ? 1 : 0); |
448 #endif | 449 #endif |
449 if (codec_.mode == kScreensharing) { | 450 if (codec_.mode == kScreensharing) { |
450 // Adjust internal parameters to screen content. | 451 // Adjust internal parameters to screen content. |
451 vpx_codec_control(encoder_, VP9E_SET_TUNE_CONTENT, 1); | 452 vpx_codec_control(encoder_, VP9E_SET_TUNE_CONTENT, 1); |
452 } | 453 } |
453 // Enable encoder skip of static/low content blocks. | 454 // Enable encoder skip of static/low content blocks. |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 frame_buffer_pool_.ClearPool(); | 979 frame_buffer_pool_.ClearPool(); |
979 inited_ = false; | 980 inited_ = false; |
980 return WEBRTC_VIDEO_CODEC_OK; | 981 return WEBRTC_VIDEO_CODEC_OK; |
981 } | 982 } |
982 | 983 |
983 const char* VP9DecoderImpl::ImplementationName() const { | 984 const char* VP9DecoderImpl::ImplementationName() const { |
984 return "libvpx"; | 985 return "libvpx"; |
985 } | 986 } |
986 | 987 |
987 } // namespace webrtc | 988 } // namespace webrtc |
OLD | NEW |