static void put_audio_specific_config(AVCodecContext *avctx)
{
    PutBitContext pb;
    AACEncContext *s = avctx->priv_data;
    init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
    put_bits(&pb, 5, 2);
    put_bits(&pb, 4, s->samplerate_index);
    put_bits(&pb, 4, s->channels);
    put_bits(&pb, 1, 0);
    put_bits(&pb, 1, 0);
    put_bits(&pb, 1, 0);
    put_bits(&pb, 11, 0x2b7);
    put_bits(&pb, 5,  AOT_SBR);
    put_bits(&pb, 1,  0);
    flush_put_bits(&pb);
}
['static void put_audio_specific_config(AVCodecContext *avctx)\n{\n    PutBitContext pb;\n    AACEncContext *s = avctx->priv_data;\n    init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);\n    put_bits(&pb, 5, 2);\n    put_bits(&pb, 4, s->samplerate_index);\n    put_bits(&pb, 4, s->channels);\n    put_bits(&pb, 1, 0);\n    put_bits(&pb, 1, 0);\n    put_bits(&pb, 1, 0);\n    put_bits(&pb, 11, 0x2b7);\n    put_bits(&pb, 5,  AOT_SBR);\n    put_bits(&pb, 1,  0);\n    flush_put_bits(&pb);\n}', 'static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)\n{\n    if(buffer_size < 0) {\n        buffer_size = 0;\n        buffer = NULL;\n    }\n    s->size_in_bits= 8*buffer_size;\n    s->buf = buffer;\n    s->buf_end = s->buf + buffer_size;\n    s->buf_ptr = s->buf;\n    s->bit_left=32;\n    s->bit_buf=0;\n}', 'static inline void put_bits(PutBitContext *s, int n, unsigned int value)\n{\n    unsigned int bit_buf;\n    int bit_left;\n    assert(n <= 31 && value < (1U << n));\n    bit_buf = s->bit_buf;\n    bit_left = s->bit_left;\n#ifdef BITSTREAM_WRITER_LE\n    bit_buf |= value << (32 - bit_left);\n    if (n >= bit_left) {\n        AV_WL32(s->buf_ptr, bit_buf);\n        s->buf_ptr+=4;\n        bit_buf = (bit_left==32)?0:value >> bit_left;\n        bit_left+=32;\n    }\n    bit_left-=n;\n#else\n    if (n < bit_left) {\n        bit_buf = (bit_buf<<n) | value;\n        bit_left-=n;\n    } else {\n        bit_buf<<=bit_left;\n        bit_buf |= value >> (n - bit_left);\n        AV_WB32(s->buf_ptr, bit_buf);\n        s->buf_ptr+=4;\n        bit_left+=32 - n;\n        bit_buf = value;\n    }\n#endif\n    s->bit_buf = bit_buf;\n    s->bit_left = bit_left;\n}']