[FFmpeg-devel] [PATCH] ALS decoder
Thilo Borgmann
thilo.borgmann
Mon Aug 24 00:26:11 CEST 2009
>> Have I missed get_bits() supports random access?
>> As far as I can see, using get_bits() for the desired parsing would
>> require a copy of the GetBitContext for each iterative call an this
>> would be way too much overhead, I think. Am I wrong?
>
> hmm, no, lets leave this one, i cant see how it could be done cleanly
> either when i look more careully now, sorry
Ok.
>
> [...]
>>>> +static av_cold int decode_init(AVCodecContext *avctx)
>>>> ...
>>>> + if (sconf->floating) {
>>>> + avctx->sample_fmt = SAMPLE_FMT_FLT;
>>>> + avctx->bits_per_raw_sample = 32;
>>> why is this not set to 24 for simplifying that if(), i dont think
>>> bits_per_raw_sample has a meaning currently for floats but maybe i
>>> forgot something
>> I dont't care. Just consolidate yourselves.
>
> set it to the value that is most convenient, i think that is 24
> floats dont have 32 significnat bits anyway in terms of precission
In my opinion there are three issues with bits_per_raw_sample = 24:
a) Conformance files using float define ALSSpecificConfig.resolution = 3
(32-bit). Consistency?
b) Writing output samples in decode_frame() uses either 16 or 32 bit for
the final output sample. Having bits_per_raw_sample == 24 would need
another way of determining the output format. This would add another if
which this "= 24" shall remove.
c) In read_var_block(), reading the first value of a ra_block would also
have to be rewritten. This would move the awful if to that position.
So I really think the more convenient solution is to stick to one awful
if construct and "= 32".
Really do it?
-Thilo
More information about the ffmpeg-devel
mailing list