Add workaround for incorrect color range in AMF AV1 encoding output

This commit is contained in:
Cameron Gutman 2024-09-04 23:13:48 -05:00
parent 34549864ad
commit 67e89d9e16

View file

@ -569,6 +569,12 @@ bool PlVkRenderer::mapAvFrameToPlacebo(const AVFrame *frame, pl_frame* mappedFra
mappedFrame->color.hdr.min_luma = PL_COLOR_HDR_BLACK;
}
// HACK: AMF AV1 encoding on the host PC does not set full color range properly in the
// bitstream data, so libplacebo incorrectly renders the content as limited range.
//
// As a workaround, set full range manually in the mapped frame ourselves.
mappedFrame->repr.levels = PL_COLOR_LEVELS_FULL;
return true;
}