comparison vorbis_dec.c @ 7962:c0745c5b1bb4 libavcodec

Interleaved forward/backward channels processing in order to increase chances of stepping on already cached data for the cores with extremely small data cache. Patch by Siarhei Siamashka: name dot surname at gmail
author benoit
date Wed, 01 Oct 2008 07:28:34 +0000
parents a34931a8fea9
children fb9a51e5d116
comparison
equal deleted inserted replaced
7961:ef0616549c16 7962:c0745c5b1bb4
1424 1424
1425 uint_fast8_t previous_window=vc->previous_window; 1425 uint_fast8_t previous_window=vc->previous_window;
1426 uint_fast8_t mode_number; 1426 uint_fast8_t mode_number;
1427 uint_fast8_t blockflag; 1427 uint_fast8_t blockflag;
1428 uint_fast16_t blocksize; 1428 uint_fast16_t blocksize;
1429 int_fast32_t i,j,dir; 1429 int_fast32_t i,j;
1430 uint_fast8_t no_residue[vc->audio_channels]; 1430 uint_fast8_t no_residue[vc->audio_channels];
1431 uint_fast8_t do_not_decode[vc->audio_channels]; 1431 uint_fast8_t do_not_decode[vc->audio_channels];
1432 vorbis_mapping *mapping; 1432 vorbis_mapping *mapping;
1433 float *ch_res_ptr=vc->channel_residues; 1433 float *ch_res_ptr=vc->channel_residues;
1434 float *ch_floor_ptr=vc->channel_floors; 1434 float *ch_floor_ptr=vc->channel_floors;
1516 mag=vc->channel_residues+res_chan[mapping->magnitude[i]]*blocksize/2; 1516 mag=vc->channel_residues+res_chan[mapping->magnitude[i]]*blocksize/2;
1517 ang=vc->channel_residues+res_chan[mapping->angle[i]]*blocksize/2; 1517 ang=vc->channel_residues+res_chan[mapping->angle[i]]*blocksize/2;
1518 vc->dsp.vorbis_inverse_coupling(mag, ang, blocksize/2); 1518 vc->dsp.vorbis_inverse_coupling(mag, ang, blocksize/2);
1519 } 1519 }
1520 1520
1521 // Dotproduct 1521 // Dotproduct, MDCT
1522 1522
1523 for(j=0, ch_floor_ptr=vc->channel_floors;j<vc->audio_channels;++j,ch_floor_ptr+=blocksize/2) { 1523 for(j=vc->audio_channels-1;j>=0;j--) {
1524 ch_floor_ptr=vc->channel_floors+j*blocksize/2;
1524 ch_res_ptr=vc->channel_residues+res_chan[j]*blocksize/2; 1525 ch_res_ptr=vc->channel_residues+res_chan[j]*blocksize/2;
1525 vc->dsp.vector_fmul(ch_floor_ptr, ch_res_ptr, blocksize/2); 1526 vc->dsp.vector_fmul(ch_floor_ptr, ch_res_ptr, blocksize/2);
1526 } 1527 ff_imdct_half(&vc->mdct[blockflag], ch_res_ptr, ch_floor_ptr);
1527 1528 }
1528 // MDCT, overlap/add, save data for next overlapping FPMATH 1529
1530 // Overlap/add, save data for next overlapping FPMATH
1529 1531
1530 retlen = (blocksize + vc->blocksize[previous_window])/4; 1532 retlen = (blocksize + vc->blocksize[previous_window])/4;
1531 dir = retlen <= blocksize/2; // pick an order so that ret[] can reuse floors[] without stepping on any data we need 1533 for(j=0;j<vc->audio_channels;j++) {
1532 for(j=dir?0:vc->audio_channels-1; (unsigned)j<vc->audio_channels; j+=dir*2-1) {
1533 uint_fast16_t bs0=vc->blocksize[0]; 1534 uint_fast16_t bs0=vc->blocksize[0];
1534 uint_fast16_t bs1=vc->blocksize[1]; 1535 uint_fast16_t bs1=vc->blocksize[1];
1535 float *residue=vc->channel_residues+res_chan[j]*blocksize/2; 1536 float *residue=vc->channel_residues+res_chan[j]*blocksize/2;
1536 float *floor=vc->channel_floors+j*blocksize/2;
1537 float *saved=vc->saved+j*bs1/4; 1537 float *saved=vc->saved+j*bs1/4;
1538 float *ret=vc->channel_floors+j*retlen; 1538 float *ret=vc->channel_floors+j*retlen;
1539 float *buf=residue; 1539 float *buf=residue;
1540 const float *win=vc->win[blockflag&previous_window]; 1540 const float *win=vc->win[blockflag&previous_window];
1541
1542 ff_imdct_half(&vc->mdct[blockflag], buf, floor);
1543 1541
1544 if(blockflag == previous_window) { 1542 if(blockflag == previous_window) {
1545 vc->dsp.vector_fmul_window(ret, saved, buf, win, fadd_bias, blocksize/4); 1543 vc->dsp.vector_fmul_window(ret, saved, buf, win, fadd_bias, blocksize/4);
1546 } else if(blockflag > previous_window) { 1544 } else if(blockflag > previous_window) {
1547 vc->dsp.vector_fmul_window(ret, saved, buf, win, fadd_bias, bs0/4); 1545 vc->dsp.vector_fmul_window(ret, saved, buf, win, fadd_bias, bs0/4);