diff mbox series

[FFmpeg-devel,02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified

Message ID 20240622231520.7410-2-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/10,v4] avutil/stereo3d: add a Monoscopic view enum value | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer June 22, 2024, 11:15 p.m. UTC
Given that a video stream/frame may have only one or both views coded with
the packing information being unavailable, this commit adds a new type value
AV_STEREO3D_UNSPEC for this purpose.
The most common case for this is container level signaling of Stereo3D video
where the specifics are defined at the bitstream level.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/stereo3d.c | 1 +
 libavutil/stereo3d.h | 6 ++++++
 2 files changed, 7 insertions(+)

Comments

Vittorio Giovara June 25, 2024, 6:30 p.m. UTC | #1
On Sun, Jun 23, 2024 at 1:16 AM James Almer <jamrial@gmail.com> wrote:

> Given that a video stream/frame may have only one or both views coded with
> the packing information being unavailable, this commit adds a new type
> value
> AV_STEREO3D_UNSPEC for this purpose.
>

not to bikeshed the name, but why UNSPEC instead of UNKNOWN?
Vittorio


> The most common case for this is container level signaling of Stereo3D
> video
> where the specifics are defined at the bitstream level.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavutil/stereo3d.c | 1 +
>  libavutil/stereo3d.h | 6 ++++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c
> index 37cf093099..1f944e9cac 100644
> --- a/libavutil/stereo3d.c
> +++ b/libavutil/stereo3d.c
> @@ -65,6 +65,7 @@ static const char * const stereo3d_type_names[] = {
>      [AV_STEREO3D_SIDEBYSIDE_QUINCUNX] = "side by side (quincunx
> subsampling)",
>      [AV_STEREO3D_LINES]               = "interleaved lines",
>      [AV_STEREO3D_COLUMNS]             = "interleaved columns",
> +    [AV_STEREO3D_UNSPEC]              = "unspecified",
>  };
>
>  static const char * const stereo3d_view_names[] = {
> diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h
> index 9a004d88a1..deddecfb36 100644
> --- a/libavutil/stereo3d.h
> +++ b/libavutil/stereo3d.h
> @@ -136,6 +136,12 @@ enum AVStereo3DType {
>       * @endcode
>       */
>      AV_STEREO3D_COLUMNS,
> +
> +    /**
> +     * Video may be monoscopic, or stereoscopic where the
> +     * packing is unspecified.
> +     */
> +    AV_STEREO3D_UNSPEC,
>  };
>
>  /**
> --
> 2.45.2
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
James Almer June 25, 2024, 7:06 p.m. UTC | #2
On 6/25/2024 3:30 PM, Vittorio Giovara wrote:
> On Sun, Jun 23, 2024 at 1:16 AM James Almer <jamrial@gmail.com> wrote:
> 
>> Given that a video stream/frame may have only one or both views coded with
>> the packing information being unavailable, this commit adds a new type
>> value
>> AV_STEREO3D_UNSPEC for this purpose.
>>
> 
> not to bikeshed the name, but why UNSPEC instead of UNKNOWN?

It's what was used in ch_layout, so i figured I'd use it here too.

> Vittorio
> 
> 
>> The most common case for this is container level signaling of Stereo3D
>> video
>> where the specifics are defined at the bitstream level.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   libavutil/stereo3d.c | 1 +
>>   libavutil/stereo3d.h | 6 ++++++
>>   2 files changed, 7 insertions(+)
>>
>> diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c
>> index 37cf093099..1f944e9cac 100644
>> --- a/libavutil/stereo3d.c
>> +++ b/libavutil/stereo3d.c
>> @@ -65,6 +65,7 @@ static const char * const stereo3d_type_names[] = {
>>       [AV_STEREO3D_SIDEBYSIDE_QUINCUNX] = "side by side (quincunx
>> subsampling)",
>>       [AV_STEREO3D_LINES]               = "interleaved lines",
>>       [AV_STEREO3D_COLUMNS]             = "interleaved columns",
>> +    [AV_STEREO3D_UNSPEC]              = "unspecified",
>>   };
>>
>>   static const char * const stereo3d_view_names[] = {
>> diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h
>> index 9a004d88a1..deddecfb36 100644
>> --- a/libavutil/stereo3d.h
>> +++ b/libavutil/stereo3d.h
>> @@ -136,6 +136,12 @@ enum AVStereo3DType {
>>        * @endcode
>>        */
>>       AV_STEREO3D_COLUMNS,
>> +
>> +    /**
>> +     * Video may be monoscopic, or stereoscopic where the
>> +     * packing is unspecified.
>> +     */
>> +    AV_STEREO3D_UNSPEC,
>>   };
>>
>>   /**
>> --
>> 2.45.2
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>
> 
>
Anton Khirnov June 25, 2024, 7:10 p.m. UTC | #3
Quoting James Almer (2024-06-23 01:15:12)
> Given that a video stream/frame may have only one or both views coded with
> the packing information being unavailable, this commit adds a new type value
> AV_STEREO3D_UNSPEC for this purpose.
> The most common case for this is container level signaling of Stereo3D video
> where the specifics are defined at the bitstream level.

So what information does the side data contain then?
James Almer June 25, 2024, 7:14 p.m. UTC | #4
On 6/25/2024 4:10 PM, Anton Khirnov wrote:
> Quoting James Almer (2024-06-23 01:15:12)
>> Given that a video stream/frame may have only one or both views coded with
>> the packing information being unavailable, this commit adds a new type value
>> AV_STEREO3D_UNSPEC for this purpose.
>> The most common case for this is container level signaling of Stereo3D video
>> where the specifics are defined at the bitstream level.
> 
> So what information does the side data contain then?

Everything but the packing type (AVStereo3DView, AVStereo3DPrimaryEye, 
baseline, horizontal_disparity_adjustment, and 
horizontal_field_of_view), which is what the vexu and hfov boxes signal.
Anton Khirnov June 25, 2024, 7:39 p.m. UTC | #5
Quoting James Almer (2024-06-25 21:14:01)
> On 6/25/2024 4:10 PM, Anton Khirnov wrote:
> > Quoting James Almer (2024-06-23 01:15:12)
> >> Given that a video stream/frame may have only one or both views coded with
> >> the packing information being unavailable, this commit adds a new type value
> >> AV_STEREO3D_UNSPEC for this purpose.
> >> The most common case for this is container level signaling of Stereo3D video
> >> where the specifics are defined at the bitstream level.
> > 
> > So what information does the side data contain then?
> 
> Everything but the packing type (AVStereo3DView, AVStereo3DPrimaryEye, 
> baseline, horizontal_disparity_adjustment, and 
> horizontal_field_of_view), which is what the vexu and hfov boxes signal.

Don't all these imply the video is stereo?
James Almer June 25, 2024, 7:43 p.m. UTC | #6
On 6/25/2024 4:39 PM, Anton Khirnov wrote:
> Quoting James Almer (2024-06-25 21:14:01)
>> On 6/25/2024 4:10 PM, Anton Khirnov wrote:
>>> Quoting James Almer (2024-06-23 01:15:12)
>>>> Given that a video stream/frame may have only one or both views coded with
>>>> the packing information being unavailable, this commit adds a new type value
>>>> AV_STEREO3D_UNSPEC for this purpose.
>>>> The most common case for this is container level signaling of Stereo3D video
>>>> where the specifics are defined at the bitstream level.
>>>
>>> So what information does the side data contain then?
>>
>> Everything but the packing type (AVStereo3DView, AVStereo3DPrimaryEye,
>> baseline, horizontal_disparity_adjustment, and
>> horizontal_field_of_view), which is what the vexu and hfov boxes signal.
> 
> Don't all these imply the video is stereo?

Yes, but not how the views are packed.
I changed the description locally to "Video is stereoscopic but the 
packing is unspecified.", fwiw. 2D should be the only value for monoscopic.
Anton Khirnov June 26, 2024, 6:33 a.m. UTC | #7
Quoting James Almer (2024-06-25 21:43:02)
> On 6/25/2024 4:39 PM, Anton Khirnov wrote:
> > Quoting James Almer (2024-06-25 21:14:01)
> >> On 6/25/2024 4:10 PM, Anton Khirnov wrote:
> >>> Quoting James Almer (2024-06-23 01:15:12)
> >>>> Given that a video stream/frame may have only one or both views coded with
> >>>> the packing information being unavailable, this commit adds a new type value
> >>>> AV_STEREO3D_UNSPEC for this purpose.
> >>>> The most common case for this is container level signaling of Stereo3D video
> >>>> where the specifics are defined at the bitstream level.
> >>>
> >>> So what information does the side data contain then?
> >>
> >> Everything but the packing type (AVStereo3DView, AVStereo3DPrimaryEye,
> >> baseline, horizontal_disparity_adjustment, and
> >> horizontal_field_of_view), which is what the vexu and hfov boxes signal.
> > 
> > Don't all these imply the video is stereo?
> 
> Yes, but not how the views are packed.
> I changed the description locally to "Video is stereoscopic but the 
> packing is unspecified.", fwiw. 2D should be the only value for monoscopic.

Ok, that addresses my concerns.
diff mbox series

Patch

diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c
index 37cf093099..1f944e9cac 100644
--- a/libavutil/stereo3d.c
+++ b/libavutil/stereo3d.c
@@ -65,6 +65,7 @@  static const char * const stereo3d_type_names[] = {
     [AV_STEREO3D_SIDEBYSIDE_QUINCUNX] = "side by side (quincunx subsampling)",
     [AV_STEREO3D_LINES]               = "interleaved lines",
     [AV_STEREO3D_COLUMNS]             = "interleaved columns",
+    [AV_STEREO3D_UNSPEC]              = "unspecified",
 };
 
 static const char * const stereo3d_view_names[] = {
diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h
index 9a004d88a1..deddecfb36 100644
--- a/libavutil/stereo3d.h
+++ b/libavutil/stereo3d.h
@@ -136,6 +136,12 @@  enum AVStereo3DType {
      * @endcode
      */
     AV_STEREO3D_COLUMNS,
+
+    /**
+     * Video may be monoscopic, or stereoscopic where the
+     * packing is unspecified.
+     */
+    AV_STEREO3D_UNSPEC,
 };
 
 /**