search for: max16

Displaying 13 results from an estimated 13 matches for "max16".

Did you mean: max1
2013 Dec 09
1
incorrect use of MAX16
Hello, in celt/celt_encoder.c line 369, the 'b' argument to MAX16 can sometimes be greater than what can be represented by a 16bit integer. The default definition of MAX16 is type-less, but I am working on an architecture with hardware support for min/max of 16bit. Changing the default definition to take advantage of this hardware changes the result of that comp...
2016 Aug 29
1
TI DSP support
I did find it using my browser search. I am not sure where the "Git" is. It looks like many of the macros that use the TI intrinsics are commented-out. #if 0 +#include "dsplib.h" + +#undef MAX16 +#define MAX16(a,b) _max(a,b) ... Once my development has commenced (still in the study phase). I will be trying it. dave -----Original Message----- From: Jean-Marc Valin [mailto:jmvalin at jmvalin.ca] Sent: Monday, August 29, 2016 4:31 PM To: David Boles; opus at xiph.org Subject: Re: [opus] T...
2016 Aug 29
3
TI DSP support
I see the following in arch.h #elif defined (TI_C6X_ASM) #include "fixed_c6x.h" But there does not seem to be a header file by that name in the 1.1.2 distribution. dave
2007 Sep 17
1
Possible fixed point overflow/div 0 preprocess.c
...hen calculating 'beta' within 'speex_preprocess_run', I received a floating point exception even when compiled with -DFIXED_POINT. The reason is as follows: <original beta calculation within speex_preprocess_run> ... st->nb_adapt++; st->min_count++; beta = MAX16(QCONST16(.03,15),DIV32_16(Q15_ONE,st->nb_adapt)); beta_1 = Q15_ONE-beta; ... </> On my architecture(x86) at least the DIV32_16 is defined as follows. typedef short spx_int16_t; typedef spx_int16_t spx_word16_t; #define DIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a))/((spx_word16_t)(...
2010 Mar 25
0
Blackfin inline assembly for fixed math
...ON) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FIXED_BFIN_H #define FIXED_BFIN_H #undef MAX16 static inline celt_int16 MAX16(celt_int16 a, celt_int16 b) { celt_int32 res; __asm__ ( "%1 = %1.L (X);\n\t" "%2 = %2.L (X);\n\t" "%0 = MAX(%1,%2);" : "=d" (res) : "%d" (a), "d" (b) ); return re...
2019 May 27
0
opus-1.3.1 patch for ARM Cortex-M4F (single precision)
...ationarity = MIN16(0.99f,L1/(float)sqrt(1e-15f+NB_FRAMES*L2)); stationarity *= stationarity; stationarity *= stationarity; frame_stationarity += stationarity; @@ -748,7 +748,7 @@ static void tonality_analysis(TonalityAn neighbouring bands. */ float boost = MAX16(0, leakage_to[b] - band_log2[b]) + MAX16(0, band_log2[b] - (leakage_from[b]+LEAKAGE_OFFSET)); - info->leak_boost[b] = IMIN(255, (int)floor(.5 + 64.f*boost)); + info->leak_boost[b] = IMIN(255, (int)floor(.5f + 64.f*boost)); } for (;b<LEAK_BANDS;b++) info-...
2007 Jun 14
2
Blackfin inline assembler and VisualDSP++ toolchain
...about everything fails. Some things fail during compilation, the rest during final assembling pass. Thinking about it, the problem is probably not in the asm syntax, but in a way by each the compiler treats the asm keyword. For example, for the following function: ----- static inline spx_word16_t MAX16(spx_word16_t a, spx_word16_t b) { spx_word32_t res; __asm__ ( "%1 = %1.L (X);\n\t" "%2 = %2.L (X);\n\t" "%0 = MAX(%1,%2);" : "=d" (res) : "%d" (a), "d" (b) ); return res; } --- Compiler says: &...
2008 Feb 05
1
Re: Problem with Blackfin assembly optimizations -- bug in fixed_bfin.h / resampler saturation???
...), and wondered why the return value of the function inside 'fixed_bfin.h' is of type 'spx_word16_t', but the local variable 'res' which is returned by this function is of type 'spx_word32_t'. Is this a trick of optimization or a bug? (Same question for PDIV32_16 and MAX16, too!) best regards, Frank -----Urspr?ngliche Nachricht----- Von: "Jean-Marc Valin" <jean-marc.valin@usherbrooke.ca> Gesendet: 02.02.08 06:26:08 An: speex-dev <speex-dev@xiph.org> Betreff: Re: FW: Re: [Speex-dev] Problem with Blackfin assembly optimizations -- bug in fixed...
2008 Feb 08
1
Re: Problem with Blackfin assembly optimizations -- bug in fixed_bfin.h / resampler saturation???
...the return value of the function inside > 'fixed_bfin.h' is of type 'spx_word16_t', but the local variable > 'res' which is returned by this function is of type 'spx_word32_t'. > Is this a trick of optimization or a bug? (Same question for > PDIV32_16 and MAX16, too!) Neither (AFAIK). The idea is that sometimes gcc does silly/counter-intuitive things when I specify a 16-bit variable as a constraint. That way, I force the top 16 bits to be zero. Jean-Marc > best regards, Frank > > > -----Urspr?ngliche Nachricht----- Von: "Jean-Marc V...
2008 Feb 12
1
Re: Problem with Blackfin assembly optimizations -- bug in fixed_bfin.h / resampler saturation???
...the function inside >> 'fixed_bfin.h' is of type 'spx_word16_t', but the local variable >> 'res' which is returned by this function is of type 'spx_word32_t'. >> Is this a trick of optimization or a bug? (Same question for >> PDIV32_16 and MAX16, too!) > > Neither (AFAIK). The idea is that sometimes gcc does > silly/counter-intuitive things when I specify a 16-bit variable as a > constraint. That way, I force the top 16 bits to be zero. > > Jean-Marc > >> best regards, Frank >> >> >> ----...
2008 Feb 22
1
Re: Problem with Blackfin assembly optimizations -- bug in fixed_bfin.h / resampler saturation???
...ide >>> 'fixed_bfin.h' is of type 'spx_word16_t', but the local variable >>> 'res' which is returned by this function is of type 'spx_word32_t'. >>> Is this a trick of optimization or a bug? (Same question for >>> PDIV32_16 and MAX16, too!) >> Neither (AFAIK). The idea is that sometimes gcc does >> silly/counter-intuitive things when I specify a 16-bit variable as a >> constraint. That way, I force the top 16 bits to be zero. >> >> Jean-Marc >> >>> best regards, Frank >>>...
2008 Mar 05
1
Problem with Blackfin assembly optimizations -- bug in fixed_bfin.h / resampler saturation???
...; inside 'fixed_bfin.h' is of type 'spx_word16_t', but the local >>>> variable 'res' which is returned by this function is of type >>>> 'spx_word32_t'. Is this a trick of optimization or a bug? (Same >>>> question for PDIV32_16 and MAX16, too!) >>> Neither (AFAIK). The idea is that sometimes gcc does >>> silly/counter-intuitive things when I specify a 16-bit variable >>> as a constraint. That way, I force the top 16 bits to be zero. >>> >>> Jean-Marc >>> >>>> best...
2009 Apr 24
2
[PATCH] Blackfin: cleanup astat/cc/hardware loop asm clobbers
...: "=m" (res) : "m" (a), "m" (bb) - : "P0", "R0", "R1", "cc"); + : "P0", "R0", "R1", "ASTAT" BFIN_HWLOOP0_REGS); return res; } @@ -98,6 +100,7 @@ static inline spx_word16_t MAX16(spx_word16_t a, spx_word16_t b) "%0 = MAX(%1,%2);" : "=d" (res) : "%d" (a), "d" (b) + : "ASTAT" ); return res; } @@ -113,7 +116,7 @@ static inline spx_word32_t MULT16_32_Q15(spx_word16_t a, spx_word32_t b) &quo...