EALayer3: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
Line 1: Line 1:
EALayer3 is a codec derived from MPEG-1 Audio. It exists in 2 known variants, EL31 and L32P.
EALayer3 is a codec derived from MPEG-1 Audio. It exists in 2 known variants, EL31 and L32P.
EL31 files have the following header:
EL31 files have the following header for each granule:


  8 bits - nonzero value here indicates the presence of uncompressed samples at the end of the granule.
  8 bits - nonzero value here indicates the presence of uncompressed samples at the end of the granule.
Line 17: Line 17:
  channels * uncompressed * 16 bits - uncompressed PCM samples
  channels * uncompressed * 16 bits - uncompressed PCM samples


L32P files have the following header:
L32P files have the following header for each granule:
  1 bit - there is an extended header
  1 bit - there is an extended header
  1 bit - unknown
  1 bit - unknown

Latest revision as of 18:43, 26 August 2010

EALayer3 is a codec derived from MPEG-1 Audio. It exists in 2 known variants, EL31 and L32P. EL31 files have the following header for each granule:

8 bits - nonzero value here indicates the presence of uncompressed samples at the end of the granule.
2 bits - MPEG version
2 bits - MPEG sample rate index
2 bits - MPEG channel mode
2 bits - MPEG mode extension
1 bit - which granule
if granule is 1 and version is 3 (MPEG 1.0):
channels * 4 bits - MPEG scfsi
MPEG side info beginning after scfsi for each channel
MPEG data
if there are uncompressed samples
32 bits - number of uncompressed sample frames
32 bits - offset in the outputted granule these samples go
channels * uncompressed * 16 bits - uncompressed PCM samples

L32P files have the following header for each granule:

1 bit - there is an extended header
1 bit - unknown
2 bits - unused
12 bits - total granule size including this small header and uncompressed samples
if extended header:
2 bits - mode
10 bits - sample frames to discard (mode == 0) or skip (mode == 1 or 2) before outputting the uncompressed samples
10 bits - number of uncompressed sample frames at the end of the granule
10 bits - granule size (can be zero)
end extended header
2 bits - MPEG version
2 bits - MPEG sample rate index
2 bits - MPEG channel mode
2 bits - MPEG mode extension
1 bit - which granule
if granule is 1 and version is 3 (MPEG 1.0):
channels * 4 bits - MPEG scfsi
MPEG side info beginning after scfsi for each channel
MPEG data
if there are uncompressed samples
channels * uncompressed * 16 bits - uncompressed PCM samples

Other Electronic Arts games use EALayer3 audio inside other container formats but the details of that variant of the codec is not described here.

Code (under the BSD license) to decode EALayer3 audio can be found here