search for: be_short

Displaying 6 results from an estimated 6 matches for "be_short".

Did you mean: le_short
2007 Apr 24
3
Re: just noise
...n't the whole story, and I will explain how it's still > not working, but first you need to update your example at: OK I finally figured out the second noise problem. It's a riddle wrapped in a mystery inside an enigma. Judging by the somewhat odd structure of le_short() and be_short(), I think this keeps coming up over and over again. Even Apple's byte swapping macros fail under certain circumstances, and here's why: 1. Logical shifting must be used, not arithmetic (or else the high bit is wrong) 2. Conversion from short to float must be signed, not unsigned (o...
2007 Apr 24
2
just noise
Hi, I tried both the stable and beta versions of the speex source code download on Mac OS 10.4.9. I just do: ./configure make sudo make install Then I added libspeex.a from /usr/local/lib and the headers to my xcode project. My app compiles and I'm able to call all of the speex functions. I copied the example code from the website and tweaked it to include the first 10000 bytes of
2007 May 02
0
[patch] Mac Universal Binaries
...(working copy) > @@ -35,7 +35,7 @@ > #include <stdio.h> > #include "speex/speex_types.h" > > -#ifdef WORDS_BIGENDIAN > +#ifdef __BIG_ENDIAN__ > #define le_short(s) ((short) ((unsigned short) (s) << 8) | ((unsigned short) (s) >> 8)) > #define be_short(s) ((short) (s)) > #else > @@ -46,7 +46,7 @@ > /** Convert little endian */ > static inline spx_int32_t le_int(spx_int32_t i) > { > -#ifdef WORDS_BIGENDIAN > +#ifdef __BIG_ENDIAN__ > spx_uint32_t ui, ret; > ui = i; > ret = ui>>24; > Index: con...
2007 Apr 24
0
Re: just noise
...u must swap the byte order of the samples with the following code:" //////////////////////////////////////// /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #define WORDS_BIGENDIAN 1 unsigned short be_short(unsigned short s) { unsigned short ret=s; #ifndef WORDS_BIGENDIAN ret = s>>8; ret += s<<8; #endif return ret; } unsigned short le_short(unsigned short s) { unsigned short ret=s; #ifdef WORDS_BIGENDIAN ret = s>>8; ret += s<<8; #endif return...
2007 Apr 24
0
Re: just noise
> OK I finally figured out the second noise problem. It's a riddle > wrapped in a mystery inside an enigma. Judging by the somewhat odd > structure of le_short() and be_short(), I think this keeps coming up > over and over again. Even Apple's byte swapping macros fail under > certain circumstances, and here's why: Funny thing is you seem to be the first to report that... not quite sure why. > 1. Logical shifting must be used, not arithmetic (or else...
2007 May 02
4
[patch] Mac Universal Binaries
Hi all, Speex currently decides endianness at configure-time. This causes the ppc half of Mac universal binaries to have some endianness problems. Most notably, the header built by speex_packet_to_header() has incorrect byte-ordering. This Apple developer page describes the incantation that can be used to build universal binaries on Mac. It also highlights the configure-time versus compile-time