[vlc-devel] [vlc-commits] motion: move rotate code into the rotate video filter

Pierre Ynard linkfanel at yahoo.fr
Mon Oct 8 06:11:18 CEST 2012


> > motion: move rotate code into the rotate video filter
> > 
> > Where it belongs. Used with --video-filter rotate --rotate-use-motion
> 
> I would avoid branching within a spinning critical section...
> It's not even hard in this case.

Why? And is it better to just always use the spinlocks, even in the case
there is nothing to protect?

> Also b_motion is superfluous:
>     b_motion == (p_motion != NULL)

Fixed, thanks.

> And then:
>     i_angle = ((3600+i_angle/2)%3600);
> is the same as:
>     i_angle = (i_angle / 2) % 3600;

No it's actually not? A negative angle would give a negative result.
Although I suppose it doesn't really matter anymore since it's passed to
cos() and sin() now.

> Though I don't understand why tenth of degrees are used rather than
> floating point.

Because the motion sensors return integers, and we probably don't need
*floating* point decimals here. And because the rotate filter angle
options don't take floats, but that may not strictly hold anymore. I
don't really mind.

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list