[xiph-commits] r15469 - in trunk/theora/lib: . dec
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Thu Oct 30 05:49:43 PDT 2008
Author: tterribe
Date: 2008-10-30 05:49:42 -0700 (Thu, 30 Oct 2008)
New Revision: 15469
Modified:
trunk/theora/lib/dec/fragment.c
trunk/theora/lib/dec/state.c
trunk/theora/lib/internal.h
Log:
Cleaner patch resolving #1402.
Thanks to Brian Lu of Sun for testing.
Modified: trunk/theora/lib/dec/fragment.c
===================================================================
--- trunk/theora/lib/dec/fragment.c 2008-10-29 09:40:50 UTC (rev 15468)
+++ trunk/theora/lib/dec/fragment.c 2008-10-30 12:49:42 UTC (rev 15469)
@@ -179,7 +179,7 @@
pflag=1<<i;
if((BC_MASK[bc]&pflag)&&predfr[i]->coded&&
OC_FRAME_FOR_MODE[predfr[i]->mbmode]==pred_frame){
- p[np++]=(ogg_int16_t)predfr[i]->dc;
+ p[np++]=predfr[i]->dc;
pflags|=pflag;
}
}
Modified: trunk/theora/lib/dec/state.c
===================================================================
--- trunk/theora/lib/dec/state.c 2008-10-29 09:40:50 UTC (rev 15468)
+++ trunk/theora/lib/dec/state.c 2008-10-30 12:49:42 UTC (rev 15469)
@@ -831,13 +831,13 @@
ogg_int16_t p;
/*Why is the iquant product rounded in this case and no others?
Who knows.*/
- p=(ogg_int16_t)((ogg_int32_t)(ogg_int16_t)_frag->dc*_dc_iquant+15>>5);
+ 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{
/*First, dequantize the coefficients.*/
- dct_buf[0]=(ogg_int16_t)((ogg_int32_t)(ogg_int16_t)_frag->dc*_dc_iquant);
+ dct_buf[0]=(ogg_int16_t)((ogg_int32_t)_frag->dc*_dc_iquant);
for(zzi=1;zzi<_ncoefs;zzi++){
int ci;
ci=OC_FZIG_ZAG[zzi];
Modified: trunk/theora/lib/internal.h
===================================================================
--- trunk/theora/lib/internal.h 2008-10-29 09:40:50 UTC (rev 15468)
+++ trunk/theora/lib/internal.h 2008-10-30 12:49:42 UTC (rev 15469)
@@ -211,12 +211,13 @@
unsigned invalid:1;
/*The quality index used for this fragment's AC coefficients.*/
unsigned qi:6;
- /*The mode of the macroblock this fragment belongs to.*/
+ /*The mode of the macroblock this fragment belongs to.
+ Note that the C standard requires an explicit signed keyword for bitfield
+ types, since some compilers may treat them as unsigned without it.*/
signed int mbmode:8;
/*The prediction-corrected DC component.
- Note that some compilers (e.g., Solaris's) will ignore the signedness of
- the type and treat this value as unsigned always, so it will need to be
- casted before being used.*/
+ Note that the C standard requires an explicit signed keyword for bitfield
+ types, since some compilers may treat them as unsigned without it.*/
signed int dc:16;
/*A pointer to the portion of an image covered by this fragment in several
images.
More information about the commits
mailing list