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

Michael Niedermayer michaelni
Sun Apr 20 19:05:58 CEST 2008

On Sun, Apr 20, 2008 at 06:40:20PM +0200, Lars T?uber wrote:
> 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)

I would just change the type of samples to void * in decode2

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

Yes, or uint8_t but one thing at a time, first lets try to get one other
sample format working.

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

Well, the idea is that the decoder should return its internal buffers
with no convertion, and these will either be int16 int32 or float.


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Thouse who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080420/5e0a0fa5/attachment.pgp>

More information about the ffmpeg-devel mailing list