mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
HDR: Clamp YUV to RGB conversion.
Manually tested using transformer demo HLG videos. Before this CL, RGB values after the YUV to RGB conversion reached up to 1.025. After this CL, RGB values correctly clamp at 1.0.
PiperOrigin-RevId: 468426092
(cherry picked from commit 32ee44805b)
This commit is contained in:
parent
c65acc04d6
commit
4c36dae9bb
1 changed files with 1 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ highp vec4 hlgOetf(highp vec4 hlgColor) {
|
|||
/** Convert YUV to RGBA. */
|
||||
vec4 yuvToRgba(vec3 yuv) {
|
||||
const vec3 yuvOffset = vec3(0.0625, 0.5, 0.5);
|
||||
vec3 rgb = uYuvToRgbColorTransform * (yuv - yuvOffset);
|
||||
vec3 rgb = clamp(uYuvToRgbColorTransform * (yuv - yuvOffset), 0.0, 1.0);
|
||||
return vec4(rgb, 1.0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue