
Minimp3 – Minimalistic, single-header library for decoding MP3 - lieff
https://github.com/lieff/minimp3
======
userbinator
Looks like it was inspired by
[http://keyj.emphy.de/minimp3/](http://keyj.emphy.de/minimp3/) and
[https://keyj.emphy.de/kjmp2/](https://keyj.emphy.de/kjmp2/) , always good to
see more people trying to implement multimedia codecs. The theory behind it
all is not easy to understand, but in practice it turns into a bunch of
arithmetic and table lookups.

That said, this one being floating-point and requiring intrinsics makes it
less portable.

~~~
lieff
You absolutely correct, it's indeed inspired by Keyj`s minimp3. Float-point
used because it's hard do with 4-byte fixed-point type and achieve ISO
conformance. We must to use different dynamic ranges for different parts of
decoder (i.e. emulate own floating point) or more than 4-byte fixed-point
type. Only float-point support is needed, SSE/NEON intrinsics is not required
and can be fully disabled by MINIMP3_NO_SIMD.

------
laveur
I wonder if this is small enough and performant enough to run on an Arduino.
Or does it rely heavily on Intel instructions?

~~~
twtw
It looks like it's fast because it makes use of x86 and arm SIMD extensions,
but you could probably get the scalar version to run on an arduino with some
effort. It would likely be slow, though.

If you are looking at arduino audio applications, I would suggest either using
a MP3 codec asic or pre-decoding to wav and compensating by using larger
storage.

------
vortico
This is really cool and educational! How difficult is encoding relative to
decoding?

~~~
lieff
Encoders usually harder, because, for example, you can't verify it using
reference vectors (there no exact reference to compare with). Also encoders
like h264 contains big part of decoder as well, because it must reconstruct
encoded frame internally for motion compensation.

------
rundell1x
Let me download mp3 files from the internet and run them through a completely
new and untested parser and decoder. That sounds like a great plan.

~~~
agnsaft
Shouldnt really be a problem unless those mp3s have malicious code for that
particular decoder

