[FFmpeg-devel] [PATCH 1/3] lavu: Add AVSphericalMapping type and frame side data

Vittorio Giovara vittorio.giovara at gmail.com
Sat Nov 12 19:30:52 EET 2016


On Sat, Nov 12, 2016 at 9:41 AM, James Almer <jamrial at gmail.com> wrote:
> On 11/11/2016 10:39 PM, Michael Niedermayer wrote:
>> On Fri, Nov 11, 2016 at 05:49:00PM -0500, Vittorio Giovara wrote:
>> [...]
>>> +/**
>>> + * This structure describes how to handle spherical videos, outlining
>>> + * information about projection, initial layout, and any other view modifier.
>>> + *
>>> + * @note The struct must be allocated with av_spherical_alloc() and
>>> + *       its size is not a part of the public ABI.
>>> + */
>>> +typedef struct AVSphericalMapping {
>>> +    /**
>>> +     * Projection type.
>>> +     */
>>> +    enum AVSphericalProjection projection;
>>> +
>>> +    /**
>>> +     * @name Initial orientation
>>> +     * @{
>>> +     * These fields represent the pose values that measure the rotation
>>> +     * transformation (in degrees) to be applied to the projection.
>>> +     * See this equirectangular projection as example:
>>> +     *
>>> +     * @code{.unparsed}
>>> +     *                   Yaw
>>> +     *     -180           0           180
>>> +     *   90 +-------------+-------------+  180
>>> +     *      |             |             |
>>> +     * P    |             |      o>     |
>>> +     * i    |             ^             |
>>> +     * t  0 +-------------X-------------+    0 Roll
>>> +     * c    |             |             |
>>> +     * h    |             |             |
>>> +     *      |             |             |
>>> +     *  -90 +-------------+-------------+ -180
>>> +     *
>>> +     * X - the default camera center
>>> +     * ^ - the default up vector
>>> +     * > - the up vector for a rotation of 90 degrees
>>> +     * o - the image center for yaw = 90, pitch = 45, roll = 0
>>> +     * @endcode
>>> +     *
>>> +     * The order of transformation is always yaw, followed by pitch, and
>>> +     * finally by roll.
>>> +     */
>>
>>> +    double yaw;   ///< Clockwise rotation around the up vector [-180, 180].
>>> +    double pitch; ///< Counter-clockwise rotation around the right vector [-90, 90].
>>> +    double roll;  ///< Counter-clockwise rotation around the forward vector [-180, 180].
>>
>> please use intXY (64 or 32 as preferred) so there are no platform
>> rounding dependancies

These are rotation angles which are inherently floating point, and
consistent with what other rotation-related APIs export (eg.
av_display_matrix_rotation_get()). Besides using intXX would lose
precision that the original specification offers.
-- 
Vittorio


More information about the ffmpeg-devel mailing list