fix: code style

Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
gnattu 2024-02-15 23:22:32 +08:00
parent c18ef13b3b
commit cf3e3e2c3d
1 changed files with 4 additions and 1 deletions

View File

@ -2955,6 +2955,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
arg2 = (isSizeFixed ? ':' : '=') + arg2;
}
if (string.Equals(hwScaleSuffix, "vt", StringComparison.OrdinalIgnoreCase))
{
// VideoToolBox scaling filter requires different syntax
@ -5004,18 +5005,20 @@ namespace MediaBrowser.Controller.MediaEncoding
var swScaleFilter = GetSwScaleFilter(state, options, vidEncoder, inW, inH, threeDFormat, reqW, reqH, reqMaxW, reqMaxH);
newfilters.Add(swScaleFilter);
}
// hwupload on videotoolbox encoders can automatically convert AVFrame into its CVPixelBuffer equivalent
// videotoolbox will automatically convert the CVPixelBuffer to a pixel format the encoder supports, so we don't have to set a pixel format explicitly here
// This will reduce CPU usage significantly on UHD videos with 10 bit colors because we bypassed the ffmpeg pixel format conversion
newfilters.Add("hwupload");
if (supportsHwScale)
{
var hwScaleFilter = GetHwScaleFilter("vt", "", inW, inH, reqW, reqH, reqMaxW, reqMaxH);
var hwScaleFilter = GetHwScaleFilter("vt", string.Empty, inW, inH, reqW, reqH, reqMaxW, reqMaxH);
if (useHwToneMapping)
{
hwScaleFilter = string.IsNullOrEmpty(hwScaleFilter) ? "scale_vt=0:0:bt709:bt709:bt709"
: string.Format(CultureInfo.InvariantCulture, hwScaleFilter, ":bt709:bt709:bt709");
}
newfilters.Add(hwScaleFilter);
}