[FFmpeg-devel] [PATCH] add 32bits output format to the flac decoder

Mathieu Velten matmaul
Sun Dec 7 19:49:55 CET 2008

2008/12/7 Justin Ruggles <justin.ruggles at gmail.com>:
> If you move shift and offset_per_sample to the FLACContext you can just
> set them once at the start of encoding instead of for every frame, along
> with avctx->bits_per_raw_sample.  It would also make ffmpeg report s32
> as the sample type instead of s16 when appropriate.  A good place to do
> this would be in ff_flac_parse_streaminfo().
I am not sure that is a good idea, the specs specifies that the bps
can change every frame.

> +                    *(int32_t *)samples = s->decoded[i][j] << shift;
after thinking a little the (int32_t *) cast could be problematic
because of the endianess when 16 bits output is used.
if anyone can confirm, I am not familiar with endianness problems.

Mathieu Velten

More information about the ffmpeg-devel mailing list