@@ -2156,43 +2156,6 @@ static void update_user_shader_opts(struct gl_video *p, const char *path,
21562156 }
21572157}
21582158
2159- static bool get_param_dynamic (struct gl_video * p , struct bstr name , double * out )
2160- {
2161- const struct mp_image_params * params = & p -> image .mpi -> params ;
2162- float chroma_offset_x , chroma_offset_y ;
2163- pl_chroma_location_offset (params -> chroma_location ,
2164- & chroma_offset_x , & chroma_offset_y );
2165-
2166- const struct {
2167- const char * name ;
2168- double value ;
2169- } opts [] = {
2170- { "PTS" , p -> image .mpi -> pts },
2171- { "chroma_offset_x" , chroma_offset_x },
2172- { "chroma_offset_y" , chroma_offset_y },
2173- { "min_luma" , params -> color .hdr .min_luma },
2174- { "max_luma" , params -> color .hdr .max_luma },
2175- { "max_cll" , params -> color .hdr .max_cll },
2176- { "max_fall" , params -> color .hdr .max_fall },
2177- { "scene_max_r" , params -> color .hdr .scene_max [0 ] },
2178- { "scene_max_g" , params -> color .hdr .scene_max [1 ] },
2179- { "scene_max_b" , params -> color .hdr .scene_max [2 ] },
2180- { "scene_avg" , params -> color .hdr .scene_avg },
2181- { "max_pq_y" , params -> color .hdr .max_pq_y },
2182- { "avg_pq_y" , params -> color .hdr .avg_pq_y },
2183- };
2184-
2185- for (int n = 0 ; n < MP_ARRAY_SIZE (opts ); n ++ ) {
2186- if (bstrcmp (name , bstr0 (opts [n ].name )) != 0 )
2187- continue ;
2188-
2189- * out = opts [n ].value ;
2190- return true;
2191- }
2192-
2193- return false;
2194- }
2195-
21962159static void user_hook (struct gl_video * p , struct image img ,
21972160 struct gl_transform * trans , void * priv )
21982161{
@@ -2213,7 +2176,7 @@ static void user_hook(struct gl_video *p, struct image img,
22132176 }
22142177
22152178 double value = param -> value ;
2216- get_param_dynamic ( p , param -> name , & value );
2179+ gpu_get_auto_param ( p -> image . mpi , param -> name , & value );
22172180
22182181 switch (param -> type ) {
22192182 case GL_USER_SHADER_PARAM_FLOAT :
0 commit comments