On Mon, 30 Sep 2013 15:14:40 +0200, Vittorio Giovara <[email protected]> wrote: > --- > libavcodec/h264.c | 54 > +++++++++++++++++++++++++++++++++++++++++++++++++ > libavcodec/h264.h | 24 +++++++++++++++++++++- > libavcodec/h264_sei.c | 40 ++++++++++++++++++++++++++++++++++++ > 3 files changed, 117 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/h264.c b/libavcodec/h264.c > index 5ff55ce..849f99a 100644 > --- a/libavcodec/h264.c > +++ b/libavcodec/h264.c > @@ -27,6 +27,7 @@ > > #include "libavutil/avassert.h" > #include "libavutil/imgutils.h" > +#include "libavutil/stereo3d.h" > #include "internal.h" > #include "cabac.h" > #include "cabac_functions.h" > @@ -2011,6 +2012,59 @@ static void decode_postinit(H264Context *h, int > setup_finished) > } > } > > + if (h->sei_frame_packing_present) { > + AVFrameSideData *side_data; > + AVStereo3D stereo; > + > + switch (h->frame_packing_arrangement_type) { > + case SEI_FPA_CHECKERBOARD: > + stereo.type = AV_STEREO3D_CHECKERS; > + break; > + case SEI_FPA_LINE_INTERLEAVED: > + stereo.type = AV_STEREO3D_LINES; > + break; > + case SEI_FPA_COLUMN_INTERLEAVED: > + stereo.type = AV_STEREO3D_COLUMNS; > + break; > + case SEI_FPA_SIDE_BY_SIDE: > + stereo.type = AV_STEREO3D_SIDEBYSIDE; > + break; > + case SEI_FPA_TOP_AND_BOTTOM: > + stereo.type = AV_STEREO3D_TOPBOTTOM; > + break; > + case SEI_FPA_FRAME_ALTERNATE: > + stereo.type = AV_STEREO3D_FRAMESEQUENCE; > + break; > + case SEI_FPA_2D: > + stereo.type = AV_STEREO3D_NOT_REALLY; > + break; > + default: > + stereo.type = AV_STEREO3D_NONE; > + break; > + } > + > + /* skip allocation if unknown type */ > + if (stereo.type != AV_STEREO3D_NONE) { > + stereo.info = AV_STEREO3D_NORMAL; > + if (h->content_interpretation_type == 2) > + stereo.info |= AV_STEREO3D_ORDER_INVERT; > + > + if (h->quincunx_subsampling) > + stereo.info |= AV_STEREO3D_QUINCUNX; > + > + if (stereo.type != AV_STEREO3D_FRAMESEQUENCE) > + stereo.info |= AV_STEREO3D_SIZE_HALF; > + > + side_data = av_frame_new_side_data(&cur->f, > + AV_FRAME_DATA_STEREO3D, > + sizeof(AVStereo3D)); > + if (!side_data) > + return; > + > + memcpy(side_data->data, &stereo, sizeof(AVStereo3D)); > + } > + } > + > // FIXME do something with unavailable reference frames > > /* Sort B-frames into display order */ > diff --git a/libavcodec/h264.h b/libavcodec/h264.h > index 3ef8420..9e0c6ba 100644 > --- a/libavcodec/h264.h > +++ b/libavcodec/h264.h > @@ -123,7 +123,8 @@ typedef enum { > SEI_BUFFERING_PERIOD = 0, ///< buffering period (H.264, > D.1.1) > SEI_TYPE_PIC_TIMING = 1, ///< picture timing > SEI_TYPE_USER_DATA_UNREGISTERED = 5, ///< unregistered user data > - SEI_TYPE_RECOVERY_POINT = 6 ///< recovery point (frame # to > decoder sync) > + SEI_TYPE_RECOVERY_POINT = 6, ///< recovery point (frame # to > decoder sync) > + SEI_TYPE_FRAME_PACKING = 45, ///< frame packing arrangement > } SEI_Type; > > /** > @@ -142,6 +143,19 @@ typedef enum { > } SEI_PicStructType; > > /** > + * type in frame packing arrangement SEI message > + */ > +typedef enum { > + SEI_FPA_CHECKERBOARD = 0, ///< 0: quincux ^^^^^^^^^^^^ ^^^^^^^ really?
I'd just drop the comments, they don't add anything. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
