[FFmpeg-devel] [VA decode] [PATCH] calculation of next marker for MPEG-4 streams
anuj mittal
am.devel at gmail.com
Tue Oct 9 08:53:19 CEST 2012
On Tue, Oct 9, 2012 at 3:19 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Mon, Oct 08, 2012 at 07:59:04PM +0530, anuj mittal wrote:
>>
>>
>> end-=2;
>> p++;
>> - for(;p<end; p+=2){
>> - if(!*p){
>> - if (!p[-1] && p[1]) return p - 1;
>> - else if(!p[ 1] && p[2]) return p;
>
>> + if(s->resync_marker){
>
> this should be in a separet patch
Thanks. Attached is the patch.
>
>> + if(s->pict_type == FF_I_TYPE){
>> + for(;p<end; p+=2){
>> + if(!*p){
>> + if (!p[-1] && ((p[1] >> 7) == 1)) return p - 1;
>> + else if(!p[ 1] && ((p[2] >> 7) == 1)) return p;
>> + }
>> + }
>> + }
>> + else{ /* P, B or S type */
>> + unsigned int f_code = s->f_code;
>> +
>> + if(s->pict_type == FF_B_TYPE){
>> + if(f_code < s->b_code)
>> + f_code = s->b_code;
>> + }
>> +
>> + for(;p<end; p+=2){
>> + if(!*p){
>> + if (!p[-1] && ((p[1] >> (8 - f_code)) == 1)) return p - 1;
>> + else if (!p[ 1] && ((p[2] >> (8 - f_code)) == 1)) return p;
>> + }
>> + }
>
> using ff_mpeg4_get_video_packet_prefix_length() should allow this to
> be simplified
>
Yes, thank you for pointing me to it. Attached is the patch. Please comment.
Thank you.
Anuj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Check-for-the-resync_marker-based-on-vop-coding-type.patch
Type: application/octet-stream
Size: 1140 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121009/361cc9aa/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Check-resync-marker-only-when-enabled.patch
Type: application/octet-stream
Size: 2779 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121009/361cc9aa/attachment-0001.obj>
More information about the ffmpeg-devel
mailing list