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

Lars Täuber lars.taeuber
Sun Apr 20 18:40:20 CEST 2008

On Sun, 20 Apr 2008 14:17:52 +0200 Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Apr 20, 2008 at 10:44:16AM +0200, Lars T?uber wrote:
> > What do you think?
> That you are insane :)
> If <=16 bits are stored the decoder should output 16bits
> If  >16 <32 bits are stored the decoder should output 32bits
> If >32bits are stored the decoder should output float

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.
> 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.


More information about the ffmpeg-devel mailing list