diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h
index 88d6f617b5..9cdec9b6c1 100644
--- a/libavcodec/hevc_ps.h
+++ b/libavcodec/hevc_ps.h
@@ -48,10 +48,10 @@ typedef struct HEVCHdrFlagParams {
 
 typedef struct HEVCHdrParams {
     HEVCHdrFlagParams flags;
-    uint8_t nal_hrd_parameters_present_flag;
-    uint8_t vcl_hrd_parameters_present_flag;
-    uint8_t sub_pic_hrd_params_present_flag;
-    uint8_t sub_pic_cpb_params_in_pic_timing_sei_flag;
+    uint8_t nal_hrd_parameters_present_flag : 1;
+    uint8_t vcl_hrd_parameters_present_flag : 1;
+    uint8_t sub_pic_hrd_params_present_flag : 1;
+    uint8_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1;
 
     uint8_t tick_divisor_minus2;
     uint8_t du_cpb_removal_delay_increment_length_minus1;
@@ -93,31 +93,28 @@ typedef struct HEVCWindow {
 
 typedef struct VUI {
     H2645VUI common;
-
-    int neutra_chroma_indication_flag;
-
-    int field_seq_flag;
-    int frame_field_info_present_flag;
-
-    int default_display_window_flag;
     HEVCWindow def_disp_win;
 
-    int vui_timing_info_present_flag;
     uint32_t vui_num_units_in_tick;
     uint32_t vui_time_scale;
-    int vui_poc_proportional_to_timing_flag;
     int vui_num_ticks_poc_diff_one_minus1;
-    int vui_hrd_parameters_present_flag;
-
-    int bitstream_restriction_flag;
-    int tiles_fixed_structure_flag;
-    int motion_vectors_over_pic_boundaries_flag;
-    int restricted_ref_pic_lists_flag;
     int min_spatial_segmentation_idc;
     int max_bytes_per_pic_denom;
     int max_bits_per_min_cu_denom;
     int log2_max_mv_length_horizontal;
     int log2_max_mv_length_vertical;
+
+    uint8_t neutra_chroma_indication_flag : 1;
+    uint8_t field_seq_flag : 1;
+    uint8_t frame_field_info_present_flag : 1;
+    uint8_t default_display_window_flag : 1;
+    uint8_t vui_timing_info_present_flag : 1;
+    uint8_t vui_poc_proportional_to_timing_flag : 1;
+    uint8_t vui_hrd_parameters_present_flag : 1;
+    uint8_t bitstream_restriction_flag : 1;
+    uint8_t tiles_fixed_structure_flag : 1;
+    uint8_t motion_vectors_over_pic_boundaries_flag : 1;
+    uint8_t restricted_ref_pic_lists_flag : 1;
 } VUI;
 
 typedef struct PTLCommon {
@@ -125,21 +122,21 @@ typedef struct PTLCommon {
     uint8_t tier_flag;
     uint8_t profile_idc;
     uint8_t profile_compatibility_flag[32];
-    uint8_t progressive_source_flag;
-    uint8_t interlaced_source_flag;
-    uint8_t non_packed_constraint_flag;
-    uint8_t frame_only_constraint_flag;
-    uint8_t max_12bit_constraint_flag;
-    uint8_t max_10bit_constraint_flag;
-    uint8_t max_8bit_constraint_flag;
-    uint8_t max_422chroma_constraint_flag;
-    uint8_t max_420chroma_constraint_flag;
-    uint8_t max_monochrome_constraint_flag;
-    uint8_t intra_constraint_flag;
-    uint8_t one_picture_only_constraint_flag;
-    uint8_t lower_bit_rate_constraint_flag;
-    uint8_t max_14bit_constraint_flag;
-    uint8_t inbld_flag;
+    uint8_t progressive_source_flag : 1;
+    uint8_t interlaced_source_flag : 1;
+    uint8_t non_packed_constraint_flag : 1;
+    uint8_t frame_only_constraint_flag : 1;
+    uint8_t max_12bit_constraint_flag : 1;
+    uint8_t max_10bit_constraint_flag : 1;
+    uint8_t max_8bit_constraint_flag : 1;
+    uint8_t max_422chroma_constraint_flag : 1;
+    uint8_t max_420chroma_constraint_flag : 1;
+    uint8_t max_monochrome_constraint_flag : 1;
+    uint8_t intra_constraint_flag : 1;
+    uint8_t one_picture_only_constraint_flag : 1;
+    uint8_t lower_bit_rate_constraint_flag : 1;
+    uint8_t max_14bit_constraint_flag : 1;
+    uint8_t inbld_flag : 1;
     uint8_t level_idc;
 } PTLCommon;
 
@@ -155,21 +152,22 @@ typedef struct HEVCVPS {
     unsigned int vps_id;
     HEVCHdrParams hdr[HEVC_MAX_LAYER_SETS];
 
-    uint8_t vps_temporal_id_nesting_flag;
+    uint8_t vps_temporal_id_nesting_flag : 1;
+    uint8_t vps_sub_layer_ordering_info_present_flag : 1;
+    uint8_t vps_timing_info_present_flag : 1;
+    uint8_t vps_poc_proportional_to_timing_flag : 1;
     int vps_max_layers;
     int vps_max_sub_layers; ///< vps_max_temporal_layers_minus1 + 1
 
     PTL ptl;
-    int vps_sub_layer_ordering_info_present_flag;
-    unsigned int vps_max_dec_pic_buffering[HEVC_MAX_SUB_LAYERS];
-    unsigned int vps_num_reorder_pics[HEVC_MAX_SUB_LAYERS];
+
+    uint8_t vps_max_dec_pic_buffering[HEVC_MAX_SUB_LAYERS];
+    uint8_t vps_num_reorder_pics[HEVC_MAX_SUB_LAYERS];
     unsigned int vps_max_latency_increase[HEVC_MAX_SUB_LAYERS];
     int vps_max_layer_id;
     int vps_num_layer_sets; ///< vps_num_layer_sets_minus1 + 1
-    uint8_t vps_timing_info_present_flag;
     uint32_t vps_num_units_in_tick;
     uint32_t vps_time_scale;
-    uint8_t vps_poc_proportional_to_timing_flag;
     int vps_num_ticks_poc_diff_one; ///< vps_num_ticks_poc_diff_one_minus1 + 1
     int vps_num_hrd_parameters;
 
@@ -187,11 +185,17 @@ typedef struct ScalingList {
 typedef struct HEVCSPS {
     unsigned vps_id;
     int chroma_format_idc;
-    uint8_t separate_colour_plane_flag;
+    uint8_t separate_colour_plane_flag : 1;
+    uint8_t conformance_window_flag : 1;
+    uint8_t sublayer_ordering_info_flag : 1;
+    uint8_t temporal_id_nesting_flag : 1;
+    uint8_t sps_extension_present_flag : 1;
+    uint8_t scaling_list_enable_flag : 1;
+    uint8_t sps_temporal_mvp_enabled_flag : 1;
+    uint8_t sps_strong_intra_smoothing_enable_flag : 1;
 
     HEVCWindow output_window;
 
-    uint8_t conformance_window_flag;
     HEVCWindow pic_conf_win;
 
     HEVCHdrParams hdr;
@@ -204,21 +208,17 @@ typedef struct HEVCSPS {
     unsigned int log2_max_poc_lsb;
     int pcm_enabled_flag;
 
-    uint8_t sublayer_ordering_info_flag;
     int max_sub_layers;
     struct {
         int max_dec_pic_buffering;
         int num_reorder_pics;
         int max_latency_increase;
     } temporal_layer[HEVC_MAX_SUB_LAYERS];
-    uint8_t temporal_id_nesting_flag;
 
     int vui_present;
     VUI vui;
     PTL ptl;
 
-    uint8_t sps_extension_present_flag;
-    uint8_t scaling_list_enable_flag;
     ScalingList scaling_list;
 
     unsigned int nb_st_rps;
@@ -239,8 +239,6 @@ typedef struct HEVCSPS {
         unsigned int log2_max_pcm_cb_size;
         uint8_t loop_filter_disable_flag;
     } pcm;
-    uint8_t sps_temporal_mvp_enabled_flag;
-    uint8_t sps_strong_intra_smoothing_enable_flag;
 
     unsigned int log2_min_cb_size;
     unsigned int log2_diff_max_min_coding_block_size;
@@ -253,30 +251,29 @@ typedef struct HEVCSPS {
     int max_transform_hierarchy_depth_inter;
     int max_transform_hierarchy_depth_intra;
 
-    int sps_range_extension_flag;
-    int transform_skip_rotation_enabled_flag;
-    int transform_skip_context_enabled_flag;
-    int implicit_rdpcm_enabled_flag;
-    int explicit_rdpcm_enabled_flag;
-    int extended_precision_processing_flag;
-    int intra_smoothing_disabled_flag;
-    int high_precision_offsets_enabled_flag;
-    int persistent_rice_adaptation_enabled_flag;
-    int cabac_bypass_alignment_enabled_flag;
-
-    int sps_multilayer_extension_flag;
-    int sps_3d_extension_flag;
-
-    int sps_scc_extension_flag;
-    int sps_curr_pic_ref_enabled_flag;
-    int palette_mode_enabled_flag;
+    uint8_t sps_range_extension_flag : 1;
+    uint8_t transform_skip_rotation_enabled_flag : 1;
+    uint8_t transform_skip_context_enabled_flag : 1;
+    uint8_t implicit_rdpcm_enabled_flag : 1;
+    uint8_t explicit_rdpcm_enabled_flag : 1;
+    uint8_t extended_precision_processing_flag : 1;
+    uint8_t intra_smoothing_disabled_flag : 1;
+    uint8_t high_precision_offsets_enabled_flag : 1;
+    uint8_t persistent_rice_adaptation_enabled_flag : 1;
+    uint8_t cabac_bypass_alignment_enabled_flag : 1;
+    uint8_t sps_multilayer_extension_flag : 1;
+    uint8_t sps_3d_extension_flag : 1;
+    uint8_t sps_scc_extension_flag : 1;
+    uint8_t sps_curr_pic_ref_enabled_flag : 1;
+    uint8_t palette_mode_enabled_flag : 1;
+    uint8_t intra_boundary_filtering_disabled_flag : 1;
+
     int palette_max_size;
     int delta_palette_max_predictor_size;
     int sps_palette_predictor_initializers_present_flag;
     int sps_num_palette_predictor_initializers;
     int sps_palette_predictor_initializer[3][HEVC_MAX_PALETTE_PREDICTOR_SIZE];
     int motion_vector_resolution_control_idc;
-    int intra_boundary_filtering_disabled_flag;
 
     ///< coded frame dimension in various units
     int width;
@@ -305,60 +302,55 @@ typedef struct HEVCPPS {
     unsigned int pps_id;
     unsigned int sps_id; ///< seq_parameter_set_id
 
-    uint8_t sign_data_hiding_flag;
-
-    uint8_t cabac_init_present_flag;
+    uint8_t sign_data_hiding_flag : 1;
+    uint8_t cabac_init_present_flag : 1;
+    uint8_t pic_slice_level_chroma_qp_offsets_present_flag : 1;
+    uint8_t weighted_pred_flag : 1;
+    uint8_t weighted_bipred_flag : 1;
+    uint8_t output_flag_present_flag : 1;
+    uint8_t transquant_bypass_enable_flag : 1;
+    uint8_t dependent_slice_segments_enabled_flag : 1;
+    uint8_t tiles_enabled_flag : 1;
+    uint8_t entropy_coding_sync_enabled_flag : 1;
+    uint8_t constrained_intra_pred_flag : 1;
+    uint8_t transform_skip_enabled_flag : 1;
+    uint8_t cu_qp_delta_enabled_flag : 1;
+    uint8_t uniform_spacing_flag : 1;
+    uint8_t loop_filter_across_tiles_enabled_flag : 1;
+    uint8_t seq_loop_filter_across_slices_enabled_flag : 1;
+    uint8_t deblocking_filter_control_present_flag : 1;
+    uint8_t deblocking_filter_override_enabled_flag : 1;
+    uint8_t scaling_list_data_present_flag : 1;
+    uint8_t lists_modification_present_flag : 1;
+    uint8_t slice_header_extension_present_flag : 1;
+    uint8_t pps_extension_present_flag : 1;
+    uint8_t pps_range_extensions_flag : 1;
+    uint8_t pps_multilayer_extension_flag : 1;
+    uint8_t pps_3d_extension_flag : 1;
+    uint8_t pps_scc_extension_flag : 1;
+    uint8_t cross_component_prediction_enabled_flag : 1;
+    uint8_t chroma_qp_offset_list_enabled_flag : 1;
 
     int num_ref_idx_l0_default_active; ///< num_ref_idx_l0_default_active_minus1 + 1
     int num_ref_idx_l1_default_active; ///< num_ref_idx_l1_default_active_minus1 + 1
     int pic_init_qp_minus26;
 
-    uint8_t constrained_intra_pred_flag;
-    uint8_t transform_skip_enabled_flag;
-
-    uint8_t cu_qp_delta_enabled_flag;
     int diff_cu_qp_delta_depth;
 
     int cb_qp_offset;
     int cr_qp_offset;
-    uint8_t pic_slice_level_chroma_qp_offsets_present_flag;
-    uint8_t weighted_pred_flag;
-    uint8_t weighted_bipred_flag;
-    uint8_t output_flag_present_flag;
-    uint8_t transquant_bypass_enable_flag;
-
-    uint8_t dependent_slice_segments_enabled_flag;
-    uint8_t tiles_enabled_flag;
-    uint8_t entropy_coding_sync_enabled_flag;
 
     uint16_t num_tile_columns;   ///< num_tile_columns_minus1 + 1
     uint16_t num_tile_rows;      ///< num_tile_rows_minus1 + 1
-    uint8_t uniform_spacing_flag;
-    uint8_t loop_filter_across_tiles_enabled_flag;
-
-    uint8_t seq_loop_filter_across_slices_enabled_flag;
-
-    uint8_t deblocking_filter_control_present_flag;
-    uint8_t deblocking_filter_override_enabled_flag;
     uint8_t disable_dbf;
     int beta_offset;    ///< beta_offset_div2 * 2
     int tc_offset;      ///< tc_offset_div2 * 2
 
-    uint8_t scaling_list_data_present_flag;
     ScalingList scaling_list;
 
-    uint8_t lists_modification_present_flag;
     int log2_parallel_merge_level; ///< log2_parallel_merge_level_minus2 + 2
     int num_extra_slice_header_bits;
-    uint8_t slice_header_extension_present_flag;
     uint8_t log2_max_transform_skip_block_size;
-    uint8_t pps_extension_present_flag;
-    uint8_t pps_range_extensions_flag;
-    uint8_t pps_multilayer_extension_flag;
-    uint8_t pps_3d_extension_flag;
-    uint8_t pps_scc_extension_flag;
-    uint8_t cross_component_prediction_enabled_flag;
-    uint8_t chroma_qp_offset_list_enabled_flag;
     uint8_t diff_cu_chroma_qp_offset_depth;
     uint8_t chroma_qp_offset_list_len_minus1;
     int8_t  cb_qp_offset_list[6];
