:: Re: [Frei0r] [PATCH] Add "colgate",…
Kezdőlap
Delete this message
Reply to this message
Szerző: Dan Dennedy
Dátum:  
Címzett: Minimalistic plugin API for video effects
Tárgy: Re: [Frei0r] [PATCH] Add "colgate", a new color correction plugin.
On Fri, Sep 14, 2012 at 12:51 PM, Steinar H. Gunderson
<sgunderson@???> wrote:
> On Fri, Sep 14, 2012 at 10:33:11AM +0200, Steinar H. Gunderson wrote:
>> I have some optimizations to try to get the CPU load down; we'll see how it
>> goes. I'll send a followup patch if it gets anywhere.
>
> Here's an updated version; I'm precomputing the multiplications so that all
> that's left is the addition, scaling and lookup back to sRGB (at the cost of
> somewhat more loads). This takes the time down from ~13.2 ms/frame to
> ~11.3 ms/frame on my Core i5 (speeds are somewhat variable from run to run,
> so this is an approximate average); with SSE2, it goes down further to ~9.2
> ms/frame, in particular since we can do the clamping of all the elements
> in parallel and without branches.
>
> The precision should also be slightly increased, since there is only one
> rounding step instead of two, and it is to a higher precision (the tables are
> precomputed in full floating point). I doubt this has any visible effects.
>
>
> commit 6821533bc858130551fa029e56b78285055c5987


When I save the original raw e-mail, it is base64-encoded only, which
'git am' does not accept. 'patch' accepted pasting the message body
copied from gmail in the browser, but I would then have to manually
prepare the git commit to reflect your authorship and message. Please
attach the next one if its not a bother.

> Author: Steinar H. Gunderson <sgunderson@???>
> Date: Mon Sep 10 22:34:01 2012 +0200
>
>     Add "colgate", a new color correction plugin.

>

[...]
> +       case COLOR_TEMPERATURE:
> +               inst->color_temperature = *((double *)param);
> +               if (inst->color_temperature < 1000.0 || inst->color_temperature > 15000.0) {
> +                       inst->color_temperature = 6500.0;
> +               }
> +               compute_correction_matrix(inst);
> +               break;


You're gonna love this: frei0r double parameters must be in the range
[0, 1]. :-\ That means you need to scale the [0, 1] input into that
real range of [1000, 15000] and then inversely scale for the
f0r_get_param_value().

Otherwise, it is working good for me, and I appreciate your contribution.

--
+-DRD-+