Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc

Issue 1841993005: Use mobile platform settings for VP8 and VP9 decoders on all Android builds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698