summaryrefslogtreecommitdiff
path: root/libavcodec/h264_sei.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-17 19:30:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-17 19:30:57 +0100
commitd6acf45ec280be866698966947a0887841a6ea20 (patch)
treecd33128f533bf6275562c8ab33c7bb2ea36f90b4 /libavcodec/h264_sei.c
parent4e1dc600a16e1ba302d7ac707670e4f6129d1dde (diff)
parent3d9fc21e593aa89b5877bd739268499b079052f2 (diff)
Merge commit '3d9fc21e593aa89b5877bd739268499b079052f2'
* commit '3d9fc21e593aa89b5877bd739268499b079052f2': h264: Refactor decode_frame_packing_arrangement Conflicts: libavcodec/h264_sei.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_sei.c')
-rw-r--r--libavcodec/h264_sei.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index a4867290ba..12d709b123 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -226,39 +226,30 @@ static int decode_buffering_period(H264Context *h)
static int decode_frame_packing_arrangement(H264Context *h)
{
- int cancel;
- int quincunx = 0;
- int content = -1;
- int type = -1;
-
h->sei_fpa.frame_packing_arrangement_id = get_ue_golomb(&h->gb);
- cancel = get_bits(&h->gb, 1);
- if (cancel == 0) {
- type = get_bits(&h->gb, 7); // frame_packing_arrangement_type
- quincunx = get_bits1(&h->gb); // quincunx_sampling_flag
- content = get_bits(&h->gb, 6); // content_interpretation_type
+ h->sei_fpa.frame_packing_arrangement_cancel_flag = get_bits1(&h->gb);
+ h->sei_frame_packing_present = !h->sei_fpa.frame_packing_arrangement_cancel_flag;
+
+ if (h->sei_frame_packing_present) {
+ h->sei_fpa.frame_packing_arrangement_type =
+ h->frame_packing_arrangement_type = get_bits(&h->gb, 7);
+ h->sei_fpa.quincunx_sampling_flag =
+ h->quincunx_subsampling = get_bits1(&h->gb);
+ h->sei_fpa.content_interpretation_type =
+ h->content_interpretation_type = get_bits(&h->gb, 6);
// the following skips: spatial_flipping_flag, frame0_flipped_flag,
// field_views_flag, current_frame_is_frame0_flag,
// frame0_self_contained_flag, frame1_self_contained_flag
skip_bits(&h->gb, 6);
- if (quincunx == 0 && type != 5)
+
+ if (!h->quincunx_subsampling && h->frame_packing_arrangement_type != 5)
skip_bits(&h->gb, 16); // frame[01]_grid_position_[xy]
skip_bits(&h->gb, 8); // frame_packing_arrangement_reserved_byte
h->sei_fpa.frame_packing_arrangement_repetition_period = get_ue_golomb(&h->gb) /* frame_packing_arrangement_repetition_period */;
}
skip_bits1(&h->gb); // frame_packing_arrangement_extension_flag
- h->sei_frame_packing_present = (cancel == 0);
- h->frame_packing_arrangement_type = type;
- h->content_interpretation_type = content;
- h->quincunx_subsampling = quincunx;
-
- h->sei_fpa.frame_packing_arrangement_cancel_flag = cancel ;
- h->sei_fpa.frame_packing_arrangement_type = type ;
- h->sei_fpa.quincunx_sampling_flag = quincunx;
- h->sei_fpa.content_interpretation_type = content ;
-
if (h->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(h->avctx, AV_LOG_DEBUG, "SEI FPA %d %d %d %d %d %d\n",
h->sei_fpa.frame_packing_arrangement_id,