static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,

                      enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],

                      GetBitContext *gb)

{

    int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index;

    int comment_len;



    skip_bits(gb, 2);  // object_type



    sampling_index = get_bits(gb, 4);

    if (m4ac->sampling_index != sampling_index)

        av_log(avctx, AV_LOG_WARNING, "Sample rate index in program config element does not match the sample rate index configured by the container.\n");



    num_front       = get_bits(gb, 4);

    num_side        = get_bits(gb, 4);

    num_back        = get_bits(gb, 4);

    num_lfe         = get_bits(gb, 2);

    num_assoc_data  = get_bits(gb, 3);

    num_cc          = get_bits(gb, 4);



    if (get_bits1(gb))

        skip_bits(gb, 4); // mono_mixdown_tag

    if (get_bits1(gb))

        skip_bits(gb, 4); // stereo_mixdown_tag



    if (get_bits1(gb))

        skip_bits(gb, 3); // mixdown_coeff_index and pseudo_surround







    decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_FRONT, gb, num_front);

    decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_SIDE,  gb, num_side );

    decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_BACK,  gb, num_back );

    decode_channel_map(NULL,                  new_che_pos[TYPE_LFE], AAC_CHANNEL_LFE,   gb, num_lfe  );



    skip_bits_long(gb, 4 * num_assoc_data);



    decode_channel_map(new_che_pos[TYPE_CCE], new_che_pos[TYPE_CCE], AAC_CHANNEL_CC,    gb, num_cc   );



    align_get_bits(gb);



    /* comment field, first byte is length */

    comment_len = get_bits(gb, 8) * 8;

    if (get_bits_left(gb) < comment_len) {




    skip_bits_long(gb, comment_len);

    return 0;

static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,

                      enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],

                      GetBitContext *gb)

{

    int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index;

    int comment_len;



    skip_bits(gb, 2);  



    sampling_index = get_bits(gb, 4);

    if (m4ac->sampling_index != sampling_index)

        av_log(avctx, AV_LOG_WARNING, "Sample rate index in program config element does not match the sample rate index configured by the container.\n");



    num_front       = get_bits(gb, 4);

    num_side        = get_bits(gb, 4);

    num_back        = get_bits(gb, 4);

    num_lfe         = get_bits(gb, 2);

    num_assoc_data  = get_bits(gb, 3);

    num_cc          = get_bits(gb, 4);



    if (get_bits1(gb))

        skip_bits(gb, 4); 

    if (get_bits1(gb))

        skip_bits(gb, 4); 



    if (get_bits1(gb))

        skip_bits(gb, 3); 







    decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_FRONT, gb, num_front);

    decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_SIDE,  gb, num_side );

    decode_channel_map(new_che_pos[TYPE_CPE], new_che_pos[TYPE_SCE], AAC_CHANNEL_BACK,  gb, num_back );

    decode_channel_map(NULL,                  new_che_pos[TYPE_LFE], AAC_CHANNEL_LFE,   gb, num_lfe  );



    skip_bits_long(gb, 4 * num_assoc_data);



    decode_channel_map(new_che_pos[TYPE_CCE], new_che_pos[TYPE_CCE], AAC_CHANNEL_CC,    gb, num_cc   );



    align_get_bits(gb);



    

    comment_len = get_bits(gb, 8) * 8;

    if (get_bits_left(gb) < comment_len) {




    skip_bits_long(gb, comment_len);

    return 0;

static int FUNC_0(AVCodecContext *VAR_0, MPEG4AudioConfig *VAR_1,

                      enum ChannelPosition VAR_2[4][MAX_ELEM_ID],

                      GetBitContext *VAR_3)

{

    int VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10;

    int VAR_11;



    skip_bits(VAR_3, 2);  



    VAR_10 = get_bits(VAR_3, 4);

    if (VAR_1->VAR_10 != VAR_10)

        av_log(VAR_0, AV_LOG_WARNING, "Sample rate index in program config element does not match the sample rate index configured by the container.\n");



    VAR_4       = get_bits(VAR_3, 4);

    VAR_5        = get_bits(VAR_3, 4);

    VAR_6        = get_bits(VAR_3, 4);

    VAR_7         = get_bits(VAR_3, 2);

    VAR_8  = get_bits(VAR_3, 3);

    VAR_9          = get_bits(VAR_3, 4);



    if (get_bits1(VAR_3))

        skip_bits(VAR_3, 4); 

    if (get_bits1(VAR_3))

        skip_bits(VAR_3, 4); 



    if (get_bits1(VAR_3))

        skip_bits(VAR_3, 3); 







    decode_channel_map(VAR_2[TYPE_CPE], VAR_2[TYPE_SCE], AAC_CHANNEL_FRONT, VAR_3, VAR_4);

    decode_channel_map(VAR_2[TYPE_CPE], VAR_2[TYPE_SCE], AAC_CHANNEL_SIDE,  VAR_3, VAR_5 );

    decode_channel_map(VAR_2[TYPE_CPE], VAR_2[TYPE_SCE], AAC_CHANNEL_BACK,  VAR_3, VAR_6 );

    decode_channel_map(NULL,                  VAR_2[TYPE_LFE], AAC_CHANNEL_LFE,   VAR_3, VAR_7  );



    skip_bits_long(VAR_3, 4 * VAR_8);



    decode_channel_map(VAR_2[TYPE_CCE], VAR_2[TYPE_CCE], AAC_CHANNEL_CC,    VAR_3, VAR_9   );



    align_get_bits(VAR_3);



    

    VAR_11 = get_bits(VAR_3, 8) * 8;

    if (get_bits_left(VAR_3) < VAR_11) {




    skip_bits_long(VAR_3, VAR_11);

    return 0;

static int FUNC_0(AVCodecContext *VAR_0, MPEG4AudioConfig *VAR_1,
enum ChannelPosition VAR_2[4][MAX_ELEM_ID],
GetBitContext *VAR_3)
{ int VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10; int VAR_11; skip_bits(VAR_3, 2); VAR_10 = get_bits(VAR_3, 4); if (VAR_1->VAR_10 != VAR_10)
av_log(VAR_0, AV_LOG_WARNING, "Sample rate index in program config element does not match the sample rate index configured by the container.\n"); VAR_4       = get_bits(VAR_3, 4); VAR_5        = get_bits(VAR_3, 4); VAR_6        = get_bits(VAR_3, 4); VAR_7         = get_bits(VAR_3, 2); VAR_8  = get_bits(VAR_3, 3); VAR_9          = get_bits(VAR_3, 4); if (get_bits1(VAR_3))
skip_bits(VAR_3, 4); if (get_bits1(VAR_3))
skip_bits(VAR_3, 4); if (get_bits1(VAR_3))
skip_bits(VAR_3, 3); decode_channel_map(VAR_2[TYPE_CPE], VAR_2[TYPE_SCE], AAC_CHANNEL_FRONT, VAR_3, VAR_4); decode_channel_map(VAR_2[TYPE_CPE], VAR_2[TYPE_SCE], AAC_CHANNEL_SIDE,  VAR_3, VAR_5 ); decode_channel_map(VAR_2[TYPE_CPE], VAR_2[TYPE_SCE], AAC_CHANNEL_BACK,  VAR_3, VAR_6 ); decode_channel_map(NULL,                  VAR_2[TYPE_LFE], AAC_CHANNEL_LFE,   VAR_3, VAR_7  ); skip_bits_long(VAR_3, 4 * VAR_8); decode_channel_map(VAR_2[TYPE_CCE], VAR_2[TYPE_CCE], AAC_CHANNEL_CC,    VAR_3, VAR_9   ); align_get_bits(VAR_3); VAR_11 = get_bits(VAR_3, 8) * 8; if (get_bits_left(VAR_3) < VAR_11) { skip_bits_long(VAR_3, VAR_11); return 0;