=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/dsp.h,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/sndiod/dsp.h 2021/05/25 08:06:12 1.10 --- src/usr.bin/sndiod/dsp.h 2022/03/07 08:58:33 1.11 *************** *** 1,4 **** ! /* $OpenBSD: dsp.h,v 1.10 2021/05/25 08:06:12 ratchov Exp $ */ /* * Copyright (c) 2012 Alexandre Ratchov * --- 1,4 ---- ! /* $OpenBSD: dsp.h,v 1.11 2022/03/07 08:58:33 ratchov Exp $ */ /* * Copyright (c) 2012 Alexandre Ratchov * *************** *** 25,52 **** * 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. */ ! #ifndef ADATA_BITS ! #define ADATA_BITS 16 ! #endif #define ADATA_LE (BYTE_ORDER == LITTLE_ENDIAN) #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) \ ((int)(((long long)(x) * (long long)(y)) >> (ADATA_BITS - 1))) 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 --- 25,38 ---- * 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. */ ! #define ADATA_BITS 24 #define ADATA_LE (BYTE_ORDER == LITTLE_ENDIAN) #define ADATA_UNIT (1 << (ADATA_BITS - 1)) #define ADATA_MUL(x,y) \ ((int)(((long long)(x) * (long long)(y)) >> (ADATA_BITS - 1))) typedef int adata_t; /* * The FIR is sampled and stored in a table of fixed-point numbers