summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_sei.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2013-11-10 23:23:57 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2013-12-09 16:02:43 +0100
commitacb77dff6af036192f6064c84f9cccc48582989e (patch)
tree2c20623f907e9052898616ba034e963bd3a5445b /libavcodec/hevc_sei.c
parent3d1d175367f1f22e0c4952299a258272e2e2acf1 (diff)
hevc: parse frame packing arrangement SEI messages and save relevant stereo3d information
Diffstat (limited to 'libavcodec/hevc_sei.c')
-rw-r--r--libavcodec/hevc_sei.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c
index 1cf698bd9d..eed7b335f8 100644
--- a/libavcodec/hevc_sei.c
+++ b/libavcodec/hevc_sei.c
@@ -46,17 +46,17 @@ static void decode_nal_sei_decoded_picture_hash(HEVCContext *s)
}
}
-static void decode_nal_sei_frame_packing_arrangement(HEVCLocalContext *lc)
+static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
{
- GetBitContext *gb = &lc->gb;
- int cancel, type, quincunx;
+ GetBitContext *gb = &s->HEVClc.gb;
+ int cancel, type, quincunx, content;
get_ue_golomb(gb); // frame_packing_arrangement_id
cancel = get_bits1(gb); // frame_packing_cancel_flag
if (cancel == 0) {
type = get_bits(gb, 7); // frame_packing_arrangement_type
quincunx = get_bits1(gb); // quincunx_sampling_flag
- skip_bits(gb, 6); // content_interpretation_type
+ content = get_bits(gb, 6); // content_interpretation_type
// the following skips spatial_flipping_flag frame0_flipped_flag
// field_views_flag current_frame_is_frame0_flag
@@ -69,6 +69,11 @@ static void decode_nal_sei_frame_packing_arrangement(HEVCLocalContext *lc)
skip_bits1(gb); // frame_packing_arrangement_persistance_flag
}
skip_bits1(gb); // upsampled_aspect_ratio_flag
+
+ s->sei_frame_packing_present = (cancel == 0);
+ s->frame_packing_arrangement_type = type;
+ s->content_interpretation_type = content;
+ s->quincunx_subsampling = quincunx;
}
static int decode_nal_sei_message(HEVCContext *s)
@@ -93,7 +98,7 @@ static int decode_nal_sei_message(HEVCContext *s)
if (payload_type == 256)
decode_nal_sei_decoded_picture_hash(s);
else if (payload_type == 45)
- decode_nal_sei_frame_packing_arrangement(&s->HEVClc);
+ decode_nal_sei_frame_packing_arrangement(s);
else {
av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", payload_type);
skip_bits(gb, 8 * payload_size);