It seems that if encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceNum is configured to number of cores as determined by openh264 (or any number > 1 in my local tests), frame rate statistics will be mucked up (apparently thousands of frames per second) and quality will bottom out because bits per frame is then very low.

BUG=webrtc:6583

Review-Url: https://codereview.webrtc.org/2458673002
Cr-Commit-Position: refs/heads/master@{#14842}
This commit is contained in:
sprang
2016-10-31 03:43:39 -07:00
committed by Commit bot
parent e602f0ab08
commit ca27f9d5b9

View File

@ -48,6 +48,8 @@ int NumberOfThreads(int width, int height, int number_of_cores) {
// } else {
// return 1; // 1 thread for VGA or less.
// }
// TODO(sprang): Also check sSliceArgument.uiSliceNum om GetEncoderPrams(),
// before enabling multithreading here.
return 1;
}
@ -445,7 +447,9 @@ SEncParamExt H264EncoderImpl::CreateEncoderParams() const {
#else
// When uiSliceMode = SM_FIXEDSLCNUM_SLICE, uiSliceNum = 0 means auto design
// it with cpu core number.
encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceNum = 0;
// TODO(sprang): Set to 0 when we understand why the rate controller borks
// when uiSliceNum > 1.
encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceNum = 1;
encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceMode =
SM_FIXEDSLCNUM_SLICE;
#endif