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

@ -858,20 +858,6 @@ namespace MediaBrowser.Controller.MediaEncoding
}
else if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase)
|| string.Equals(videoEncoder, "hevc_amf", StringComparison.OrdinalIgnoreCase))
{
var videoStream = state.VideoStream;
var isColorDepth10 = IsColorDepth10(state);
if (isColorDepth10
&& _mediaEncoder.SupportsHwaccel("opencl")
&& encodingOptions.EnableTonemapping
&& !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)
{
@ -897,6 +883,18 @@ namespace MediaBrowser.Controller.MediaEncoding
param += "-quality speed";
break;
}
var videoStream = state.VideoStream;
var isColorDepth10 = IsColorDepth10(state);
if (isColorDepth10
&& _mediaEncoder.SupportsHwaccel("opencl")
&& encodingOptions.EnableTonemapping
&& !string.IsNullOrEmpty(videoStream.VideoRange)
&& videoStream.VideoRange.Contains("HDR", StringComparison.OrdinalIgnoreCase))
{
// Enhance workload when tone mapping with AMF on some APUs
param += " -preanalysis true";
}
}
else if (string.Equals(videoEncoder, "libvpx", StringComparison.OrdinalIgnoreCase)) // webm