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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 357 } |
358 | 358 |
359 tl0_pic_idx_ = static_cast<uint8_t>(rand()); | 359 tl0_pic_idx_ = static_cast<uint8_t>(rand()); |
360 | 360 |
361 return InitAndSetControlSettings(inst); | 361 return InitAndSetControlSettings(inst); |
362 } | 362 } |
363 | 363 |
364 int VP9EncoderImpl::NumberOfThreads(int width, | 364 int VP9EncoderImpl::NumberOfThreads(int width, |
365 int height, | 365 int height, |
366 int number_of_cores) { | 366 int number_of_cores) { |
367 // For the current libvpx library, only 1 thread is supported when SVC is | |
368 // turned on. | |
369 if (num_temporal_layers_ > 1 || num_spatial_layers_ > 1) { | |
370 return 1; | |
371 } | |
372 | |
373 // Keep the number of encoder threads equal to the possible number of column | 367 // Keep the number of encoder threads equal to the possible number of column |
374 // tiles, which is (1, 2, 4, 8). See comments below for VP9E_SET_TILE_COLUMNS. | 368 // tiles, which is (1, 2, 4, 8). See comments below for VP9E_SET_TILE_COLUMNS. |
375 if (width * height >= 1280 * 720 && number_of_cores > 4) { | 369 if (width * height >= 1280 * 720 && number_of_cores > 4) { |
376 return 4; | 370 return 4; |
377 } else if (width * height >= 640 * 480 && number_of_cores > 2) { | 371 } else if (width * height >= 640 * 480 && number_of_cores > 2) { |
378 return 2; | 372 return 2; |
379 } else { | 373 } else { |
380 // 1 thread less than VGA. | 374 // 1 thread less than VGA. |
381 return 1; | 375 return 1; |
382 } | 376 } |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 decoder_ = NULL; | 815 decoder_ = NULL; |
822 } | 816 } |
823 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers | 817 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers |
824 // still referenced externally are deleted once fully released, not returning | 818 // still referenced externally are deleted once fully released, not returning |
825 // to the pool. | 819 // to the pool. |
826 frame_buffer_pool_.ClearPool(); | 820 frame_buffer_pool_.ClearPool(); |
827 inited_ = false; | 821 inited_ = false; |
828 return WEBRTC_VIDEO_CODEC_OK; | 822 return WEBRTC_VIDEO_CODEC_OK; |
829 } | 823 } |
830 } // namespace webrtc | 824 } // namespace webrtc |
OLD | NEW |