Commit c4ad80e8 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into...

- Merge remote-tracking branch 'remotes/origin/main' into 1324-tsm-memory-lost-in-jbm-bitrate-switching
parents 352951fa 4433b38c
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
variables:
  # note: GitLab cannot reference variables defined by users in the include ref:, we need to use a YAML anchor for this
  # see https://docs.gitlab.com/ci/yaml/includes/#use-variables-with-include for more information
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF 44cb5638949b874ce0f5c3bf4359f9db860d88bc
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF a31272de16bd1b556269a50bc179321a60f2a500

include:
  - local: .gitlab-ci/variables.yml
@@ -484,7 +484,7 @@ pytest-compare-20ms-and-5ms-rendering:
  needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/disable-limiter.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/disable-limiter.sh
    - make clean
    - make -j
    ### prepare pytest
+1 −1
Original line number Diff line number Diff line
@@ -174,9 +174,9 @@
#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ 
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_1250_MCMASA_LS_OUTPUT                     /* VA: issue 1250: fix crash in McMASA to custom LS output decoding */
#define NONBE_1302_FIX_OMASA_JBM_FLUSH                  /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */
#define NONBE_1324_TC_BUFFER_MEMOERY_KEEP               /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */


/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+40 −2
Original line number Diff line number Diff line
@@ -1504,17 +1504,54 @@ ivas_error ivas_jbm_dec_flush_renderer(
            if ( ism_mode_old == ISM_MASA_MODE_DISC )
            {
                float *tc_local[MAX_NUM_OBJECTS];
#ifdef NONBE_1302_FIX_OMASA_JBM_FLUSH
                int16_t last_dirac_md_idx;
                uint16_t nSamplesAvailableNext;
                ISM_MODE ism_mode_orig;
                RENDERER_TYPE renderer_type_orig;
                int32_t ivas_total_brate;
#endif

                /* copy from ISM delay buffer to the correct place in TCs */
                for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ )
                {
                    tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx + 2][hTcBuffer->n_samples_rendered];
                    mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size );
                }

#ifdef NONBE_1302_FIX_OMASA_JBM_FLUSH
                /* to render flushed samples, use configuration from the last received frame */
                ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
                renderer_type_orig = st_ivas->renderer_type;
                ism_mode_orig = st_ivas->ism_mode;
                st_ivas->ism_mode = ism_mode_old;
                st_ivas->renderer_type = renderer_type_old;
                st_ivas->hDecoderConfig->ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate;
                last_dirac_md_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->slots_rendered - 1];

                /* transfer adapted sf info from hTcBuffer to DirAC */
                st_ivas->hSpatParamRendCom->nb_subframes = 1;
                st_ivas->hSpatParamRendCom->subframes_rendered = 0;
                st_ivas->hSpatParamRendCom->subframe_nbslots[0] = JBM_CLDFB_SLOTS_IN_SUBFRAME;
                st_ivas->hSpatParamRendCom->slots_rendered = 0;
                st_ivas->hSpatParamRendCom->num_slots = JBM_CLDFB_SLOTS_IN_SUBFRAME;
                set_s( st_ivas->hSpatParamRendCom->render_to_md_map, last_dirac_md_idx, n_slots_still_available );

                if ( ( error = ivas_omasa_dirac_td_binaural_jbm( st_ivas, (uint16_t) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, CPE_CHANNELS, p_output ) ) != IVAS_ERR_OK )
                {
                    return error;
                }

                /* restore original configuration */
                st_ivas->ism_mode = ism_mode_orig;
                st_ivas->renderer_type = renderer_type_orig;
                st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate;
#else
                if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#endif
            }
        }
        else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
@@ -1529,20 +1566,20 @@ ivas_error ivas_jbm_dec_flush_renderer(
                RENDERER_TYPE renderer_type_orig;
                int32_t ivas_total_brate;

                /* to render flushed samples, use configuration from the last received frame */
                ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
                renderer_type_orig = st_ivas->renderer_type;
                ism_mode_orig = st_ivas->ism_mode;
                st_ivas->ism_mode = ism_mode_old;
                st_ivas->renderer_type = renderer_type_old;
                st_ivas->hDecoderConfig->ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate;

                last_spar_md_idx = st_ivas->hSpar->render_to_md_map[st_ivas->hSpar->slots_rendered - 1];
                last_dirac_md_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->slots_rendered - 1];
#ifdef DEBUGGING
                assert( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV );
#endif

                /* copy from ISM delay buffer to the correct place in tcs */
                /* copy from ISM delay buffer to the correct place in TCs */
                for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ )
                {
                    tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx][hTcBuffer->n_samples_rendered];
@@ -1571,6 +1608,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
                    return error;
                }

                /* restore original configuration */
                st_ivas->ism_mode = ism_mode_orig;
                st_ivas->renderer_type = renderer_type_orig;
                st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate;