* [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value
@ 2024-06-22 23:15 James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified James Almer
` (9 more replies)
0 siblings, 10 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
We need a way to signal the frame has a single view that doesn't map to any
particular eye, and it should be the default one.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavutil/stereo3d.c | 1 +
libavutil/stereo3d.h | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c
index 19e81e4124..37cf093099 100644
--- a/libavutil/stereo3d.c
+++ b/libavutil/stereo3d.c
@@ -71,6 +71,7 @@ static const char * const stereo3d_view_names[] = {
[AV_STEREO3D_VIEW_PACKED] = "packed",
[AV_STEREO3D_VIEW_LEFT] = "left",
[AV_STEREO3D_VIEW_RIGHT] = "right",
+ [AV_STEREO3D_VIEW_MONO] = "monoscopic",
};
static const char * const stereo3d_primary_eye_names[] = {
diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h
index 00a5c3900e..9a004d88a1 100644
--- a/libavutil/stereo3d.h
+++ b/libavutil/stereo3d.h
@@ -156,6 +156,11 @@ enum AVStereo3DView {
* Frame contains only the right view.
*/
AV_STEREO3D_VIEW_RIGHT,
+
+ /**
+ * Frame is monoscopic.
+ */
+ AV_STEREO3D_VIEW_MONO,
};
/**
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-25 18:30 ` Vittorio Giovara
2024-06-25 19:10 ` Anton Khirnov
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 03/10 v3] avformat/mov: default to Monoscopic view when parsing eyes and st3d boxes James Almer
` (8 subsequent siblings)
9 siblings, 2 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
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(+)
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 03/10 v3] avformat/mov: default to Monoscopic view when parsing eyes and st3d boxes
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 04/10] avcodec/h2645_sei: set Monoscopic view for 2D projection James Almer
` (7 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/mov.c | 16 ++++++++++++++--
tests/ref/fate/mov-spherical-mono | 2 +-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f08fec3fb6..b0930b2936 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6298,6 +6298,7 @@ static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
AVStream *st;
MOVStreamContext *sc;
enum AVStereo3DType type;
+ enum AVStereo3DView view = AV_STEREO3D_VIEW_PACKED;
int mode;
if (c->fc->nb_streams < 1)
@@ -6320,6 +6321,7 @@ static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
switch (mode) {
case 0:
type = AV_STEREO3D_2D;
+ view = AV_STEREO3D_VIEW_MONO;
break;
case 1:
type = AV_STEREO3D_TOPBOTTOM;
@@ -6337,6 +6339,7 @@ static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return AVERROR(ENOMEM);
sc->stereo3d->type = type;
+ sc->stereo3d->view = view;
return 0;
}
@@ -6546,7 +6549,8 @@ static int mov_read_eyes(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int size, flags = 0;
int64_t remaining;
uint32_t tag, baseline = 0;
- enum AVStereo3DView view = AV_STEREO3D_VIEW_PACKED;
+ enum AVStereo3DType type = AV_STEREO3D_2D;
+ enum AVStereo3DView view = AV_STEREO3D_VIEW_MONO;
enum AVStereo3DPrimaryEye primary_eye = AV_PRIMARY_EYE_NONE;
AVRational horizontal_disparity_adjustment = { 0, 1 };
@@ -6596,6 +6600,9 @@ static int mov_read_eyes(MOVContext *c, AVIOContext *pb, MOVAtom atom)
view = AV_STEREO3D_VIEW_LEFT;
else if (has_right)
view = AV_STEREO3D_VIEW_RIGHT;
+ if (view)
+ type = AV_STEREO3D_UNSPEC;
+
break;
}
case MKTAG('h','e','r','o'): {
@@ -6697,6 +6704,7 @@ static int mov_read_eyes(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
sc->stereo3d->flags = flags;
+ sc->stereo3d->type = type;
sc->stereo3d->view = view;
sc->stereo3d->primary_eye = primary_eye;
sc->stereo3d->baseline = baseline;
@@ -6818,19 +6826,23 @@ static int mov_parse_uuid_spherical(MOVStreamContext *sc, AVIOContext *pb, size_
if (av_stristr(buffer, "<GSpherical:StereoMode>") && !sc->stereo3d) {
enum AVStereo3DType mode;
+ enum AVStereo3DView view = AV_STEREO3D_VIEW_PACKED;
if (av_stristr(buffer, "left-right"))
mode = AV_STEREO3D_SIDEBYSIDE;
else if (av_stristr(buffer, "top-bottom"))
mode = AV_STEREO3D_TOPBOTTOM;
- else
+ else {
mode = AV_STEREO3D_2D;
+ view = AV_STEREO3D_VIEW_MONO;
+ }
sc->stereo3d = av_stereo3d_alloc();
if (!sc->stereo3d)
goto out;
sc->stereo3d->type = mode;
+ sc->stereo3d->view = view;
}
/* orientation */
diff --git a/tests/ref/fate/mov-spherical-mono b/tests/ref/fate/mov-spherical-mono
index b108596350..aa17e9c624 100644
--- a/tests/ref/fate/mov-spherical-mono
+++ b/tests/ref/fate/mov-spherical-mono
@@ -3,7 +3,7 @@
side_data_type=Stereo 3D
type=2D
inverted=0
-view=packed
+view=monoscopic
primary_eye=none
baseline=0
horizontal_disparity_adjustment=0/1
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 04/10] avcodec/h2645_sei: set Monoscopic view for 2D projection
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 03/10 v3] avformat/mov: default to Monoscopic view when parsing eyes and st3d boxes James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 05/10] avcodec/mjpegdec: " James Almer
` (6 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
packed view (current default) is obviously not correct.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/h2645_sei.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/h2645_sei.c b/libavcodec/h2645_sei.c
index 7c83747cd0..b30d2c1ca8 100644
--- a/libavcodec/h2645_sei.c
+++ b/libavcodec/h2645_sei.c
@@ -714,6 +714,7 @@ int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei,
#if CONFIG_H264_SEI
case SEI_FPA_H264_TYPE_2D:
stereo->type = AV_STEREO3D_2D;
+ stereo->view = AV_STEREO3D_VIEW_MONO;
break;
#endif
}
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 05/10] avcodec/mjpegdec: set Monoscopic view for 2D projection
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
` (2 preceding siblings ...)
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 04/10] avcodec/h2645_sei: set Monoscopic view for 2D projection James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 06/10] avcodec/mpeg12dec: " James Almer
` (5 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/mjpegdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 1481a7f285..ec16186532 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2019,6 +2019,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
}
if (type == 0) {
s->stereo3d->type = AV_STEREO3D_2D;
+ s->stereo3d->view = AV_STEREO3D_VIEW_MONO;
} else if (type == 1) {
switch (layout) {
case 0x01:
@@ -2825,6 +2826,7 @@ the_end:
AVStereo3D *stereo = av_stereo3d_create_side_data(frame);
if (stereo) {
stereo->type = s->stereo3d->type;
+ stereo->view = s->stereo3d->view;
stereo->flags = s->stereo3d->flags;
}
av_freep(&s->stereo3d);
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 06/10] avcodec/mpeg12dec: set Monoscopic view for 2D projection
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
` (3 preceding siblings ...)
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 05/10] avcodec/mjpegdec: " James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 07/10] avformat/matroska: " James Almer
` (4 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/mpeg12dec.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 7485b7c65f..fad79aa018 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2125,6 +2125,7 @@ static void mpeg_decode_user_data(AVCodecContext *avctx,
break;
case 0x08:
s1->stereo3d.type = AV_STEREO3D_2D;
+ s1->stereo3d.view = AV_STEREO3D_VIEW_MONO;
break;
case 0x23:
s1->stereo3d.type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 07/10] avformat/matroska: set Monoscopic view for 2D projection
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
` (4 preceding siblings ...)
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 06/10] avcodec/mpeg12dec: " James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 08/10 v3] avutil/stereo3d: add a new allocator function that returns a size James Almer
` (3 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/matroska.h | 36 ++++++++++++--------
libavformat/matroskadec.c | 6 ++--
libavformat/matroskaenc.c | 8 ++---
tests/ref/fate/matroska-spherical-mono | 2 +-
tests/ref/fate/matroska-spherical-mono-remux | 4 +--
tests/ref/fate/matroska-vp8-alpha-remux | 2 +-
6 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/libavformat/matroska.h b/libavformat/matroska.h
index 719f2ef796..8c4d8dcb99 100644
--- a/libavformat/matroska.h
+++ b/libavformat/matroska.h
@@ -392,35 +392,41 @@ extern const AVMetadataConv ff_mkv_metadata_conv[];
* as well as WebM compatibility.
*
* MAP and MKV_ONLY are macros to be provided by the user.
- * MAP(MatroskaVideoStereoModeType, AVStereo3DType, AV_STEREO3D_FLAG_*,
- * HALF_WIDTH, HALF_HEIGHT, WebM-compatibility)
+ * MAP(MatroskaVideoStereoModeType, AVStereo3DType, AVStereo3DView,
+ * AV_STEREO3D_FLAG_*, HALF_WIDTH, HALF_HEIGHT, WebM-compatibility)
* is for the stereo modes that have a Stereo3D counterpart.
* MKV_ONLY(MatroskaVideoStereoModeType, HALF_WIDTH, HALF_HEIGHT, WebM)
* is for those that don't have a Stereo3D counterpart.
* */
#define STEREOMODE_STEREO3D_MAPPING(MAP, MKV_ONLY) \
- MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_MONO, AV_STEREO3D_2D, 0, 0, 0, 1) \
- MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT, AV_STEREO3D_SIDEBYSIDE, 0, 1, 0, 1) \
+ MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_MONO, AV_STEREO3D_2D, \
+ AV_STEREO3D_VIEW_MONO, 0, 0, 0, 1) \
+ MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT, AV_STEREO3D_SIDEBYSIDE, \
+ AV_STEREO3D_VIEW_PACKED, 0, 1, 0, 1) \
MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP, AV_STEREO3D_TOPBOTTOM, \
- AV_STEREO3D_FLAG_INVERT, 0, 1, 1) \
- MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM, AV_STEREO3D_TOPBOTTOM, 0, 0, 1, 1) \
+ AV_STEREO3D_VIEW_PACKED, AV_STEREO3D_FLAG_INVERT, 0, 1, 1) \
+ MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM, AV_STEREO3D_TOPBOTTOM, \
+ AV_STEREO3D_VIEW_PACKED, 0, 0, 1, 1) \
MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL, AV_STEREO3D_CHECKERBOARD, \
- AV_STEREO3D_FLAG_INVERT, 0, 0, 0) \
- MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR, AV_STEREO3D_CHECKERBOARD, 0, 0, 0, 0) \
+ AV_STEREO3D_VIEW_PACKED, AV_STEREO3D_FLAG_INVERT, 0, 0, 0) \
+ MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR, AV_STEREO3D_CHECKERBOARD, \
+ AV_STEREO3D_VIEW_PACKED, 0, 0, 0, 0) \
MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL, AV_STEREO3D_LINES, \
- AV_STEREO3D_FLAG_INVERT, 0, 1, 0) \
- MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR, AV_STEREO3D_LINES, 0, 0, 1, 0) \
+ AV_STEREO3D_VIEW_PACKED, AV_STEREO3D_FLAG_INVERT, 0, 1, 0) \
+ MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR, AV_STEREO3D_LINES, \
+ AV_STEREO3D_VIEW_PACKED, 0, 0, 1, 0) \
MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL, AV_STEREO3D_COLUMNS, \
- AV_STEREO3D_FLAG_INVERT, 1, 0, 0) \
- MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR, AV_STEREO3D_COLUMNS, 0, 1, 0, 0) \
+ AV_STEREO3D_VIEW_PACKED, AV_STEREO3D_FLAG_INVERT, 1, 0, 0) \
+ MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR, AV_STEREO3D_COLUMNS, \
+ AV_STEREO3D_VIEW_PACKED, 0, 1, 0, 0) \
MKV_ONLY(MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED, 0, 0, 0) \
MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT, AV_STEREO3D_SIDEBYSIDE, \
- AV_STEREO3D_FLAG_INVERT, 1, 0, 1) \
+ AV_STEREO3D_VIEW_PACKED, AV_STEREO3D_FLAG_INVERT, 1, 0, 1) \
MKV_ONLY(MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG, 0, 0, 0) \
MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR, AV_STEREO3D_FRAMESEQUENCE, \
- 0, 0, 0, 0) \
+ AV_STEREO3D_VIEW_PACKED, 0, 0, 0, 0) \
MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL, AV_STEREO3D_FRAMESEQUENCE, \
- AV_STEREO3D_FLAG_INVERT, 0, 0, 0)
+ AV_STEREO3D_VIEW_PACKED, AV_STEREO3D_FLAG_INVERT, 0, 0, 0)
extern const char * const ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB];
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 6bc5fa621e..e6437ac68f 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2245,10 +2245,11 @@ static int mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mo
{
static const struct {
char type;
+ char view;
char flags;
} stereo_mode_conv [] = {
-#define STEREO_MODE_CONV(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM) \
- [(STEREOMODETYPE)] = { .type = (STEREO3DTYPE), .flags = (FLAGS) },
+#define STEREO_MODE_CONV(STEREOMODETYPE, STEREO3DTYPE, STEREO3DVIEW, FLAGS, WDIV, HDIV, WEBM) \
+ [(STEREOMODETYPE)] = { .type = (STEREO3DTYPE), .view = (STEREO3DVIEW), .flags = (FLAGS) },
#define NOTHING(STEREOMODETYPE, WDIV, HDIV, WEBM)
STEREOMODE_STEREO3D_MAPPING(STEREO_MODE_CONV, NOTHING)
};
@@ -2259,6 +2260,7 @@ static int mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mo
return AVERROR(ENOMEM);
stereo->type = stereo_mode_conv[stereo_mode].type;
+ stereo->view = stereo_mode_conv[stereo_mode].view;
stereo->flags = stereo_mode_conv[stereo_mode].flags;
if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 094cf61357..dfcdda1adc 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1605,20 +1605,20 @@ static int mkv_write_stereo_mode(AVFormatContext *s, EbmlWriter *writer,
* indicates whether the MatroskaVideoStereoModeType with that value
* uses double width/height or is WebM compatible. */
#define FLAG(STEREOMODETYPE, BOOL) | (BOOL) << (STEREOMODETYPE)
-#define WDIV1(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM) \
+#define WDIV1(STEREOMODETYPE, STEREO3DTYPE, STEREO3DVIEW, FLAGS, WDIV, HDIV, WEBM) \
FLAG(STEREOMODETYPE, WDIV)
#define WDIV2(STEREOMODETYPE, WDIV, HDIV, WEBM) \
FLAG(STEREOMODETYPE, WDIV)
// The zero in the following line consumes the first '|'.
const unsigned width_bitfield = 0 STEREOMODE_STEREO3D_MAPPING(WDIV1, WDIV2);
-#define HDIV1(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM) \
+#define HDIV1(STEREOMODETYPE, STEREO3DTYPE, STEREO3DVIEW, FLAGS, WDIV, HDIV, WEBM) \
FLAG(STEREOMODETYPE, HDIV)
#define HDIV2(STEREOMODETYPE, WDIV, HDIV, WEBM) \
FLAG(STEREOMODETYPE, HDIV)
const unsigned height_bitfield = 0 STEREOMODE_STEREO3D_MAPPING(HDIV1, HDIV2);
-#define WEBM1(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM) \
+#define WEBM1(STEREOMODETYPE, STEREO3DTYPE, STEREO3DVIEW, FLAGS, WDIV, HDIV, WEBM) \
FLAG(STEREOMODETYPE, WEBM)
#define WEBM2(STEREOMODETYPE, WDIV, HDIV, WEBM) \
FLAG(STEREOMODETYPE, WEBM)
@@ -1646,7 +1646,7 @@ static int mkv_write_stereo_mode(AVFormatContext *s, EbmlWriter *writer,
const AVStereo3D *stereo;
/* The following macro presumes all MATROSKA_VIDEO_STEREOMODE_TYPE_*
* values to be in the range 0..254. */
-#define STEREOMODE(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM) \
+#define STEREOMODE(STEREOMODETYPE, STEREO3DTYPE, STEREO3DVIEW, FLAGS, WDIV, HDIV, WEBM) \
[(STEREO3DTYPE)][!!((FLAGS) & AV_STEREO3D_FLAG_INVERT)] = (STEREOMODETYPE) + 1,
#define NOTHING(STEREOMODETYPE, WDIV, HDIV, WEBM)
static const unsigned char conversion_table[][2] = {
diff --git a/tests/ref/fate/matroska-spherical-mono b/tests/ref/fate/matroska-spherical-mono
index b108596350..aa17e9c624 100644
--- a/tests/ref/fate/matroska-spherical-mono
+++ b/tests/ref/fate/matroska-spherical-mono
@@ -3,7 +3,7 @@
side_data_type=Stereo 3D
type=2D
inverted=0
-view=packed
+view=monoscopic
primary_eye=none
baseline=0
horizontal_disparity_adjustment=0/1
diff --git a/tests/ref/fate/matroska-spherical-mono-remux b/tests/ref/fate/matroska-spherical-mono-remux
index eec41b77f3..75a9b73a37 100644
--- a/tests/ref/fate/matroska-spherical-mono-remux
+++ b/tests/ref/fate/matroska-spherical-mono-remux
@@ -27,7 +27,7 @@ DISPOSITION:forced=1
side_data_type=Stereo 3D
type=2D
inverted=0
-view=packed
+view=monoscopic
primary_eye=none
baseline=0
horizontal_disparity_adjustment=0/1
@@ -56,7 +56,7 @@ DISPOSITION:forced=0
side_data_type=Stereo 3D
type=2D
inverted=0
-view=packed
+view=monoscopic
primary_eye=none
baseline=0
horizontal_disparity_adjustment=0/1
diff --git a/tests/ref/fate/matroska-vp8-alpha-remux b/tests/ref/fate/matroska-vp8-alpha-remux
index 06bcc4b4ba..814463eeda 100644
--- a/tests/ref/fate/matroska-vp8-alpha-remux
+++ b/tests/ref/fate/matroska-vp8-alpha-remux
@@ -35,7 +35,7 @@ DISPOSITION:still_image=0
side_data_type=Stereo 3D
type=2D
inverted=0
-view=packed
+view=monoscopic
primary_eye=none
baseline=0
horizontal_disparity_adjustment=0/1
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 08/10 v3] avutil/stereo3d: add a new allocator function that returns a size
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
` (5 preceding siblings ...)
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 07/10] avformat/matroska: " James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 09/10 v3] avformat/mov: don't use sizeof(AVStereo3D) James Almer
` (2 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
av_stereo3d_alloc() is not useful in scenarios where you need to know the
runtime size of AVStereo3D.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavutil/stereo3d.c | 8 ++++++++
libavutil/stereo3d.h | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c
index 1f944e9cac..0eaa8154d9 100644
--- a/libavutil/stereo3d.c
+++ b/libavutil/stereo3d.c
@@ -32,6 +32,11 @@ static void get_defaults(AVStereo3D *stereo)
}
AVStereo3D *av_stereo3d_alloc(void)
+{
+ return av_stereo3d_alloc_size(NULL);
+}
+
+AVStereo3D *av_stereo3d_alloc_size(size_t *size)
{
AVStereo3D *stereo = av_mallocz(sizeof(AVStereo3D));
if (!stereo)
@@ -39,6 +44,9 @@ AVStereo3D *av_stereo3d_alloc(void)
get_defaults(stereo);
+ if (size)
+ *size = sizeof(*stereo);
+
return stereo;
}
diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h
index deddecfb36..a2e480b1ff 100644
--- a/libavutil/stereo3d.h
+++ b/libavutil/stereo3d.h
@@ -248,6 +248,14 @@ typedef struct AVStereo3D {
*/
AVStereo3D *av_stereo3d_alloc(void);
+/**
+ * Allocate an AVStereo3D structure and set its fields to default values.
+ * The resulting struct can be freed using av_freep().
+ *
+ * @return An AVStereo3D filled with default values or NULL on failure.
+ */
+AVStereo3D *av_stereo3d_alloc_size(size_t *size);
+
/**
* Allocate a complete AVFrameSideData and add it to the frame.
*
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 09/10 v3] avformat/mov: don't use sizeof(AVStereo3D)
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
` (6 preceding siblings ...)
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 08/10 v3] avutil/stereo3d: add a new allocator function that returns a size James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 10/10 v3] avformat/matroskadec: " James Almer
2024-06-24 12:58 ` [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
It's not part of the libavutil ABI.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/isom.h | 1 +
libavformat/mov.c | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 35b767a52c..a0498f45e5 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -247,6 +247,7 @@ typedef struct MOVStreamContext {
int32_t *display_matrix;
AVStereo3D *stereo3d;
+ size_t stereo3d_size;
AVSphericalMapping *spherical;
size_t spherical_size;
AVMasteringDisplayMetadata *mastering;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b0930b2936..650b5c2a40 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6334,7 +6334,7 @@ static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
- sc->stereo3d = av_stereo3d_alloc();
+ sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
if (!sc->stereo3d)
return AVERROR(ENOMEM);
@@ -6698,7 +6698,7 @@ static int mov_read_eyes(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
if (!sc->stereo3d) {
- sc->stereo3d = av_stereo3d_alloc();
+ sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
if (!sc->stereo3d)
return AVERROR(ENOMEM);
}
@@ -6785,7 +6785,7 @@ static int mov_read_hfov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (!sc->stereo3d) {
- sc->stereo3d = av_stereo3d_alloc();
+ sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
if (!sc->stereo3d)
return AVERROR(ENOMEM);
}
@@ -6837,7 +6837,7 @@ static int mov_parse_uuid_spherical(MOVStreamContext *sc, AVIOContext *pb, size_
view = AV_STEREO3D_VIEW_MONO;
}
- sc->stereo3d = av_stereo3d_alloc();
+ sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
if (!sc->stereo3d)
goto out;
@@ -10039,7 +10039,7 @@ static int mov_read_header(AVFormatContext *s)
if (sc->stereo3d) {
if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
AV_PKT_DATA_STEREO3D,
- (uint8_t *)sc->stereo3d, sizeof(*sc->stereo3d), 0))
+ (uint8_t *)sc->stereo3d, sc->stereo3d_size, 0))
return AVERROR(ENOMEM);
sc->stereo3d = NULL;
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* [FFmpeg-devel] [PATCH 10/10 v3] avformat/matroskadec: don't use sizeof(AVStereo3D)
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
` (7 preceding siblings ...)
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 09/10 v3] avformat/mov: don't use sizeof(AVStereo3D) James Almer
@ 2024-06-22 23:15 ` James Almer
2024-06-24 12:58 ` [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-22 23:15 UTC (permalink / raw)
To: ffmpeg-devel
It's not part of the libavutil ABI.
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavformat/matroskadec.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e6437ac68f..f090d8d798 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2254,8 +2254,9 @@ static int mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mo
STEREOMODE_STEREO3D_MAPPING(STEREO_MODE_CONV, NOTHING)
};
AVStereo3D *stereo;
+ size_t size;
- stereo = av_stereo3d_alloc();
+ stereo = av_stereo3d_alloc_size(&size);
if (!stereo)
return AVERROR(ENOMEM);
@@ -2264,7 +2265,7 @@ static int mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mo
stereo->flags = stereo_mode_conv[stereo_mode].flags;
if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
- AV_PKT_DATA_STEREO3D, stereo, sizeof(*stereo), 0)) {
+ AV_PKT_DATA_STEREO3D, stereo, size, 0)) {
av_freep(&stereo);
return AVERROR(ENOMEM);
}
--
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
` (8 preceding siblings ...)
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 10/10 v3] avformat/matroskadec: " James Almer
@ 2024-06-24 12:58 ` James Almer
9 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-24 12:58 UTC (permalink / raw)
To: ffmpeg-devel
On 6/22/2024 8:15 PM, James Almer wrote:
> We need a way to signal the frame has a single view that doesn't map to any
> particular eye, and it should be the default one.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> libavutil/stereo3d.c | 1 +
> libavutil/stereo3d.h | 5 +++++
> 2 files changed, 6 insertions(+)
>
> diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c
> index 19e81e4124..37cf093099 100644
> --- a/libavutil/stereo3d.c
> +++ b/libavutil/stereo3d.c
> @@ -71,6 +71,7 @@ static const char * const stereo3d_view_names[] = {
> [AV_STEREO3D_VIEW_PACKED] = "packed",
> [AV_STEREO3D_VIEW_LEFT] = "left",
> [AV_STEREO3D_VIEW_RIGHT] = "right",
> + [AV_STEREO3D_VIEW_MONO] = "monoscopic",
> };
>
> static const char * const stereo3d_primary_eye_names[] = {
> diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h
> index 00a5c3900e..9a004d88a1 100644
> --- a/libavutil/stereo3d.h
> +++ b/libavutil/stereo3d.h
> @@ -156,6 +156,11 @@ enum AVStereo3DView {
> * Frame contains only the right view.
> */
> AV_STEREO3D_VIEW_RIGHT,
> +
> + /**
> + * Frame is monoscopic.
> + */
> + AV_STEREO3D_VIEW_MONO,
> };
>
> /**
Looking more into this, i don't know if this is a good idea, or even
backwards compatible. AVStereo3DView is right now only ever looked at if
type is not 2D, so adding a view that only applies to 2D seems
pointless. And if we make it the default, users (wrongly) making the
assumption packed view is the default will find themselves with a 3D
type signaling a monoscopic view.
For now I'll apply patch 2 adding unspec type plus the patches that
don't deal with the view added here, unless there are objections.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified James Almer
@ 2024-06-25 18:30 ` Vittorio Giovara
2024-06-25 19:06 ` James Almer
2024-06-25 19:10 ` Anton Khirnov
1 sibling, 1 reply; 18+ messages in thread
From: Vittorio Giovara @ 2024-06-25 18:30 UTC (permalink / raw)
To: FFmpeg development discussions and patches
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".
>
--
Vittorio
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-25 18:30 ` Vittorio Giovara
@ 2024-06-25 19:06 ` James Almer
0 siblings, 0 replies; 18+ messages in thread
From: James Almer @ 2024-06-25 19:06 UTC (permalink / raw)
To: ffmpeg-devel
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".
>>
>
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified James Almer
2024-06-25 18:30 ` Vittorio Giovara
@ 2024-06-25 19:10 ` Anton Khirnov
2024-06-25 19:14 ` James Almer
1 sibling, 1 reply; 18+ messages in thread
From: Anton Khirnov @ 2024-06-25 19:10 UTC (permalink / raw)
To: FFmpeg development discussions and patches
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?
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-25 19:10 ` Anton Khirnov
@ 2024-06-25 19:14 ` James Almer
2024-06-25 19:39 ` Anton Khirnov
0 siblings, 1 reply; 18+ messages in thread
From: James Almer @ 2024-06-25 19:14 UTC (permalink / raw)
To: ffmpeg-devel
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.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-25 19:14 ` James Almer
@ 2024-06-25 19:39 ` Anton Khirnov
2024-06-25 19:43 ` James Almer
0 siblings, 1 reply; 18+ messages in thread
From: Anton Khirnov @ 2024-06-25 19:39 UTC (permalink / raw)
To: FFmpeg development discussions and patches
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?
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-25 19:39 ` Anton Khirnov
@ 2024-06-25 19:43 ` James Almer
2024-06-26 6:33 ` Anton Khirnov
0 siblings, 1 reply; 18+ messages in thread
From: James Almer @ 2024-06-25 19:43 UTC (permalink / raw)
To: ffmpeg-devel
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.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified
2024-06-25 19:43 ` James Almer
@ 2024-06-26 6:33 ` Anton Khirnov
0 siblings, 0 replies; 18+ messages in thread
From: Anton Khirnov @ 2024-06-26 6:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches
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.
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2024-06-26 6:33 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-22 23:15 [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 02/10] avutil/stereo3d: add a Stereo3D type to signal that the packing is unspecified James Almer
2024-06-25 18:30 ` Vittorio Giovara
2024-06-25 19:06 ` James Almer
2024-06-25 19:10 ` Anton Khirnov
2024-06-25 19:14 ` James Almer
2024-06-25 19:39 ` Anton Khirnov
2024-06-25 19:43 ` James Almer
2024-06-26 6:33 ` Anton Khirnov
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 03/10 v3] avformat/mov: default to Monoscopic view when parsing eyes and st3d boxes James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 04/10] avcodec/h2645_sei: set Monoscopic view for 2D projection James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 05/10] avcodec/mjpegdec: " James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 06/10] avcodec/mpeg12dec: " James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 07/10] avformat/matroska: " James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 08/10 v3] avutil/stereo3d: add a new allocator function that returns a size James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 09/10 v3] avformat/mov: don't use sizeof(AVStereo3D) James Almer
2024-06-22 23:15 ` [FFmpeg-devel] [PATCH 10/10 v3] avformat/matroskadec: " James Almer
2024-06-24 12:58 ` [FFmpeg-devel] [PATCH 01/10 v4] avutil/stereo3d: add a Monoscopic view enum value James Almer
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git