Skip to content

Commit

Permalink
antiringing: change shifted range to [0.1,1.1]
Browse files Browse the repository at this point in the history
Just align with libplacebo behavior.

The reason to use [0.5,1.5] before is to make anti-ringing strength
somehow more consistent for all sample values from [0.0, 1.0]. Lower
the range to [0.1, 1.1] will make antiringing slightly more aggressive
in low light and high light areas. However, the differences are expected
to be visually indistinguishable.
  • Loading branch information
bjin committed Sep 12, 2023
1 parent ae21baa commit 3f24e7c
Show file tree
Hide file tree
Showing 23 changed files with 215 additions and 215 deletions.
14 changes: 7 additions & 7 deletions compute/ravu-lite-ar-r2.hook
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ vec4 lo = vec4(0.0), hi = vec4(0.0), lo2 = vec4(0.0), hi2 = vec4(0.0), wg, cg4,
w = texture(ravu_lite_lut2, vec2(0.1, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 0] * w + inp[local_pos + 22] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 0], 1.5 - inp[local_pos + 0], 0.5 + inp[local_pos + 22], 1.5 - inp[local_pos + 22]);
cg4 = vec4(0.1 + inp[local_pos + 0], 1.1 - inp[local_pos + 0], 0.1 + inp[local_pos + 22], 1.1 - inp[local_pos + 22]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -86,7 +86,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut2, vec2(0.3, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 1] * w + inp[local_pos + 21] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 1], 1.5 - inp[local_pos + 1], 0.5 + inp[local_pos + 21], 1.5 - inp[local_pos + 21]);
cg4 = vec4(0.1 + inp[local_pos + 1], 1.1 - inp[local_pos + 1], 0.1 + inp[local_pos + 21], 1.1 - inp[local_pos + 21]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -97,7 +97,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut2, vec2(0.5, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 2] * w + inp[local_pos + 20] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 2], 1.5 - inp[local_pos + 2], 0.5 + inp[local_pos + 20], 1.5 - inp[local_pos + 20]);
cg4 = vec4(0.1 + inp[local_pos + 2], 1.1 - inp[local_pos + 2], 0.1 + inp[local_pos + 20], 1.1 - inp[local_pos + 20]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -108,7 +108,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut2, vec2(0.7, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 10] * w + inp[local_pos + 12] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 10], 1.5 - inp[local_pos + 10], 0.5 + inp[local_pos + 12], 1.5 - inp[local_pos + 12]);
cg4 = vec4(0.1 + inp[local_pos + 10], 1.1 - inp[local_pos + 10], 0.1 + inp[local_pos + 12], 1.1 - inp[local_pos + 12]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -119,16 +119,16 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut2, vec2(0.9, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 11] * w;
vec2 cg2 = vec2(0.5 + inp[local_pos + 11], 1.5 - inp[local_pos + 11]);
vec2 cg2 = vec2(0.1 + inp[local_pos + 11], 1.1 - inp[local_pos + 11]);
vec2 cg2_1 = cg2;
cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;
hi += cg2.x * wg;
lo += cg2.y * wg;
cg2 *= cg2_1;
hi2 += cg2.x * wg;
lo2 += cg2.y * wg;
lo = 1.5 - lo2 / lo;
hi = hi2 / hi - 0.5;
lo = 1.1 - lo2 / lo;
hi = hi2 / hi - 0.1;
res = mix(res, clamp(res, lo, hi), 0.800000);
imageStore(out_image, ivec2(gl_GlobalInvocationID) * 2 + ivec2(0, 0), vec4(res[0], 0.0, 0.0, 0.0));
imageStore(out_image, ivec2(gl_GlobalInvocationID) * 2 + ivec2(0, 1), vec4(res[1], 0.0, 0.0, 0.0));
Expand Down
18 changes: 9 additions & 9 deletions compute/ravu-lite-ar-r3.hook
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ res += inp[local_pos + 1] * w + inp[local_pos + 51] * w.wzyx;
w = texture(ravu_lite_lut3, vec2(0.19230769230769232, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 2] * w + inp[local_pos + 50] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 2], 1.5 - inp[local_pos + 2], 0.5 + inp[local_pos + 50], 1.5 - inp[local_pos + 50]);
cg4 = vec4(0.1 + inp[local_pos + 2], 1.1 - inp[local_pos + 2], 0.1 + inp[local_pos + 50], 1.1 - inp[local_pos + 50]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -96,7 +96,7 @@ res += inp[local_pos + 12] * w + inp[local_pos + 40] * w.wzyx;
w = texture(ravu_lite_lut3, vec2(0.5, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 13] * w + inp[local_pos + 39] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 13], 1.5 - inp[local_pos + 13], 0.5 + inp[local_pos + 39], 1.5 - inp[local_pos + 39]);
cg4 = vec4(0.1 + inp[local_pos + 13], 1.1 - inp[local_pos + 13], 0.1 + inp[local_pos + 39], 1.1 - inp[local_pos + 39]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -107,7 +107,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut3, vec2(0.5769230769230769, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 14] * w + inp[local_pos + 38] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 14], 1.5 - inp[local_pos + 14], 0.5 + inp[local_pos + 38], 1.5 - inp[local_pos + 38]);
cg4 = vec4(0.1 + inp[local_pos + 14], 1.1 - inp[local_pos + 14], 0.1 + inp[local_pos + 38], 1.1 - inp[local_pos + 38]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -118,7 +118,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut3, vec2(0.6538461538461539, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 15] * w + inp[local_pos + 37] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 15], 1.5 - inp[local_pos + 15], 0.5 + inp[local_pos + 37], 1.5 - inp[local_pos + 37]);
cg4 = vec4(0.1 + inp[local_pos + 15], 1.1 - inp[local_pos + 15], 0.1 + inp[local_pos + 37], 1.1 - inp[local_pos + 37]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -131,7 +131,7 @@ res += inp[local_pos + 16] * w + inp[local_pos + 36] * w.wzyx;
w = texture(ravu_lite_lut3, vec2(0.8076923076923077, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 24] * w + inp[local_pos + 28] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 24], 1.5 - inp[local_pos + 24], 0.5 + inp[local_pos + 28], 1.5 - inp[local_pos + 28]);
cg4 = vec4(0.1 + inp[local_pos + 24], 1.1 - inp[local_pos + 24], 0.1 + inp[local_pos + 28], 1.1 - inp[local_pos + 28]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -142,7 +142,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut3, vec2(0.8846153846153846, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 25] * w + inp[local_pos + 27] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 25], 1.5 - inp[local_pos + 25], 0.5 + inp[local_pos + 27], 1.5 - inp[local_pos + 27]);
cg4 = vec4(0.1 + inp[local_pos + 25], 1.1 - inp[local_pos + 25], 0.1 + inp[local_pos + 27], 1.1 - inp[local_pos + 27]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -153,16 +153,16 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut3, vec2(0.9615384615384616, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 26] * w;
vec2 cg2 = vec2(0.5 + inp[local_pos + 26], 1.5 - inp[local_pos + 26]);
vec2 cg2 = vec2(0.1 + inp[local_pos + 26], 1.1 - inp[local_pos + 26]);
vec2 cg2_1 = cg2;
cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;
hi += cg2.x * wg;
lo += cg2.y * wg;
cg2 *= cg2_1;
hi2 += cg2.x * wg;
lo2 += cg2.y * wg;
lo = 1.5 - lo2 / lo;
hi = hi2 / hi - 0.5;
lo = 1.1 - lo2 / lo;
hi = hi2 / hi - 0.1;
res = mix(res, clamp(res, lo, hi), 0.800000);
imageStore(out_image, ivec2(gl_GlobalInvocationID) * 2 + ivec2(0, 0), vec4(res[0], 0.0, 0.0, 0.0));
imageStore(out_image, ivec2(gl_GlobalInvocationID) * 2 + ivec2(0, 1), vec4(res[1], 0.0, 0.0, 0.0));
Expand Down
18 changes: 9 additions & 9 deletions compute/ravu-lite-ar-r4.hook
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ res += inp[local_pos + 16] * w + inp[local_pos + 74] * w.wzyx;
w = texture(ravu_lite_lut4, vec2(0.42, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 17] * w + inp[local_pos + 73] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 17], 1.5 - inp[local_pos + 17], 0.5 + inp[local_pos + 73], 1.5 - inp[local_pos + 73]);
cg4 = vec4(0.1 + inp[local_pos + 17], 1.1 - inp[local_pos + 17], 0.1 + inp[local_pos + 73], 1.1 - inp[local_pos + 73]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -164,7 +164,7 @@ res += inp[local_pos + 29] * w + inp[local_pos + 61] * w.wzyx;
w = texture(ravu_lite_lut4, vec2(0.66, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 30] * w + inp[local_pos + 60] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 30], 1.5 - inp[local_pos + 30], 0.5 + inp[local_pos + 60], 1.5 - inp[local_pos + 60]);
cg4 = vec4(0.1 + inp[local_pos + 30], 1.1 - inp[local_pos + 30], 0.1 + inp[local_pos + 60], 1.1 - inp[local_pos + 60]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -175,7 +175,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut4, vec2(0.7, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 31] * w + inp[local_pos + 59] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 31], 1.5 - inp[local_pos + 31], 0.5 + inp[local_pos + 59], 1.5 - inp[local_pos + 59]);
cg4 = vec4(0.1 + inp[local_pos + 31], 1.1 - inp[local_pos + 31], 0.1 + inp[local_pos + 59], 1.1 - inp[local_pos + 59]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -186,7 +186,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut4, vec2(0.74, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 32] * w + inp[local_pos + 58] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 32], 1.5 - inp[local_pos + 32], 0.5 + inp[local_pos + 58], 1.5 - inp[local_pos + 58]);
cg4 = vec4(0.1 + inp[local_pos + 32], 1.1 - inp[local_pos + 32], 0.1 + inp[local_pos + 58], 1.1 - inp[local_pos + 58]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -203,7 +203,7 @@ res += inp[local_pos + 42] * w + inp[local_pos + 48] * w.wzyx;
w = texture(ravu_lite_lut4, vec2(0.9, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 43] * w + inp[local_pos + 47] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 43], 1.5 - inp[local_pos + 43], 0.5 + inp[local_pos + 47], 1.5 - inp[local_pos + 47]);
cg4 = vec4(0.1 + inp[local_pos + 43], 1.1 - inp[local_pos + 43], 0.1 + inp[local_pos + 47], 1.1 - inp[local_pos + 47]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -214,7 +214,7 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut4, vec2(0.94, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 44] * w + inp[local_pos + 46] * w.wzyx;
cg4 = vec4(0.5 + inp[local_pos + 44], 1.5 - inp[local_pos + 44], 0.5 + inp[local_pos + 46], 1.5 - inp[local_pos + 46]);
cg4 = vec4(0.1 + inp[local_pos + 44], 1.1 - inp[local_pos + 44], 0.1 + inp[local_pos + 46], 1.1 - inp[local_pos + 46]);
cg4_1 = cg4;
cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;cg4 *= cg4;
hi += cg4.x * wg + cg4.z * wg.wzyx;
Expand All @@ -225,16 +225,16 @@ lo2 += cg4.y * wg + cg4.w * wg.wzyx;
w = texture(ravu_lite_lut4, vec2(0.98, coord_y));
wg = max(vec4(0.0), w);
res += inp[local_pos + 45] * w;
vec2 cg2 = vec2(0.5 + inp[local_pos + 45], 1.5 - inp[local_pos + 45]);
vec2 cg2 = vec2(0.1 + inp[local_pos + 45], 1.1 - inp[local_pos + 45]);
vec2 cg2_1 = cg2;
cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;cg2 *= cg2;
hi += cg2.x * wg;
lo += cg2.y * wg;
cg2 *= cg2_1;
hi2 += cg2.x * wg;
lo2 += cg2.y * wg;
lo = 1.5 - lo2 / lo;
hi = hi2 / hi - 0.5;
lo = 1.1 - lo2 / lo;
hi = hi2 / hi - 0.1;
res = mix(res, clamp(res, lo, hi), 0.800000);
imageStore(out_image, ivec2(gl_GlobalInvocationID) * 2 + ivec2(0, 0), vec4(res[0], 0.0, 0.0, 0.0));
imageStore(out_image, ivec2(gl_GlobalInvocationID) * 2 + ivec2(0, 1), vec4(res[1], 0.0, 0.0, 0.0));
Expand Down
20 changes: 10 additions & 10 deletions compute/ravu-zoom-ar-r2-rgb.hook
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ res += sample10 * w[1];
res += sample9 * w[2];
res += sample8 * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.0, coord_y) + subpix);
cg = mat4x3(0.5 + sample0, 1.5 - sample0, 0.5 + sample1, 1.5 - sample1);
cg = mat4x3(0.1 + sample0, 1.1 - sample0, 0.1 + sample1, 1.1 - sample1);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample2, 1.5 - sample2, 0.5 + sample3, 1.5 - sample3);
cg = mat4x3(0.1 + sample2, 1.1 - sample2, 0.1 + sample3, 1.1 - sample3);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
Expand All @@ -182,15 +182,15 @@ cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.5, coord_y) + subpix);
cg = mat4x3(0.5 + sample4, 1.5 - sample4, 0.5 + sample5, 1.5 - sample5);
cg = mat4x3(0.1 + sample4, 1.1 - sample4, 0.1 + sample5, 1.1 - sample5);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample6, 1.5 - sample6, 0.5 + sample7, 1.5 - sample7);
cg = mat4x3(0.1 + sample6, 1.1 - sample6, 0.1 + sample7, 1.1 - sample7);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
Expand All @@ -199,15 +199,15 @@ cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.0, coord_y) + subpix_inv);
cg = mat4x3(0.5 + sample15, 1.5 - sample15, 0.5 + sample14, 1.5 - sample14);
cg = mat4x3(0.1 + sample15, 1.1 - sample15, 0.1 + sample14, 1.1 - sample14);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample13, 1.5 - sample13, 0.5 + sample12, 1.5 - sample12);
cg = mat4x3(0.1 + sample13, 1.1 - sample13, 0.1 + sample12, 1.1 - sample12);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
Expand All @@ -216,24 +216,24 @@ cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.5, coord_y) + subpix_inv);
cg = mat4x3(0.5 + sample11, 1.5 - sample11, 0.5 + sample10, 1.5 - sample10);
cg = mat4x3(0.1 + sample11, 1.1 - sample11, 0.1 + sample10, 1.1 - sample10);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample9, 1.5 - sample9, 0.5 + sample8, 1.5 - sample8);
cg = mat4x3(0.1 + sample9, 1.1 - sample9, 0.1 + sample8, 1.1 - sample8);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
lo += cg[1] * w[2] + cg[3] * w[3];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
hi = hi2 / hi - 0.5;
lo = 1.5 - lo2 / lo;
hi = hi2 / hi - 0.1;
lo = 1.1 - lo2 / lo;
res = mix(res, clamp(res, lo, hi), 0.800000);
imageStore(out_image, ivec2(gl_GlobalInvocationID), vec4(res, 1.0));
}
Expand Down
20 changes: 10 additions & 10 deletions compute/ravu-zoom-ar-r2-yuv.hook
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ res += sample10 * w[1];
res += sample9 * w[2];
res += sample8 * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.0, coord_y) + subpix);
cg = mat4x3(0.5 + sample0, 1.5 - sample0, 0.5 + sample1, 1.5 - sample1);
cg = mat4x3(0.1 + sample0, 1.1 - sample0, 0.1 + sample1, 1.1 - sample1);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample2, 1.5 - sample2, 0.5 + sample3, 1.5 - sample3);
cg = mat4x3(0.1 + sample2, 1.1 - sample2, 0.1 + sample3, 1.1 - sample3);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
Expand All @@ -165,15 +165,15 @@ cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.5, coord_y) + subpix);
cg = mat4x3(0.5 + sample4, 1.5 - sample4, 0.5 + sample5, 1.5 - sample5);
cg = mat4x3(0.1 + sample4, 1.1 - sample4, 0.1 + sample5, 1.1 - sample5);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample6, 1.5 - sample6, 0.5 + sample7, 1.5 - sample7);
cg = mat4x3(0.1 + sample6, 1.1 - sample6, 0.1 + sample7, 1.1 - sample7);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
Expand All @@ -182,15 +182,15 @@ cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.0, coord_y) + subpix_inv);
cg = mat4x3(0.5 + sample15, 1.5 - sample15, 0.5 + sample14, 1.5 - sample14);
cg = mat4x3(0.1 + sample15, 1.1 - sample15, 0.1 + sample14, 1.1 - sample14);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample13, 1.5 - sample13, 0.5 + sample12, 1.5 - sample12);
cg = mat4x3(0.1 + sample13, 1.1 - sample13, 0.1 + sample12, 1.1 - sample12);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
Expand All @@ -199,24 +199,24 @@ cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
w = texture(ravu_zoom_lut2_ar, vec2(0.5, coord_y) + subpix_inv);
cg = mat4x3(0.5 + sample11, 1.5 - sample11, 0.5 + sample10, 1.5 - sample10);
cg = mat4x3(0.1 + sample11, 1.1 - sample11, 0.1 + sample10, 1.1 - sample10);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[0] + cg[2] * w[1];
lo += cg[1] * w[0] + cg[3] * w[1];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[0] + cg[2] * w[1];
lo2 += cg[1] * w[0] + cg[3] * w[1];
cg = mat4x3(0.5 + sample9, 1.5 - sample9, 0.5 + sample8, 1.5 - sample8);
cg = mat4x3(0.1 + sample9, 1.1 - sample9, 0.1 + sample8, 1.1 - sample8);
cg1 = cg;
cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);cg = matrixCompMult(cg, cg);
hi += cg[0] * w[2] + cg[2] * w[3];
lo += cg[1] * w[2] + cg[3] * w[3];
cg = matrixCompMult(cg, cg1);
hi2 += cg[0] * w[2] + cg[2] * w[3];
lo2 += cg[1] * w[2] + cg[3] * w[3];
hi = hi2 / hi - 0.5;
lo = 1.5 - lo2 / lo;
hi = hi2 / hi - 0.1;
lo = 1.1 - lo2 / lo;
res = mix(res, clamp(res, lo, hi), 0.800000);
imageStore(out_image, ivec2(gl_GlobalInvocationID), vec4(res, 1.0));
}
Expand Down
Loading

0 comments on commit 3f24e7c

Please sign in to comment.