[FFmpeg-devel] [PATCH] h264 bitstream filter

Benoit Fouet benoit.fouet
Fri Aug 31 12:11:03 CEST 2007


Benoit Fouet wrote:
> M?ns Rullg?rd wrote:
>   
>> This is wrong.  Maybe you misunderstood what I said about where to
>> insert SPS and PPS.
>>     
>
> it seems so...
>
>   
>>   They should be added before the first type 5 NAL
>> unit of an IDR picture, after whatever SEI or AUD units that picture
>> has.  A multislice IDR picture only needs SPS and PPS before the first
>> slice, and non-IDR pictures should not have SPS or PPS added.
>>
>>   
>>     
>
> i'm not sure i get it, here is what i understood, please correct me if
> i'm wrong
> i receive NALU in the filter
> if it's the first coded slice of an IDR picture (type 5 NAL), i prepend
> sps and pps NALUs (i don't really have to care about SEI or AUD in the
> bitstream filter case, right?)
> else, i don't add sps and pps
>
> this would give, in pseudo code:
>
> if (not sps and pps data)
>   retrieve sps and pps
>   first_idr=1
>
> if (first_idr && nal_unit_type == 5)
>   prepend sps and pps
>   first_idr=0
> else
>   don't prepend sps and pps
>   if( nal_unit_type != 5)
>   

when i think about it, i'd put:
if (nal_unit_type == 1) instead...

>     first_idr=1
>
> is this right ?
>   

-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list