private static void initialize ( ) { double lFlen = 1.0f / ( double ) SPLINE_LUTLEN ; double lScale = ( double ) SPLINE_QUANTSCALE ; for ( int i = 0 ; i < SPLINE_LUTLEN ; i ++ ) { double lX = ( ( double ) i ) * lFlen ; int lIdx = i << 2 ; double lCm1 = Math . floor ( 0.5 + lScale * ( - 0.5 * lX * lX * lX + 1.0 * lX * lX - 0.5 * lX ) ) ; double lC0 = Math . floor ( 0.5 + lScale * ( 1.5 * lX * lX * lX - 2.5 * lX * lX + 1.0 ) ) ; double lC1 = Math . floor ( 0.5 + lScale * ( - 1.5 * lX * lX * lX + 2.0 * lX * lX + 0.5 * lX ) ) ; double lC2 = Math . floor ( 0.5 + lScale * ( 0.5 * lX * lX * lX - 0.5 * lX * lX ) ) ; lut [ lIdx + 0 ] = ( int ) ( ( lCm1 < - lScale ) ? - lScale : ( ( lCm1 > lScale ) ? lScale : lCm1 ) ) ; lut [ lIdx + 1 ] = ( int ) ( ( lC0 < - lScale ) ? - lScale : ( ( lC0 > lScale ) ? lScale : lC0 ) ) ; lut [ lIdx + 2 ] = ( int ) ( ( lC1 < - lScale ) ? - lScale : ( ( lC1 > lScale ) ? lScale : lC1 ) ) ; lut [ lIdx + 3 ] = ( int ) ( ( lC2 < - lScale ) ? - lScale : ( ( lC2 > lScale ) ? lScale : lC2 ) ) ; // forces coefs-set to unity gain: int lSum = lut [ lIdx + 0 ] + lut [ lIdx + 1 ] + lut [ lIdx + 2 ] + lut [ lIdx + 3 ] ; if ( lSum != SPLINE_QUANTSCALE ) { int lMax = lIdx ; if ( lut [ lIdx + 1 ] > lut [ lMax ] ) lMax = lIdx + 1 ; if ( lut [ lIdx + 2 ] > lut [ lMax ] ) lMax = lIdx + 2 ; if ( lut [ lIdx + 3 ] > lut [ lMax ] ) lMax = lIdx + 3 ; lut [ lMax ] += ( SPLINE_QUANTSCALE - lSum ) ; } } }
Init the static params