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

Måns Rullgård mans
Mon Jun 14 15:34:34 CEST 2010


Thilo Borgmann <thilo.borgmann at googlemail.com> writes:

> 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.

Don't let it hold up your patch for too long though.  It has huge
bikeshed potential...

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list