[FFmpeg-devel] support for audio with sample resolution better than 16bit

Ian Caulfield ian.caulfield
Sun Apr 20 19:21:14 CEST 2008

On Sun, Apr 20, 2008 at 5:40 PM, Lars T?uber <lars.taeuber at gmx.net> wrote:
> Ok, my suggestion is to complicated. I see.
> When I understand this right you agree to a new function, e.g.
> int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx,
>                                              void *samples,
>                                              int *frame_size_ptr,
>                                              uint8_t *sample_res,
>                                              const uint8_t *buf, int buf_size)
> with samples being (int16_t*), (int32_t*) or (float*) depending on *sample_res and on AVCodecContext.sample_fmt ?
> In this case I'd suggest samples could be (int8_t*) too if *samples_res<=8.

Possibly bits_per_sample in AVCodec would be worth using instead of

> > The decoder sets AVCodecContext.sample_fmt to the format it outputs
> There are some resolutions missing. As far as I know gsm for instance has a resoltion of 13bits and flac is said (Wikipedia) to be able to contain every width from 4bits to 32bits fixed point.

I think the idea of sample_fmt is it represents the data type used to
store the data rather than the actual precision represented...


More information about the ffmpeg-devel mailing list