[FFmpeg-devel] [PATCH] ALAC Encoder

Ramiro Polla ramiro.polla
Sun Aug 17 16:17:27 CEST 2008


On Sun, Aug 17, 2008 at 10:15 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Aug 17, 2008 at 09:09:00AM +0530, Jai Menon wrote:
>> Hi,
>>
>> On Sunday 17 Aug 2008 8:05:14 am Michael Niedermayer wrote:
>> > On Sun, Aug 17, 2008 at 04:14:43AM +0530, Jai Menon wrote:
> [...]
>> > > +static void alac_stereo_decorrelation(AlacEncodeContext *s)
>> > > +{
>> > > +    int32_t *left = s->sample_buf[0], *right = s->sample_buf[1];
>> > > +    int32_t tmp;
>> > > +    int i;
>> > > +
>> > > +    for(i=0; i<s->avctx->frame_size; i++) {
>> > > +        tmp = left[i];
>> > > +        left[i] = (tmp + right[i]) >> 1;
>> > > +        right[i] = tmp - right[i];
>> > > +    }
>> > >
>> > > +    s->interlacing_leftweight = 1;
>> > > +    s->interlacing_shift = 1;
>> >
>> > i do not belive this is optimal
>> >
>>
>> It may not be optimal in the sense that I do not adaptively select the
>> decorrelation scheme, but this is just the first iteration which aims at
>> getting a basic encoder into svn. And it is better than doing no
>> deorrelation. I did initially try out an adaptive approach but the difference
>> in compression wasn't that great. I'm looking into how this can be done in a
>> better manner. Till then, I was hoping if we could go with this.
>
> see the pca.c/h i posted in a reply to ramiro a few days ago
> it might be worth a try ...

Speaking of that... I haven't finished integrating it in MLP (I'm
working on some other stuff atm), but it seems to be what I need.
Could you get it cleaned up and committed like you suggested?

> (and dont hesitate to ask if you have no clue
> on how to use it ...)

It took me some 4 hours or so to finally understand it =). Many thanks
to "Lindsay I. Smith" and her tutorial <
http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf
>

I attached my modified pca.[hc] that makes the TEST easier to
understand how this thing works (no changes on the actual pca code).

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pca.c
Type: text/x-csrc
Size: 6747 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080817/3f01fb75/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pca.h
Type: text/x-chdr
Size: 1155 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080817/3f01fb75/attachment.h>



More information about the ffmpeg-devel mailing list