hevc: Refactor decode_nal_sei_frame_packing_arrangement

Directly set the fields when necessary.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
Luca Barbato 2013-12-13 15:39:45 +00:00 committed by Vittorio Giovara
parent cfb4ee3097
commit 3a149e23d3
1 changed files with 7 additions and 12 deletions

View File

@ -49,31 +49,26 @@ static void decode_nal_sei_decoded_picture_hash(HEVCContext *s)
static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s) static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
{ {
GetBitContext *gb = &s->HEVClc.gb; GetBitContext *gb = &s->HEVClc.gb;
int cancel, type, quincunx, content;
get_ue_golomb(gb); // frame_packing_arrangement_id get_ue_golomb(gb); // frame_packing_arrangement_id
cancel = get_bits1(gb); // frame_packing_cancel_flag s->sei_frame_packing_present = !get_bits1(gb);
if (cancel == 0) {
type = get_bits(gb, 7); // frame_packing_arrangement_type if (s->sei_frame_packing_present) {
quincunx = get_bits1(gb); // quincunx_sampling_flag s->frame_packing_arrangement_type = get_bits(gb, 7);
content = get_bits(gb, 6); // content_interpretation_type s->quincunx_subsampling = get_bits1(gb);
s->content_interpretation_type = get_bits(gb, 6);
// the following skips spatial_flipping_flag frame0_flipped_flag // the following skips spatial_flipping_flag frame0_flipped_flag
// field_views_flag current_frame_is_frame0_flag // field_views_flag current_frame_is_frame0_flag
// frame0_self_contained_flag frame1_self_contained_flag // frame0_self_contained_flag frame1_self_contained_flag
skip_bits(gb, 6); skip_bits(gb, 6);
if (quincunx == 0 && type != 5) if (!s->quincunx_subsampling && s->frame_packing_arrangement_type != 5)
skip_bits(gb, 16); // frame[01]_grid_position_[xy] skip_bits(gb, 16); // frame[01]_grid_position_[xy]
skip_bits(gb, 8); // frame_packing_arrangement_reserved_byte skip_bits(gb, 8); // frame_packing_arrangement_reserved_byte
skip_bits1(gb); // frame_packing_arrangement_persistance_flag skip_bits1(gb); // frame_packing_arrangement_persistance_flag
} }
skip_bits1(gb); // upsampled_aspect_ratio_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) static int decode_nal_sei_message(HEVCContext *s)