Commit 57196485 authored by reutelhuber's avatar reutelhuber
Browse files

first implementation of low-delay SBA-to-mono

parent f1badaee
Loading
Loading
Loading
Loading
Loading

lib_com/ivas_prot.h

100644 → 100755
+3 −0
Original line number Diff line number Diff line
@@ -1115,6 +1115,9 @@ void stereo_dft_dec(
    float *input_mem,                                           /* i/o: mem of buffer DFT analysis          */
    STEREO_CNG_DEC_HANDLE hStereoCng,                           /* i/o: Stereo CNG data structure           */
    const int16_t sba_dirac_stereo_flag,                        /* i  : signal stereo output for SBA DirAC  */
#ifdef SBA2MONO
    const int16_t sba_mono_flag,                                /* i  : signal mono output for SBA DirAC    */
#endif
    ivas_spar_md_dec_state_t *hMdDec,                           /* i/o: SPAR MD handle for upmixing         */
    const int16_t cross_fade_start_offset,                      /* i  : SPAR mixer delay compensation       */
    const int32_t output_Fs,                                    /* i  : Fs for delay calculation            */
+2 −0
Original line number Diff line number Diff line
@@ -168,6 +168,8 @@
#define FIX_94_VERIFY_WAV_NUM_CHANNELS                  /* FhG: Issue 94 - Check if number of channels in input wav file matches encoder/renderer configuration */
#define ISM_HIGHEST_BITRATE                             /* VA: Issue 284: Update highest bitrate limit in ISM format */

#define SBA2MONO                                        /* FhG: Issue 365: Adapt processing of SBA mono output to be in line with stereo output (less delay, lower complexity) */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif

lib_dec/ivas_cpe_dec.c

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -405,7 +405,11 @@ ivas_error ivas_cpe_dec(
        }
        else
        {
#ifdef SBA2MONO
            stereo_dft_dec( hCPE->hStereoDft, sts[0], DFT, hCPE->input_mem[1], hCPE->hStereoCng, 0, 0, 0, 0, 0, 0 );
#else
            stereo_dft_dec( hCPE->hStereoDft, sts[0], DFT, hCPE->input_mem[1], hCPE->hStereoCng, 0, 0, 0, 0, 0 );
#endif
        }

        /* synthesis iFFT */

lib_dec/ivas_dec.c

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -385,7 +385,11 @@ ivas_error ivas_dec(
                ivas_dirac_dec( st_ivas, output, nchan_remapped, NULL, NULL, -1 );
            }
        }
#ifdef SBA2MONO
        else if ( !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 )
#else
        else if ( !st_ivas->sba_dirac_stereo_flag )
#endif
        {
            ivas_sba_upmixer_renderer( st_ivas, output, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
        }

lib_dec/ivas_init_dec.c

100644 → 100755
+8 −0
Original line number Diff line number Diff line
@@ -903,7 +903,11 @@ ivas_error ivas_init_decoder(
                    ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ),
                                             st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 );
                }
#ifdef SBA2MONO
                st_ivas->sba_dirac_stereo_flag = ( output_config == AUDIO_CONFIG_STEREO || ( output_config == AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) );
#else
                st_ivas->sba_dirac_stereo_flag = ( output_config == AUDIO_CONFIG_STEREO );
#endif
            }
            else /* SBA_MODE_DIRAC */
            {
@@ -1368,7 +1372,11 @@ ivas_error ivas_init_decoder(
    }

    /* CLDFB Interpolation weights */
#ifdef SBA2MONO
    if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR && !st_ivas->sba_dirac_stereo_flag && st_ivas->hDecoderConfig->nchan_out != 1 )
#else
    if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR && !st_ivas->sba_dirac_stereo_flag )
#endif
    {
        ivas_spar_get_cldfb_gains( st_ivas->hSpar, st_ivas->cldfbAnaDec[0], st_ivas->cldfbSynDec[0], hDecoderConfig );
    }
Loading