Loading lib_isar/isar_stat.h +3 −3 Original line number Diff line number Diff line Loading @@ -350,9 +350,9 @@ typedef struct { float *real; float *imag; uint32_t capacity; uint32_t write_pos; uint32_t read_pos; int32_t capacity; int32_t write_pos; int32_t read_pos; int16_t is_full; } ISAR_CLDFB_RINGBUF, *ISAR_CLDFB_RINGBUF_HANDLE; Loading lib_rend/ivas_cldfb_ring_buffer.c +10 −11 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ static int16_t ivas_cldfb_ringbuf_IsFull( /*---------------------------------------------------------------------* * ivas_CLDFB_RINGBUF_Open() * * Allocate a ring buffer for CLDFB data with the given capacity of CLDFB columns. * Allocates a ring buffer for CLDFB data with the given capacity of CLDFB columns. * Each column is expected to contain at most CLDFB_NO_CHANNELS_MAX frequency bands. * * May return IVAS_ERR_FAILED_ALLOC on failed allocation, or IVAS_ERR_OK otherwise. Loading @@ -88,7 +88,7 @@ ivas_error ivas_CLDFB_RINGBUF_Open( ISAR_CLDFB_RINGBUF_HANDLE h; int32_t capacity; capacity = capacity_columns * CLDFB_NO_CHANNELS_MAX; capacity = (int32_t) capacity_columns * CLDFB_NO_CHANNELS_MAX; if ( ( h = malloc( sizeof( ISAR_CLDFB_RINGBUF ) ) ) == NULL ) { Loading Loading @@ -119,7 +119,7 @@ ivas_error ivas_CLDFB_RINGBUF_Open( /*---------------------------------------------------------------------* * ivas_CLDFB_RINGBUF_Close() * * Dellocate CLDFB ring buffer. The given handle will be set to NULL. * Dellocates CLDFB ring buffer. The given handle will be set to NULL. *---------------------------------------------------------------------*/ void ivas_CLDFB_RINGBUF_Close( Loading Loading @@ -190,7 +190,7 @@ void ivas_CLDFB_RINGBUF_Push( /*---------------------------------------------------------------------* * ivas_CLDFB_RINGBUF_Pop() * * Pop a single column from the front of the CLDFB ring buffer into real and imag arrays. * Pops a single column from the front of the CLDFB ring buffer into real and imag arrays. *---------------------------------------------------------------------*/ void ivas_CLDFB_RINGBUF_Pop( Loading Loading @@ -229,7 +229,7 @@ void ivas_CLDFB_RINGBUF_Pop( * Returns total number of buffered samples (including number of channels) *---------------------------------------------------------------------*/ static uint32_t ivas_cldfb_ringbuf_total_size( static int32_t ivas_cldfb_ringbuf_total_size( ISAR_CLDFB_RINGBUF_HANDLE h ) { if ( ivas_cldfb_ringbuf_IsFull( h ) ) Loading Loading @@ -265,8 +265,8 @@ void ivas_CLDFB_RINGBUF_GetByIdx( const int16_t col_idx ) { int32_t idx = col_idx * CLDFB_NO_CHANNELS_MAX; int32_t num_floats = (int32_t) ivas_cldfb_ringbuf_total_size( h ); uint32_t offset, uidx; int32_t num_floats = ivas_cldfb_ringbuf_total_size( h ); int32_t offset; assert( -num_floats <= idx && idx <= num_floats ); Loading @@ -280,14 +280,13 @@ void ivas_CLDFB_RINGBUF_GetByIdx( } else { uidx = (uint32_t) -idx; if ( uidx <= h->write_pos ) if ( -idx <= h->write_pos ) { offset = h->write_pos - uidx; offset = h->write_pos + idx; } else { offset = h->write_pos + h->capacity - uidx; offset = h->write_pos + h->capacity + idx; } } Loading Loading
lib_isar/isar_stat.h +3 −3 Original line number Diff line number Diff line Loading @@ -350,9 +350,9 @@ typedef struct { float *real; float *imag; uint32_t capacity; uint32_t write_pos; uint32_t read_pos; int32_t capacity; int32_t write_pos; int32_t read_pos; int16_t is_full; } ISAR_CLDFB_RINGBUF, *ISAR_CLDFB_RINGBUF_HANDLE; Loading
lib_rend/ivas_cldfb_ring_buffer.c +10 −11 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ static int16_t ivas_cldfb_ringbuf_IsFull( /*---------------------------------------------------------------------* * ivas_CLDFB_RINGBUF_Open() * * Allocate a ring buffer for CLDFB data with the given capacity of CLDFB columns. * Allocates a ring buffer for CLDFB data with the given capacity of CLDFB columns. * Each column is expected to contain at most CLDFB_NO_CHANNELS_MAX frequency bands. * * May return IVAS_ERR_FAILED_ALLOC on failed allocation, or IVAS_ERR_OK otherwise. Loading @@ -88,7 +88,7 @@ ivas_error ivas_CLDFB_RINGBUF_Open( ISAR_CLDFB_RINGBUF_HANDLE h; int32_t capacity; capacity = capacity_columns * CLDFB_NO_CHANNELS_MAX; capacity = (int32_t) capacity_columns * CLDFB_NO_CHANNELS_MAX; if ( ( h = malloc( sizeof( ISAR_CLDFB_RINGBUF ) ) ) == NULL ) { Loading Loading @@ -119,7 +119,7 @@ ivas_error ivas_CLDFB_RINGBUF_Open( /*---------------------------------------------------------------------* * ivas_CLDFB_RINGBUF_Close() * * Dellocate CLDFB ring buffer. The given handle will be set to NULL. * Dellocates CLDFB ring buffer. The given handle will be set to NULL. *---------------------------------------------------------------------*/ void ivas_CLDFB_RINGBUF_Close( Loading Loading @@ -190,7 +190,7 @@ void ivas_CLDFB_RINGBUF_Push( /*---------------------------------------------------------------------* * ivas_CLDFB_RINGBUF_Pop() * * Pop a single column from the front of the CLDFB ring buffer into real and imag arrays. * Pops a single column from the front of the CLDFB ring buffer into real and imag arrays. *---------------------------------------------------------------------*/ void ivas_CLDFB_RINGBUF_Pop( Loading Loading @@ -229,7 +229,7 @@ void ivas_CLDFB_RINGBUF_Pop( * Returns total number of buffered samples (including number of channels) *---------------------------------------------------------------------*/ static uint32_t ivas_cldfb_ringbuf_total_size( static int32_t ivas_cldfb_ringbuf_total_size( ISAR_CLDFB_RINGBUF_HANDLE h ) { if ( ivas_cldfb_ringbuf_IsFull( h ) ) Loading Loading @@ -265,8 +265,8 @@ void ivas_CLDFB_RINGBUF_GetByIdx( const int16_t col_idx ) { int32_t idx = col_idx * CLDFB_NO_CHANNELS_MAX; int32_t num_floats = (int32_t) ivas_cldfb_ringbuf_total_size( h ); uint32_t offset, uidx; int32_t num_floats = ivas_cldfb_ringbuf_total_size( h ); int32_t offset; assert( -num_floats <= idx && idx <= num_floats ); Loading @@ -280,14 +280,13 @@ void ivas_CLDFB_RINGBUF_GetByIdx( } else { uidx = (uint32_t) -idx; if ( uidx <= h->write_pos ) if ( -idx <= h->write_pos ) { offset = h->write_pos - uidx; offset = h->write_pos + idx; } else { offset = h->write_pos + h->capacity - uidx; offset = h->write_pos + h->capacity + idx; } } Loading