[BACK]Return to dsp.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Diff for /src/usr.bin/sndiod/dsp.h between version 1.10 and 1.11

version 1.10, 2021/05/25 08:06:12 version 1.11, 2022/03/07 08:58:33
Line 25 
Line 25 
  * boundary is excluded. We represent them as signed fixed point numbers   * boundary is excluded. We represent them as signed fixed point numbers
  * of ADATA_BITS. We also assume that 2^(ADATA_BITS - 1) fits in a int.   * of ADATA_BITS. We also assume that 2^(ADATA_BITS - 1) fits in a int.
  */   */
 #ifndef ADATA_BITS  #define ADATA_BITS                      24
 #define ADATA_BITS                      16  
 #endif  
 #define ADATA_LE                        (BYTE_ORDER == LITTLE_ENDIAN)  #define ADATA_LE                        (BYTE_ORDER == LITTLE_ENDIAN)
 #define ADATA_UNIT                      (1 << (ADATA_BITS - 1))  #define ADATA_UNIT                      (1 << (ADATA_BITS - 1))
   
 #if ADATA_BITS == 16  
   
 #define ADATA_MUL(x,y)          (((int)(x) * (int)(y)) >> (ADATA_BITS - 1))  
   
 typedef short adata_t;  
   
 #elif ADATA_BITS == 24  
   
 #define ADATA_MUL(x,y)          \  #define ADATA_MUL(x,y)          \
         ((int)(((long long)(x) * (long long)(y)) >> (ADATA_BITS - 1)))          ((int)(((long long)(x) * (long long)(y)) >> (ADATA_BITS - 1)))
   
 typedef int adata_t;  typedef int adata_t;
   
 #else  
 #error "only 16-bit and 24-bit precisions are supported"  
 #endif  
   
 /*  /*
  * The FIR is sampled and stored in a table of fixed-point numbers   * The FIR is sampled and stored in a table of fixed-point numbers

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11