vc->buf=(float *)av_malloc(vc->blocksize_1 * sizeof(float)); vc->buf_tmp=(float *)av_malloc(vc->blocksize_1 * sizeof(float));
static int vorbis_parse_id_hdr(vorbis_context *vc){    GetBitContext *gb=&vc->gb;    uint_fast8_t bl0, bl1;    const float *vwin[8]={ vwin64, vwin128, vwin256, vwin512, vwin1024, vwin2048, vwin4096, vwin8192 };    if ((get_bits(gb, 8)!='v') || (get_bits(gb, 8)!='o') ||    (get_bits(gb, 8)!='r') || (get_bits(gb, 8)!='b') ||    (get_bits(gb, 8)!='i') || (get_bits(gb, 8)!='s')) {        av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (no vorbis signature). \n");        return 1;    }    vc->version=get_bits_long_le(gb, 32);    //FIXME check 0    vc->audio_channels=get_bits(gb, 8);   //FIXME check >0    vc->audio_samplerate=get_bits_long_le(gb, 32);   //FIXME check >0    vc->bitrate_maximum=get_bits_long_le(gb, 32);    vc->bitrate_nominal=get_bits_long_le(gb, 32);    vc->bitrate_minimum=get_bits_long_le(gb, 32);    bl0=get_bits(gb, 4);    bl1=get_bits(gb, 4);    vc->blocksize_0=(1<<bl0);    vc->blocksize_1=(1<<bl1);    if (bl0>13 || bl0<6 || bl1>13 || bl1<6) {        av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (illegal blocksize). \n");        return 3;    }    vc->swin=vwin[bl0-6];    vc->lwin=vwin[bl1-6];    if ((get_bits1(gb)) == 0) {        av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (framing flag not set). \n");        return 2;    }    vc->channel_residues=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));    vc->channel_floors=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));    vc->saved=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));    vc->ret=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));    vc->saved_start=0;    ff_mdct_init(&vc->mdct0, bl0, 1);    ff_mdct_init(&vc->mdct1, bl1, 1);    AV_DEBUG(" vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",            vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize_0, vc->blocksize_1);/*    BLK=vc->blocksize_0;    for(i=0;i<BLK/2;++i) {        vc->swin[i]=sin(0.5*3.14159265358*(sin(((float)i+0.5)/(float)BLK*3.14159265358))*(sin(((float)i+0.5)/(float)BLK*3.14159265358)));    }*/    return 0;}