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

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Tue Feb 12 20:22:36 PST 2008

> 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.

Really? How low does it take to swap bytes vs. the time it takes to read
from disk? Unless I'm missing something, the read speed is limited by
the disk bandwidth (~100 MB/s max) while the swapping is only limited by
the memory speed (5+ GB/s now).


More information about the ogg-dev mailing list