[vlc-devel] [PATCH 2/2] XYZ to RGB filter conversion

Nicolas BERTRAND nicoinattendu at gmail.com
Thu Feb 14 17:27:29 CET 2013


>> +struct filter_sys_t
>> +{
>> +    int xyzgamma[4096];
>> +    int rgbgamma[4096];
> Why is all this data regenerated for each filter instance?
Agree, How I can Initialize it only once?
>
>> +    int matrix[3][3];
> This matrix should probably be a static const.
Okay
>
>> +   double v_xyzgamma ;
>> +   double v_rgbgamma ;
> These values could probably be symbolic constants. Also do you really need
> double precision?
Okay
> +static void InitFilter( filter_sys_t *p_sys)
> +{
> +    int i;
> +    p_sys->v_xyzgamma = XYZGAMMA;
> +    p_sys->v_rgbgamma = RGBGAMMA;
> +
> +    for (i = 0; i < 4096; i++)
> +        {
> +        p_sys->xyzgamma[i] =
> (int)(pow(i/4095.0,p_sys->v_xyzgamma)*4095.0+0.5);
> +        p_sys->rgbgamma[i] =
> (int)(pow(i/4095.0,p_sys->v_rgbgamma)*4095.0+0.5);
> +        }
> Same question... If not, you should use powf() and the f constant postfix.
Actually i didn't found the question -)





More information about the vlc-devel mailing list