On Wed, Jul 02, 2003 at 04:37:13PM -0700, Rob Leslie wrote:
What has people's experience been with Tremor? Is there anything lacking that a new implementation might be able to address and overcome?
Interface is basically the same as the regular ogg's interface. (There are ints passed instead of floats for some arguments; but that's rather obvious why).
If you like the ogg library interface (and I do), there are no complaints here concerning tremor. I have not had a chance to see how well it performs on my target platform (200mhz strongarm), but it used roughly the same CPU utilization as the regular ogg library on my development box (400mhz intel celeron).
And I'm going to add this next (long) bit not because I dislike libmad (it is very fast and works well), but because we mentioned ogg, mad, and improvements in the same email:
If I were to pick something to improve it would be the high-level library interface for libmad. The vorbisfile interface is very program(er) friendly. However the libmad one is a little harder to use. (Though, there is the advantage/complexity tradeoff of having 24bit samples in libmad).
To compare, my player's abstraction files for the two interfaces are 110 lines for vorbisfile and 208 lines for libmad. The biggest (I assume avoidable) complexity that libmad has is the hand-off of new raw data for construction of a frame.
That is for libmad, one has to feed a buffer that may not be entirely consumed, and one is responsible for re-sending the unconsumed part.
For vorbisfile, one just hands off a file-handle.
(Luckily, for my libmad routines, mmap makes things pretty fast and reasonable to code).
An interesting note, though, is that vorbisfile's documentation (to my memory) implies that the requested output frame size (you may specify) will be constant. It is, in fact not, but may be very small or very large. (I suppose due to modulo math and the difference between actual frame size and you specification).
On the other hand, libmad quite plainly states that you may receive any size for a frame (since it chooses to return a whole frame). It even warns that this size may change. (But in practice rarely does, though one can hardly ignore it when it happens!)
The point I'm making for this last bit was that vorbisfile would probably be better off using libmad's idea of returning the whole frame. But actually it would be nice if both went a step further than vorbisfile: The library should be told how much to fetch, and it returns that much unless EOF (or stream error, etc.). Just like a regular file read.
Overall, that's the interface that's ideal, give it a file handle (or at worse, a buffer pointer and size) and then read from it like it were a file. vorbis file is pretty close (and if you don't mind getting small "frames" it meets that mark), but libmad is pretty tough in comparison.
Again, I hope this is viewed only as constructive criticism. I, of course, thank all the hard work going into -all- the libraries that I use.
Thanks for list'in.
-Adam Luter