Am 21.11.2011 19:41, schrieb Einar Rünkaru:
> Linear interoplation is not applicable to on/off switch
> Rounding interpolated blur radius value
> Fix proposed by Michal Fapso <[email protected]>

BTW, I would very much appreciate if you would include the complete
explanation why this fix is needed in the commit message, including the
symptoms that can be seen without the patch. For example:

-----
Do not interpolate on-off-switches for two reasons:

- It does not make sense. To use the setting of the preceding keyframe
  is the only thing that makes sense.

- When both the previous and the next keyframe have the setting at one,
  then the exact result of the numeric computation should be one as
  well. However, the sum of prev_scale and next_scale can be slightly
  less than one due to floatingpoint rounding. In such a case, the
  value is truncated to zero, and causes the blur to be turned off
  spuriously, causing flickering video in the interpolated range.

Also do not just truncate the interpolated value of the blur radius,
but round it.

Fix proposed by Michal Fapso <[email protected]>
------

-       this->vertical = (int)(prev.vertical * prev_scale + next.vertical *
next_scale);
-       this->horizontal = (int)(prev.horizontal * prev_scale +
next.horizontal * next_scale);
-       this->radius = (int)(prev.radius * prev_scale + next.radius * 
next_scale);
+       this->vertical = prev.vertical;
+       this->horizontal = prev.horizontal;
+       this->radius = round(prev.radius * prev_scale + next.radius * 
next_scale);

Don't you see a warning here? There result of round() is still double
and should require a cast to int.

-- Hannes

_______________________________________________
Cinelerra mailing list
[email protected]
https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra

Reply via email to