Merge pull request #628 from DelinWorks/fix-video-player-shader

`YUY2` GLSL ES Shader error
This commit is contained in:
一线灵 2022-05-02 12:08:08 +08:00 committed by GitHub
commit 4b592b6f45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -115,7 +115,7 @@ vec4 inYUY2(vec4 tempyuv, float isOdd)
vec4 limitedYCbCrToComputerRGBNormalized(vec4 yuv)
{
vec4 rgb = vec4(0.0);
float scale = 1.0f / 256.0f;
float scale = 1.0 / 256.0;
yuv = yuv * 255.0;
@ -127,9 +127,9 @@ vec4 limitedYCbCrToComputerRGBNormalized(vec4 yuv)
rgb.g = scale * ((298.082 * yuv.r) + (-54.592 * yuv.g) + (-136.425 * yuv.b));
rgb.b = scale * ((298.082 * yuv.r) + (540.775 * yuv.g));
rgb.a = 255.0f;
rgb.a = 255.0;
rgb = rgb / 255.0f;
rgb = rgb / 255.0;
return rgb;
}
@ -164,9 +164,9 @@ vec4 fullYCbCrToComputerRGBNormalized(vec4 yuv)
rgb.g = scale * ((256.0 * yuv.r) + (-47.954944 * yuv.g) + (-119.839744 * yuv.b));
rgb.b = scale * ((256.0 * yuv.r) + (475.0336 * yuv.g));
rgb.a = 255.0f;
rgb.a = 255.0;
rgb = rgb / 255.0f;
rgb = rgb / 255.0;
return rgb;
}