[FFmpeg-devel] [PATCH] Add CRC check to ALS decoder

Thilo Borgmann thilo.borgmann
Mon Jun 14 15:28:48 CEST 2010


Am 14.06.10 14:18, schrieb M?ns Rullg?rd:
> Thilo Borgmann <thilo.borgmann at googlemail.com> writes:
> 
>> 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.
> 
> What do you mean?  I posted a patch adding a 16-bit block bswap to
> dsputil.  Once that is applied, you can use it.
> 

I meant there is an if() in my patch that checks for 16-bit. Assuming
that you wanted me to use the already existing 32bit version for
anything else than the 16/24-bit case (the case for 16 bit to be created).

If there will be a 16-bit bswap_buf() in dsputil, it will make the code
even more efficient. And I've seen your patch submission to the list now
and I can surely wait for it to be committed to include it in a new
revision of this patch.

Thanks for the hint!
-Thilo



More information about the ffmpeg-devel mailing list