Enhance workload when tone mapping on some APUs

This commit is contained in:
Nyanmisaka 2020-10-03 17:53:10 +08:00 committed by GitHub
parent 2124bc2e18
commit 9fbf725a6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -859,6 +859,31 @@ namespace MediaBrowser.Controller.MediaEncoding
else if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase)
|| string.Equals(videoEncoder, "hevc_amf", StringComparison.OrdinalIgnoreCase))
{
switch (encodingOptions.EncoderPreset)
{
case "veryslow":
case "slow":
case "slower":
param += "-quality quality";
break;
case "medium":
param += "-quality balanced";
break;
case "fast":
case "faster":
case "veryfast":
case "superfast":
case "ultrafast":
param += "-quality speed";
break;
default:
param += "-quality speed";
break;
}
var videoStream = state.VideoStream;
var isColorDepth10 = IsColorDepth10(state);
@ -868,35 +893,8 @@ namespace MediaBrowser.Controller.MediaEncoding
&& !string.IsNullOrEmpty(videoStream.VideoRange)
&& videoStream.VideoRange.Contains("HDR", StringComparison.OrdinalIgnoreCase))
{
// Enhance quality and workload when tone mapping with AMF
param += "-quality quality -preanalysis true";
}
else
{
switch (encodingOptions.EncoderPreset)
{
case "veryslow":
case "slow":
case "slower":
param += "-quality quality";
break;
case "medium":
param += "-quality balanced";
break;
case "fast":
case "faster":
case "veryfast":
case "superfast":
case "ultrafast":
param += "-quality speed";
break;
default:
param += "-quality speed";
break;
}
// Enhance workload when tone mapping with AMF on some APUs
param += " -preanalysis true";
}
}
else if (string.Equals(videoEncoder, "libvpx", StringComparison.OrdinalIgnoreCase)) // webm