aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-09 21:53:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-09 21:53:23 +0100
commitbe6e81463c72dda837d62ef0a7c26f35a666d1d3 (patch)
tree54e21d585a93dfb9d1adf47c5c4d2513154b043c /libavcodec/h264.c
parent7a6034805305cb5d6a3d755d774f0ad09119049e (diff)
parent5b10ef729f610fcbc9c485e7b643ce53268144cb (diff)
downloadffmpeg-be6e81463c72dda837d62ef0a7c26f35a666d1d3.tar.gz
Merge commit '5b10ef729f610fcbc9c485e7b643ce53268144cb'
* commit '5b10ef729f610fcbc9c485e7b643ce53268144cb': h264: parse frame packing arrangement SEI messages and save relevant stereo3d information Conflicts: libavcodec/h264.c libavcodec/h264_sei.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4cf7726b40..77a26575ad 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -30,6 +30,7 @@
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
+#include "libavutil/stereo3d.h"
#include "internal.h"
#include "cabac.h"
#include "cabac_functions.h"
@@ -2108,8 +2109,49 @@ static void decode_postinit(H264Context *h, int setup_finished)
}
}
+ if (h->sei_frame_packing_present &&
+ h->frame_packing_arrangement_type >= 0 &&
+ h->frame_packing_arrangement_type <= 6 &&
+ h->content_interpretation_type > 0 &&
+ h->content_interpretation_type < 3) {
+ AVStereo3D *stereo = av_stereo3d_create_side_data(&cur->f);
+ if (!stereo)
+ return;
+
+ switch (h->frame_packing_arrangement_type) {
+ case 0:
+ stereo->type = AV_STEREO3D_CHECKERBOARD;
+ break;
+ case 1:
+ stereo->type = AV_STEREO3D_LINES;
+ break;
+ case 2:
+ stereo->type = AV_STEREO3D_COLUMNS;
+ break;
+ case 3:
+ if (h->quincunx_subsampling)
+ stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
+ else
+ stereo->type = AV_STEREO3D_SIDEBYSIDE;
+ break;
+ case 4:
+ stereo->type = AV_STEREO3D_TOPBOTTOM;
+ break;
+ case 5:
+ stereo->type = AV_STEREO3D_FRAMESEQUENCE;
+ break;
+ case 6:
+ stereo->type = AV_STEREO3D_2D;
+ break;
+ }
+
+ if (h->content_interpretation_type == 2)
+ stereo->flags = AV_STEREO3D_FLAG_INVERT;
+ }
+
cur->mmco_reset = h->mmco_reset;
h->mmco_reset = 0;
+
// FIXME do something with unavailable reference frames
/* Sort B-frames into display order */