OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 encoder_params.iMultipleThreadIdc = NumberOfThreads( | 432 encoder_params.iMultipleThreadIdc = NumberOfThreads( |
433 encoder_params.iPicWidth, encoder_params.iPicHeight, number_of_cores_); | 433 encoder_params.iPicWidth, encoder_params.iPicHeight, number_of_cores_); |
434 // The base spatial layer 0 is the only one we use. | 434 // The base spatial layer 0 is the only one we use. |
435 encoder_params.sSpatialLayers[0].iVideoWidth = encoder_params.iPicWidth; | 435 encoder_params.sSpatialLayers[0].iVideoWidth = encoder_params.iPicWidth; |
436 encoder_params.sSpatialLayers[0].iVideoHeight = encoder_params.iPicHeight; | 436 encoder_params.sSpatialLayers[0].iVideoHeight = encoder_params.iPicHeight; |
437 encoder_params.sSpatialLayers[0].fFrameRate = encoder_params.fMaxFrameRate; | 437 encoder_params.sSpatialLayers[0].fFrameRate = encoder_params.fMaxFrameRate; |
438 encoder_params.sSpatialLayers[0].iSpatialBitrate = | 438 encoder_params.sSpatialLayers[0].iSpatialBitrate = |
439 encoder_params.iTargetBitrate; | 439 encoder_params.iTargetBitrate; |
440 encoder_params.sSpatialLayers[0].iMaxSpatialBitrate = | 440 encoder_params.sSpatialLayers[0].iMaxSpatialBitrate = |
441 encoder_params.iMaxBitrate; | 441 encoder_params.iMaxBitrate; |
442 // Slice num according to number of threads. | |
442 #if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5) | 443 #if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5) |
443 // Slice num according to number of threads. | |
444 encoder_params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_AUTO_SLICE; | 444 encoder_params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_AUTO_SLICE; |
445 #else | 445 #else |
446 // When uiSliceMode = SM_FIXEDSLCNUM_SLICE, uiSliceNum = 0 means auto design | 446 encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceNum = |
447 // it with cpu core number. | 447 encoder_params.iMultipleThreadIdc; |
hbos
2016/10/28 09:01:03
Do we know that n works if number of threads are n
sprang_webrtc
2016/10/31 09:22:29
I tried with 4 thread and uiSliceNum 4 and the rat
hbos
2016/10/31 09:23:33
sgtm
| |
448 encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceNum = 0; | |
449 encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceMode = | 448 encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceMode = |
450 SM_FIXEDSLCNUM_SLICE; | 449 SM_FIXEDSLCNUM_SLICE; |
451 #endif | 450 #endif |
452 | 451 |
453 return encoder_params; | 452 return encoder_params; |
454 } | 453 } |
455 | 454 |
456 void H264EncoderImpl::ReportInit() { | 455 void H264EncoderImpl::ReportInit() { |
457 if (has_reported_init_) | 456 if (has_reported_init_) |
458 return; | 457 return; |
(...skipping 19 matching lines...) Expand all Loading... | |
478 | 477 |
479 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 478 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
480 return WEBRTC_VIDEO_CODEC_OK; | 479 return WEBRTC_VIDEO_CODEC_OK; |
481 } | 480 } |
482 | 481 |
483 void H264EncoderImpl::OnDroppedFrame() { | 482 void H264EncoderImpl::OnDroppedFrame() { |
484 quality_scaler_.ReportDroppedFrame(); | 483 quality_scaler_.ReportDroppedFrame(); |
485 } | 484 } |
486 | 485 |
487 } // namespace webrtc | 486 } // namespace webrtc |
OLD | NEW |