Line data Source code
1 : /****************************************************************************************************** 2 : 3 : (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, 4 : Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., 5 : Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, 6 : Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other 7 : contributors to this repository. All Rights Reserved. 8 : 9 : This software is protected by copyright law and by international treaties. 10 : The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, 11 : Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., 12 : Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, 13 : Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other 14 : contributors to this repository retain full ownership rights in their respective contributions in 15 : the software. This notice grants no license of any kind, including but not limited to patent 16 : license, nor is any license granted by implication, estoppel or otherwise. 17 : 18 : Contributors are required to enter into the IVAS codec Public Collaboration agreement before making 19 : contributions. 20 : 21 : This software is provided "AS IS", without any express or implied warranties. The software is in the 22 : development stage. It is intended exclusively for experts who have experience with such software and 23 : solely for the purpose of inspection. All implied warranties of non-infringement, merchantability 24 : and fitness for a particular purpose are hereby disclaimed and excluded. 25 : 26 : Any dispute, controversy or claim arising under or in relation to providing this software shall be 27 : submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in 28 : accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and 29 : the United Nations Convention on Contracts on the International Sales of Goods. 30 : 31 : *******************************************************************************************************/ 32 : 33 : #include "options.h" 34 : #include <stdint.h> 35 : #include "ivas_cnst.h" 36 : #include "ivas_prot_rend_fx.h" 37 : #include "prot_fx.h" 38 : #include "wmc_auto.h" 39 : #include "ivas_prot_fx.h" 40 : 41 : 42 : /*------------------------------------------------------------------------- 43 : * ivas_mcmasa_dec_reconfig() 44 : * 45 : * Reconfigure McMASA decoder 46 : *------------------------------------------------------------------------*/ 47 208 : ivas_error ivas_mcmasa_dec_reconfig( 48 : Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ 49 : ) 50 : { 51 : ivas_error error; 52 : Word32 ivas_total_brate; 53 : 54 208 : ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; 55 208 : move32(); 56 : 57 : /* close the old MASA instance */ 58 208 : ivas_masa_dec_close_fx( &( st_ivas->hMasa ) ); 59 : 60 : /* get new McMASA settings */ 61 208 : ivas_mcmasa_setNumTransportChannels_fx( &( st_ivas->nchan_transport ), &( st_ivas->element_mode_init ), ivas_total_brate ); 62 208 : ivas_mcmasa_set_separate_channel_mode_fx( &( st_ivas->hOutSetup.separateChannelEnabled ), &( st_ivas->hOutSetup.separateChannelIndex ), ivas_total_brate ); 63 : 64 : /* transport channel settings may affect renderer */ 65 208 : ivas_renderer_select( st_ivas ); 66 : 67 : /* renderer change may affect internal config */ 68 208 : ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); 69 208 : ivas_mcmasa_set_separate_channel_mode_fx( &( st_ivas->hIntSetup.separateChannelEnabled ), &( st_ivas->hIntSetup.separateChannelIndex ), ivas_total_brate ); 70 : 71 208 : if ( NE_32( ( error = ivas_masa_dec_open_fx( st_ivas ) ), IVAS_ERR_OK ) ) 72 : { 73 0 : return error; 74 : } 75 : 76 208 : st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); 77 208 : move16(); 78 : 79 208 : test(); 80 208 : IF( NE_16( st_ivas->renderer_type, RENDERER_DISABLE ) && NE_16( st_ivas->renderer_type, RENDERER_MCMASA_MONO_STEREO ) ) 81 : { 82 200 : IF( st_ivas->hDirAC == NULL ) 83 : { 84 178 : if ( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_OPEN ) ), IVAS_ERR_OK ) ) 85 : { 86 0 : return error; 87 : } 88 : } 89 : ELSE 90 : { 91 22 : if ( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ), IVAS_ERR_OK ) ) 92 : { 93 0 : return error; 94 : } 95 : } 96 : } 97 : 98 208 : return error; 99 : }