Commit fc5d6876 authored by sagnowski's avatar sagnowski
Browse files

Fix default split codec framing

parent 5ae96a87
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -196,7 +196,17 @@ ivas_error ivas_dec_init_split_rend(
        }
    }

#ifdef API_5MS
    if ( ( error = ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec,
                                                         &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms,
                                                         ( cldfb_in == 0 ),
                                                         pcm_out ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#else
    ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, ( cldfb_in == 0 ), pcm_out );
#endif

    error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend,
                                      &st_ivas->hRenderConfig->split_rend_config,
+6 −12
Original line number Diff line number Diff line
@@ -1229,7 +1229,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    AUDIO_CONFIG output_config;
    int32_t output_Fs;
    float output[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k];
    float pcmBuf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k]; /* TODO(sgi): Need conversion */
    float pcmBuf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k];
    int16_t numSamplesPerChannelCacheSize;
    int16_t numSamplesPerChannelToDecode;
    int16_t numSamplesPerChannelToSplitEncode;
@@ -1295,7 +1295,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
        }
        assert( numSamplesPerChannelToDecode == *nOutSamples );
#ifdef DEBUGGING
        dbgwrite( output, sizeof( float ), numSamplesPerChannelToDecode * 2, 1, "res/output_float.pcm" );
        dbgwrite( output, sizeof( float ), numSamplesPerChannelToDecode * BINAURAL_CHANNELS * numPoses, 1, "res/output_float.pcm" );
#endif

        /* copy to cache if cache is in use */
@@ -1332,22 +1332,16 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
        hSplitBinRend->numTdSamplesPerChannelCached -= numSamplesPerChannelToSplitEncode;
    }

    /* [tmp] convert int back to float and change buffer layout */
    /* change buffer layout */
    for ( i = 0; i < numSamplesPerChannelToSplitEncode; ++i )
    {
#ifdef DEBUGGING
        for ( j = 0; j < BINAURAL_CHANNELS * numPoses; ++j )
        {
            output[j][i] = 0;
        }
#endif
        for ( j = 0; j < BINAURAL_CHANNELS /* * numPoses */; ++j )
        {
            output[j][i] = pcmBuf[i * BINAURAL_CHANNELS /* * numPoses */ + j];
            output[j][i] = pcmBuf[i * BINAURAL_CHANNELS * numPoses + j];
        }
    }
#ifdef DEBUGGING
    dbgwrite( output[0], sizeof( float ), 240, 1, "res/output.pcm" );
    dbgwrite( output[0], sizeof( float ), numSamplesPerChannelToSplitEncode, 1, "res/output.pcm" );
#endif
    max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 );
    pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
@@ -2191,7 +2185,7 @@ static ivas_error copyRendererConfigStruct( RENDER_CONFIG_HANDLE hRCin, IVAS_REN
    hRCout->split_rend_config.hq_mode = 0;
    hRCout->split_rend_config.codec_delay_ms = 0;
#ifdef API_5MS
    hRCout->split_rend_config.codec_frame_size_ms = 5;
    hRCout->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */
#endif
    hRCout->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT;
    hRCout->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB;
+10 −2
Original line number Diff line number Diff line
@@ -1510,7 +1510,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural(
    const int32_t SplitRendBitRate,
    IVAS_SPLIT_REND_CODEC splitCodec,
    #ifdef API_5MS
    const int16_t codec_frame_size_ms,
    int16_t codec_frame_size_ms,
    #endif
    ivas_split_rend_bits_t *pBits,
    float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
@@ -1734,8 +1734,16 @@ void masaPrerendClose(
);

#ifdef SPLIT_REND_WITH_HEAD_ROT
void ivas_split_rend_choose_default_codec(
#ifdef API_5MS
ivas_error
#else
void
#endif
ivas_split_rend_choose_default_codec(
    IVAS_SPLIT_REND_CODEC *pCodec,                              /* i/o: pointer to codec setting                */
#ifdef API_5MS
    int16_t *pCodec_frame_size_ms,                               /* i/o: pointer to codec frame size setting */
#endif
    int16_t isRenderingInTd,                                     /* i  : flag: is rendering done in TD?          */
	int16_t pcm_out                                              /*i : flag to indicate PCM output*/ 
	);
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ ivas_error ivas_render_config_init_from_rom(
    ( *hRenderConfig )->split_rend_config.hq_mode = 0;
    ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0;
#ifdef API_5MS
    ( *hRenderConfig )->split_rend_config.codec_frame_size_ms = 5;
    ( *hRenderConfig )->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */
#endif
    ( *hRenderConfig )->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT;
    ( *hRenderConfig )->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB;
+8 −1
Original line number Diff line number Diff line
@@ -2340,7 +2340,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural(
    const int32_t SplitRendBitRate,
    IVAS_SPLIT_REND_CODEC splitCodec,
#ifdef API_5MS
    const int16_t codec_frame_size_ms,
    int16_t codec_frame_size_ms,
#endif
    ivas_split_rend_bits_t *pBits,
    float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
@@ -2366,7 +2366,14 @@ ivas_error ivas_renderMultiBinToSplitBinaural(
    /* Needs to be done at runtime. If this was in another API function,
     * there would be no guarantee that the user did not change
     * the split rendering config before calling the main rendering function */
     #ifdef API_5MS
    if ( ( error = ivas_split_rend_choose_default_codec( &splitCodec, &codec_frame_size_ms, td_input, pcm_out ) ) != IVAS_ERR_OK )
    {
        return error;
    }
     #else
    ivas_split_rend_choose_default_codec( &splitCodec, td_input, pcm_out );
     #endif

    if ( td_input )
    {
Loading