[FFmpeg-devel] [PATCH] deprecate SAMPLE_FMT_S24

Ramiro Polla ramiro.polla
Sun Aug 17 16:19:38 CEST 2008


On Sun, Aug 17, 2008 at 10:57 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Aug 17, 2008 at 03:32:30PM +0200, Aurelien Jacobs wrote:
>> Peter Ross wrote:
>>
>> > This patch flags SAMPLE_FMT_S24 as deprecated.
>>
>> So what will happen if a user suply a 32-bits pcm sample and re-encode
>> it with a supposedly lossless encoder which only support 24-bits ?
>> There is no way to tell the user that the encoding won't be lossless.
>> There is also no way for the 24-bits encoder to apply dithering to
>> 32-bits samples (it would mess-up the real 24-bits samples stored in
>> 32-bits).
>> Also, what happens if you transcode a 24-bits sample to wav (pcm) ?
>> The "encoder" will have no way to know that it's a 24-bits sample
>> and will store it as 32-bits. This is a huge waste of bytes.
>>
>> IMO, SAMPLE_FMT_S24 is useful, even if it's treated internally the
>> exact same way as SAMPLE_FMT_S32. This allows encoders to behave
>> more sensibly if desired.
>
> and 20bit 22bit 18bit ...
>
> I think a field in AVCodecContext that simply contains the number of
> bits in there would be more flexible.

That was the intention of pross' patch about the user passing
parameters through bits_per_field.




More information about the ffmpeg-devel mailing list