HydrogenAudio

Lossy Audio Compression => MP3 => Topic started by: sreyan32 on 2020-03-17 08:03:17

Title: Writing your own mp3 decoder
Post by: sreyan32 on 2020-03-17 08:03:17
Not sure if this is the correct forum to ask about this.

How do you go about writing your own mp3 decoder ?

What are the resources that are out there for that ?

Can you please advise me on the starting points ?
Title: Re: Writing your own mp3 decoder
Post by: DVDdoug on 2020-03-17 08:26:41
LAME (https://lame.sourceforge.io/index.php) is both an encoder and decoder and the website says:
Quote
LAME is an educational tool to be used for learning about MP3 encoding.
Title: Re: Writing your own mp3 decoder
Post by: john33 on 2020-03-17 13:45:35
Not sure if this is the correct forum to ask about this.

How do you go about writing your own mp3 decoder ?

What are the resources that are out there for that ?

Can you please advise me on the starting points ?
The MAD decoder was always highly rated and is open source. You will find it and a lot of useful info and links here:

MAD Decoder (https://www.underbit.com/products/mad/)
Title: Re: Writing your own mp3 decoder
Post by: sreyan32 on 2020-03-17 14:24:35
Not sure if this is the correct forum to ask about this.

How do you go about writing your own mp3 decoder ?

What are the resources that are out there for that ?

Can you please advise me on the starting points ?
The MAD decoder was always highly rated and is open source. You will find it and a lot of useful info and links here:

MAD Decoder (https://www.underbit.com/products/mad/)

Where are you getting information about the encoding standard itself ?

I tried getting the actual standard from ISO, but its really expensive. Where do I get information about MP3 itself ?
Title: Re: Writing your own mp3 decoder
Post by: DVDdoug on 2020-03-17 15:19:55
This is beyond my programming abilities but I assume both LAME and MAD are well documented.   These kind of "bigger projects" are also usually team efforts. 

Inside The MP3 CODEC (http://www.mp3-converter.com/mp3codec/) has quite a bit of information, but probably not the nitty-gritty details you need.

MP3 Diags (http://mp3diags.sourceforge.net/) is another open source project that might be helpful.
Title: Re: Writing your own mp3 decoder
Post by: john33 on 2020-03-17 15:26:35
I can only echo the above.
Title: Re: Writing your own mp3 decoder
Post by: saratoga on 2020-03-17 17:27:43
Can you please advise me on the starting points ?

When I was starting out I went to a university library and borrowed a book on mpeg compression.  Once I was more comfortable with the basics, I started reading source code of existing decoders, which made a lot more sense once I understood what they were doing.   
Title: Re: Writing your own mp3 decoder
Post by: DVDdoug on 2020-03-17 20:11:19
I also had a link to The Theory Behind Mp3 (https://www.mp3-tech.org/programmer/docs/mp3_theory.pdf)
Title: Re: Writing your own mp3 decoder
Post by: sreyan32 on 2020-03-22 16:53:53
When I was starting out I went to a university library and borrowed a book on mpeg compression. 

Do you remember what book it was ? Can you please tell me the name ?
Title: Re: Writing your own mp3 decoder
Post by: sreyan32 on 2020-03-22 16:54:27
I also had a link to The Theory Behind Mp3 (https://www.mp3-tech.org/programmer/docs/mp3_theory.pdf)

This is really helpful as a starting point.
Title: Re: Writing your own mp3 decoder
Post by: sreyan32 on 2020-03-22 16:56:39
This is beyond my programming abilities but I assume both LAME and MAD are well documented.   These kind of "bigger projects" are also usually team efforts. 

Inside The MP3 CODEC (http://www.mp3-converter.com/mp3codec/) has quite a bit of information, but probably not the nitty-gritty details you need.

MP3 Diags (http://mp3diags.sourceforge.net/) is another open source project that might be helpful.

Good starting point. I wish I could have got my hands on the standard.
Title: Re: Writing your own mp3 decoder
Post by: MichaelF16 on 2023-01-22 13:00:51
Not sure if this is the correct forum to ask about this.

How do you go about writing your own mp3 decoder ?

What are the resources that are out there for that ?

Can you please advise me on the starting points ?

Great idea, did you manage to write it down?
Title: Re: Writing your own mp3 decoder
Post by: fooball on 2023-01-22 16:33:44
I tried getting the actual standard from ISO, but its really expensive. Where do I get information about MP3 itself ?
I realise this is a long-dead topic, but just my passing comments...

Yes, obtaining official standards is expensive because they are expensive to produce.  The industry bodies with an interest invest a great deal into researching and coming to agreement on a technical standard, and they want to protect that investment.  Having a standard is intended to ensure interoperability and wide consumer adoption, and anybody wishing to join that club has to stump up the cost of entry.  This applies to all manner of standards, not just MP3.

Anyone not working to the official standard is just guessing.  If third-party encoders/decoders happen to work, it's by trial and error and no guarantees.
Title: Re: Writing your own mp3 decoder
Post by: ktf on 2023-01-22 18:32:24
Yes, obtaining official standards is expensive because they are expensive to produce.  [...]  This applies to all manner of standards, not just MP3.
Not really. All IETF standards are free, and they are pretty high quality. HTTP, FTP, TCP, UDP, IPv4, IPv6, DHCP, SMTP, IMAP, RTP and hundreds of others are all free. But yes, most standards organisations choose to charge money for viewing those documents.
Title: Re: Writing your own mp3 decoder
Post by: MichaelF16 on 2023-01-24 21:05:28
I tried getting the actual standard from ISO, but its really expensive. Where do I get information about MP3 itself ?
I realise this is a long-dead topic, but just my passing comments...

Yes, obtaining official standards is expensive because they are expensive to produce.  The industry bodies with an interest invest a great deal into researching and coming to agreement on a technical standard, and they want to protect that investment.  Having a standard is intended to ensure interoperability and wide consumer adoption, and anybody wishing to join that club has to stump up the cost of entry.  This applies to all manner of standards, not just MP3.

Anyone not working to the official standard is just guessing.  If third-party encoders/decoders happen to work, it's by trial and error and no guarantees.
You're right and it's good that industries work this way. This ensures progress.
Title: Re: Writing your own mp3 decoder
Post by: MichaelF16 on 2023-01-25 22:58:52
By the way, today I read an article in the student magazine of my university, now there are several studies going on at the same time and maybe soon we will have a new format that will be easier to use.
Title: Re: Writing your own mp3 decoder
Post by: Porcus on 2023-01-26 08:27:55
By the way, today I read an article in the student magazine of my university, now there are several studies going on at the same time and maybe soon we will have a new format that will be easier to use.
What are you talking about? A new compressed audio format and someone about to write a press release claiming that "it is so much easier for you to play than MP3s" without even mentioning that none of the relevant playing applications are even considering to support it yet?