Is anybody interested in cleanly separating encode and decode in vorbis? I'm trying to take a stab at it myself from the head of cvs as of this morning, but it looks like a lot of files contain both encode-only and decode-only functions. An obvious one is mdct.c, which contains mdct_forward and mdct_backward (which isn't that big of a deal, since both are pretty well-contained, but it could be easily fixed by moving all of the helper functions into a header file). A more complicated one is block.c, which contains several calls into psy.c, which I would presume should be mostly encode-only. I'm working by starting with decoder_example.c and compiling by hand adding in more .c files until it links properly. My main reason for doing this is that based on recent mails to the list, decode really doesn't need double-precision arithmetic and my platform has single-precision arithmetic but not double-precision. Also, for what it's worth, now that tremor exists does it make any sense to keep the float-or-int macros (MULT_NORM, etc) in mdct.c? Thanks again, -Dave --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Perhaps a cleaner way to patch this in without introducing a bunch of new files would be add something like #ifndef DECODE_ONLY to the appropriate places (either around the entire file or around the relevant functions). I can probably work this out well enough, but if I wanted to submit my patches back to the maintainer are there any preferences on the symbol name? I'd rather use #ifndef instead of #ifdef for obvious reasons -- everything will still work as before. -Dave --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Okay, that wasn't so painless after all. Attached is a cvs diff of my DECODE_ONLY changes; I can resupply the patch with whatever diff options somebody would prefer. Here are the files I needed to get it to link properly: cl -D DECODE_ONLY -I ../include -I ../../ogg/include decoder_example.c info.c block.c registry.c mapping0.c res0.c floor0.c floor1.c bitrate.c synthesis.c mdct.c psy.c lsp.c envelope.c codebook.c sharedbook.c window.c smallft.c bitwise.c framing.c The last two are actually part of ogg, not vorbis. The only potential problem I saw is in mapping0.c, which sets up a table of function pointers. My assumption is that mapping0_forward is an encode-only function, so I ifndef'd its reference and replaced it with a null pointer. Also, while mucking around in psy.c I assume that functions containing "anaylsis" were encode-only. Hope this helps, -Dave <p><p> -------------- next part -------------- A non-text attachment was scrubbed... Name: decode-only-patch Type: application/octet-stream Size: 1750 bytes Desc: decode-only-patch Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20030521/5855db28/decode-only-patch-0001.obj