Commit 8c837c38 authored by sagnowski's avatar sagnowski
Browse files

Use first draft of IVAS_DEC_GetSplitBinaural

parent 4f1720b0
Loading
Loading
Loading
Loading
Loading
+24 −7
Original line number Diff line number Diff line
@@ -2076,7 +2076,21 @@ static ivas_error decodeG192(
                }
            }

            /* TODO(sgi): Get split bitstream here */
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED || arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM )
            {
                error = IVAS_DEC_GetSplitBinaural(hIvasDec, &splitRendBits, &nSamplesRendered_loop, &needNewFrame );
                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
                if ( error != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetSplitBinaural: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }
            else
            {
#endif
                error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmBuf + nOutChannels * nSamplesRendered, &nSamplesRendered_loop, &needNewFrame );
                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
@@ -2085,6 +2099,9 @@ static ivas_error decodeG192(
                    fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#ifdef SPLIT_REND_WITH_HEAD_ROT
            }
#endif


        } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK );
+5 −1
Original line number Diff line number Diff line
@@ -1730,9 +1730,13 @@ void ivas_rend_CldfbMultiBinRendProcess(
    for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ )
    {
#endif
        for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )
        for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) /* FhG@Dolby: this looks suspicious */
        {
#ifdef API_5MS
            idx = slot_idx;
#else
            idx = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx;
#endif
            for ( ch_idx = 0; ch_idx < hCldfbRend->nInChannels; ch_idx++ )
            {
                mvr2r( &Cldfb_In_Real[ch_idx][idx][0], &Cldfb_RealBuffer_sfIn[ch_idx][slot_idx][0], hCldfbRend->max_band );
+12 −5
Original line number Diff line number Diff line
@@ -982,8 +982,9 @@ ivas_error IVAS_DEC_GetSamples(
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
ivas_error IVAS_DEC_GetSplitBinaural(
    IVAS_DEC_HANDLE hIvasDec,    /* i/o: IVAS decoder handle                                                     */
    bool *needNewFrame,                        /* indication that the decoder needs a new frame                                */
    IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits /* o : bitstream output for split rendering mode*/
    IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits,  /* o : bitstream output for split rendering mode*/
    int16_t *nOutSamples,        /* o  : number of samples per channel written to output buffer                  */
    bool *needNewFrame           /* indication that the decoder needs a new frame                                */
)
{
    Decoder_Struct *st_ivas;
@@ -991,7 +992,7 @@ ivas_error IVAS_DEC_GetSplitBinaural(
    int32_t output_Fs;
    float output[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k];
    int16_t output_int[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k]; /* TODO(sgi): Need conversion */
    int16_t numSamplesPerChannel, nOutSamples;
    int16_t numSamplesPerChannel;
    int16_t i, j;
    ivas_error error;

@@ -1006,19 +1007,25 @@ ivas_error IVAS_DEC_GetSplitBinaural(
        return IVAS_ERR_WRONG_PARAMS;
    }

    *nOutSamples = 0;

    while ( error == IVAS_ERR_OK )
    {
        int16_t nOutSamplesLocal;

        /* Decode and render */
        if ( ( error = IVAS_DEC_GetSamples(
                   hIvasDec,
                   numSamplesPerChannel,
                   output_int,
                   &nOutSamples,
                   &nOutSamplesLocal,
                   needNewFrame ) ) != IVAS_ERR_OK )
        {
            return error;
        }

        *nOutSamples += nOutSamplesLocal;

        /*split rendering process calls*/
        IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend;
        int16_t max_band;
+3 −2
Original line number Diff line number Diff line
@@ -197,8 +197,9 @@ ivas_error IVAS_DEC_GetSamples(
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
ivas_error IVAS_DEC_GetSplitBinaural(
    IVAS_DEC_HANDLE hIvasDec,    /* i/o: IVAS decoder handle                                                     */
    bool *needNewFrame,           /* indication that the decoder needs a new frame                                */
    IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits  /* o : bitstream output for split rendering mode*/
    IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits,  /* o : bitstream output for split rendering mode*/
    int16_t *nOutSamples,        /* o  : number of samples per channel written to output buffer                  */
    bool *needNewFrame           /* indication that the decoder needs a new frame                                */
);
#endif