cosmetic changes

fixed warning for implicit cast from doulbe to int
This commit is contained in:
darkeye 2005-04-11 19:26:55 +00:00
parent a415fd63b8
commit 028f6d98fd
1 changed files with 23 additions and 12 deletions

View File

@ -94,19 +94,26 @@ VorbisLibEncoder :: init ( CastSink * sink,
bool useLinear = true;
double inverse = 1 / resampleRatio;
int integer = inverse;
int integer = (int) inverse;
if( integer == inverse ) { // Check that the inverse of the ratio is an integer
// Check that the inverse of the ratio is an integer
if( integer == inverse ) {
while( useLinear && integer ) { // Loop through the bits
if( integer & 1 && integer != 1 ) // If the lowest order bit is not the only one set
useLinear = false; // Not a power of two; cannot use linear
else
integer >>= 1; // Shift all the bits over and try again
}
} else
// If the lowest order bit is not the only one set
if( integer & 1 && integer != 1 ) {
// Not a power of two; cannot use linear
useLinear = false;
} else {
// Shift all the bits over and try again
integer >>= 1;
}
}
} else {
useLinear = false;
}
// If we get here and useLinear is still true, then we have a power of two.
// If we get here and useLinear is still true, then we have
// a power of two.
// open the aflibConverter in
// - high quality
@ -408,6 +415,10 @@ VorbisLibEncoder :: close ( void ) throw ( Exception )
$Source$
$Log$
Revision 1.21 2005/04/11 19:26:55 darkeye
cosmetic changes
fixed warning for implicit cast from doulbe to int
Revision 1.20 2005/04/03 05:18:24 jbebel
Add test to determine if the sample rate conversion ratio is a power of 2.
If so, use linear interpolation. Otherwise use more complicated quadratic