-static void Interleave24( int8_t *p_out, const int32_t * const *pp_in,
- const int pi_index[],
- int i_nb_channels, int i_samples )
-{
- int i, j;
- for ( j = 0; j < i_samples; j++ )
- {
- for ( i = 0; i < i_nb_channels; i++ )
- {
- const int i_index = pi_index[i];
-#ifdef WORDS_BIGENDIAN
- p_out[3*(j * i_nb_channels + i)+0] = (pp_in[i_index][j] >> 16) & 0xff;
- p_out[3*(j * i_nb_channels + i)+1] = (pp_in[i_index][j] >> 8 ) & 0xff;
- p_out[3*(j * i_nb_channels + i)+2] = (pp_in[i_index][j] >> 0 ) & 0xff;
-#else
- p_out[3*(j * i_nb_channels + i)+2] = (pp_in[i_index][j] >> 16) & 0xff;
- p_out[3*(j * i_nb_channels + i)+1] = (pp_in[i_index][j] >> 8 ) & 0xff;
- p_out[3*(j * i_nb_channels + i)+0] = (pp_in[i_index][j] >> 0 ) & 0xff;
-#endif
- }
- }
-}
-
-static void Interleave16( int16_t *p_out, const int32_t * const *pp_in,
- const int pi_index[],
- int i_nb_channels, int i_samples )
-{
- int i, j;
- for ( j = 0; j < i_samples; j++ )
- {
- for ( i = 0; i < i_nb_channels; i++ )
- {
- p_out[j * i_nb_channels + i] = (int32_t)(pp_in[pi_index[i]][j]);
- }
- }
+ for( unsigned j = 0; j < i_samples; j++ )
+ for( unsigned i = 0; i < i_nb_channels; i++ )
+ p_out[j * i_nb_channels + i] = pp_in[pi_index[i]][j] << shift;