Commit 334d6b2a authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_759_CODE_COVERAGE_OSBA

parent 24e406c5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -162,7 +162,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_759_CODE_COVERAGE_OSBA                      /* VA: issue 759: remove obsolete code in the OSBA encoder */
#define FIX_708_AEID_COMMAND_LINE                       /* VA: issue 708: improve AEID command-line robustness */
#define FIX_513_REND_MC_ALLOC                           /* FhG: issue 513, optimise external renderer allocation for multichannel */
#define FIX_518_ISM_BRIR_EXTREND                        /* FhG: fix issue #518, cleanup ISM to BINAURAL_ROOM_IR rendering in the external renderer */
+0 −107
Original line number Diff line number Diff line
@@ -60,9 +60,6 @@ ivas_error ivas_enc(
    IVAS_FORMAT ivas_format;
    ENCODER_CONFIG_HANDLE hEncoderConfig;
    BSTR_ENC_HANDLE hMetaData;
#ifndef FIX_759_CODE_COVERAGE_OSBA
    Encoder_State *st; /* used for bitstream handling */
#endif
    int16_t nb_bits_metadata[MAX_SCE + 1];
    float *data_f[MAX_INPUT_CHANNELS + MAX_NUM_OBJECTS];
    int32_t ivas_total_brate;
@@ -225,15 +222,6 @@ ivas_error ivas_enc(
            {
                return error;
            }
#endif
#ifndef FIX_759_CODE_COVERAGE_OSBA
            st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0];

            /* Write SBA planar flag */
            push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_planar, SBA_PLANAR_BITS );

            /* Write SBA order */
            push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_order, SBA_ORDER_BITS );
#endif
        }
        else
@@ -403,100 +391,31 @@ ivas_error ivas_enc(
            hEncoderConfig->sba_planar = 0;
            if ( st_ivas->nchan_transport == 1 )
            {
#ifndef FIX_759_CODE_COVERAGE_OSBA
                st = st_ivas->hSCE[st_ivas->nSCE - 1]->hCoreCoder[0];
#endif
                hMetaData = st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData;
            }
            else
            {
#ifndef FIX_759_CODE_COVERAGE_OSBA
                st = st_ivas->hCPE[0]->hCoreCoder[0];
#endif
                hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData;
            }

#ifndef FIX_759_CODE_COVERAGE_OSBA
            if ( st_ivas->hEncoderConfig->ivas_total_brate < IVAS_24k4 )
            {
                /* Write SBA planar flag */
                push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_planar, SBA_PLANAR_BITS );

                /* hack to indicate OSBA bitstream at VLBR */
                push_indice( st->hBstr, IND_SMODE, 0, SBA_ORDER_BITS );
            }
            else
            {
                /* Write SBA order */
                push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_order, SBA_ORDER_BITS );
            }

            /* write the number of objects in ISM_SBA format*/
            push_next_indice( hMetaData, hEncoderConfig->nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ );
#endif
            /* SBA metadata encoding and SBA metadata bitstream writing */
            if ( ( error = ivas_spar_enc( st_ivas, data_f, input_frame, nb_bits_metadata, hMetaData ) ) != IVAS_ERR_OK )
            {
                return error;
            }

#ifndef FIX_759_CODE_COVERAGE_OSBA
            /* core-coding of transport channels */
            if ( st_ivas->nSCE == 1 )
            {
                if ( ( error = ivas_sce_enc( st_ivas, 0, data_f[0], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
            else if ( st_ivas->nCPE == 1 ) /* Stereo DMX */
            {
                if ( ( error = ivas_cpe_enc( st_ivas, 0, data_f[0], data_f[1], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
            else if ( st_ivas->nCPE > 1 ) /* FOA/HOA format */
            {
                if ( ( error = ivas_mct_enc( st_ivas, data_f, input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
#endif
            hEncoderConfig->sba_planar = planar_sba_orig;
        }
        else
        {
            n = hEncoderConfig->nchan_ism;
#ifndef FIX_759_CODE_COVERAGE_OSBA
            st = st_ivas->hCPE[0]->hCoreCoder[0];
#endif
            hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData;

#ifndef FIX_759_CODE_COVERAGE_OSBA
            if ( hEncoderConfig->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE )
            {
                /* write the number of objects in ISM_SBA format*/
                push_next_indice( hMetaData, hEncoderConfig->nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ );
            }
#endif
#ifdef FIX_759_CODE_COVERAGE_OSBA
            if ( ( error = ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, n, st_ivas->hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, NULL, hMetaData, &nb_bits_metadata[1], 0, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, -1, 0, NULL, st_ivas->hCPE[0]->hCoreCoder[0]->ini_frame ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, n, st_ivas->hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, NULL, hMetaData, &nb_bits_metadata[1], 0, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, -1, 0, NULL, st->ini_frame ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }

#ifndef FIX_759_CODE_COVERAGE_OSBA
            /* Write SBA planar flag */
            push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_planar, SBA_PLANAR_BITS );

            /* Write SBA order */
            push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_order, SBA_ORDER_BITS );
#endif
            /* SBA metadata encoding and SBA metadata bitstream writing */
            if ( ( error = ivas_spar_enc( st_ivas, &data_f[n], input_frame, nb_bits_metadata, hMetaData ) ) != IVAS_ERR_OK )
            {
@@ -506,33 +425,8 @@ ivas_error ivas_enc(
            /* get SBA TCs */
            ivas_sba_getTCs( &data_f[n], st_ivas, input_frame );

#ifndef FIX_759_CODE_COVERAGE_OSBA
            /* encode SBA transport channels */
            if ( st_ivas->nchan_transport == 1 )
            {
                if ( ( error = ivas_sce_enc( st_ivas, hEncoderConfig->nchan_ism, data_f[n], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
            else if ( st_ivas->nCPE == 1 ) /* Stereo DMX */
            {
                if ( ( error = ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
            else if ( st_ivas->nCPE > 1 ) /* FOA/HOA format */
            {
                if ( ( error = ivas_mct_enc( st_ivas, data_f, input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
            }
#endif
        }

#ifdef FIX_759_CODE_COVERAGE_OSBA
        /* core-coding of transport channels */
        if ( st_ivas->nSCE == 1 )
        {
@@ -555,7 +449,6 @@ ivas_error ivas_enc(
                return error;
            }
        }
#endif
    }
    else if ( ivas_format == MC_FORMAT )
    {
+0 −4
Original line number Diff line number Diff line
@@ -331,14 +331,11 @@ ivas_error ivas_spar_enc(
)
{
    ENCODER_CONFIG_HANDLE hEncoderConfig;
#ifdef FIX_759_CODE_COVERAGE_OSBA
    Encoder_State *st0; /* used for bitstream handling */
#endif
    ivas_error error;

    error = IVAS_ERR_OK;
    hEncoderConfig = st_ivas->hEncoderConfig;
#ifdef FIX_759_CODE_COVERAGE_OSBA
    st0 = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0];

    /* Write SBA signaling bits */
@@ -372,7 +369,6 @@ ivas_error ivas_spar_enc(
        /* write the number of objects in ISM_SBA format*/
        push_indice( hMetaData, IND_ISM_NUM_OBJECTS, hEncoderConfig->nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ );
    }
#endif

    /* front VAD */
    if ( ( error = front_vad_spar( st_ivas->hSpar, data_f[0], hEncoderConfig, input_frame ) ) != IVAS_ERR_OK )