[FFmpeg-devel] [RFC] Monkey's Audio decoder

Vitor Sessak vitor1001
Mon Sep 10 22:09:54 CEST 2007


Hi

Kostya wrote:
> Here's Monkey's Audio decoder made from libdemac by Benjamin Zores
> and made working by me.
> 
> Please comment on decoder/demuxer structure
> (ape.c is demuxer, apedec.c is decoder).

Some nitpicking...

in apedec.c:
> 
>     uint8_t *data;
>     uint8_t *data_end;
>     uint8_t *ptr;
> } APEContext;
> 
> #define FP_TO_INT(x,y) ((x + (1 << (y - 1))) >> y);     /* round(x) */

This is used only once, could be an inline function

> 
>     p->XlastA = 0;
> }
> 
> /* Return 0 if x is zero, -1 if x is positive, 1 if x is negative */
> #define SIGN(x) (x) ? (((x) > 0) ? -1 : 1) : 0

Maybe M_SIGN would be a better name, it looks like more to be -SIGN(x)...

in ape.c:
> static int ape_read_close(AVFormatContext * s)
> {
>     return 0;
> }

I found this rather ugly. I really don't know how ffmpeg api work, but 
can't just set the field in ape_demuxer to NULL instead?

-Vitor




More information about the ffmpeg-devel mailing list