浏览代码

Use nv15 as intermediate format for 2-pass rkrga scaling (#13313)

gnattu 5 月之前
父节点
当前提交
5c6317f68d
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 5 - 1
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -5695,7 +5695,11 @@ namespace MediaBrowser.Controller.MediaEncoding
                     if (!string.IsNullOrEmpty(doScaling)
                         && !IsScaleRatioSupported(inW, inH, reqW, reqH, reqMaxW, reqMaxH, 8.0f))
                     {
-                        var hwScaleFilterFirstPass = $"scale_rkrga=w=iw/7.9:h=ih/7.9:format={outFormat}:afbc=1";
+                        // Vendor provided BSP kernel has an RGA driver bug that causes the output to be corrupted for P010 format.
+                        // Use NV15 instead of P010 to avoid the issue.
+                        // SDR inputs are using BGRA formats already which is not affected.
+                        var intermediateFormat = string.Equals(outFormat, "p010", StringComparison.OrdinalIgnoreCase) ? "nv15" : outFormat;
+                        var hwScaleFilterFirstPass = $"scale_rkrga=w=iw/7.9:h=ih/7.9:format={intermediateFormat}:force_divisible_by=4:afbc=1";
                         mainFilters.Add(hwScaleFilterFirstPass);
                     }