[ogg-dev] OggPCM: support for little-endianness only?

Erik de Castro Lopo mle+xiph at mega-nerd.com
Tue Feb 12 20:10:00 PST 2008


Timothy B. Terriberry wrote:

> It doesn't even really matter which architecture you're actually on. In
> any format that is to be used on both, it is always better to pick one
> and stick with it. Otherwise you require _both_ architectures to write
> additional code that is largely useless. Unless you can guarantee that
> you're writing streams that are only going to be passed within a single
> architecture, allowing both formats is always worse. That happens seldom
> enough in practice and has a small enough benefit that it is in no way
> worth making everyone else do extra work.

For a compressed format I would agree 100%, but PCM is not a compressed
format; its a format that if the endian-nesses of the file and CPU match,
can be dumped from file to disk and disk to file without any processing.

In libsndfile I handle this by doing a straight read or write when the
endian-nesses match and endswapping where I have to. For a data format 
as simple as PCM the minor effort required for a couple of different code 
paths is well worth it for the performance payoff.

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"We can build a better product than Linux" -- Microsoft
Corp.'s Windows operating-system chief, Jim Allchin.
One has to wonder why, with their huge resources, they haven't.
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"So if you were to say 'Microsoft,' I'd say 'Where? Let me grab
me my stake and crucifix!'." -- Bridget Kulakauskas


More information about the ogg-dev mailing list