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
This commit is contained in:
parent
6950f3aaa8
commit
244d38cf0e
@ -63,7 +63,7 @@ highp vec4 hlgOetf(highp vec4 hlgColor) {
|
|||||||
/** Convert YUV to RGBA. */
|
/** Convert YUV to RGBA. */
|
||||||
vec4 yuvToRgba(vec3 yuv) {
|
vec4 yuvToRgba(vec3 yuv) {
|
||||||
const vec3 yuvOffset = vec3(0.0625, 0.5, 0.5);
|
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);
|
return vec4(rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user