Skip to content

mat-tso/MPEG2part3decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Yet another MPEG-2 Part 3 decoder

An attempt at an MPEG-2 Part 3 decoder in Rust.

This is a toy project, use at your own risk!

Supported layers

Roadmap

  1. Find a simple reference implementation
    • It should be in C and contain as few as possible assembly and no threading
    • It should have a compatible license
    • It should have a test suite
    • It should be simple to read and port (no assembly, no complex SIMD)
  1. Compile the reference implementation as submodule with Cargo
  2. Make the reference implementation callable from Rust (C2Rust?)
  3. Reimplement each component and compare with reference implementation

Layer I being so simple, a reference implementation may not be needed.

Personal goals

  • Learn Rust
  • Learn MP3 file format
  • Learn audio signal processing

Safety goals

  • Use safe Rust as much as possible
  • No explicit panic

Features

  • Dump MPEG-2 structure
  • Dump MPEG-2 packets
  • Output PCM

Test goals

  • 100% test coverage
  • Compare struct dump to reference
  • Compare packets dump to reference
  • PCM output is identical to reference excluding rounding errors
  • Stretch: Assembly generated never calls panic!

Reference should be generatable from fmprobe and ffmpeg.

Existing implementations

Implementation SIMD Layer License ISO Note
Jon Olick's [ ] I Public [?] archive
PDMP2 [ ] II Zlib [?]
mp3-decoder [ ] III GPL [ ]
minimp3 [X] All CC0 [X]
libmad [X] All GPL [X]
PDMP3 [ ] All? CC0 [?]
TwoLame [?] II LGPL [X] Encoder only

Interesting links

Releases

No releases published

Packages

No packages published