[FFmpeg-devel] [PATCH] Fix compilation of FASTDIV() with llvm-gcc on x86_64

David Conrad lessen42
Mon Aug 2 19:24:08 CEST 2010


On Aug 2, 2010, at 10:20 AM, M?ns Rullg?rd <mans at mansr.com> wrote:

> M?ns Rullg?rd <mans at mansr.com> writes:
>
>> M?ns Rullg?rd <mans at mansr.com> writes:
>>
>>> David Conrad <lessen42 at gmail.com> writes:
>>>
>>>> On Jul 5, 2010, at 1:45 PM, M?ns Rullg?rd wrote:
>>>>
>>>>> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
>>>>>
>>>>>> On Mon, Jul 05, 2010 at 02:54:09PM +0100, Mans Rullgard wrote:
>>>>>>> LLVM requires matching input and output asm parameters to have  
>>>>>>> the
>>>>>>> same type.  For the FASTDIV macro, an (int) cast on the input  
>>>>>>> fixes
>>>>>>> this trivially.
>>>>>>
>>>>>> Uh, where is a different type than int used with FASTDIV?
>>>>>> I am not at all convinced those uses are really correct.
>>>>>
>>>>> vorbis_dec.c line 1329.
>>>>
>>>> This could be changed to int if it helps; neither operand is  
>>>> greater
>>>> than 24 bits unsigned.
>>>
>>> Making it a plain unsigned works.  I never understood why that  
>>> file is
>>> so obsessive with the _fast types.
>>
>> Do we want to fix this or not?
>>
>> diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c
>> index b3cc43f..1772e55 100644
>> --- a/libavcodec/vorbis_dec.c
>> +++ b/libavcodec/vorbis_dec.c
>> @@ -97,7 +97,7 @@ typedef struct {
>>     uint_fast16_t type;
>>     uint_fast32_t begin;
>>     uint_fast32_t end;
>> -    uint_fast32_t partition_size;
>> +    unsigned      partition_size;
>>     uint_fast8_t  classifications;
>>     uint_fast8_t  classbook;
>>     int_fast16_t  books[64][8];
>> @@ -655,7 +655,7 @@ static int vorbis_parse_setup_hdr_residues 
>> (vorbis_context *vc)
>>         if (res_setup->begin>res_setup->end ||
>>             res_setup->end > vc->avccontext->channels * vc- 
>> >blocksize[1] / (res_setup->type == 2 ? 1 : 2) ||
>>             (res_setup->end-res_setup->begin) / res_setup- 
>> >partition_size > V_MAX_PARTITIONS) {
>> -            av_log(vc->avccontext, AV_LOG_ERROR, "partition out of  
>> bounds: type, begin, end, size, blocksize: %"PRIdFAST16",  
>> %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32"\n",  
>> res_setup->type, res_setup->begin, res_setup->end, res_setup- 
>> >partition_size, vc->blocksize[1] / 2);
>> +            av_log(vc->avccontext, AV_LOG_ERROR, "partition out of  
>> bounds: type, begin, end, size, blocksize: %"PRIdFAST16",  
>> %"PRIdFAST32", %"PRIdFAST32", %u, %"PRIdFAST32"\n", res_setup- 
>> >type, res_setup->begin, res_setup->end, res_setup->partition_size,  
>> vc->blocksize[1] / 2);
>>             return -1;
>>         }
>
> And again nobody cares.  I'll apply this in 24 hours if nobody gives
> me a good reason not to.

Sorry, must have missed this
Unsigned instead of fast types is fine



More information about the ffmpeg-devel mailing list