Commit 7433066a authored by vaclav's avatar vaclav
Browse files

cleaning + comments

parent 242310b4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -915,7 +915,7 @@ ivas_error ivas_init_decoder(
            }
        }

        for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ )
        for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed?
        {
            if ( ( error = create_sce_dec( st_ivas, sce_id, ivas_total_brate / st_ivas->nchan_transport ) ) != IVAS_ERR_OK )
            {
@@ -1116,7 +1116,7 @@ ivas_error ivas_init_decoder(
                return error;
            }

            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed?
            {
                if ( ( error = create_cpe_dec( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nSCE + st_ivas->nCPE ) ) ) != IVAS_ERR_OK )
                {
@@ -1129,7 +1129,7 @@ ivas_error ivas_init_decoder(
                }
            }

            if ( st_ivas->nCPE > 1 )
            if ( st_ivas->nCPE > 1 ) // VE: TBV - is this needed?
            {
                if ( ( error = create_mct_dec( st_ivas ) ) != IVAS_ERR_OK )
                {
@@ -1179,7 +1179,7 @@ ivas_error ivas_init_decoder(

            ivas_mcmasa_split_brate( st_ivas->hOutSetup.separateChannelEnabled, ivas_total_brate, st_ivas->nSCE, st_ivas->nCPE, &brate_sce, &brate_cpe );

            for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ )
            for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed?
            {
                if ( ( error = create_sce_dec( st_ivas, sce_id, brate_sce ) ) != IVAS_ERR_OK )
                {
@@ -1189,7 +1189,7 @@ ivas_error ivas_init_decoder(
                reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] );
            }

            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed?
            {
                st_ivas->element_mode_init = IVAS_CPE_MDCT; /* element_mode_init was IVAS_SCE for SCE initialization */
                if ( ( error = create_cpe_dec( st_ivas, cpe_id, brate_cpe ) ) != IVAS_ERR_OK )
+17 −25
Original line number Diff line number Diff line
@@ -506,7 +506,7 @@ ivas_error ivas_init_encoder(
            }
        }

        for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ )
        for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed?
        {
            if ( ( error = create_sce_enc( st_ivas, sce_id, ivas_total_brate / st_ivas->nchan_transport ) ) != IVAS_ERR_OK )
            {
@@ -626,9 +626,7 @@ ivas_error ivas_init_encoder(
            st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT;
        }

        for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
        {
            if ( ( error = create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK )
        if ( ( error = create_cpe_enc( st_ivas, 0, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -636,17 +634,12 @@ ivas_error ivas_init_encoder(
        /* prepare bitstream buffers */
        for ( n = 0; n < CPE_CHANNELS; n++ )
        {
                st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[st_ivas->nSCE + cpe_id * CPE_CHANNELS + n];
                reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES );
            st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list = ind_list[st_ivas->nSCE + n];
            reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES );
        }

            /* Metadata only initialized for the last cpe index*/
            if ( cpe_id == st_ivas->nCPE - 1 )
            {
                st_ivas->hCPE[cpe_id]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE];
                reset_indices_enc( st_ivas->hCPE[cpe_id]->hMetaData, MAX_BITS_METADATA );
            }
        }
        st_ivas->hCPE[0]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE];
        reset_indices_enc( st_ivas->hCPE[0]->hMetaData, MAX_BITS_METADATA );
    }
#endif
    else if ( ivas_format == MC_FORMAT )
@@ -654,11 +647,10 @@ ivas_error ivas_init_encoder(
        st_ivas->mc_mode = ivas_mc_mode_select( hEncoderConfig->mc_input_setup, ivas_total_brate );
        hEncoderConfig->nchan_inp = ivas_mc_ls_setup_get_num_channels( hEncoderConfig->mc_input_setup );


        if ( st_ivas->mc_mode == MC_MODE_MCT )
        {
            st_ivas->nSCE = 0;
            st_ivas->nCPE = hEncoderConfig->nchan_inp / 2;
            st_ivas->nCPE = hEncoderConfig->nchan_inp / CPE_CHANNELS;

            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
            {
@@ -674,6 +666,7 @@ ivas_error ivas_init_encoder(
                    st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[cpe_id * CPE_CHANNELS + n];
                    reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES );
                }

                /* Metadata only initialized for the last CPE index*/
                if ( cpe_id == st_ivas->nCPE - 1 )
                {
@@ -701,14 +694,13 @@ ivas_error ivas_init_encoder(
                return error;
            }

            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed?
            {
                if ( ( error = create_cpe_enc( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nCPE + st_ivas->nSCE ) ) ) != IVAS_ERR_OK )
                {
                    return error;
                }


                /* prepare bitstream buffers */
                for ( n = 0; n < CPE_CHANNELS; n++ )
                {
@@ -755,7 +747,7 @@ ivas_error ivas_init_encoder(

            ivas_mcmasa_split_brate( st_ivas->hMcMasa->separateChannelEnabled, ivas_total_brate, st_ivas->nSCE, st_ivas->nCPE, &brate_sce, &brate_cpe );

            for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ )
            for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed?
            {
                if ( ( error = create_sce_enc( st_ivas, sce_id, brate_sce ) ) != IVAS_ERR_OK )
                {
@@ -770,7 +762,7 @@ ivas_error ivas_init_encoder(
                reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA );
            }

            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed?
            {
                hEncoderConfig->element_mode_init = IVAS_CPE_MDCT;