# HG changeset patch # User lorenm # Date 1155246931 0 # Node ID 991ef6ade2766dbf41ebfc1fb7eecb13862a1e54 # Parent c42c03f3b402faf053e8f9f14d6084b529819cfd misc tweaks in vorbis_residue_decode(). 4% faster vorbis. diff -r c42c03f3b402 -r 991ef6ade276 vorbis.c --- a/vorbis.c Thu Aug 10 20:24:58 2006 +0000 +++ b/vorbis.c Thu Aug 10 21:55:31 2006 +0000 @@ -1374,6 +1374,7 @@ voffset=vr->begin; for(partition_count=0;partition_countclassifications]; for(j_times_ptns_to_read=0, j=0;jcodebooks[vr->classbook].vlc.table, @@ -1385,7 +1386,7 @@ for(i=0;iclassifications])>>32; + temp2=(((uint_fast64_t)temp) * inverse_class)>>32; if (partition_count+c_p_c-1-i < ptns_to_read) { classifs[j_times_ptns_to_read+partition_count+c_p_c-1-i]=temp-temp2*vr->classifications; } @@ -1405,7 +1406,7 @@ if (vqbook>=0) { uint_fast16_t coffs; - uint_fast8_t dim= vc->codebooks[vqbook].dimensions; + unsigned dim= vc->codebooks[vqbook].dimensions; // not uint_fast8_t: 64bit is slower here on amd64 uint_fast16_t step= dim==1 ? vr->partition_size : FASTDIV(vr->partition_size, dim); vorbis_codebook codebook= vc->codebooks[vqbook]; @@ -1414,8 +1415,8 @@ voffs=voffset+j*vlen; for(k=0;ktype==1) { voffs=voffset+j*vlen; for(k=0;ktype==2 && ch==2 && (voffset&1)==0 && (codebook.dimensions&1)==0) { // most frequent case optimized + else if (vr->type==2 && ch==2 && (voffset&1)==0 && (dim&1)==0) { // most frequent case optimized voffs=voffset>>1; + if(dim==2) { + for(k=0;k