[FFmpeg-devel] atrac1 decoder and aea demuxer rev 6
Michael Niedermayer
michaelni
Thu Sep 10 11:33:53 CEST 2009
On Thu, Sep 10, 2009 at 10:27:21AM +0200, Benjamin Larsson wrote:
> Michael Niedermayer wrote:
>>> + /* low band */
>>> + bsm_tmp = get_bits(gb, 2);
>>> + if (bsm_tmp & 1)
>>> + return -1;
>>> + bsm[IDX_LOW_BAND] = 2 - bsm_tmp;
>>> +
>>> + /* middle band */
>>> + bsm_tmp = get_bits(gb, 2);
>>> + if (bsm_tmp & 1)
>>> + return -1;
>>> + bsm[IDX_MID_BAND] = 2 - bsm_tmp;
>>>
>>
>> for(2)
>>
>>
> IMO this makes the code less clear but I'll change it if you insist.
i think i would prefer for()
[...]
>>> + /* Magic is '00 08 00 00' in Little Endian*/
>>> + if(AV_RL32(p->buf)==0x800) {
>>> + int bsm_s, bsm_e, inb_s, inb_e;
>>> + bsm_s = p->buf[2048];
>>> + inb_s = p->buf[2048+1];
>>> + inb_e = p->buf[2048+210];
>>> + bsm_e = p->buf[2048+211];
>>> +
>>> +
>>> + /* Check so that the redundant bsm bytes and info bytes are
>>> valid
>>> + * the block size mode bytes have to be the same
>>> + * the info bytes have to be the same
>>> + * the block size mode and info byte can't be the same
>>> + */
>>> + if ((bsm_s == bsm_e) && (inb_s == inb_e) && (bsm_s != inb_s))
>>>
>>
>> the () are useless
>> also this can be simplified to
>> a= AV_RL16()
>> b= AV_RL16()
>> if(a == bswap16(b) && a != b)
>>
>
> Well IMO that is obfuscation. But if you insist.
i dont insist ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No great genius has ever existed without some touch of madness. -- Aristotle
-------------- 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/20090910/0eff7767/attachment.pgp>
More information about the ffmpeg-devel
mailing list