[FFmpeg-devel] [VA decode] [PATCH] calculation of next marker for MPEG-4 streams

Michael Niedermayer michaelni at gmx.at
Tue Oct 9 16:53:06 CEST 2012


On Tue, Oct 09, 2012 at 07:13:16PM +0530, anuj mittal wrote:
> On Tue, Oct 9, 2012 at 5:21 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Tue, Oct 09, 2012 at 12:23:19PM +0530, anuj mittal wrote:
> >> 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:
> >>
> >> ---
> >>  lib/ffmpeg/libavcodec/ituh263dec.c |    5 +++--
> >>  1 files changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/lib/ffmpeg/libavcodec/ituh263dec.c b/lib/ffmpeg/libavcodec/ituh263dec.c
> >> index 4678287..bb8ca56 100644
> >
> >> --- a/lib/ffmpeg/libavcodec/ituh263dec.c
> >> +++ b/lib/ffmpeg/libavcodec/ituh263dec.c
> >
> > these patches dont apply cleanly with "git am"
> 
> Sorry about that. The attached ones should apply cleanly.
> 
> >
> >> @@ -217,10 +217,11 @@ const uint8_t *ff_h263_find_resync_marker(MpegEncContext *s, const uint8_t *rest
> >>      end-=2;
> >>      p++;
> >>      if(s->resync_marker){
> >
> >> +        int f_code = ff_mpeg4_get_video_packet_prefix_length(s);
> >
> > this is the prefix length and not the f code
> 
> Corrected.
> 
> >
> >
> >>          for(;p<end; p+=2){
> >>              if(!*p){
> >> -                if     (!p[-1] && p[1]) return p - 1;
> >> -                else if(!p[ 1] && p[2]) return p;
> >> +                if      (!p[-1] && ((p[1] >> (f_code-9)) == 1)) return p - 1;
> >> +                else if (!p[ 1] && ((p[2] >> (f_code-9)) == 1)) return p;
> >
> > if the prefix length is > 16  this would do (byte >> 8) == 1 or rather
> > 0 == 1
> >
> > also please make sure the code is tested with a file that does have
> > resync markers
> >
> 
> Thanks for pointing out the flaw in the logic. The prefix length
> should be between 16 and 22. Checking for correct number of zeroes
> now.
> 
> Change tested with a resync marker stream.

patches applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121009/c8406c7e/attachment.asc>


More information about the ffmpeg-devel mailing list