Commit e0f293c6 authored by Jan Kiene's avatar Jan Kiene
Browse files

port data type changes from float branch

parent b13e1544
Loading
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1601,7 +1601,7 @@ void ivas_rend_closeCldfbRend(

ivas_error ivas_TD_RINGBUF_Open(
    TD_RINGBUF_HANDLE *ph,                                      /* i/o: Ring buffer handle                     */
    const UWord32 capacity_per_channel,                        /* i  : Number of samples stored per channel   */
    const UWord16 capacity_per_channel,                        /* i  : Number of samples stored per channel   */
    const UWord16 num_channels                                 /* i  : Number of channels                     */
);

@@ -1612,21 +1612,21 @@ void ivas_TD_RINGBUF_Close(
void ivas_TD_RINGBUF_Push( 
    TD_RINGBUF_HANDLE h,                                        /* i/o: Ring buffer handle                       */
    const Word32 *data,                                          /* i  : Input data                               */
    const UWord32 num_samples_per_channel                      /* i  : Number of samples per channel to store   */
    const UWord16 num_samples_per_channel                      /* i  : Number of samples per channel to store   */
);

void ivas_TD_RINGBUF_PushZeros( 
    TD_RINGBUF_HANDLE h,                                        /* i/o: Ring buffer handle                      */
    const UWord32 num_samples_per_channel                      /* i  : Number of zeros per channel to store    */
    const UWord16 num_samples_per_channel                      /* i  : Number of zeros per channel to store    */
);

void ivas_TD_RINGBUF_Pop( 
    TD_RINGBUF_HANDLE h,                                        /* i/o: Ring buffer handle                      */
    Word32 *data,                                                /* i  : Output data                             */
    const UWord32 num_samples_per_channel                      /* i  : Number of samples per channel to retrieve*/
    const UWord16 num_samples_per_channel                      /* i  : Number of samples per channel to retrieve*/
);

uint32_t ivas_TD_RINGBUF_Size(
uint16_t ivas_TD_RINGBUF_Size(
    const TD_RINGBUF_HANDLE h                                   /* i  : Ring buffer handle                      */
);

+14 −17
Original line number Diff line number Diff line
@@ -105,14 +105,14 @@ static Word16 ivas_td_ringbuf_has_space_for_num_samples(

ivas_error ivas_TD_RINGBUF_Open(
    TD_RINGBUF_HANDLE *ph,              /* i/o: Ring buffer handle                     */
    const UWord32 capacity_per_channel, /* i  : Number of samples stored per channel   */
    const UWord16 capacity_per_channel, /* i  : Number of samples stored per channel   */
    const UWord16 num_channels          /* i  : Number of channels                     */
)
{
    TD_RINGBUF_HANDLE h;
    UWord32 capacity;

    capacity = Mult_32_16( capacity_per_channel, num_channels );
    capacity = L_mult0( capacity_per_channel, num_channels ); // Q0 x Q0 -> Q0

    h = malloc( sizeof( TD_RINGBUF_DATA ) );
    IF( h == NULL )
@@ -197,13 +197,12 @@ void ivas_TD_RINGBUF_Close(
void ivas_TD_RINGBUF_Push(
    TD_RINGBUF_HANDLE h,                  /* i/o: Ring buffer handle                       */
    const Word32 *data,                   /* i  : Input data                               */
    const UWord32 num_samples_per_channel /* i  : Number of samples per channel to store   */
    const UWord16 num_samples_per_channel /* i  : Number of samples per channel to store   */
)
{
    UWord32 s;
    UWord16 c;
    UWord16 c, s;

    assert( ivas_td_ringbuf_has_space_for_num_samples( h, Mult_32_16( num_samples_per_channel, h->num_channels ) ) );
    assert( ivas_td_ringbuf_has_space_for_num_samples( h, L_mult0( num_samples_per_channel, h->num_channels ) ) );

    FOR( s = 0; s < num_samples_per_channel; ++s )
    {
@@ -245,14 +244,13 @@ void ivas_TD_RINGBUF_Push(

void ivas_TD_RINGBUF_PushZeros(
    TD_RINGBUF_HANDLE h,                  /* i/o: Ring buffer handle                   */
    const UWord32 num_samples_per_channel /* i  : Number of zeros per channel to store */
    const UWord16 num_samples_per_channel /* i  : Number of zeros per channel to store */
)
{
    UWord32 s;
    UWord16 c;
    UWord16 c, s;

    assert( ivas_td_ringbuf_has_space_for_num_samples( h, Mult_32_16( num_samples_per_channel, h->num_channels ) ) );
    IF( EQ_32( num_samples_per_channel, 0 ) )
    assert( ivas_td_ringbuf_has_space_for_num_samples( h, L_mult0( num_samples_per_channel, h->num_channels ) ) );
    IF( EQ_16( num_samples_per_channel, 0 ) )
    {
        return;
    }
@@ -292,14 +290,13 @@ void ivas_TD_RINGBUF_PushZeros(
void ivas_TD_RINGBUF_Pop(
    TD_RINGBUF_HANDLE h,                  /* i/o: Ring buffer handle                           */
    Word32 *data,                         /* i  : Output data                                  */
    const UWord32 num_samples_per_channel /* i  : Number of samples per channel to retrieve    */
    const UWord16 num_samples_per_channel /* i  : Number of samples per channel to retrieve    */
)
{
    UWord32 s;
    UWord16 c;
    UWord16 c, s;
    Word32 requested_samples;

    requested_samples = Mult_32_16( num_samples_per_channel, h->num_channels );
    requested_samples = L_mult0( num_samples_per_channel, h->num_channels );
    assert( GE_32( ivas_td_ringbuf_total_size( h ), requested_samples ) );

    FOR( s = 0; s < num_samples_per_channel; ++s )
@@ -339,11 +336,11 @@ void ivas_TD_RINGBUF_Pop(
 * Returns number of buffered samples per channel.
 *---------------------------------------------------------------------*/

UWord32 ivas_TD_RINGBUF_Size(
UWord16 ivas_TD_RINGBUF_Size(
    const TD_RINGBUF_HANDLE h /* i  : Ring buffer handle */
)
{
    UWord32 size;
    UWord16 size;

    size = div_l( ivas_td_ringbuf_total_size( h ), h->num_channels );
    return size;
+4 −5
Original line number Diff line number Diff line
@@ -1642,9 +1642,8 @@ static ivas_error alignInputDelay(
{
    ivas_error error;
    input_ism *inputIsm;
    Word16 maxGlobalDelaySamples;
    Word32 numSamplesToPush, numSamplesToPop;
    UWord32 ringBufferSize, preDelay;
    Word16 maxGlobalDelaySamples, numSamplesToPush, numSamplesToPop;
    UWord16 ringBufferSize, preDelay;

    maxGlobalDelaySamples = latencyNsToSamples( sampleRateOut, maxGlobalDelayNs );
    maxGlobalDelaySamples = i_mult( maxGlobalDelaySamples, cldfb2tdSampleFact );
@@ -1691,7 +1690,7 @@ static ivas_error alignInputDelay(
        IF( NE_16( flushInputs, 0 ) )
        {
            numSamplesToPush = 0;
            move32();
            move16();

            numSamplesToPop = ivas_TD_RINGBUF_Size( inputBase->delayBuffer );
        }
@@ -1700,7 +1699,7 @@ static ivas_error alignInputDelay(
            numSamplesToPush = inputAudio.config.numSamplesPerChannel;
            move32();

            numSamplesToPop = (Word32) inputAudio.config.numSamplesPerChannel;
            numSamplesToPop = inputAudio.config.numSamplesPerChannel;
            move32();
        }