mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 19:42:26 +00:00
[355/906] same motion compensation
This commit is contained in:
parent
df4e712ca2
commit
56d656adf6
1 changed files with 4 additions and 7 deletions
|
@ -111,6 +111,7 @@ static const gchar *greedyh_fragment_source =
|
|||
" L1_a1 = texture2DRect(tex_prev, texcoord_L1_a1).rgb;\n"
|
||||
" L3_a1 = texture2DRect(tex_prev, texcoord_L3_a1).rgb;\n"
|
||||
" }\n"
|
||||
""
|
||||
"" //STEP 1
|
||||
" vec3 avg_a1 = (L1_a1 + L3_a1) / 2.0;\n"
|
||||
" vec3 avg = (L1 + L3) / 2.0;\n"
|
||||
|
@ -150,13 +151,9 @@ static const gchar *greedyh_fragment_source =
|
|||
" last.b = clamp(best.b, max(min(L1.b, L3.b) - max_comb, 0.0), min(max(L1.b, L3.b) + max_comb, 1.0));\n"
|
||||
""
|
||||
"" //STEP 3
|
||||
" vec3 mov;\n"
|
||||
" mov.r = min(max(abs(L2.r - LP2.r) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.r = (last.r * (1.0 - mov.r) + avg_sc.r * mov.r);\n"
|
||||
" mov.g = min(max(abs(L2.g - LP2.g) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.g = (last.g * (1.0 - mov.g) + avg_sc.g * mov.g);\n"
|
||||
" mov.b = min(max(abs(L2.b - LP2.b) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.b = last.b * (1.0 - mov.b) + avg_sc.b * mov.b;\n"
|
||||
" const vec3 luma = vec3 (0.299011, 0.586987, 0.114001);"
|
||||
" float mov = min(max(abs(dot(L2 - LP2, luma)) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last = last * (1.0 - mov) + avg_sc * mov;\n"
|
||||
""
|
||||
" gl_FragColor = vec4(last, 1.0);\n"
|
||||
" }\n"
|
||||
|
|
Loading…
Reference in a new issue