mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-11-12 14:57:20 +00:00
[client] network: crop aligned video planes
This commit is contained in:
@@ -303,20 +303,25 @@ static const char NETWORK_VIDEO_YUV_SHADER[] =
|
||||
"uniform float lumaScale;\n"
|
||||
"uniform float chromaMidpoint;\n"
|
||||
"uniform float chromaScale;\n"
|
||||
"void main(){ivec2 pixel=ivec2(gl_GlobalInvocationID.xy);\n"
|
||||
"void main(){\n"
|
||||
" ivec2 pixel = ivec2(gl_GlobalInvocationID.xy);\n"
|
||||
" if(any(greaterThanEqual(pixel,outputSize)))return;\n"
|
||||
" vec2 uv=(vec2(pixel)+0.5)/vec2(outputSize);\n"
|
||||
" vec2 offset=chromaLeft?vec2(0.5/float(outputSize.x),0.0):vec2(0.0);\n"
|
||||
" float y=clamp((texture(lumaPlane,uv).x-lumaOffset)*lumaScale,0.0,1.0);\n"
|
||||
" float cb=clamp((texture(cbPlane,uv+offset).x-chromaMidpoint)*\n"
|
||||
" ivec2 planeSize = textureSize(lumaPlane,0);\n"
|
||||
" vec2 uv = (vec2(pixel)+0.5)/vec2(planeSize);\n"
|
||||
" vec2 offset = chromaLeft?\n"
|
||||
" vec2(0.5/float(planeSize.x),0.0):vec2(0.0);\n"
|
||||
" float y = clamp((texture(lumaPlane,uv).x-lumaOffset)*\n"
|
||||
" lumaScale,0.0,1.0);\n"
|
||||
" float cb = clamp((texture(cbPlane,uv+offset).x-chromaMidpoint)*\n"
|
||||
" chromaScale,-0.5,0.5);\n"
|
||||
" float cr=clamp((texture(crPlane,uv+offset).x-chromaMidpoint)*\n"
|
||||
" float cr = clamp((texture(crPlane,uv+offset).x-chromaMidpoint)*\n"
|
||||
" chromaScale,-0.5,0.5);\n"
|
||||
" mat3 m=bt2020?mat3(vec3(1.0),vec3(0.0,-0.16455313,1.8814),\n"
|
||||
" mat3 m = bt2020?\n"
|
||||
" mat3(vec3(1.0),vec3(0.0,-0.16455313,1.8814),\n"
|
||||
" vec3(1.4746,-0.57135313,0.0)):\n"
|
||||
" mat3(vec3(1.0),vec3(0.0,-0.13397432/0.7152,1.8556),\n"
|
||||
" vec3(1.5748,-0.33480248/0.7152,0.0));\n"
|
||||
" vec3 rgb=clamp(m*vec3(y,cb,cr),vec3(0.0),vec3(1.0));\n"
|
||||
" vec3 rgb = clamp(m*vec3(y,cb,cr),vec3(0.0),vec3(1.0));\n"
|
||||
" imageStore(outputImage,pixel,vec4(rgb,1.0));}\n";
|
||||
|
||||
static const char * const NETWORK_VIDEO_DEQUANT_SOURCES[] =
|
||||
|
||||
Reference in New Issue
Block a user