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

Guillaume Poirier gpoirier
Wed Jun 20 14:13:25 CEST 2007


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;
}
---------->%------------------

It won't compile with:
gcc test.c -std=c99 -ansi -pedantic -c -o /tmp/test.o

GCC will say:
test.c: In function 'func':
test.c:2: warning: ISO C forbids omitting the middle term of a ?:
expression


It will, however, compile with:
gcc test.c -std=c99 -ansi -c -o /tmp/test.o

Guillaume




More information about the ffmpeg-devel mailing list