static int decode_audio_specific_config(AACContext *ac,
                                        AVCodecContext *avctx,
                                        MPEG4AudioConfig *m4ac,
                                        const uint8_t *data, int data_size)
{
    GetBitContext gb;
    int i;
    av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
    for (i = 0; i < avctx->extradata_size; i++)
         av_dlog(avctx, "%02x ", avctx->extradata[i]);
    av_dlog(avctx, "\n");
    init_get_bits(&gb, data, data_size * 8);
    if ((i = avpriv_mpeg4audio_get_config(m4ac, data, data_size)) < 0)
        return -1;
    if (m4ac->sampling_index > 12) {
        av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index);
        return -1;
    }
    if (m4ac->sbr == 1 && m4ac->ps == -1)
        m4ac->ps = 1;
    skip_bits_long(&gb, i);
    switch (m4ac->object_type) {
    case AOT_AAC_MAIN:
    case AOT_AAC_LC:
    case AOT_AAC_LTP:
        if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config))
            return -1;
        break;
    default:
        av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\n",
               m4ac->sbr == 1? "SBR+" : "", m4ac->object_type);
        return -1;
    }
    av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
            m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
            m4ac->sample_rate, m4ac->sbr, m4ac->ps);
    return get_bits_count(&gb);
}
['static int decode_audio_specific_config(AACContext *ac,\n                                        AVCodecContext *avctx,\n                                        MPEG4AudioConfig *m4ac,\n                                        const uint8_t *data, int data_size)\n{\n    GetBitContext gb;\n    int i;\n    av_dlog(avctx, "extradata size %d\\n", avctx->extradata_size);\n    for (i = 0; i < avctx->extradata_size; i++)\n         av_dlog(avctx, "%02x ", avctx->extradata[i]);\n    av_dlog(avctx, "\\n");\n    init_get_bits(&gb, data, data_size * 8);\n    if ((i = avpriv_mpeg4audio_get_config(m4ac, data, data_size)) < 0)\n        return -1;\n    if (m4ac->sampling_index > 12) {\n        av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\\n", m4ac->sampling_index);\n        return -1;\n    }\n    if (m4ac->sbr == 1 && m4ac->ps == -1)\n        m4ac->ps = 1;\n    skip_bits_long(&gb, i);\n    switch (m4ac->object_type) {\n    case AOT_AAC_MAIN:\n    case AOT_AAC_LC:\n    case AOT_AAC_LTP:\n        if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config))\n            return -1;\n        break;\n    default:\n        av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\\n",\n               m4ac->sbr == 1? "SBR+" : "", m4ac->object_type);\n        return -1;\n    }\n    av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\\n",\n            m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,\n            m4ac->sample_rate, m4ac->sbr, m4ac->ps);\n    return get_bits_count(&gb);\n}', 'static inline void init_get_bits(GetBitContext *s,\n                   const uint8_t *buffer, int bit_size)\n{\n    int buffer_size = (bit_size+7)>>3;\n    if (buffer_size < 0 || bit_size < 0) {\n        buffer_size = bit_size = 0;\n        buffer = NULL;\n    }\n    s->buffer       = buffer;\n    s->size_in_bits = bit_size;\n    s->buffer_end   = buffer + buffer_size;\n#ifdef ALT_BITSTREAM_READER\n    s->index        = 0;\n#elif defined A32_BITSTREAM_READER\n    s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);\n    s->bit_count    = 32 +     8*((intptr_t)buffer &  3);\n    skip_bits_long(s, 0);\n#endif\n}', 'static inline void skip_bits_long(GetBitContext *s, int n){\n    s->index += n;\n}']