[Ffmpeg-devel] [RFC] More PCM formats (was: [PATCH] demuxer for dcinema audio)
Michael Niedermayer
michaelni
Fri Sep 2 01:02:36 CEST 2005
Hi
On Fri, Sep 02, 2005 at 12:08:11AM +0200, Reimar D?ffinger wrote:
[...]
>
> > > uninitalized bytes are not acceptable, they could messup the regression
> > > tests
> >
> > The best way I could thing of was unfortunately doing
> > if (bps > 2) memset(dst, 0, ...).
>
> Did it like that.
> Awaiting another round of comments.
please use 4 space indention / keep indention consistant within each file
[...]
> + short **samples, uint8_t **dst, int n) {
> + if (bps > 2)
> + memset(*dst, 0, n * bps);
> + if (le) *dst += bps - 2;
> + for(;n>0;n--) {
> + register int v = *(*samples)++;
> + if (us) v += 0x8000;
> + (*dst)[le] = v >> 8;
> + (*dst)[1 - le] = v & 0xff;
isnt the & 0xff redundant here?
[...]
> + for (i = 0; i < 16; i++) {
> + tmp2 <<= 1;
> + tmp2 |= (tmp & 1);
> + tmp >>= 1;
> + }
should be ff_reverse[tmp>>8] + (ff_reverse[tmp&0xFF]<<8)
[...]
--
Michael
More information about the ffmpeg-devel
mailing list