mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08: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
This commit is contained in:
parent
d11c3be952
commit
32ee44805b
@ -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…
x
Reference in New Issue
Block a user