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

Måns Rullgård mans
Wed Jun 20 11:32:46 CEST 2007


Andreas ?man wrote:
> Hi
>
> Benoit Fouet wrote:
>> Hi Andreas,
>>
>> Andreas ?man wrote:
>>> Index: libavcodec/h264.c
>>> ===================================================================
>>> --- libavcodec/h264.c	(revision 9371)
>>> +++ libavcodec/h264.c	(working copy)
>>> @@ -1392,6 +1392,7 @@
>>>  static uint8_t *decode_nal(H264Context *h, uint8_t *src, int *dst_length,
>>> int *consumed, int length){
>>>      int i, si, di;
>>>      uint8_t *dst;
>>> +    int bufidx;
>>>
>>>  //    src[0]&0x80;                //forbidden bit
>>>      h->nal_ref_idc= src[0]>>5;
>>> @@ -1420,8 +1421,9 @@
>>>          return src;
>>>      }
>>>
>>> -    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.

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




More information about the ffmpeg-devel mailing list