Loading apps/ambi_converter.c +8 −8 Original line number Diff line number Diff line Loading @@ -51,27 +51,27 @@ int main( int argc, char *argv[] ) uint32_t samplingRate; uint32_t samplesInFile; uint32_t numSamples = L_FRAME48k; uint32_t numSamples = AMBI_MAX_FRAME_LENGTH; uint32_t numSamplesRead32 = 0; // uint32_t numSamplesClipped = 0; uint32_t numFramesClipped = 0; int16_t bps; int16_t samples[L_FRAME48k * AMBI_MAX_CHANNELS]; int16_t samples[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; int16_t order = 0; int16_t numChannels; const char *name_conventions[6] = { "ACN-SN3D", "ACN-N3D", "FuMa-MaxN", "FuMa-FuMa", "SID-SN3D", "SID-N3D" }; AMBI_FMT in_format, out_format; Word16 samples_f_in[L_FRAME48k * AMBI_MAX_CHANNELS]; Word16 samples_f_out[L_FRAME48k * AMBI_MAX_CHANNELS]; Word16 samples_f_in[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; Word16 samples_f_out[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; Word16 *in[AMBI_MAX_CHANNELS], *out[AMBI_MAX_CHANNELS]; for ( int16_t j = 0; j < AMBI_MAX_CHANNELS; j++ ) { in[j] = &samples_f_in[j * L_FRAME48k]; out[j] = &samples_f_out[j * L_FRAME48k]; in[j] = &samples_f_in[j * AMBI_MAX_FRAME_LENGTH]; out[j] = &samples_f_out[j * AMBI_MAX_FRAME_LENGTH]; } printf( "Ambisonics converter program\n" ); Loading Loading @@ -122,7 +122,7 @@ int main( int argc, char *argv[] ) order = (int16_t) sqrtf( numChannels ) - 1; assert( order > 0 && order <= 3 ); numSamples = L_FRAME48k * numChannels; numSamples = ( samplingRate * 20 * numChannels ) / 1000; /* 20ms worth of samples */ while ( ReadWavShort( wavFile_in, samples, numSamples, &numSamplesRead32 ) == __TWI_SUCCESS ) { int32_t err = 0; Loading @@ -140,7 +140,7 @@ int main( int argc, char *argv[] ) } } err = convert_ambi_format( in, out, order, in_format, out_format ); err = convert_ambi_format( in, out, order, in_format, out_format, ( const uint16_t )( numSamples / numChannels ) ); if ( err == AMBI_CONVERT_CLIPPING_DETECTED ) { numFramesClipped++; Loading lib_util/ambi_convert.c +36 −28 Original line number Diff line number Diff line Loading @@ -132,13 +132,14 @@ static const Word16 REORDER_ACN_SID[AMBI_MAX_CHANNELS] = { 0, AMBI_CONVERT_ERROR convert_ambi_format( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_FMT in_format, /* i: input ambisonics format */ AMBI_FMT out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_FMT in_format, /* i: input ambisonics format */ const AMBI_FMT out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ) { Word16 tmp[AMBI_MAX_CHANNELS * L_FRAME48k]; Word16 tmp[AMBI_MAX_CHANNELS * AMBI_MAX_FRAME_LENGTH]; Word16 *p_tmp[AMBI_MAX_CHANNELS]; AMBI_CONVERT_ERROR err_normalize = AMBI_CONVERT_OK; AMBI_CONVERT_ERROR err_reorder = AMBI_CONVERT_OK; Loading @@ -153,6 +154,11 @@ AMBI_CONVERT_ERROR convert_ambi_format( assert( order <= 3 ); if ( frame_length > AMBI_MAX_FRAME_LENGTH ) { return AMBI_CONVERT_UNSUPPORTED_FRAME_LENGTH; } if ( in_format != AMBI_FMT_ACN_SN3D && out_format != AMBI_FMT_ACN_SN3D ) { assert( 0 && "Conversion only supported to and from ACN-SN3D" ); Loading @@ -163,7 +169,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( { p_tmp[j] = &tmp[i]; move32(); i = add( i, L_FRAME48k ); i = add( i, frame_length ); } SWITCH( in_format ) Loading Loading @@ -254,19 +260,19 @@ AMBI_CONVERT_ERROR convert_ambi_format( { IF( ch_ord_in != ch_ord_out ) { err_normalize = renormalize_channels( in, p_tmp, order, ch_norm_in, ch_norm_out ); err_normalize = renormalize_channels( in, p_tmp, order, ch_norm_in, ch_norm_out, frame_length ); IF( ( err_normalize != AMBI_CONVERT_OK ) && ( err_normalize != AMBI_CONVERT_CLIPPING_DETECTED ) ) { return err_normalize; } IF( ( err_reorder = reorder_channels( p_tmp, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( p_tmp, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } } ELSE { err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out ); err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out, frame_length ); IF( ( err_normalize != AMBI_CONVERT_OK ) && ( err_normalize != AMBI_CONVERT_CLIPPING_DETECTED ) ) { return err_normalize; Loading @@ -275,7 +281,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } ELSE IF( in_format == AMBI_FMT_ACN_SN3D && ch_ord_in != ch_ord_out ) { IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } Loading @@ -284,11 +290,11 @@ AMBI_CONVERT_ERROR convert_ambi_format( { IF( ch_ord_in != ch_ord_out ) { IF( ( err_reorder = reorder_channels( in, p_tmp, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( in, p_tmp, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } err_normalize = renormalize_channels( p_tmp, out, order, ch_norm_in, ch_norm_out ); err_normalize = renormalize_channels( p_tmp, out, order, ch_norm_in, ch_norm_out, frame_length ); IF( ( err_normalize != AMBI_CONVERT_OK ) && ( err_normalize != AMBI_CONVERT_CLIPPING_DETECTED ) ) { return err_normalize; Loading @@ -296,7 +302,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } ELSE { IF( ( err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out ) ) != AMBI_CONVERT_OK ) IF( ( err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_normalize; } Loading @@ -304,7 +310,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } ELSE IF( out_format == AMBI_FMT_ACN_SN3D && ch_ord_in != ch_ord_out ) { IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } Loading @@ -318,7 +324,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( { Word16 i_s = 0; move16(); FOR( i_s = 0; i_s < L_FRAME48k; i_s++ ) FOR( i_s = 0; i_s < frame_length; i_s++ ) { out[i_chan][i_s] = in[i_chan][i_s]; move16(); Loading @@ -342,9 +348,10 @@ AMBI_CONVERT_ERROR convert_ambi_format( AMBI_CONVERT_ERROR renormalize_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ AMBI_CHANNEL_NORM out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_NORM out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ) { Word16 n_chan = i_mult2( add( order, 1 ), add( order, 1 ) ); Loading Loading @@ -413,7 +420,7 @@ AMBI_CONVERT_ERROR renormalize_channels( Word32 conversion_factor = conversion_table[i_chan]; Word32 outval; move32(); FOR( i = 0; i < L_FRAME48k; i++ ) FOR( i = 0; i < frame_length; i++ ) { Word64 tmp; tmp = W_mult0_32_32( (Word32) in[i_chan][i], conversion_factor ); Loading Loading @@ -441,9 +448,10 @@ AMBI_CONVERT_ERROR renormalize_channels( AMBI_CONVERT_ERROR reorder_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ AMBI_CHANNEL_ORDER out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_ORDER out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ) { Word16 n_chan = i_mult2( add( order, 1 ), add( order, 1 ) ); Loading Loading @@ -490,7 +498,7 @@ AMBI_CONVERT_ERROR reorder_channels( return AMBI_CONVERT_UNSUPPORTED_CONVERSION; } FOR( i = 0; i < L_FRAME48k; i++ ) FOR( i = 0; i < frame_length; i++ ) { FOR( i_chan = 0; i_chan < n_chan; i_chan++ ) { Loading lib_util/ambi_convert.h +21 −17 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ #include "stl.h" #include "cnst.h" #define L_FRAME48k 960 #define AMBI_MAX_FRAME_LENGTH 960 /* 20ms at 48 kHz Sampling rate */ #define AMBI_MAX_CHANNELS 16 typedef enum Loading Loading @@ -69,30 +69,34 @@ typedef enum { AMBI_CONVERT_OK = 0, AMBI_CONVERT_UNSUPPORTED_CONVERSION, AMBI_CONVERT_UNSUPPORTED_FRAME_LENGTH, AMBI_CONVERT_CLIPPING_DETECTED } AMBI_CONVERT_ERROR; AMBI_CONVERT_ERROR convert_ambi_format( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_FMT in_format, /* i: input ambisonics format */ AMBI_FMT out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_FMT in_format, /* i: input ambisonics format */ const AMBI_FMT out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ); AMBI_CONVERT_ERROR renormalize_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ AMBI_CHANNEL_NORM out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_NORM out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ); AMBI_CONVERT_ERROR reorder_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ AMBI_CHANNEL_ORDER out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_ORDER out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ); #endif Loading
apps/ambi_converter.c +8 −8 Original line number Diff line number Diff line Loading @@ -51,27 +51,27 @@ int main( int argc, char *argv[] ) uint32_t samplingRate; uint32_t samplesInFile; uint32_t numSamples = L_FRAME48k; uint32_t numSamples = AMBI_MAX_FRAME_LENGTH; uint32_t numSamplesRead32 = 0; // uint32_t numSamplesClipped = 0; uint32_t numFramesClipped = 0; int16_t bps; int16_t samples[L_FRAME48k * AMBI_MAX_CHANNELS]; int16_t samples[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; int16_t order = 0; int16_t numChannels; const char *name_conventions[6] = { "ACN-SN3D", "ACN-N3D", "FuMa-MaxN", "FuMa-FuMa", "SID-SN3D", "SID-N3D" }; AMBI_FMT in_format, out_format; Word16 samples_f_in[L_FRAME48k * AMBI_MAX_CHANNELS]; Word16 samples_f_out[L_FRAME48k * AMBI_MAX_CHANNELS]; Word16 samples_f_in[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; Word16 samples_f_out[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; Word16 *in[AMBI_MAX_CHANNELS], *out[AMBI_MAX_CHANNELS]; for ( int16_t j = 0; j < AMBI_MAX_CHANNELS; j++ ) { in[j] = &samples_f_in[j * L_FRAME48k]; out[j] = &samples_f_out[j * L_FRAME48k]; in[j] = &samples_f_in[j * AMBI_MAX_FRAME_LENGTH]; out[j] = &samples_f_out[j * AMBI_MAX_FRAME_LENGTH]; } printf( "Ambisonics converter program\n" ); Loading Loading @@ -122,7 +122,7 @@ int main( int argc, char *argv[] ) order = (int16_t) sqrtf( numChannels ) - 1; assert( order > 0 && order <= 3 ); numSamples = L_FRAME48k * numChannels; numSamples = ( samplingRate * 20 * numChannels ) / 1000; /* 20ms worth of samples */ while ( ReadWavShort( wavFile_in, samples, numSamples, &numSamplesRead32 ) == __TWI_SUCCESS ) { int32_t err = 0; Loading @@ -140,7 +140,7 @@ int main( int argc, char *argv[] ) } } err = convert_ambi_format( in, out, order, in_format, out_format ); err = convert_ambi_format( in, out, order, in_format, out_format, ( const uint16_t )( numSamples / numChannels ) ); if ( err == AMBI_CONVERT_CLIPPING_DETECTED ) { numFramesClipped++; Loading
lib_util/ambi_convert.c +36 −28 Original line number Diff line number Diff line Loading @@ -132,13 +132,14 @@ static const Word16 REORDER_ACN_SID[AMBI_MAX_CHANNELS] = { 0, AMBI_CONVERT_ERROR convert_ambi_format( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_FMT in_format, /* i: input ambisonics format */ AMBI_FMT out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_FMT in_format, /* i: input ambisonics format */ const AMBI_FMT out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ) { Word16 tmp[AMBI_MAX_CHANNELS * L_FRAME48k]; Word16 tmp[AMBI_MAX_CHANNELS * AMBI_MAX_FRAME_LENGTH]; Word16 *p_tmp[AMBI_MAX_CHANNELS]; AMBI_CONVERT_ERROR err_normalize = AMBI_CONVERT_OK; AMBI_CONVERT_ERROR err_reorder = AMBI_CONVERT_OK; Loading @@ -153,6 +154,11 @@ AMBI_CONVERT_ERROR convert_ambi_format( assert( order <= 3 ); if ( frame_length > AMBI_MAX_FRAME_LENGTH ) { return AMBI_CONVERT_UNSUPPORTED_FRAME_LENGTH; } if ( in_format != AMBI_FMT_ACN_SN3D && out_format != AMBI_FMT_ACN_SN3D ) { assert( 0 && "Conversion only supported to and from ACN-SN3D" ); Loading @@ -163,7 +169,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( { p_tmp[j] = &tmp[i]; move32(); i = add( i, L_FRAME48k ); i = add( i, frame_length ); } SWITCH( in_format ) Loading Loading @@ -254,19 +260,19 @@ AMBI_CONVERT_ERROR convert_ambi_format( { IF( ch_ord_in != ch_ord_out ) { err_normalize = renormalize_channels( in, p_tmp, order, ch_norm_in, ch_norm_out ); err_normalize = renormalize_channels( in, p_tmp, order, ch_norm_in, ch_norm_out, frame_length ); IF( ( err_normalize != AMBI_CONVERT_OK ) && ( err_normalize != AMBI_CONVERT_CLIPPING_DETECTED ) ) { return err_normalize; } IF( ( err_reorder = reorder_channels( p_tmp, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( p_tmp, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } } ELSE { err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out ); err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out, frame_length ); IF( ( err_normalize != AMBI_CONVERT_OK ) && ( err_normalize != AMBI_CONVERT_CLIPPING_DETECTED ) ) { return err_normalize; Loading @@ -275,7 +281,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } ELSE IF( in_format == AMBI_FMT_ACN_SN3D && ch_ord_in != ch_ord_out ) { IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } Loading @@ -284,11 +290,11 @@ AMBI_CONVERT_ERROR convert_ambi_format( { IF( ch_ord_in != ch_ord_out ) { IF( ( err_reorder = reorder_channels( in, p_tmp, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( in, p_tmp, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } err_normalize = renormalize_channels( p_tmp, out, order, ch_norm_in, ch_norm_out ); err_normalize = renormalize_channels( p_tmp, out, order, ch_norm_in, ch_norm_out, frame_length ); IF( ( err_normalize != AMBI_CONVERT_OK ) && ( err_normalize != AMBI_CONVERT_CLIPPING_DETECTED ) ) { return err_normalize; Loading @@ -296,7 +302,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } ELSE { IF( ( err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out ) ) != AMBI_CONVERT_OK ) IF( ( err_normalize = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_normalize; } Loading @@ -304,7 +310,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } ELSE IF( out_format == AMBI_FMT_ACN_SN3D && ch_ord_in != ch_ord_out ) { IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) IF( ( err_reorder = reorder_channels( in, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err_reorder; } Loading @@ -318,7 +324,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( { Word16 i_s = 0; move16(); FOR( i_s = 0; i_s < L_FRAME48k; i_s++ ) FOR( i_s = 0; i_s < frame_length; i_s++ ) { out[i_chan][i_s] = in[i_chan][i_s]; move16(); Loading @@ -342,9 +348,10 @@ AMBI_CONVERT_ERROR convert_ambi_format( AMBI_CONVERT_ERROR renormalize_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ AMBI_CHANNEL_NORM out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_NORM out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ) { Word16 n_chan = i_mult2( add( order, 1 ), add( order, 1 ) ); Loading Loading @@ -413,7 +420,7 @@ AMBI_CONVERT_ERROR renormalize_channels( Word32 conversion_factor = conversion_table[i_chan]; Word32 outval; move32(); FOR( i = 0; i < L_FRAME48k; i++ ) FOR( i = 0; i < frame_length; i++ ) { Word64 tmp; tmp = W_mult0_32_32( (Word32) in[i_chan][i], conversion_factor ); Loading Loading @@ -441,9 +448,10 @@ AMBI_CONVERT_ERROR renormalize_channels( AMBI_CONVERT_ERROR reorder_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ AMBI_CHANNEL_ORDER out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_ORDER out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ) { Word16 n_chan = i_mult2( add( order, 1 ), add( order, 1 ) ); Loading Loading @@ -490,7 +498,7 @@ AMBI_CONVERT_ERROR reorder_channels( return AMBI_CONVERT_UNSUPPORTED_CONVERSION; } FOR( i = 0; i < L_FRAME48k; i++ ) FOR( i = 0; i < frame_length; i++ ) { FOR( i_chan = 0; i_chan < n_chan; i_chan++ ) { Loading
lib_util/ambi_convert.h +21 −17 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ #include "stl.h" #include "cnst.h" #define L_FRAME48k 960 #define AMBI_MAX_FRAME_LENGTH 960 /* 20ms at 48 kHz Sampling rate */ #define AMBI_MAX_CHANNELS 16 typedef enum Loading Loading @@ -69,30 +69,34 @@ typedef enum { AMBI_CONVERT_OK = 0, AMBI_CONVERT_UNSUPPORTED_CONVERSION, AMBI_CONVERT_UNSUPPORTED_FRAME_LENGTH, AMBI_CONVERT_CLIPPING_DETECTED } AMBI_CONVERT_ERROR; AMBI_CONVERT_ERROR convert_ambi_format( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_FMT in_format, /* i: input ambisonics format */ AMBI_FMT out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_FMT in_format, /* i: input ambisonics format */ const AMBI_FMT out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ); AMBI_CONVERT_ERROR renormalize_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ AMBI_CHANNEL_NORM out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_NORM out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ); AMBI_CONVERT_ERROR reorder_channels( Word16 *in[], /* i: input ambisonics channels, Q0 */ Word16 *out[], /* o: output ambisonics channels, Q0 */ Word16 order, /* i: ambisonics order */ AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ AMBI_CHANNEL_ORDER out_format /* i: output ambisonics format */ const Word16 order, /* i: ambisonics order */ const AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ const AMBI_CHANNEL_ORDER out_format, /* i: output ambisonics format */ const int16_t frame_length /* i: input/output frame length */ ); #endif