[FFmpeg-devel] [PATCH] Add CRC check to ALS decoder
Thilo Borgmann
thilo.borgmann
Mon Jun 14 12:16:36 CEST 2010
Am 13.06.10 19:51, schrieb M?ns Rullg?rd:
>> + // update CRC
>> + if (sconf->crc_enabled && avctx->error_recognition >= FF_ER_CAREFUL) {
>> + int swap = HAVE_BIGENDIAN != sconf->msb_first;
>> +
>> + #define CONVERT_OUTPUT(bps) \
>> + { \
>> + int##bps##_t *src = (int##bps##_t*) data; \
>> + int##bps##_t *dest = (int##bps##_t*) ctx->crc_buffer; \
>> + for (sample = 0; \
>> + sample < ctx->cur_frame_length * avctx->channels; \
>> + sample++) \
>> + *dest++ = bswap_##bps (src[sample]); \
>> + }
>
> Use bswap_buf from dsputil after adding a 16-bit version.
There already is a 16-bit case. Swapping with this new function is
untested now, so it would be great if someone could test it on a big
endian arch again (Carl Eugen?)
>> +#if HAVE_BIGENDIAN
>> + COND_MALLOC(!sconf->msb_first);
>> +#else
>> + COND_MALLOC( sconf->msb_first);
>> +#endif
>
> sconf->msb_first != HAVE_BIGENDIAN
Yes, like Justin also said.
All done in revision 3.
Thanks,
Thilo
More information about the ffmpeg-devel
mailing list