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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 return InitAndSetControlSettings(inst); | 374 return InitAndSetControlSettings(inst); |
375 } | 375 } |
376 | 376 |
377 int VP9EncoderImpl::NumberOfThreads(int width, | 377 int VP9EncoderImpl::NumberOfThreads(int width, |
378 int height, | 378 int height, |
379 int number_of_cores) { | 379 int number_of_cores) { |
380 // Keep the number of encoder threads equal to the possible number of column | 380 // Keep the number of encoder threads equal to the possible number of column |
381 // tiles, which is (1, 2, 4, 8). See comments below for VP9E_SET_TILE_COLUMNS. | 381 // tiles, which is (1, 2, 4, 8). See comments below for VP9E_SET_TILE_COLUMNS. |
382 if (width * height >= 1280 * 720 && number_of_cores > 4) { | 382 if (width * height >= 1280 * 720 && number_of_cores > 4) { |
383 return 4; | 383 return 4; |
384 } else if (width * height >= 640 * 480 && number_of_cores > 2) { | 384 } else if (width * height >= 640 * 360 && number_of_cores > 2) { |
385 return 2; | 385 return 2; |
386 } else { | 386 } else { |
387 // 1 thread less than VGA. | 387 // 1 thread less than VGA. |
388 return 1; | 388 return 1; |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 int VP9EncoderImpl::InitAndSetControlSettings(const VideoCodec* inst) { | 392 int VP9EncoderImpl::InitAndSetControlSettings(const VideoCodec* inst) { |
393 // Set QP-min/max per spatial and temporal layer. | 393 // Set QP-min/max per spatial and temporal layer. |
394 int tot_num_layers = num_spatial_layers_ * num_temporal_layers_; | 394 int tot_num_layers = num_spatial_layers_ * num_temporal_layers_; |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 frame_buffer_pool_.ClearPool(); | 1008 frame_buffer_pool_.ClearPool(); |
1009 inited_ = false; | 1009 inited_ = false; |
1010 return WEBRTC_VIDEO_CODEC_OK; | 1010 return WEBRTC_VIDEO_CODEC_OK; |
1011 } | 1011 } |
1012 | 1012 |
1013 const char* VP9DecoderImpl::ImplementationName() const { | 1013 const char* VP9DecoderImpl::ImplementationName() const { |
1014 return "libvpx"; | 1014 return "libvpx"; |
1015 } | 1015 } |
1016 | 1016 |
1017 } // namespace webrtc | 1017 } // namespace webrtc |
OLD | NEW |