[Libav-user] QTKit -> Libav: has it ever been done?

Brad O'Hearne brado at bighillsoftware.com
Wed Mar 27 21:24:59 CET 2013

On Mar 27, 2013, at 1:08 PM, Paul B Mahol <onemda at gmail.com> wrote:
> Than use AV_SAMPLE_FMT_FLTP, you do not need to manually interleave samples.
> Each channel samples are put into separate frame->data[X] where X is channel
> number starting from 0.

Hey thanks for the idea, Paul, I'll give it a shot! The resampling will still be converting floats to signed 16-bits, so I am very interested in exactly the conversion that is taking place here. I would think it shouldn't be just casting or truncating, it should be scaling the sample value based on the available storage space. Given 32-bit to 16-bit conversion, and that: 

Signed 16-bit (I'm assuming integral) = From −32,768 to 32,767, or from −(2^15) to 2^15 − 1


32-bit float = (I'm just going to post a Wikipedia link here for brevity, but a float has one bit for sign, 8 bits for exponent, and 23 bits for float data): http://en.wikipedia.org/wiki/Single-precision_floating-point_format

So I'm curious -- how is libswresample converting from float to signed 16-bit?



More information about the Libav-user mailing list