[vlc-devel] [PATCH v2 1/8] viewpoint: add reverse viewpoint function
Alexandre Janniaux
ajanni at videolabs.io
Fri Mar 8 09:59:24 CET 2019
Hi,
I don't think it's that more efficient, it even produces exactly the
same code
in -O0 with gcc.
However, it might be a clearer intent and more idiomatic, thank you for
the note.
On 2019-03-08 09:33, Steve Lhomme wrote:
> On 3/6/2019 4:31 PM, Alexandre Janniaux wrote:
>> It reverses the transformation (here rotation only) which is helpful
>> to
>> convert the viewpoint rotation into a world rotation for video
>> outputs.
>> ---
>> include/vlc_viewpoint.h | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/include/vlc_viewpoint.h b/include/vlc_viewpoint.h
>> index b9e162b02e..7c11c86323 100644
>> --- a/include/vlc_viewpoint.h
>> +++ b/include/vlc_viewpoint.h
>> @@ -59,4 +59,18 @@ static inline void vlc_viewpoint_clip(
>> vlc_viewpoint_t *p_vp )
>> FIELD_OF_VIEW_DEGREES_MAX );
>> }
>> +/**
>> + * Reverse the viewpoint rotation.
>> + *
>> + * It can be used to convert a camera view into a world
>> transformation.
>> + *
>> + * \param vp the viewpoint for which the rotation need to be reversed
>> + */
>> +static inline void vlc_viewpoint_reverse( vlc_viewpoint_t *vp )
>> +{
>> + vp->yaw *= -1;
>
> Wouldn't "vp->yaw = -vp->yaw" be more efficient ?
>
>> + vp->pitch *= -1;
>> + vp->roll *= -1;
>> +}
>> +
>> #endif /* VLC_VIEWPOINT_H_ */
>> -- 2.21.0
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list