[FFmpeg-devel] [PATCH] ALS decoder

Michael Niedermayer michaelni
Sun Aug 23 05:39:05 CEST 2009


On Sat, Aug 22, 2009 at 06:29:52PM -0400, Justin Ruggles wrote:
> Thilo Borgmann wrote:
> 
> >>> +    int rlslms;               ///< use RLS-LMS predictor: 1 = on, 0 = off
> >> RLSMLS?
> >> no i did not read the spec ...
> > It is correct as it is.
> 

> I think he means, what is rlslms?

exactly and sorry for beig unclear


> 
> So your comment should say Recursive Least Square-Least Mean Square
> instead of RLS-LMS.

ok, iam not entirely sure what it is from that term but i canguess the
direction i guess ...


> 
> >>> +/** Converts PARCOR coefficient k to direct filter coefficient.
> >>> + */
> >>> +static void parcor_to_lpc(unsigned int k, int64_t *par, int64_t *cof)
> >>> +{
> >>> +    int i;
> >>> +    int64_t tmp1, tmp2;
> >>> +
> >>> +    for (i = 0; i < (k+1) >> 1; i++) {
> >>> +        tmp1 = cof[    i    ] + ((par[k] * cof[k - i - 1] + (1 << 19)) >> 20);
> >>> +        tmp2 = cof[k - i - 1] + ((par[k] * cof[    i    ] + (1 << 19)) >> 20);
> >>> +        cof[k - i - 1] = tmp2;
> >>> +        cof[    i    ] = tmp1;
> >>> +    }
> >>> +
> >>> +    cof[k] = par[k];
> >>> +}
> >> doesnt look entirely unfamiliar, dont some of our other audio codecs have
> >> something that can be used? (no i dont know which, i would have to RTFS too)
> > RTFS for me too and RTFM about other audio codecs... anyone?
> 
> The only thing I could find is a function in ra144.c that converts
> reflection coefficients to lpc coefficients, but it seems to be very
> codec-specific.  This function is also very codec-specific because the
> ALS spec defines a bit-exact transformation between the 20-bit quantized
> PARCOR and LPC coefficients.  This is required in order for it to be
> lossless.

i see, still at least the declarations could be moved in the loop
and f course if something can be done about the 64bit that would be great
speedwise ...


> 
> 
> >>> +
> >>> +    if (const_block) {
> >>> +        unsigned int const_val_bits;
> >>> +
> >>> +        if (sconf->resolution == 2 || sconf->floating)
> >>> +            const_val_bits = 24;
> >>> +        else
> >>> +            const_val_bits = avctx->bits_per_raw_sample;
> >> why would const_val_bits != avctx->bits_per_raw_sample ?
> > bits_per_raw_sample = 32 for floating sconf->floating.
> 
> To explain this further... The way floating-point in ALS works is that
> it has a 24-bit integer part and a floating-point difference part.  So
> the final output is 32-bit, even though the integer part decoded here is
> only 24-bit.

the sconf->resolution == 2 still is useless?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090823/b739b9bf/attachment.pgp>



More information about the ffmpeg-devel mailing list