[FFmpeg-devel] [PATCH] ALS decoder

Michael Niedermayer michaelni
Mon Aug 24 03:00:44 CEST 2009


On Mon, Aug 24, 2009 at 12:26:11AM +0200, Thilo Borgmann wrote:
> 
> >> 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?

lets leave that code as is until the float stuff is impllemented then it
should be clearer what would happen

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20090824/5085d74e/attachment.pgp>



More information about the ffmpeg-devel mailing list