[xiph-commits] r14348 - in trunk: theora/lib/dec
theora-exp/examples theora-exp/lib
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Fri Jan 4 10:17:02 PST 2008
Author: tterribe
Date: 2008-01-04 10:17:00 -0800 (Fri, 04 Jan 2008)
New Revision: 14348
Modified:
trunk/theora-exp/examples/rehuff.c
trunk/theora-exp/lib/decode.c
trunk/theora-exp/lib/encvbr.c
trunk/theora-exp/lib/fragment.c
trunk/theora-exp/lib/recode.c
trunk/theora-exp/lib/state.c
trunk/theora/lib/dec/decode.c
trunk/theora/lib/dec/fragment.c
trunk/theora/lib/dec/state.c
Log:
Mark which loops auto-vectorize.
Currently the auto-vectorizer produces _slower_ code than normal, so it is
disabledby default.
Modified: trunk/theora/lib/dec/decode.c
===================================================================
--- trunk/theora/lib/dec/decode.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora/lib/dec/decode.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -598,6 +598,7 @@
corrupt and the rest of the packet is garbage anyway, but this way we
won't crash, and we'll decode SOMETHING.*/
TH_DEBUG("mode scheme list = { ");
+ /*LOOP VECTORIZES.*/
for(mi=0;mi<OC_NMODES;mi++)scheme0_alphabet[mi]=OC_MODE_INTER_NOMV;
for(mi=0;mi<OC_NMODES;mi++){
theora_read(&_dec->opb,3,&val);
@@ -1289,6 +1290,7 @@
int zzi;
int rl;
zzi=*_zzi;
+ /*LOOP VECTORIZES.*/
for(rl=_token-OC_DCT_RUN_CAT1A+1;rl-->0;)_dct_coeffs[zzi++]=0;
_dct_coeffs[zzi++]=(ogg_int16_t)(1-(_extra_bits<<1));
*_zzi=zzi;
@@ -1321,6 +1323,7 @@
_token-=OC_DCT_RUN_CAT1B;
rl=(_extra_bits&NZEROS_MASK[_token])+NZEROS_ADJUST[_token];
zzi=*_zzi;
+ /*LOOP VECTORIZES.*/
while(rl-->0)_dct_coeffs[zzi++]=0;
valsigned[0]=VALUE_ADJUST[_token]+
(_extra_bits>>VALUE_SHIFT[_token]&VALUE_MASK[_token]);
Modified: trunk/theora/lib/dec/fragment.c
===================================================================
--- trunk/theora/lib/dec/fragment.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora/lib/dec/fragment.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -186,6 +186,7 @@
if(pflags==0)return _pred_last[pred_frame];
else{
ret=PRED_SCALE[pflags][0]*p[0];
+ /*LOOP VECTORIZES.*/
for(i=1;i<np;i++)ret+=PRED_SCALE[pflags][i]*p[i];
ret=OC_DIV_POW2(ret,PRED_SHIFT[pflags],PRED_RMASK[pflags]);
}
Modified: trunk/theora/lib/dec/state.c
===================================================================
--- trunk/theora/lib/dec/state.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora/lib/dec/state.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -821,6 +821,7 @@
Who knows.*/
p=(ogg_int16_t)((ogg_int32_t)_frag->dc*_dc_iquant+15>>5);
+ /*LOOP VECTORIZES.*/
for(ci=0;ci<64;ci++)res_buf[ci]=p;
#ifdef _TH_DEBUG_
Modified: trunk/theora-exp/examples/rehuff.c
===================================================================
--- trunk/theora-exp/examples/rehuff.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora-exp/examples/rehuff.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -216,6 +216,7 @@
int ti;
int c;
c=0;
+ /*LOOP VECTORIZES.*/
for(ti=0;ti<_nfreqs;ti++)c+=_freqs[ti];
return c;
}
Modified: trunk/theora-exp/lib/decode.c
===================================================================
--- trunk/theora-exp/lib/decode.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora-exp/lib/decode.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -503,6 +503,7 @@
If the bitstream doesn't contain each index exactly once, it's likely
corrupt and the rest of the packet is garbage anyway, but this way we
won't crash, and we'll decode SOMETHING.*/
+ /*LOOP VECTORIZES.*/
for(mi=0;mi<OC_NMODES;mi++)scheme0_alphabet[mi]=OC_MODE_INTER_NOMV;
for(mi=0;mi<OC_NMODES;mi++){
theora_read(&_dec->opb,3,&val);
@@ -1123,6 +1124,7 @@
int zzi;
int rl;
zzi=*_zzi;
+ /*LOOP VECTORIZES.*/
for(rl=_token-OC_DCT_RUN_CAT1A+1;rl-->0;)_dct_coeffs[zzi++]=0;
_dct_coeffs[zzi++]=(ogg_int16_t)(1-(_extra_bits<<1));
*_zzi=zzi;
@@ -1155,6 +1157,7 @@
_token-=OC_DCT_RUN_CAT1B;
rl=(_extra_bits&NZEROS_MASK[_token])+NZEROS_ADJUST[_token];
zzi=*_zzi;
+ /*LOOP VECTORIZES.*/
while(rl-->0)_dct_coeffs[zzi++]=0;
valsigned[0]=VALUE_ADJUST[_token]+
(_extra_bits>>VALUE_SHIFT[_token]&VALUE_MASK[_token]);
Modified: trunk/theora-exp/lib/encvbr.c
===================================================================
--- trunk/theora-exp/lib/encvbr.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora-exp/lib/encvbr.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -620,6 +620,7 @@
int pli;
int zzi;
/*Clear any existing DCT tokens.*/
+ /*LOOP VECTORIZES.*/
for(zzi=0;zzi<64;zzi++){
_enc->ndct_tokens[zzi]=_enc->nextra_bits[zzi]=0;
_enc->extra_bits_offs[zzi]=0;
@@ -1065,6 +1066,7 @@
}
/*Bit costs are stored in the table with extra precision.
Round them down to whole bits here.*/
+ /*LOOP VECTORIZES.*/
for(modei=0;modei<OC_NMODES;modei++){
bits[modei]=bits[modei]+(1<<OC_BIT_SCALE-1)>>OC_BIT_SCALE;
}
Modified: trunk/theora-exp/lib/fragment.c
===================================================================
--- trunk/theora-exp/lib/fragment.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora-exp/lib/fragment.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -169,6 +169,7 @@
if(pflags==0)return _pred_last[pred_frame];
else{
ret=PRED_SCALE[pflags][0]*p[0];
+ /*LOOP VECTORIZES.*/
for(i=1;i<np;i++)ret+=PRED_SCALE[pflags][i]*p[i];
ret=OC_DIV_POW2(ret,PRED_SHIFT[pflags],PRED_RMASK[pflags]);
}
Modified: trunk/theora-exp/lib/recode.c
===================================================================
--- trunk/theora-exp/lib/recode.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora-exp/lib/recode.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -510,6 +510,7 @@
If the bitstream doesn't contain each index exactly once, it's likely
corrupt and the rest of the packet is garbage anyway, but this way we
won't crash, and we'll decode SOMETHING.*/
+ /*LOOP VECTORIZES.*/
for(mi=0;mi<OC_NMODES;mi++)scheme0_alphabet[mi]=OC_MODE_INTER_NOMV;
for(mi=0;mi<OC_NMODES;mi++){
theora_read(&_rec->dec_opb,3,&val);
Modified: trunk/theora-exp/lib/state.c
===================================================================
--- trunk/theora-exp/lib/state.c 2008-01-04 18:11:10 UTC (rev 14347)
+++ trunk/theora-exp/lib/state.c 2008-01-04 18:17:00 UTC (rev 14348)
@@ -792,6 +792,7 @@
/*Why is the iquant product rounded in this case and no others?
Who knows.*/
p=(ogg_int16_t)((ogg_int32_t)_frag->dc*_dc_iquant+15>>5);
+ /*LOOP VECTORIZES.*/
for(ci=0;ci<64;ci++)res_buf[ci]=p;
}
else{
More information about the commits
mailing list