Commit dd0a86a7 authored by Nicolas Roussin's avatar Nicolas Roussin
Browse files

Merge branch '2142-implement-basop-w_min-and-w_max-functions' into...

Merge branch '2142-implement-basop-w_min-and-w_max-functions' into 2157-optimize-ivas_dirac_dec_binaural_formulate_input_covariance_matrices
parents bb3fed41 024b3128
Loading
Loading
Loading
Loading
Loading
+1 −96
Original line number Diff line number Diff line
@@ -40,103 +40,7 @@
 *****************************************************************************/

#ifdef ENH_64_BIT_OPERATOR
/*______________________________________________________________________________
|                                                                              |
|   Function Name : W_min                                                      |
|                                                                              |
|   Purpose :                                                                  |
|                                                                              |
|    Compares L64_var1 and L64_var2 and returns the minimum value.             |
|                                                                              |
|   Complexity weight : 1                                                      |
|                                                                              |
|   Inputs :                                                                   |
|                                                                              |
|    L64_var1   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|    L64_var2   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|   Outputs :                                                                  |
|                                                                              |
|    none                                                                      |
|                                                                              |
|   Return Value :                                                             |
|                                                                              |
|    L64_var_out                                                               |
|             64 bit long signed integer (Word64) whose value falls in the     |
|       range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. |
|______________________________________________________________________________|
*/
Word64 W_min( Word64 L64_var1, Word64 L64_var2 )
{
    Word64 L64_var_out;

    if ( L64_var1 <= L64_var2 )
    {
        L64_var_out = L64_var1;
    }
    else
    {
        L64_var_out = L64_var2;
    }

#ifdef WMOPS
    multiCounter[currCounter].W_min++;
#endif /* ifdef WMOPS */

    return ( L64_var_out );
}

/*______________________________________________________________________________
|                                                                              |
|   Function Name : W_max                                                      |
|                                                                              |
|   Purpose :                                                                  |
|                                                                              |
|    Compares L64_var1 and L64_var2 and returns the maximum value.             |
|                                                                              |
|   Complexity weight : 1                                                      |
|                                                                              |
|   Inputs :                                                                   |
|                                                                              |
|    L64_var1   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|    L64_var2   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|   Outputs :                                                                  |
|                                                                              |
|    none                                                                      |
|                                                                              |
|   Return Value :                                                             |
|                                                                              |
|    L64_var_out                                                               |
|             64 bit long signed integer (Word64) whose value falls in the     |
|       range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. |
|______________________________________________________________________________|
*/
Word64 W_max( Word64 L64_var1, Word64 L64_var2 )
{
    Word64 L64_var_out;

    if ( L64_var1 >= L64_var2 )
    {
        L64_var_out = L64_var1;
    }
    else
    {
        L64_var_out = L64_var2;
    }

#ifdef WMOPS
    multiCounter[currCounter].W_max++;
#endif /* ifdef WMOPS */

    return ( L64_var_out );
}

/*___________________________________________________________________________
|                                                                           |
@@ -180,6 +84,7 @@ Word64 W_add_nosat( Word64 L64_var1, Word64 L64_var2 )
    return L64_var_out;
}


/*___________________________________________________________________________
|                                                                           |
|   Function Name : W_sub_nosat                                             |
+102 −2
Original line number Diff line number Diff line
@@ -21,8 +21,108 @@
 *
 *****************************************************************************/
#ifdef ENH_64_BIT_OPERATOR
Word64 W_min( Word64 L64_var1, Word64 L64_var2 );
Word64 W_max( Word64 L64_var1, Word64 L64_var2 );


/*______________________________________________________________________________
|                                                                              |
|   Function Name : W_min                                                      |
|                                                                              |
|   Purpose :                                                                  |
|                                                                              |
|    Compares L64_var1 and L64_var2 and returns the minimum value.             |
|                                                                              |
|   Complexity weight : 1                                                      |
|                                                                              |
|   Inputs :                                                                   |
|                                                                              |
|    L64_var1   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|    L64_var2   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|   Outputs :                                                                  |
|                                                                              |
|    none                                                                      |
|                                                                              |
|   Return Value :                                                             |
|                                                                              |
|    L64_var_out                                                               |
|             64 bit long signed integer (Word64) whose value falls in the     |
|       range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. |
|______________________________________________________________________________|
*/
static __inline Word64 W_min( Word64 L64_var1, Word64 L64_var2 )
{
    Word64 L64_var_out;

    if ( L64_var1 <= L64_var2 )
    {
        L64_var_out = L64_var1;
    }
    else
    {
        L64_var_out = L64_var2;
    }

#ifdef WMOPS
    multiCounter[currCounter].W_min++;
#endif /* ifdef WMOPS */

    return ( L64_var_out );
}


/*______________________________________________________________________________
|                                                                              |
|   Function Name : W_max                                                      |
|                                                                              |
|   Purpose :                                                                  |
|                                                                              |
|    Compares L64_var1 and L64_var2 and returns the maximum value.             |
|                                                                              |
|   Complexity weight : 1                                                      |
|                                                                              |
|   Inputs :                                                                   |
|                                                                              |
|    L64_var1   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|    L64_var2   64 bit long signed integer (Word64) whose value falls in the   |
|       range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL.    |
|                                                                              |
|   Outputs :                                                                  |
|                                                                              |
|    none                                                                      |
|                                                                              |
|   Return Value :                                                             |
|                                                                              |
|    L64_var_out                                                               |
|             64 bit long signed integer (Word64) whose value falls in the     |
|       range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. |
|______________________________________________________________________________|
*/
static __inline Word64 W_max( Word64 L64_var1, Word64 L64_var2 )
{
    Word64 L64_var_out;

    if ( L64_var1 >= L64_var2 )
    {
        L64_var_out = L64_var1;
    }
    else
    {
        L64_var_out = L64_var2;
    }

#ifdef WMOPS
    multiCounter[currCounter].W_max++;
#endif /* ifdef WMOPS */

    return ( L64_var_out );
}


Word64 W_add_nosat( Word64 L64_var1, Word64 L64_var2 );
Word64 W_sub_nosat( Word64 L64_var1, Word64 L64_var2 );
Word64 W_shl( Word64 L64_var1, Word16 var2 );
+7 −0
Original line number Diff line number Diff line
@@ -130,6 +130,9 @@ typedef enum
    IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT,
    IVAS_ERR_NO_FILE_OPEN,
    IVAS_ERR_SAMPLING_RATE_UNKNOWN,
#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK
    IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT,
#endif

    /*----------------------------------------*
     *    renderer (lib_rend only)            *
@@ -269,6 +272,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Invalid input format";
        case IVAS_ERR_INVALID_INDEX:
            return "Invalid index";
#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK
        case IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT:
            return "Euler angles were detected in the input but only Quaternions are supported";
#endif
        default:
            break;
    }
+9 −0
Original line number Diff line number Diff line
@@ -178,6 +178,15 @@ void ivas_omasa_render_objects_from_mix_fx(
    Word16 *output_q                                            /* i/o: output Q value                          */
);

#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
void ivas_omasa_gain_masa_tc_fx(
    Word32 *output_fx[],                                       /* i/o: output synthesis signal                  */
    const Word16 gainMasa_fx,                                  /* i  : gain for MASA transport channels         */
    const Word16 nchan_transport_ism,                          /* i  : number of ISM TCs                        */
    const Word16 output_frame                                  /* i  : output frame length per channel          */
);
#endif

ivas_error ivas_omasa_ism_metadata_dec_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const Word32 ism_total_brate,                               /* i  : ISM total bitrate                       */
+7 −0
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@
#define FIX_2092_ASSERT_IN_OMASA_RENDER                      /* FhG, Nokia: Fix LTV crash due to overflow in OMASA EXT output */
#define FIX_2084_FLOATING_POINT_LEFTOVERS                    /* FhG: convert floating-point leftovers in IVAS_ENC_FeedObjectMetadata() */
#define FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING          /* FhG: Replace L_shl with L_shl_sat to prevent overflow when calculating scale factors for very small numbers in the logarithmic domain */
#define FIX_APA_EXECS_SCALING                                /* VA: fix scaling of JBM APA buffer */

/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
@@ -113,6 +115,9 @@
#define UNIFIED_DECODING_PATHS_LEFTOVERS                /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */
#define FIX_NCHAN_BUFFERS                               /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */
#define FIX_RENDERER_STACK                              /* VA: issue 1322: reduction of renderers' buffers size */
#define FIX_1370_EXTERNAL_ORIENTATION_CHECK             /* Nokia: add sanity check for Euler angles for external orientations */
#define NONBE_FIX_1197_OMASA_META_BUFFER                /* Nokia: OMASA ISM_MASA_MODE_PARAM_ONE_OBJ history zero in rateswitching - port 251 */
#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */

// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
@@ -125,6 +130,8 @@
#define NONBE_FIX_1255_OBJ_EDIT_JBM                     /* VA: issue 1255: restore object editing in JBM */
#define FIX_1372_OSBA_OBJECT_EDITING                    /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */
#define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES        /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */
#define NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT               /* Nokia: issue 1305: Fix OMASA ext output in case of object editing */
#define NONBE_FIX_1172_OBJ_EDIT_JBM                     /* VA: issue 1172: fix OMASA object editing in JBM */

/* #################### End BASOP porting switches ############################ */

Loading