Commit ecba0c59 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'float_code_cleanup_encoder' into 'main'

Float code cleanup across modules

See merge request !824
parents 652a388e 6094768b
Loading
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -134,10 +134,7 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
static void usage_dec( void );
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec );
#if 0
void run_fft_unit_test( void );
void run_mdct_unit_test( void );
#endif


/*------------------------------------------------------------------------------------------*
 * main()
@@ -165,9 +162,6 @@ int main(
    RenderConfigReader *renderConfigReader = NULL;
    int16_t *pcmBuf = NULL;
    IVAS_RENDER_FRAMESIZE asked_frame_size;
#if 0
    int16_t run_unit_tests = 0;
#endif

#ifdef WMOPS
    reset_wmops();
@@ -180,16 +174,6 @@ int main(

    IVAS_DEC_PrintDisclaimer();

#if 0
    if ( run_unit_tests )
    {
        run_fft_unit_test();
        run_mdct_unit_test();
        return 0;
    }

#endif

    if ( !parseCmdlIVAS_dec( (int16_t) argc, argv, &arg ) )
    {
        /* Error printout done in parseCmdlIVAS_dec() */
+0 −9
Original line number Diff line number Diff line
@@ -371,21 +371,12 @@ int main(
            }
            break;
        case IVAS_ENC_INPUT_SBA:
#if 0
            if ((error = IVAS_ENC_ConfigureForAmbisonics_fx(hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar,
              arg.pca)) != IVAS_ERR_OK)
            {
              fprintf(stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage(error));
              goto cleanup;
            }
#else
            if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar,
                                                            arg.pca ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                goto cleanup;
            }
#endif
            break;
        case IVAS_ENC_INPUT_MASA:
            if ( ( error = IVAS_ENC_ConfigureForMasa( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masaVariant ) ) != IVAS_ERR_OK )
+1 −3
Original line number Diff line number Diff line
@@ -3068,9 +3068,7 @@ enum
#define DEGREE_180                            (Word32)(180.0 *ONE_IN_Q23)
#define DEGREE_360                            (Word32)(360.0 *ONE_IN_Q23)
extern const Word16 Idx2Freq_Tbl[];
#if 0 
//TO do add in rom_com
#endif

#define chk_fs(fs)
/* 'x' is converted to Q6, 'Freq_Tbl'/1000 in Q9 */
/* only works for 'fs' = [8000,12800,16000,25600,32000,48000] (unpredictable otherwise) */
+0 −50
Original line number Diff line number Diff line
@@ -487,56 +487,6 @@ void WMOPS_output_all_std( Word16 dtx_mode );
 * free all allocated counter memory
 */
void WMOPS_destroy( void );
#if 0
/*
 * Example of how count.h could be used.
 *
 * In the example below it is assumed that the init_OBJECT functions
 * does not use any calls to counter.h or basic_op.h. If this is the case
 * a call to the function Reset_WMOPS_counter() must be done after each call
 * to init_OBJECT if these operations is not to be included in the statistics.
 */

int main () {
  int spe1Id, spe2Id, cheId;

  /* initiate counters and objects */
  spe1Id = getCounterId ("Spe 5k8");
  setCounter (spe1Id);
  Init_WMOPS_counter ();
  init_spe1 ( ...);

  spe2Id = getCounterId ("Spe 12k2");
  setCounter (spe2Id);
  Init_WMOPS_counter ();
  init_spe2 ( ...);

  cheId = getCounterId ("Channel encoder");
  setCounter (cheId);
  Init_WMOPS_counter ();
  init_che ( ...);
  ... while (data) {
    test ();                    /* Note this call to test(); */
    if (useSpe1)
      setCounter (spe1Id);
    else
      setCounter (spe2Id);
    Reset_WMOPS_counter ();
    speEncode ( ...);
    WMOPS_output (0);           /* Normal routine for displaying WMOPS info */

    setCounter (cheId);
    Reset_WMOPS_counter ();
    preChannelInter ( ...);
    fwc ();                     /* Note the call to fwc() for each part */
    convolve ( ...);
    fwc ();                     /* of the channel encoder. */
    interleave ( ...);
    fwc ();
    WMOPS_output (0);           /* Normal routine for displaying WMOPS info */
  }
}
#endif /* #if 0 */

/* jdr 20120117: add FLC similar functions */
/* mul 20130729: set BASOP_COUNT_SUBROUTINES to count on a per-BASOP_sub_start()/BASOP_sub_end() base;
+0 −52
Original line number Diff line number Diff line
@@ -69,59 +69,7 @@ UWord32 UL_deposit_l( UWord16 uvar )
#endif
    return ( UL_result );
}
#if 0
/*_____________________________________________________________________________
 |                                                                             |
 |   Function Name : norm_ul_float                                                   |
 |                                                                             |
 |   Purpose :                                                                 |
 |                                                                             |
 |   Produces the number of left shifts needed to normalize the 32 bit varia-  |
 |   ble UL_var1 for positive values on the interval with minimum of           |
 |   0 and maximum of 0xffffffff, ; in order to normalize the                  | 
 |   result, the following operation must be done :                            |
 |                                                                             |
 |      norm_UL_var1 = UL_lshl(UL_var1, norm_ul_float(UL_var1)).                     |
 |                                                                             |
 |   Complexity weight : 1                                                     |
 |                                                                             |
 |   Inputs :                                                                  |
 |                                                                             |
 |     UL_var1                                                                 |
 |       32 bit long unsigned integer (UWord32) whose value falls in the       |
 |       range : 0x0000 0000 <= var1 <= 0xffff ffff.                           |
 |                                                                             |
 |   Outputs :                                                                 |
 |                                                                             |
 |     none                                                                    |
 |                                                                             |
 |   Return Value :                                                            |
 |                                                                             |
 |     var_out                                                                 |
 |        16 bit short signed integer (Word16) whose value falls in the        |
 |        range : 0x0000 0000 <= var_out <= 0x0000 001f. (0..31d)              |
 |_____________________________________________________________________________|
*/
Word16 norm_ul_float (UWord32 UL_var1) {
  Word16 var_out;

  if (UL_var1 == 0) {
    var_out = 0;
  }
  else {
    /* simply test shift up until  highest bit is set */
    for (var_out = 0; UL_var1 < (UWord32) 0x80000000U; var_out++) {
      UL_var1 <<= 1;
    }
  }

#ifdef WMOPS
  multiCounter[currCounter].norm_ul_float++;
#endif

  return (var_out);
}
#endif
/*___________________________________________________________________________
 |                                                                           |
 |   Function Name : UL_addNs                                                |
Loading