Commit 3fb9d1e1 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_803_SCE_MD_HANDLE

parent 19a8865b
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -282,7 +282,6 @@ void ivas_destroy_enc(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);

#ifdef FIX_803_SCE_MD_HANDLE
ivas_error ivas_initialize_MD_bstr_enc(
    BSTR_ENC_HANDLE *hBstr,                                     /* o  : encoder MD bitstream handle             */
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
@@ -291,7 +290,6 @@ ivas_error ivas_initialize_MD_bstr_enc(
void ivas_destroy_MD_bstr_enc(
    BSTR_ENC_HANDLE *hMetaData                                  /* i/o: encoder MD bitstream handle             */
);
#endif

ivas_error ivas_init_decoder_front(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
+0 −1
Original line number Diff line number Diff line
@@ -163,7 +163,6 @@
#define FIX_708_DPID_COMMAND_LINE                       /* issue 708: sanity checks for '-dpid' command-line */
#define FIX_730_DPID_NOT_SET_CORRECTLY                  /* Eri: issue 730: write dpid read from file in correct index, print informative error message when DPID specified is not found. */
#define FIX_513_REND_MC_ALLOC                           /* FhG: issue 513, optimise external renderer allocation for multichannel */
#define FIX_803_SCE_MD_HANDLE                           /* VA: issue 803: Resolve "MD handle needed only for one SCE" */
#define FIX_812_DOUBLE_PREC_MCT                         /* FhG: Issue 812: Avoid double precision in MCT */
#define FIX_807_VARIABLE_SPEED_DECODING                 /* FhG: Issue 807: Resolve "Variable Speed Decoding broken" */
#define FIX_818_DOUBLE_PREC_KERNEN_SW                   /* FhG: Issue 818: Avoid double precision in kernel switching */
+0 −27
Original line number Diff line number Diff line
@@ -281,9 +281,7 @@ ivas_error ivas_corecoder_enc_reconfig(
                st_ivas->hSCE[sce_id]->element_brate = brate_SCE;
                st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */

#ifdef FIX_803_SCE_MD_HANDLE
                ivas_destroy_MD_bstr_enc( &( st_ivas->hSCE[sce_id]->hMetaData ) );
#endif
            }

            for ( sce_id = nSCE_existing; sce_id < st_ivas->nSCE; sce_id++ )
@@ -306,7 +304,6 @@ ivas_error ivas_corecoder_enc_reconfig(
                }
            }

#ifdef FIX_803_SCE_MD_HANDLE
            if ( st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData == NULL )
            {
                if ( ( error = ivas_initialize_MD_bstr_enc( &( st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData ), st_ivas ) ) != IVAS_ERR_OK )
@@ -314,7 +311,6 @@ ivas_error ivas_corecoder_enc_reconfig(
                    return error;
                }
            }
#endif
        }

        if ( st_ivas->nCPE > 0 )
@@ -476,40 +472,17 @@ ivas_error ivas_corecoder_enc_reconfig(
        {
            if ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData == NULL )
            {
#ifdef FIX_803_SCE_MD_HANDLE
                if ( ( error = ivas_initialize_MD_bstr_enc( &( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData ), st_ivas ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#else
                if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData = (BSTR_ENC_HANDLE) malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL )
                {
                    return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) );
                }

                /* set pointer to the buffer of metadata indices */
                st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ind_list = st_ivas->ind_list_metadata;
                st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata;
                st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata;
                st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_ind_tot = 0;
                st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_bits_tot = 0;
                st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->st_ivas = st_ivas;
#endif
            }

            reset_indices_enc( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData, st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData->nb_ind_tot );

            for ( cpe_id = 0; cpe_id < st_ivas->nCPE - 1; cpe_id++ )
            {
#ifdef FIX_803_SCE_MD_HANDLE
                ivas_destroy_MD_bstr_enc( &( st_ivas->hCPE[cpe_id]->hMetaData ) );
#else
                if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL )
                {
                    free( st_ivas->hCPE[cpe_id]->hMetaData );
                    st_ivas->hCPE[cpe_id]->hMetaData = NULL;
                }
#endif
            }
        }

+0 −27
Original line number Diff line number Diff line
@@ -875,31 +875,12 @@ ivas_error create_cpe_enc(
     * Metadata: allocate and initialize
     *-----------------------------------------------------------------*/

#ifndef FIX_803_SCE_MD_HANDLE
    /* we need the meta data handle also if we init as MC_FORMAT/MCT since it might be needed
       at a bit rate switch to ParamMC or McMASA and the metadata index list is only really reachable
       in the ivas_init_encoder() function and has to be connected to the MD handle there */
#endif
    if ( cpe_id == ( st_ivas->nCPE - 1 ) )
    {
#ifdef FIX_803_SCE_MD_HANDLE
        if ( ( error = ivas_initialize_MD_bstr_enc( &( hCPE->hMetaData ), st_ivas ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#else
        if ( ( hCPE->hMetaData = (BSTR_ENC_HANDLE) malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) );
        }

        /* set pointer to the buffer of metadata indices */
        hCPE->hMetaData->ind_list = st_ivas->ind_list_metadata;
        hCPE->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata;
        hCPE->hMetaData->ivas_max_num_indices = &st_ivas->ivas_max_num_indices_metadata;
        hCPE->hMetaData->st_ivas = st_ivas;
        reset_indices_enc( hCPE->hMetaData, st_ivas->ivas_max_num_indices_metadata );
#endif
    }

    /*-----------------------------------------------------------------*
@@ -1088,15 +1069,7 @@ void destroy_cpe_enc(
        }
    }

#ifdef FIX_803_SCE_MD_HANDLE
    ivas_destroy_MD_bstr_enc( &( hCPE->hMetaData ) );
#else
    if ( hCPE->hMetaData != NULL )
    {
        free( hCPE->hMetaData );
        hCPE->hMetaData = NULL;
    }
#endif

    for ( n = 0; n < CPE_CHANNELS; n++ )
    {
+0 −2
Original line number Diff line number Diff line
@@ -1211,7 +1211,6 @@ void ivas_destroy_enc(
    return;
}

#ifdef FIX_803_SCE_MD_HANDLE
/*-------------------------------------------------------------------------
 * ivas_initialize_MD_bstr_enc()
 *
@@ -1264,4 +1263,3 @@ void ivas_destroy_MD_bstr_enc(

    return;
}
#endif
Loading