encoder.js
function downscaleType( fromType, toType ) {
	// Lookup conversion on the downscale table
	for (var i=0; i<NUMTYPE_DOWNSCALE.FROM.length; ++i) {
		if ( (NUMTYPE_DOWNSCALE.FROM[i] === fromType) && 
			 (NUMTYPE_DOWNSCALE.TO[i] === toType) )
			return i;
	}
	// Nothing found
	return undefined;
}
function downscaleType( fromType, toType ) {
	// Lookup conversion on the downscale table
	for (var i=0; i<NUMTYPE_DOWNSCALE.FROM.length; ++i) {
		if ( (NUMTYPE_DOWNSCALE.FROM[i] === fromType) && 
			 (NUMTYPE_DOWNSCALE.TO[i] === toType) )
			return i;
	}
	// Nothing found
	return undefined;
}
function downscaleType ( fromType , toType ) { // Lookup conversion on the downscale table for ( var i = 0 ; i < NUMTYPE_DOWNSCALE . FROM . length ; ++ i ) { if ( ( NUMTYPE_DOWNSCALE . FROM [ i ] === fromType ) && ( NUMTYPE_DOWNSCALE . TO [ i ] === toType ) ) return i ; } // Nothing found return undefined ; }
Pick a matching downscaling type
Pick a matching downscaling type