[FFmpeg-devel] [PATCH] alac.c cleanup (was ALAC question)

Vitor Sessak vitor1001
Wed Jul 18 03:39:08 CEST 2007


Hi

Michael Niedermayer wrote:
> Hi

[...]

> 
> 
> ok, sorry, ive looked at an old checkout by misstake, the patch is ok then

Applied. The last chunk of Matthieu's patch (attached) unifies the mono 
and stereo decoding (one is basically a copy of the other). Actually, in 
the code

switch(channels) {
case 1:
	{ mono_code }
  	break;
case 2:
	{ stereo code }
	break;
}

I've cut { mono_code } and { stereo code } to separated files and diffed 
them (attached too), so you can see they're actually the same thing. The 
only modification is that alac->setinfo_sample_size is replaced by 
readsamplesize in the mono code. But readsamplesize is:

readsamplesize = alac->setinfo_sample_size - (wasted_bytes * 8) + 
channels - 1;

Since wasted_bytes != 0 is unsupported (one comment in the code says it 
has something to do with files with more than 2 audio channels), 
readsamplesize and alac->setinfo_sample_size should be identical in mono 
files.

I tested with both mono and stereo files and the decoded result are 
identical before and after the patch.

-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mono_stereo.diff
Type: text/x-patch
Size: 7740 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070718/a352ad24/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alac5_p2.diff
Type: text/x-patch
Size: 7909 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070718/a352ad24/attachment-0001.bin>



More information about the ffmpeg-devel mailing list