[FFmpeg-devel] [PATCH] Bink file demuxer and audio decoder

Michael Niedermayer michaelni
Wed Jan 27 22:00:35 CET 2010


On Wed, Jan 27, 2010 at 10:14:40PM +1100, pross at xvid.org wrote:
> On Fri, Jan 22, 2010 at 10:49:42PM +0100, Michael Niedermayer wrote:
> > On Wed, Jan 20, 2010 at 09:15:24PM +1100, pross at xvid.org wrote:
> > > On Thu, Jun 25, 2009 at 12:11:54AM +0200, Diego Biurrun wrote:
> > > > On Sat, Jun 20, 2009 at 11:49:05PM +1000, Peter Ross wrote:
[...]
> > 
> > 
> > > +    short *samples_end  = (void*)((uint8_t*)data + *data_size);
> > 
> > the void cast looks strange in there
> 
> Updated patch enclosed.  Thanks for spotting these.
> 
> Should the decoder be called binkaudio{1,2} or binkaudio{rdft,dct} ?
> the 1 and 2 numbers were arbitrarily assigned by me.

iam in favor of strings over integers


[...]
> +
> +/**
> + * Decode Bink Audio block
> + * @param[out] out Output buffer (must contain s->block_size elements)
> + */
> +static void decode_block(BinkAudioContext *s, short *out, int use_dct)
> +{
> +    int ch, i, j, k;
> +    float q, quant[25];
> +    int width, coeff;
> +    GetBitContext *gb = &s->gb;
> +
> +    if (use_dct)
> +        skip_bits(gb, 2);
> +
> +    for (ch = 0; ch < s->channels; ch++) {
> +        FFTSample *coeffs = s->coeffs_ptr[ch];
> +        q = 0.0;
> +        coeffs[0] = get_float(gb);
> +        coeffs[1] = get_float(gb);
> +
> +        for (i = 0; i < s->num_bands; i++) {
> +            int value = get_bits(gb, 8);
> +            quant[i] = pow(10.0, FFMIN(value, 95) * 0.066399999);

you could use exp() here instead of pow with a different constant
exp() might be faster than pow()

except that ok


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- 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/20100127/cbd4ced5/attachment.pgp>



More information about the ffmpeg-devel mailing list