[FFmpeg-devel] [PATCH] h264: rbsp de-escape and data partitioning..

Måns Rullgård mans
Wed Jun 20 14:42:15 CEST 2007


Guillaume Poirier wrote:
> Hi,
>
> M?ns Rullg?rd wrote:
>> Andreas ?man wrote:
>>> Hi
>>>
>>> Benoit Fouet wrote:
>>>> Hi Andreas,
>>>>
>>>> Andreas ?man wrote:
>
>>>>> -    h->rbsp_buffer= av_fast_realloc(h->rbsp_buffer, &h->rbsp_buffer_size,
>>>>> length);
>>>>> -    dst= h->rbsp_buffer;
>>>>> +    bufidx = h->nal_unit_type == NAL_DPC ? 1 : 0; // use second escape
>>>>> buffer for inter data
>>>>>
>>>> i think the "? 1 : 0" is not needed
>>> They are not indeed, but i tend to keep such things in for
>>> clarity
>>
>> I keep them out for clarity.  If you don't think it's clear without them,
>> go back and read your K&R once more.
>>
>
> This is NOT pedantic valid C:
>
> try to compile:
> ----------%<------test.c------
> int func() {
>         return 1?:0;
> }
> ---------->%------------------

Nobody suggested using that silly gcc-ism.  The debate is over "foo == bar"
vs "foo == bar? 1: 0".  Both evaluate to exactly the same thing, the former
is less cluttered.

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




More information about the ffmpeg-devel mailing list