static int ra144_decode_frame(AVCodecContext * avctx, void *vdata,
                              int *data_size, const uint8_t *buf, int buf_size)
{
    static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};
    unsigned int refl_rms[4];
    uint16_t block_coefs[4][30];
    unsigned int lpc_refl[10];
    int i, j;
    int16_t *data = vdata;
    unsigned int energy;
    RA144Context *ractx = avctx->priv_data;
    GetBitContext gb;
    if (*data_size < 2*160)
        return -1;
    if(buf_size < 20) {
        av_log(avctx, AV_LOG_ERROR,
               "Frame too small (%d bytes). Truncated file?\n", buf_size);
        *data_size = 0;
        return buf_size;
    }
    init_get_bits(&gb, buf, 20 * 8);
    for (i=0; i<10; i++)
        lpc_refl[i] = lpc_refl_cb[i][get_bits(&gb, sizes[i])];
    eval_coefs(ractx->lpc_coef[0], lpc_refl);
    ractx->lpc_refl_rms[0] = rms(lpc_refl);
    energy = energy_tab[get_bits(&gb, 5)];
    refl_rms[0] = interp(ractx, block_coefs[0], 1, 1, ractx->old_energy);
    refl_rms[1] = interp(ractx, block_coefs[1], 2, energy <= ractx->old_energy,
                    t_sqrt(energy*ractx->old_energy) >> 12);
    refl_rms[2] = interp(ractx, block_coefs[2], 3, 0, energy);
    refl_rms[3] = rescale_rms(ractx->lpc_refl_rms[0], energy);
    int_to_int16(block_coefs[3], ractx->lpc_coef[0]);
    for (i=0; i < 4; i++) {
        do_output_subblock(ractx, block_coefs[i], refl_rms[i], &gb);
        for (j=0; j < BLOCKSIZE; j++)
            *data++ = av_clip_int16(ractx->curr_sblock[j + 10] << 2);
    }
    ractx->old_energy = energy;
    ractx->lpc_refl_rms[1] = ractx->lpc_refl_rms[0];
    FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]);
    *data_size = 2*160;
    return 20;
}
['static int ra144_decode_frame(AVCodecContext * avctx, void *vdata,\n                              int *data_size, const uint8_t *buf, int buf_size)\n{\n    static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};\n    unsigned int refl_rms[4];\n    uint16_t block_coefs[4][30];\n    unsigned int lpc_refl[10];\n    int i, j;\n    int16_t *data = vdata;\n    unsigned int energy;\n    RA144Context *ractx = avctx->priv_data;\n    GetBitContext gb;\n    if (*data_size < 2*160)\n        return -1;\n    if(buf_size < 20) {\n        av_log(avctx, AV_LOG_ERROR,\n               "Frame too small (%d bytes). Truncated file?\\n", buf_size);\n        *data_size = 0;\n        return buf_size;\n    }\n    init_get_bits(&gb, buf, 20 * 8);\n    for (i=0; i<10; i++)\n        lpc_refl[i] = lpc_refl_cb[i][get_bits(&gb, sizes[i])];\n    eval_coefs(ractx->lpc_coef[0], lpc_refl);\n    ractx->lpc_refl_rms[0] = rms(lpc_refl);\n    energy = energy_tab[get_bits(&gb, 5)];\n    refl_rms[0] = interp(ractx, block_coefs[0], 1, 1, ractx->old_energy);\n    refl_rms[1] = interp(ractx, block_coefs[1], 2, energy <= ractx->old_energy,\n                    t_sqrt(energy*ractx->old_energy) >> 12);\n    refl_rms[2] = interp(ractx, block_coefs[2], 3, 0, energy);\n    refl_rms[3] = rescale_rms(ractx->lpc_refl_rms[0], energy);\n    int_to_int16(block_coefs[3], ractx->lpc_coef[0]);\n    for (i=0; i < 4; i++) {\n        do_output_subblock(ractx, block_coefs[i], refl_rms[i], &gb);\n        for (j=0; j < BLOCKSIZE; j++)\n            *data++ = av_clip_int16(ractx->curr_sblock[j + 10] << 2);\n    }\n    ractx->old_energy = energy;\n    ractx->lpc_refl_rms[1] = ractx->lpc_refl_rms[0];\n    FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]);\n    *data_size = 2*160;\n    return 20;\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 unsigned int get_bits(GetBitContext *s, int n){\n    register int tmp;\n    OPEN_READER(re, s)\n    UPDATE_CACHE(re, s)\n    tmp= SHOW_UBITS(re, s, n);\n    LAST_SKIP_BITS(re, s, n)\n    CLOSE_READER(re, s)\n    return tmp;\n}']