Commit 874a29c8 authored by vaclav's avatar vaclav
Browse files

- add TUNE_360_OBJECT_WITH_NOISE (switch under development)

parent 3a833e96
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@

#ifdef DEBUGGING

/*#define DEBUG_MODE_INFO*/                     /* output most important parameters to the subdirectory "res/" */
#define DEBUG_MODE_INFO                     /* output most important parameters to the subdirectory "res/" */
#ifdef DEBUG_MODE_INFO
/*#define DEBUG_MODE_ACELP*/                    /* output most important ACELP core parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_TCX*/                      /* output most important TCX core parameters to the subdirectory "res/" */
@@ -168,6 +168,9 @@
#define UNIFY_MD_QUANTIZER
#define DISC_CNG

#define TUNE_360_OBJECT_WITH_NOISE      // VA: issue 360: consider objects being speech+noise for active speech coding */


/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+2 −0
Original line number Diff line number Diff line
@@ -448,6 +448,8 @@ ivas_error ivas_core_enc(
        dbgwrite( &st->sp_aud_decision1, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision1", n, id, ENC ) );
        dbgwrite( &st->sp_aud_decision2, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision2", n, id, ENC ) );

        dbgwrite( &st->lp_noise, sizeof( float ), 1, input_frame, fname( debug_dir, "lp_noise", n, id, ENC ) );

#if ( defined DEBUG_MODE_ACELP ) || ( defined DEBUG_MODE_TCX )
        if ( st->coder_type == INACTIVE || st->coder_type == UNVOICED )
        {
+7 −0
Original line number Diff line number Diff line
@@ -127,6 +127,13 @@ int16_t ivas_ism_dtx_enc(
    float tmp1, tmp2;
#endif

#ifdef TUNE_360_OBJECT_WITH_NOISE
    for ( ch = 0; ch < nchan_transport; ch++ )
    {
        hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0;
    }
#endif

    /*------------------------------------------------------------------*
     * compute global ISM DTX flag
     *-----------------------------------------------------------------*/
+37 −0
Original line number Diff line number Diff line
@@ -434,6 +434,43 @@ ivas_error ivas_ism_enc(
    }
#endif


#ifdef PARAM_ISM_DTX_CNG
#ifdef DEBUG_MODE_INFO
    if ( dtx_flag )
    {
        float tmpF;
        int16_t id, n;

        n = 0;
        for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ )
        {
            if ( sce_id != st_ivas->hISMDTX->sce_id_dtx )
            {
                st = st_ivas->hSCE[sce_id]->hCoreCoder[0];
                id = st->id_element;

                dbgwrite( &st->core, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "core", n, id, ENC ) );
                dbgwrite( &st->extl, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "extl", n, id, ENC ) );
                dbgwrite( &st->bwidth, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "bwidth", n, id, ENC ) );
                tmpF = st->total_brate / 1000.0f;
                dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "total_brate", n, id, ENC ) );
                tmpF = st->core_brate / 1000.0f;
                dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "core_brate", n, id, ENC ) );
                tmpF = st->extl_brate / 1000.0f;
                dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "extl_brate", n, id, ENC ) );

                dbgwrite( &st->coder_type, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type", n, id, ENC ) );
                dbgwrite( &st->coder_type_raw, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type_raw", n, id, ENC ) );
                dbgwrite( &st->vad_flag, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "vad_flag", n, id, ENC ) );
                dbgwrite( &st->localVAD, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "localVAD", n, id, ENC ) );

                dbgwrite( &st->lp_noise, sizeof( float ), 1, input_frame, fname( debug_dir, "lp_noise", n, id, ENC ) );
            }
        }
    }
#endif
#endif
    pop_wmops();

    return error;
+6 −0
Original line number Diff line number Diff line
@@ -212,6 +212,9 @@ ivas_error ivas_ism_metadata_enc(
        }
        else if ( ism_mode == ISM_MODE_DISC )
        {
#ifdef TUNE_360_OBJECT_WITH_NOISE
            hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10;
#else
            hIsmMeta[ch]->ism_metadata_flag = localVAD[ch];

            if ( hIsmMeta[ch]->ism_metadata_flag == 0 )
@@ -230,6 +233,7 @@ ivas_error ivas_ism_metadata_enc(
                    hIsmMeta[ch]->ism_metadata_flag = 1;
                }
            }
#endif

            if ( hSCE[ch]->hCoreCoder[0]->tcxonly )
            {
@@ -245,6 +249,7 @@ ivas_error ivas_ism_metadata_enc(

    rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp );

#ifndef TUNE_360_OBJECT_WITH_NOISE
    /* relax the importance decision in "stereo" coding for noisy audio */
    if ( ism_mode == ISM_MODE_DISC && num_obj == 2 )
    {
@@ -264,6 +269,7 @@ ivas_error ivas_ism_metadata_enc(
            }
        }
    }
#endif

    /*----------------------------------------------------------------*
     * Write ISm common signaling