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 18 matching lines...) Expand all Loading... |
29 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 29 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
30 #include "webrtc/modules/include/module_common_types.h" | 30 #include "webrtc/modules/include/module_common_types.h" |
31 #include "webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h" | 31 #include "webrtc/modules/video_coding/codecs/vp9/screenshare_layers.h" |
32 #include "webrtc/system_wrappers/include/tick_util.h" | 32 #include "webrtc/system_wrappers/include/tick_util.h" |
33 | 33 |
34 namespace webrtc { | 34 namespace webrtc { |
35 | 35 |
36 // Only positive speeds, range for real-time coding currently is: 5 - 8. | 36 // Only positive speeds, range for real-time coding currently is: 5 - 8. |
37 // Lower means slower/better quality, higher means fastest/lower quality. | 37 // Lower means slower/better quality, higher means fastest/lower quality. |
38 int GetCpuSpeed(int width, int height) { | 38 int GetCpuSpeed(int width, int height) { |
| 39 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) |
| 40 return 8; |
| 41 #else |
39 // For smaller resolutions, use lower speed setting (get some coding gain at | 42 // For smaller resolutions, use lower speed setting (get some coding gain at |
40 // the cost of increased encoding complexity). | 43 // the cost of increased encoding complexity). |
41 if (width * height <= 352 * 288) | 44 if (width * height <= 352 * 288) |
42 return 5; | 45 return 5; |
43 else | 46 else |
44 return 7; | 47 return 7; |
| 48 #endif |
45 } | 49 } |
46 | 50 |
47 VP9Encoder* VP9Encoder::Create() { | 51 VP9Encoder* VP9Encoder::Create() { |
48 return new VP9EncoderImpl(); | 52 return new VP9EncoderImpl(); |
49 } | 53 } |
50 | 54 |
51 void VP9EncoderImpl::EncoderOutputCodedPacketCallback(vpx_codec_cx_pkt* pkt, | 55 void VP9EncoderImpl::EncoderOutputCodedPacketCallback(vpx_codec_cx_pkt* pkt, |
52 void* user_data) { | 56 void* user_data) { |
53 VP9EncoderImpl* enc = (VP9EncoderImpl*)(user_data); | 57 VP9EncoderImpl* enc = (VP9EncoderImpl*)(user_data); |
54 enc->GetEncodedLayerFrame(pkt); | 58 enc->GetEncodedLayerFrame(pkt); |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 decoder_ = NULL; | 974 decoder_ = NULL; |
971 } | 975 } |
972 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers | 976 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers |
973 // still referenced externally are deleted once fully released, not returning | 977 // still referenced externally are deleted once fully released, not returning |
974 // to the pool. | 978 // to the pool. |
975 frame_buffer_pool_.ClearPool(); | 979 frame_buffer_pool_.ClearPool(); |
976 inited_ = false; | 980 inited_ = false; |
977 return WEBRTC_VIDEO_CODEC_OK; | 981 return WEBRTC_VIDEO_CODEC_OK; |
978 } | 982 } |
979 } // namespace webrtc | 983 } // namespace webrtc |
OLD | NEW |