This structure hosts optional information about
frame composition, frame packing and frame state.
---

I reworked the stereo3d patch into something much more general. Now there is a 
type which determines what the surface contains, and if not unknown or 2d how 
many views are present and how they are relative to each other.
Also I've allocated some space for John's 'showall' patch so that avframe abi 
can stay the same.
If the type structure is ok for everyone I'll implement the alloc/free 
functions and backport my h264/mpeg2 frame packing patches.

Cheers,
    Vittorio

 Changelog             |    1 +
 libavutil/Makefile    |    1 +
 libavutil/structure.h |  164 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 166 insertions(+)
 create mode 100644 libavutil/structure.h

diff --git a/Changelog b/Changelog
index b0ff897..0dcf1ad 100644
--- a/Changelog
+++ b/Changelog
@@ -37,6 +37,7 @@ version 10:
 - Error Resilient AAC syntax (ER AAC LC) decoding
 - Low Delay AAC (ER AAC LD) decoding
 - mux chapters in ASF files
+- frame packing handling
 
 
 version 9:
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 9381c77..5db86c1 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -41,6 +41,7 @@ HEADERS = adler32.h                                           
          \
           rational.h                                                    \
           samplefmt.h                                                   \
           sha.h                                                         \
+          structure.h                                                    \
           time.h                                                        \
           version.h                                                     \
           xtea.h                                                        \
diff --git a/libavutil/structure.h b/libavutil/structure.h
new file mode 100644
index 0000000..2a80720
--- /dev/null
+++ b/libavutil/structure.h
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2013 Vittorio Giovara <[email protected]>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+enum AVFrameStructureType {
+    AV_FRAME_STRUCTURE_UNKNOWN,     //< no information on video surface content
+    AV_FRAME_STRUCTURE_2D,          //< video surface is 2D
+    AV_FRAME_STRUCTURE_S3D,         //< video surface is Stereo-3D
+    AV_FRAME_STRUCTURE_AUTOSTEREO,  //< video surface also contains a depth map
+    AV_FRAME_STRUCTURE_CHROMA_EXT,  //< video surface packs extra chroma planes
+}
+
+enum AVFrameStructureState {
+    AV_FRAME_STATE_NORMAL,          //< frame is ready to be shown
+    AV_FRAME_STATE_BROKEN,          //< frame has some missing parts
+}
+
+/**
+ * How views are packed within the frame.
+ */
+enum AVFrameStructurePack {
+    /**
+     * No frame packing information.
+     */
+    AV_FRAMEPACKING_UNKNOWN,
+
+    /**
+     * Views are alternated temporally.
+     *
+     *     frame0   frame1   frame2   ...
+     *    LLLLLLLL RRRRRRRR LLLLLLLL
+     *    LLLLLLLL RRRRRRRR LLLLLLLL
+     *    LLLLLLLL RRRRRRRR LLLLLLLL
+     *    ...      ...      ...
+     */
+    AV_FRAMEPACKING_FRAMESEQUENCE,
+
+    /**
+     * Views are packed in a checkerboard-like structure per pixel.
+     *
+     *    LRLRLRLR
+     *    RLRLRLRL
+     *    LRLRLRLR
+     *    ...
+     */
+    AV_FRAMEPACKING_CHECKERBOARD,
+
+    /**
+     * Views are packed per line, as if interlaced.
+     *
+     *    LLLLLLLL
+     *    RRRRRRRR
+     *    LLLLLLLL
+     *    ...
+     */
+    AV_FRAMEPACKING_LINES,
+
+    /**
+     * Views are packed per column.
+     *
+     *    LRLRLRLR
+     *    LRLRLRLR
+     *    LRLRLRLR
+     *    ...
+     */
+    AV_FRAMEPACKING_COLUMNS,
+
+    /**
+     * Views are next to each other.
+     *
+     *    LLLLRRRR
+     *    LLLLRRRR
+     *    LLLLRRRR
+     *    ...
+     */
+    AV_FRAMEPACKING_SIDEBYSIDE,
+
+    /**
+     * Views are on top of each other.
+     *
+     *    LLLLLLLL
+     *    LLLLLLLL
+     *    RRRRRRRR
+     *    RRRRRRRR
+     */
+    AV_FRAMEPACKING_TOPBOTTOM,
+
+    /**
+     * Views are colored funny.
+     */
+    AV_FRAMEPACKING_ANAGLYPH,
+
+    /**
+     * Views, lots of them.
+     */
+    AV_FRAMEPACKING_MULTIVIEW,
+};
+
+enum AVFrameStructureSubsampling {
+    /**
+     * no special subsampling set
+     */
+    AV_FRAME_SUBSAMPLE_NORMAL,
+
+    /**
+     * When upscaling apply a checkerboard pattern.
+     *
+     *     LLLLRRRR          L L L L    R R R R
+     *     LLLLRRRR    =>     L L L L  R R R R
+     *     LLLLRRRR          L L L L    R R R R
+     *     LLLLRRRR           L L L L  R R R R
+     */
+    AV_FRAME_SUBSAMPLE_QUINCUNX,
+}
+
+typedef struct AVFrameStructure {
+    /**
+     * Type of video surface.
+     */
+    enum AVFrameStructureType structure_type;
+
+    /**
+     * Decoding state of the frame.
+     */
+    enum AVFrameStructureState structure_state;
+
+    /**
+     * Composition of the frame.
+     */
+    enum AVFrameStructurePack framepacking_type;
+
+    /**
+     * Contained streams do not need upsampling.
+     */
+    int framepacking_fullres;
+
+    /**
+     * Views are in opposite position.
+     */
+    int frampeacking_inverted;
+
+    /**
+     * Number of different substreams in the video surface
+     */
+    int videos_nb;
+}
-- 
1.7.9.5

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to