Enable Multithreaded H264 Encoding For OpenH264
Re-enabled multithreaded encoding using OpenH264, as the issue described in crbug.com/583348 no longer applies. Bug: webrtc:14368 Change-Id: I5ae768a6edf3b40d99c13fb4ee4662626c993a66 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271820 Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37837}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
5d37ba29de
commit
bc8a62b244
@ -53,20 +53,17 @@ enum H264EncoderImplEvent {
|
||||
};
|
||||
|
||||
int NumberOfThreads(int width, int height, int number_of_cores) {
|
||||
// TODO(hbos): In Chromium, multiple threads do not work with sandbox on Mac,
|
||||
// see crbug.com/583348. Until further investigated, only use one thread.
|
||||
// if (width * height >= 1920 * 1080 && number_of_cores > 8) {
|
||||
// return 8; // 8 threads for 1080p on high perf machines.
|
||||
// } else if (width * height > 1280 * 960 && number_of_cores >= 6) {
|
||||
// return 3; // 3 threads for 1080p.
|
||||
// } else if (width * height > 640 * 480 && number_of_cores >= 3) {
|
||||
// return 2; // 2 threads for qHD/HD.
|
||||
// } else {
|
||||
// return 1; // 1 thread for VGA or less.
|
||||
// }
|
||||
// TODO(sprang): Also check sSliceArgument.uiSliceNum om GetEncoderPrams(),
|
||||
// before enabling multithreading here.
|
||||
return 1;
|
||||
if (width * height >= 1920 * 1080 && number_of_cores > 8) {
|
||||
return 8; // 8 threads for 1080p on high perf machines.
|
||||
} else if (width * height > 1280 * 960 && number_of_cores >= 6) {
|
||||
return 3; // 3 threads for 1080p.
|
||||
} else if (width * height > 640 * 480 && number_of_cores >= 3) {
|
||||
return 2; // 2 threads for qHD/HD.
|
||||
} else {
|
||||
return 1; // 1 thread for VGA or less.
|
||||
}
|
||||
}
|
||||
|
||||
VideoFrameType ConvertToVideoFrameType(EVideoFrameType type) {
|
||||
|
Reference in New Issue
Block a user