Allen Guan
2011-Jan-19 05:50 UTC
[Speex-dev] stream encoded in big-endian machine and then decoded in little-endian machine
Hi, all, I have a question about encoding/decoding in big/little endian machines. I have a client running in an old PowerBook G4 with big-endian CPU, the audio stream is encoded then transmitted to a Mac Mini with little-endian CPU, and decoded in this Mac Mini. I am wondering the decoded stream is in big-endian or little-endian? What kind of necessary steps I need to process when I build the speex library for this purpose? Any comments are welcome, thanks in advance. -Allen
Jean-Marc Valin
2011-Jan-19 06:17 UTC
[Speex-dev] stream encoded in big-endian machine and then decoded in little-endian machine
It's a stream of binary data, no endianness issue. At least not withing Speex itself. On 11-01-19 12:50 AM, Allen Guan wrote:> Hi, all, > > I have a question about encoding/decoding in big/little endian > machines. I have a client running in an old PowerBook G4 with > big-endian CPU, the audio stream is encoded then transmitted to a Mac > Mini with little-endian CPU, and decoded in this Mac Mini. I am > wondering the decoded stream is in big-endian or little-endian? What > kind of necessary steps I need to process when I build the speex > library for this purpose? > > Any comments are welcome, thanks in advance. > > -Allen > _______________________________________________ > Speex-dev mailing list > Speex-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev > >
Allen Guan
2011-Jan-19 06:42 UTC
[Speex-dev] stream encoded in big-endian machine and then decoded in little-endian machine
Thanks a lot for your prompt reply. So at the receiver/decoder side, the decoded stream (I use 16bit/sample) is the same endian as the CPU of that machine? I noticed the speex library has a compile switch to change the endian of header information to make it always little-endian. When I encode my stream, I just call the encoding function directly with the correctly compiled speex library, right? Thanks! -Allen On Tue, Jan 18, 2011 at 10:17 PM, Jean-Marc Valin <jmvalin at jmvalin.ca> wrote:> It's a stream of binary data, no endianness issue. At least not withing > Speex itself. > > On 11-01-19 12:50 AM, Allen Guan wrote: >> >> Hi, all, >> >> I have a question about encoding/decoding in big/little endian >> machines. I have a client running in an old PowerBook G4 with >> big-endian CPU, the audio stream is encoded then transmitted to a Mac >> Mini with little-endian CPU, and decoded in this Mac Mini. I am >> wondering the decoded stream is in big-endian or little-endian? What >> kind of necessary steps I need to process when I build the speex >> library for this purpose? >> >> Any comments are welcome, thanks in advance. >> >> -Allen >> _______________________________________________ >> Speex-dev mailing list >> Speex-dev at xiph.org >> http://lists.xiph.org/mailman/listinfo/speex-dev >> >> >