[MPlayer-dev-eng] Questions About Audio Decoding

Arpi arpi at thot.banki.hu
Fri Dec 21 18:01:07 CET 2001


Hi,

> 	There's an audio decoder I'd like to implement (number 0x62). I
> believe that it's pretty similar to IMA4 ADPCM. First off, is IMA4 data
> stored in AVI/ASF/MOV blocks with any kind of header at the start of the
> blocks? Or does the decoder just take the first byte of the first block
> and start decoding?
afair ima4 has few bytes special hardware. it was reverse engineered by
xanim author.

> 	I understand that audio is stored different than video. Video
> blocks typically contain a single discrete video frame. Audio chunks, from
> what I've seen in AVI/ASF files, tend to be stored in constant-size
> blocks, say 0x8000.
audio usually a continous stream, usually at constant bitrate.
codecs usually can sync, recognize block headers (mpeg, ac3), or simply
doesn't have blocks at all, like pcm and *law codecs.
some codecs work wiht fixed-size blocks, for example divx audio.
size of blocks is in the WAVEFORMATEX header then.
some codecs are variable bitrate (currently only mp3), and it reads chunks
instead of continous stream.

> 	I've been looking at IMA4 decoding. The decoder routine calls
> demux_read_data(). Does this routine read a certain number of bytes out of
> the audio stream, regardless of whether the read would cross block
> boundaries in the file on disk?
you can either use demyx_read_packet() to get a whole chunk, or use
demux_read_data() to get requested number of bytes. in later case, it will
continue at next chunk, if current chunk doesn't have enough bytes.
(it's for stream-like codecs, like pcm)

ps :i'm working on yuy2 support to cvid...

A'rpi / Astral & ESP-team

--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu



More information about the MPlayer-dev-eng mailing list