Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: FLAC encoder for arm cortex m4f with limited memory (Read 1248 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FLAC encoder for arm cortex m4f with limited memory

Hi

I have an application that would benefit from FLAC encoding (realtime microphone-to-sd-card recording).  However the microcontroller is a 100 MHz arm cortex m4f, and the memory size is not quite enough for FLAC encoding according to the official spec.  Is there a slightly lower-performance FLAC encoder with a smaller memory footprint ?

Bob

Re: FLAC encoder for arm cortex m4f with limited memory

Reply #1
There are a lot of FLAC decoders available, but only a few encoders.

How have you tried to get the reference encoder working? It is possible to strip quite a lot of parts, maybe that way it'll fit? Stripping the floating point parts is going to save a lot of memory for example.
Music: sounds arranged such that they construct feelings.

Re: FLAC encoder for arm cortex m4f with limited memory

Reply #2
Unless your tied to FLAC, WavPack might work for you. I created a tiny encoder a long time ago that should still be usable. It's used in Rockbox to this day (in fact I may have created it for that application) and encodes CD quality on far slower ARM processors than yours.

If that's still too much (the tiny encoder uses about 100 KBytes or so for code and data) I created another lossless compressor called SLAC that is very lightweight. The disadvantage of that is the files are not compatible with anything (there's not even really a file format, per se) but depending on your application that might not be an issue (it's lossless, so conversion could be done later off your device to something universal).

Re: FLAC encoder for arm cortex m4f with limited memory

Reply #3
Stripping the floating point parts is going to save a lot of memory for example.
Will it load so much into memory if invoked with -l0 -ss?

And how about your gloriously future-proof MS-DOS version?  ;)

Re: FLAC encoder for arm cortex m4f with limited memory

Reply #4
Thanks for the advice, I’ll look into all this.  Where might I find the ms-dos version?

Re: FLAC encoder for arm cortex m4f with limited memory

Reply #5
https://hydrogenaud.io/index.php/topic,123374.0.html

Edit: looking at that thread, I don't see any particular reason it should be any better or worse. There was some discussion on what had to be done to get it compatible with even older CPUs, but that was a hypothetical thing, I remembered wrong.

Re: FLAC encoder for arm cortex m4f with limited memory

Reply #6
I mean, how little memory we talking? Smaller frame sizes means less data to work with at a time, that could help.

Re: FLAC encoder for arm cortex m4f with limited memory

Reply #7
Thanks for the advice, I’ll look into all this.  Where might I find the ms-dos version?

I don't think using a retro MSDOS version as a starting point makes any sense when standard FLAC is already meant to run on embedded devices.

How little memory are you looking to use?