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

Diego Biurrun diego
Wed Jan 14 12:03:52 CET 2009


On Wed, Jan 14, 2009 at 02:39:28AM -0600, Daniel Verkamp wrote:
> 
> Attached are patches to add a Bink file demuxer and Bink audio
> decoder, plus support for Bink audio in Smacker files.
> 
> I also tested the samples at http://samples.mplayerhq.hu/game-formats/bink/ :
> 
> - ATI/* has various chunks of files; appending the
> --append.this.to.complete.bik to the end of the un-suffixed file
> produces the full video, which works;

IOW, these should be merged back together, right?

> the .x file is just another truncated part of the video

Truncated part of which video exactly?

> --- /dev/null
> +++ b/libavcodec/dct.c
> @@ -0,0 +1,39 @@
> +#include "dsputil.h"
> +#include "fft4g.h"

license header

> +    s->nbits = nbits;
> +    s->inverse = inverse;
> +    s->w = av_malloc(sizeof(double) * n * 5 / 4);
> +    s->data_dbl = av_malloc(sizeof(double) * n);

This could be aligned.

> --- /dev/null
> +++ b/libavcodec/rdft.c
> @@ -0,0 +1,39 @@
> +#include "dsputil.h"
> +#include "fft4g.h"

license header

> +    s->nbits = nbits;
> +    s->inverse = inverse;
> +    s->w = av_malloc(sizeof(double) * n / 2);
> +    s->data_dbl = av_malloc(sizeof(double) * n);

alignment

> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -310,6 +310,7 @@ enum CodecID {
>      CODEC_ID_MP1,
> +    CODEC_ID_BINKAUDIO,

Why not just BINK instead of BINKAUDIO?

> --- /dev/null
> +++ b/libavcodec/binkaudio.c
> @@ -0,0 +1,285 @@
> +// from wmadata.h

Ahem :)

> +        sample_rate *= avctx->channels;
> +        s->frame_len *= avctx->channels;

alignment

> +    s->overlap_len = s->frame_len / 16;
> +    sample_rate_half = (sample_rate + 1) / 2;
> +    s->root = 2.0 / sqrt(s->frame_len);

ditto

> +static int binkaudio_decode_frame(AVCodecContext *avctx, void *outdata, int *outdata_size, const uint8_t *buf, int buf_size)

Maybe you could shorten such long lines..

> +AVCodec binkaudio_decoder = {
> +    "binkaudio",

see above, bink vs. binkaudio

> --- /dev/null
> +++ b/libavformat/bink.c
> @@ -0,0 +1,254 @@
> +/*
> + * Bink file Demuxer

demuxer

Documentation and changelog updates are missing from your patches.

Diego




More information about the ffmpeg-devel mailing list