static void decode_hrd(HEVCContext *s, int common_inf_present,

                       int max_sublayers)

{

    GetBitContext *gb = &s->HEVClc.gb;

    int nal_params_present = 0, vcl_params_present = 0;

    int subpic_params_present = 0;

    int i;



    if (common_inf_present) {

        nal_params_present = get_bits1(gb);

        vcl_params_present = get_bits1(gb);



        if (nal_params_present || vcl_params_present) {

            subpic_params_present = get_bits1(gb);



            if (subpic_params_present) {

                skip_bits(gb, 8); 

                skip_bits(gb, 5); 

                skip_bits(gb, 1); 

                skip_bits(gb, 5); 

            }



            skip_bits(gb, 4); 

            skip_bits(gb, 4); 



            if (subpic_params_present)

                skip_bits(gb, 4);  



            skip_bits(gb, 5); 

            skip_bits(gb, 5); 

            skip_bits(gb, 5); 

        }

    }



    for (i = 0; i < max_sublayers; i++) {

        int low_delay = 0;

        int nb_cpb = 1;

        int fixed_rate = get_bits1(gb);



        if (!fixed_rate)

            fixed_rate = get_bits1(gb);



        if (fixed_rate)

            get_ue_golomb_long(gb);  

        else

            low_delay = get_bits1(gb);



        if (!low_delay)

            nb_cpb = get_ue_golomb_long(gb) + 1;



        if (nal_params_present)

            decode_sublayer_hrd(s, nb_cpb, subpic_params_present);

        if (vcl_params_present)

            decode_sublayer_hrd(s, nb_cpb, subpic_params_present);

    }

}
