Loading lib_rend/ivas_prot_rend_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -1624,10 +1624,11 @@ void ivas_TD_RINGBUF_Pop( Word32 *data, /* i : Output data */ const Word16 num_samples_per_channel /* i : Number of samples per channel to retrieve*/ ); #endif Word16 ivas_TD_RINGBUF_Size( const TD_RINGBUF_HANDLE h /* i : Ring buffer handle */ ); /* clang-format on */ #endif /* IVAS_PROT_REND_H */ lib_rend/ivas_stat_rend.h +5 −5 Original line number Diff line number Diff line Loading @@ -1441,10 +1441,10 @@ typedef struct typedef struct { Word32 *data; /* samples in interleaved layout, e.g. for channels A, B, C, samples are stored: A1, B1, C1, A2, B2, C2, ... */ UWord32 capacity; /* max number of Word32 values that can be stored */ UWord16 num_channels; UWord32 write_pos; UWord32 read_pos; Word32 capacity; /* max number of Word32 values that can be stored */ Word16 num_channels; Word32 write_pos; Word32 read_pos; Word16 is_full; } TD_RINGBUF_DATA, *TD_RINGBUF_HANDLE; Loading lib_rend/ivas_td_ring_buffer_fx.c +7 −11 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ static Word16 ivas_td_ringbuf_has_space_for_num_samples( TD_RINGBUF_HANDLE h, const Word32 num_samples ) { if ( LE_32( L_add( ivas_td_ringbuf_total_size( h ), num_samples ), h->capacity ) ) IF( LE_32( L_add( ivas_td_ringbuf_total_size( h ), num_samples ), h->capacity ) ) { return 1; } Loading Loading @@ -108,7 +108,6 @@ ivas_error ivas_TD_RINGBUF_Open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to allocate memory for TD ring buffer\n" ); } h->data = NULL; move32(); h->capacity = 0; move32(); h->num_channels = num_channels; Loading @@ -120,10 +119,9 @@ ivas_error ivas_TD_RINGBUF_Open( h->is_full = 0; move16(); *ph = h; move32(); h->data = malloc( capacity * sizeof( Word32 ) ); if ( h->data == NULL ) IF( h->data == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to allocate memory for TD ring buffer\n" ); } Loading Loading @@ -152,7 +150,6 @@ void ivas_TD_RINGBUF_Close( return; } h = *ph; move32(); IF( h == NULL ) { Loading @@ -166,7 +163,6 @@ void ivas_TD_RINGBUF_Close( free( h ); *ph = NULL; move32(); return; } Loading Loading @@ -196,7 +192,7 @@ void ivas_TD_RINGBUF_Push( { h->data[h->write_pos] = data[L_add( L_mult0( c, num_samples_per_channel ), s )]; move32(); ++h->write_pos; h->write_pos = L_add( h->write_pos, 1 ); if ( EQ_32( h->write_pos, h->capacity ) ) { Loading Loading @@ -231,7 +227,7 @@ void ivas_TD_RINGBUF_PushZeros( Word16 c; assert( ivas_td_ringbuf_has_space_for_num_samples( h, num_samples_per_channel * h->num_channels ) ); if ( !num_samples_per_channel ) IF( !num_samples_per_channel ) { return; } Loading @@ -242,9 +238,9 @@ void ivas_TD_RINGBUF_PushZeros( { h->data[h->write_pos] = 0; move32(); ++h->write_pos; h->write_pos = L_add( h->write_pos, 1 ); if ( EQ_32( h->write_pos, h->capacity ) ) IF( EQ_32( h->write_pos, h->capacity ) ) { h->write_pos = 0; move32(); Loading Loading @@ -295,7 +291,7 @@ void ivas_TD_RINGBUF_Pop( } } if ( h->is_full ) IF( h->is_full ) { h->is_full = 0; move16(); Loading Loading
lib_rend/ivas_prot_rend_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -1624,10 +1624,11 @@ void ivas_TD_RINGBUF_Pop( Word32 *data, /* i : Output data */ const Word16 num_samples_per_channel /* i : Number of samples per channel to retrieve*/ ); #endif Word16 ivas_TD_RINGBUF_Size( const TD_RINGBUF_HANDLE h /* i : Ring buffer handle */ ); /* clang-format on */ #endif /* IVAS_PROT_REND_H */
lib_rend/ivas_stat_rend.h +5 −5 Original line number Diff line number Diff line Loading @@ -1441,10 +1441,10 @@ typedef struct typedef struct { Word32 *data; /* samples in interleaved layout, e.g. for channels A, B, C, samples are stored: A1, B1, C1, A2, B2, C2, ... */ UWord32 capacity; /* max number of Word32 values that can be stored */ UWord16 num_channels; UWord32 write_pos; UWord32 read_pos; Word32 capacity; /* max number of Word32 values that can be stored */ Word16 num_channels; Word32 write_pos; Word32 read_pos; Word16 is_full; } TD_RINGBUF_DATA, *TD_RINGBUF_HANDLE; Loading
lib_rend/ivas_td_ring_buffer_fx.c +7 −11 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ static Word16 ivas_td_ringbuf_has_space_for_num_samples( TD_RINGBUF_HANDLE h, const Word32 num_samples ) { if ( LE_32( L_add( ivas_td_ringbuf_total_size( h ), num_samples ), h->capacity ) ) IF( LE_32( L_add( ivas_td_ringbuf_total_size( h ), num_samples ), h->capacity ) ) { return 1; } Loading Loading @@ -108,7 +108,6 @@ ivas_error ivas_TD_RINGBUF_Open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to allocate memory for TD ring buffer\n" ); } h->data = NULL; move32(); h->capacity = 0; move32(); h->num_channels = num_channels; Loading @@ -120,10 +119,9 @@ ivas_error ivas_TD_RINGBUF_Open( h->is_full = 0; move16(); *ph = h; move32(); h->data = malloc( capacity * sizeof( Word32 ) ); if ( h->data == NULL ) IF( h->data == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to allocate memory for TD ring buffer\n" ); } Loading Loading @@ -152,7 +150,6 @@ void ivas_TD_RINGBUF_Close( return; } h = *ph; move32(); IF( h == NULL ) { Loading @@ -166,7 +163,6 @@ void ivas_TD_RINGBUF_Close( free( h ); *ph = NULL; move32(); return; } Loading Loading @@ -196,7 +192,7 @@ void ivas_TD_RINGBUF_Push( { h->data[h->write_pos] = data[L_add( L_mult0( c, num_samples_per_channel ), s )]; move32(); ++h->write_pos; h->write_pos = L_add( h->write_pos, 1 ); if ( EQ_32( h->write_pos, h->capacity ) ) { Loading Loading @@ -231,7 +227,7 @@ void ivas_TD_RINGBUF_PushZeros( Word16 c; assert( ivas_td_ringbuf_has_space_for_num_samples( h, num_samples_per_channel * h->num_channels ) ); if ( !num_samples_per_channel ) IF( !num_samples_per_channel ) { return; } Loading @@ -242,9 +238,9 @@ void ivas_TD_RINGBUF_PushZeros( { h->data[h->write_pos] = 0; move32(); ++h->write_pos; h->write_pos = L_add( h->write_pos, 1 ); if ( EQ_32( h->write_pos, h->capacity ) ) IF( EQ_32( h->write_pos, h->capacity ) ) { h->write_pos = 0; move32(); Loading Loading @@ -295,7 +291,7 @@ void ivas_TD_RINGBUF_Pop( } } if ( h->is_full ) IF( h->is_full ) { h->is_full = 0; move16(); Loading