Commit 7335b242 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge branch 'main' into b_20230817_jbm-for-osba

parents 3cc15c6b eb805eab
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@
    <ClCompile Include="..\lib_com\ivas_fb_mixer.c" />
    <ClCompile Include="..\lib_com\ivas_filters.c" />
    <ClCompile Include="..\lib_com\ivas_ism_com.c" />
    <ClCompile Include="..\lib_com\ivas_lfe_com.c" />
    <ClCompile Include="..\lib_com\ivas_mcmasa_com.c" />
    <ClCompile Include="..\lib_com\ivas_dirac_com.c" />
    <ClCompile Include="..\lib_com\ivas_masa_com.c" />
+3 −0
Original line number Diff line number Diff line
@@ -469,6 +469,9 @@
    <ClCompile Include="..\lib_com\ivas_omasa_com.c">
      <Filter>common_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\ivas_lfe_com.c">
      <Filter>common_ivas_c</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\lib_com\basop_proto_func.h">
+4 −4
Original line number Diff line number Diff line
@@ -1676,10 +1676,10 @@ static void usage_dec( void )
    fprintf( stdout, "-exof File          : External orientation File for external orientation trajectory\n" );
#ifdef FIX_708_DPID_COMMAND_LINE
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up\n" );
    fprintf( stdout, "                      to 4 numbers (unsigned integers) can be specified for BINAURAL output configuration.\n" );
    fprintf( stdout, "                      ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for ISMs 1,2,3 and 4 respectively.\n" );
    fprintf( stdout, "                      This options needs to be accompanied by a render_config file, otherwise a default\n" );
    fprintf( stdout, "                      directivity pattern is used.\n" );
    fprintf( stdout, "                      to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB\n" );
    fprintf( stdout, "                      output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" );
    fprintf( stdout, "                      ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" );
    fprintf( stdout, "                      otherwise a default directivity pattern is used.\n" );
#else
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration\n" );
#endif
+1 −1
Original line number Diff line number Diff line
@@ -385,7 +385,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .match = "ism_directivity_pattern_id",
        .matchShort = "dpid",
#ifdef FIX_708_DPID_COMMAND_LINE
        .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up to 4 numbers (unsigned integers) can be specified for BINAURAL output configuration.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for ISMs 1,2,3 and 4 respectively.\nThis options needs to be accompanied by a render_config file, otherwise a default directivity pattern is used.",
        .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB output configuration.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for ISMs 1,2,3 and 4 respectively.\nThis options needs to be accompanied by a render_config file, otherwise a default directivity pattern is used.",
#else
        .description = "Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration",
#endif

lib_com/ivas_lfe_com.c

0 → 100644
+142 −0
Original line number Diff line number Diff line
/******************************************************************************************************

   (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository. All Rights Reserved.

   This software is protected by copyright law and by international treaties.
   The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository retain full ownership rights in their respective contributions in
   the software. This notice grants no license of any kind, including but not limited to patent
   license, nor is any license granted by implication, estoppel or otherwise.

   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
   contributions.

   This software is provided "AS IS", without any express or implied warranties. The software is in the
   development stage. It is intended exclusively for experts who have experience with such software and
   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
   and fitness for a particular purpose are hereby disclaimed and excluded.

   Any dispute, controversy or claim arising under or in relation to providing this software shall be
   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
   the United Nations Convention on Contracts on the International Sales of Goods.

*******************************************************************************************************/

#include <stdint.h>
#include "math.h"
#include "options.h"
#ifdef DEBUGGING
#include "debug.h"
#endif
#include "ivas_stat_com.h"
#include "prot.h"
#include "ivas_prot.h"
#include "rom_com.h"
#include "ivas_rom_com.h"
#include "cnst.h"
#include <assert.h>
#include "wmc_auto.h"


/*-----------------------------------------------------------------------------------------*
 * Function ivas_lfe_lpf_select_filt_coeff()
 *
 * Selects LFE filter coeff based on config.
 *-----------------------------------------------------------------------------------------*/

void ivas_lfe_lpf_select_filt_coeff(
    const int32_t sampling_rate, /* i  : sampling rate          */
    const int16_t order,         /* i  : filter order           */
    const float **ppFilt_coeff   /* o  : filter coefficients    */
)
{
    switch ( order )
    {
        case IVAS_FILTER_ORDER_2:
            switch ( sampling_rate )
            {
                case 16000:
                    *ppFilt_coeff = ivas_lpf_2_butter_16k;
                    break;
                case 32000:
                    *ppFilt_coeff = ivas_lpf_2_butter_32k;
                    break;
                case 48000:
                    *ppFilt_coeff = ivas_lpf_2_butter_48k;
                    break;
                default:
                    break;
            }
            break;
        case IVAS_FILTER_ORDER_4:
            switch ( sampling_rate )
            {
                case 16000:
                    *ppFilt_coeff = ivas_lpf_4_butter_16k_sos;
                    break;
                case 32000:
                    *ppFilt_coeff = ivas_lpf_4_butter_32k_sos;
                    break;
                case 48000:
                    *ppFilt_coeff = ivas_lpf_4_butter_48k_sos;
                    break;
                default:
                    break;
            }
            break;
        default:
            assert( !"Unsupported LFE Filter order" );
    }

    return;
}


/*-----------------------------------------------------------------------------------------*
 * Function ivas_lfe_window_init()
 *
 * Initialize LFE window
 *-----------------------------------------------------------------------------------------*/

void ivas_lfe_window_init(
    LFE_WINDOW_HANDLE hLFEWindow, /* i/o: LFE window handle           */
    const int32_t sampling_rate,  /* i  : sampling rate               */
    const int16_t frame_len       /* i  : frame length in samples     */
)
{
    /* Set window coefficients */
    if ( sampling_rate == 48000 )
    {
        hLFEWindow->pWindow_coeffs = ivas_lfe_window_coeff_48k;
    }
    else if ( sampling_rate == 32000 )
    {
        hLFEWindow->pWindow_coeffs = ivas_lfe_window_coeff_32k;
    }
    else if ( sampling_rate == 16000 )
    {
        hLFEWindow->pWindow_coeffs = ivas_lfe_window_coeff_16k;
    }
    else
    {
        assert( !"8kHz LFE Window not supported" );
    }

    /* 10ms stride, MDCT will be done in two iterations */
    hLFEWindow->dct_len = frame_len >> 1;

    /* 8ms of latency */
    hLFEWindow->fade_len = NS2SA( sampling_rate, IVAS_LFE_FADE_NS );
    hLFEWindow->zero_pad_len = (int16_t) ( IVAS_ZERO_PAD_LEN_MULT_FAC * ( hLFEWindow->dct_len - hLFEWindow->fade_len ) );
    hLFEWindow->full_len = hLFEWindow->zero_pad_len + hLFEWindow->fade_len + hLFEWindow->dct_len;

    return;
}
Loading