Commit 7300a7f8 authored by liksonov's avatar liksonov
Browse files

Update / clean up code.

parent 3e336076
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@
#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4

#ifdef ENABLE_PROX_BASED_MIXING
#define PROXIMITY_USER_ID ( 0 )
#define PROXIMITY_USER_ID ( 2 )
const uint8_t bitstream[] = { 0x00, 0x01, 0x80, 0x02, 0x80 };
#endif /* ENABLE_PROX_BASED_MIXING */

@@ -126,11 +126,11 @@ void ivas_mono_downmix_render_passive(

#ifdef DEBUG_PROX_MIX_INFO
    printf("\n\n  hDownmix->Smixer  =  ");
    for(int i = 0; i < numInputChannels; i++)
    for( i = 0; i < numInputChannels; i++)
        printf( "%.8f   ", hDownmix->Smixer[i] );
    
    printf("\n  hDownmix->powvec  =  ");
    for(int i = 0; i < numInputChannels; i++)
    for( i = 0; i < numInputChannels; i++)
        printf( "%.6e   ", hDownmix->powvec[i] );

    printf("\n");
+15 −15
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
  * Static functions declaration
  *------------------------------------------------------------------------------------------*/

static float get_block_power( float *vec, int32_t frame_len );
static float get_block_power( float *vec, int16_t frame_len );

/*------------------------------------------------------------------------------------------*
 * function definitions
@@ -82,12 +82,12 @@ static float get_block_power( float *vec, int32_t frame_len );

ivas_error get_users_locations( 
    const uint8_t *bitstream, 
    int32_t len, 
    int16_t len, 
    int16_t *userLoc )
{
    /* userID = channelID starting from index=0 */
    int16_t nrLoc = 1;
    int32_t i;
    int16_t nrLoc, i;
    nrLoc = 1;

    /* enter user location depending on position in userLoc array */
    for ( i = 0; i < len; i++ )
@@ -111,19 +111,19 @@ ivas_error get_prox_downmix_mixer(
    int16_t userID, 
    float *sMixer, 
    int16_t *userLoc, 
    int32_t nChan, 
    int16_t nChan, 
    float ppPcm_in[][L_FRAME48k], 
    int32_t frame_len, 
    int16_t frame_len, 
    float *powvec )
{
    /* userID = channelID starting from index=0 */
    int16_t nrUsers = 0, nrLoc = 0;
    int32_t i, j;
    int16_t locIdx = 0;
    int16_t nrUsers, nrLoc, i, j, locIdx;
    float pow_1, pow_2;
    float *pow;
    float pow[MAX_INPUT_CHANNELS];

    pow = (float *) calloc( nChan, sizeof( float ) );
    nrUsers = 0;
    nrLoc = 0;
    locIdx = 0;

    /* init */
    for ( i = 0; i < nChan; i++ )
@@ -207,7 +207,6 @@ ivas_error get_prox_downmix_mixer(
            sMixer[i] = sMixer[i] / (float) nrUsers;
        }
    }
    free( pow );

    return IVAS_ERR_OK;
}
@@ -215,10 +214,11 @@ ivas_error get_prox_downmix_mixer(

static float get_block_power( 
    float *vec, 
    int32_t frame_len )
    int16_t frame_len )
{
    int32_t i;
    float pow = 0.0f;
    int16_t i;
    float pow;
    pow = 0.0f;

    for ( i = 0; i < frame_len; i++ )
    {
+2 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
/*------------------------------------------------------------------------------------------*
 * function declarations
 *------------------------------------------------------------------------------------------*/
ivas_error get_users_locations( const uint8_t *bitstream, int32_t len, int16_t *userLoc );
ivas_error get_prox_downmix_mixer( int16_t userID, float *pMixer, int16_t *userLoc, int32_t nChan, float ppPcm_in[][L_FRAME48k], int32_t frame_len, float *powvec );
ivas_error get_users_locations( const uint8_t *bitstream, int16_t len, int16_t *userLoc );
ivas_error get_prox_downmix_mixer( int16_t userID, float *pMixer, int16_t *userLoc, int16_t nChan, float ppPcm_in[][L_FRAME48k], int16_t frame_len, float *powvec );

#endif