<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 3, 2013 at 7:32 AM, Nicolas George <span dir="ltr"><<a href="mailto:nicolas.george@normalesup.org" target="_blank">nicolas.george@normalesup.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":19i">> +    float lowlambda = av_clip(120.f / lambda, 0.25f, 1.f);<br>
> +    float rlambda = av_clip(120.f / lambda, 0.3f, 2.f);<br>
> +    const int minq = av_clip(2 * log2f(120.f / lambda) + 150, 100, 218 - SCALE_MAX_DIFF);<br>
> +    const int maxq = minq + SCALE_MAX_DIFF - 1;<br>
<br>
Do you have a specific reason to use float instead of double?</div></blockquote></div><br><br></div><div class="gmail_extra">lambda is a quality scaler, it's clipped to the range 0..65535, so double would be overkill IMO. <br>
Lambda's also a float everywhere else. Mixing float and double arithmetic creates unnecessary conversion steps, slowing things down. <br>Here in particular, I don't think it's critical, but it's good practice to never mix them up - except, perhaps, on trig functions, where the float versions are rather imprecise.<br>
<br></div></div>