Usage of open/deleteCldfb() functions - multiple variants
# Basic info <!--- Add commit SHA used to reproduce --> - Float reference: - Encoder (float): - Decoder (float): - Fixed point: - Encoder (fixed): `main-pc` - Decoder (fixed): # Bug description While running instrumented code while testing !1153 an error is reported for a missing free: ``` Fct=openCldfb_ivas_fx, Ln=1417: Error: Memory Block has not been De-Allocated with free()!! ``` It seems like `deleteCldfb()` is used instead of `deleteCldfb_ivas_fx()` in newly added split rendering code. Grepping through the code, several non-EVS instances are present: ``` ❯ rg "(open|delete)Cldfb\(" apps/renderer.c 1397: if ( ( error = IVAS_REND_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate ) ) != IVAS_ERR_OK ) 1399: fprintf( stderr, "Error in IVAS_REND_openCldfb(): %s\n", ivas_error_to_string( error ) ); lib_enc/init_enc_fx.c 601: if ( ( error = openCldfb( &st_fx->cldfbAnaEnc, CLDFB_ANALYSIS, CLDFB_getNumChannels( st_fx->input_Fs ), st_fx->input_frame_fx ) ) != IVAS_ERR_OK ) 606: if ( ( error = openCldfb( &st_fx->cldfbSynTd, CLDFB_SYNTHESIS, CLDFB_getNumChannels( 16000 ), L_FRAME16k ) ) != IVAS_ERR_OK ) 708: // IF ((error = openCldfb(&st_fx->cldfbSynTd, CLDFB_SYNTHESIS, 16000, CLDFB_PROTOTYPE_1_25MS)) != IVAS_ERR_OK) 1058: deleteCldfb( &st_fx->cldfbAnaEnc ); 1059: deleteCldfb( &st_fx->cldfbSynTd ); lib_isar/lib_isar_pre_rend.c 250: deleteCldfb( &hSplitBinRend->hCldfbHandles->cldfbAna[ch] ); 260: deleteCldfb( &hSplitBinRend->hCldfbHandles->cldfbSyn[ch] ); lib_isar/isar_splitRendererPost.c 105: if ( ( error = openCldfb( &( hBinRend->cldfbSynReconsBinDec[i][ch] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) 154: deleteCldfb( &( ( *hBinHrSplitPostRend )->cldfbSynReconsBinDec[i][ch] ) ); lib_isar/isar_splitRendererPre.c 2784: if ( ( error = openCldfb( &( hBinRend->cldfbSynRotBinDec[i][ch] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) 2840: deleteCldfb( &( ( *hBinHrSplitPreRend )->cldfbSynRotBinDec[i][n] ) ); lib_rend/lib_rend.h 375:ivas_error IVAS_REND_openCldfb( lib_rend/ivas_prot_rend.h 2047:ivas_error ivas_rend_openCldfb( lib_rend/lib_rend.c 9232: * IVAS_REND_openCldfb() 9238:IVAS_REND_openCldfb( 9291: deleteCldfb( &( cldfbAna[n] ) ); 9300: deleteCldfb( &( cldfbSyn[n] ) ); lib_dec/init_dec_fx.c 685: IF( NE_32( ( error = openCldfb( &st_fx->cldfbAna, CLDFB_ANALYSIS, CLDFB_getNumChannels( 48000 ), 320 ) ), IVAS_ERR_OK ) ) 691: IF( NE_32( ( error = openCldfb( &st_fx->cldfbBPF, CLDFB_ANALYSIS, CLDFB_getNumChannels( 16000 ), 320 ) ), IVAS_ERR_OK ) ) 696: IF( NE_32( ( error = openCldfb( &st_fx->cldfbSyn, CLDFB_SYNTHESIS, CLDFB_getNumChannels( st_fx->output_Fs ), st_fx->output_frame_fx ) ), IVAS_ERR_OK ) ) 1813: deleteCldfb( &st_fx->cldfbAna ); 1816: deleteCldfb( &st_fx->cldfbBPF ); 1819: deleteCldfb( &st_fx->cldfbSyn ); lib_com/cldfb_evs.c 977:ivas_error openCldfb( 1455:void deleteCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb ) /* i: cldfb handle */ lib_com/prot_fx.h 4743:ivas_error openCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb, /*!< CLDFB Handle */ 4789:void deleteCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb ); /*!< CLDFB Handle */ ``` Some open calls do not have the corresponding close call (e.g. for split rendering `openCldfb_ivas_fx` is used then a `deleteCldfb`. Compared to the float reference: ``` ❯ rg "(ivas_error|void) (open|delete)Cldfb" lib_com/prot.h 9046:ivas_error openCldfb( 9070:void deleteCldfb( lib_com/cldfb.c 699:ivas_error openCldfb( 880:void deleteCldfb( ``` multiple variants are defined in BASOP: ``` ❯ rg "(ivas_error|void) (open|delete)Cldfb" lib_com/prot.h 7409:ivas_error openCldfb_ivas( 7416:ivas_error openCldfb_ivas_enc( 7440:void deleteCldfb_ivas( lib_com/cldfb_evs.c 977:ivas_error openCldfb( 1455:void deleteCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb ) /* i: cldfb handle */ lib_com/cldfb.c 1363:ivas_error openCldfb_ivas_fx( 1416:ivas_error openCldfb_ivas_enc( 1573:void deleteCldfb_ivas( 1601:void deleteCldfb_ivas_fx( lib_com/prot_fx.h 4743:ivas_error openCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb, /*!< CLDFB Handle */ 4789:void deleteCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb ); /*!< CLDFB Handle */ 9815:ivas_error openCldfb_ivas_fx( 9954:void deleteCldfb_ivas_fx( ``` # Ways to reproduce Run instrumented code at the relevant operating points. <!--- Below are labels that will be added but are not shown in description. This is a template to help fill them. Add further information to the first row and remove and add labels as necessary. -->
issue