void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
                              const uint8_t *buffer)
{
    GetBitContext gb;
    init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);
    skip_bits(&gb, 16);
    s->max_blocksize = get_bits(&gb, 16);
    if (s->max_blocksize < 16) {
        av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\n",
               s->max_blocksize);
        s->max_blocksize = 16;
    }
    skip_bits(&gb, 24);
    s->max_framesize = get_bits_long(&gb, 24);
    s->samplerate = get_bits_long(&gb, 20);
    s->channels = get_bits(&gb, 3) + 1;
    s->bps = get_bits(&gb, 5) + 1;
    avctx->channels = s->channels;
    avctx->sample_rate = s->samplerate;
    avctx->bits_per_raw_sample = s->bps;
    if (s->bps > 16)
        avctx->sample_fmt = SAMPLE_FMT_S32;
    else
        avctx->sample_fmt = SAMPLE_FMT_S16;
    s->samples  = get_bits_long(&gb, 32) << 4;
    s->samples |= get_bits(&gb, 4);
    skip_bits_long(&gb, 64);
    skip_bits_long(&gb, 64);
    dump_headers(avctx, s);
}
['void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,\n                              const uint8_t *buffer)\n{\n    GetBitContext gb;\n    init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);\n    skip_bits(&gb, 16);\n    s->max_blocksize = get_bits(&gb, 16);\n    if (s->max_blocksize < 16) {\n        av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\\n",\n               s->max_blocksize);\n        s->max_blocksize = 16;\n    }\n    skip_bits(&gb, 24);\n    s->max_framesize = get_bits_long(&gb, 24);\n    s->samplerate = get_bits_long(&gb, 20);\n    s->channels = get_bits(&gb, 3) + 1;\n    s->bps = get_bits(&gb, 5) + 1;\n    avctx->channels = s->channels;\n    avctx->sample_rate = s->samplerate;\n    avctx->bits_per_raw_sample = s->bps;\n    if (s->bps > 16)\n        avctx->sample_fmt = SAMPLE_FMT_S32;\n    else\n        avctx->sample_fmt = SAMPLE_FMT_S16;\n    s->samples  = get_bits_long(&gb, 32) << 4;\n    s->samples |= get_bits(&gb, 4);\n    skip_bits_long(&gb, 64);\n    skip_bits_long(&gb, 64);\n    dump_headers(avctx, s);\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 LIBMPEG2_BITSTREAM_READER\n    s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));\n    s->bit_count = 16 + 8*((intptr_t)buffer&1);\n    skip_bits_long(s, 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(GetBitContext *s, int n){\n    OPEN_READER(re, s)\n    UPDATE_CACHE(re, s)\n    LAST_SKIP_BITS(re, s, n)\n    CLOSE_READER(re, s)\n}']