[FFmpeg-devel] [PATCH] start code detection for hardware decode in mpeg4/divx streams

Michael Niedermayer michaelni at gmx.at
Thu Nov 22 03:49:43 CET 2012


On Fri, Nov 09, 2012 at 03:58:01PM +0530, anuj mittal wrote:
> On Mon, Oct 22, 2012 at 8:16 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Mon, Oct 22, 2012 at 02:30:56PM +0530, anuj mittal wrote:
> >> On Fri, Oct 19, 2012 at 7:23 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> > On Fri, Oct 19, 2012 at 12:36:53PM +0530, anuj mittal wrote:
> >>
> >> >>
> >> >>  void ff_clean_h263_qscales(MpegEncContext *s);
> >> >>  int ff_h263_resync(MpegEncContext *s);
> >> >> -const uint8_t *ff_h263_find_resync_marker(MpegEncContext *s, const uint8_t *p, const uint8_t *end);
> >> >> +const uint8_t *ff_h263_find_marker(MpegEncContext *s, const uint8_t *p, const uint8_t *end);
> >> >
> >> > static h263_find_slice_end()
> >> >
> >> > and the renaming should be in a seperate patch
> >>
> >> Attached.
> >>
> >> >
> >> >
> >> >>  int ff_h263_get_gob_height(MpegEncContext *s);
> >> >>  void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);
> >> >>
> >> >> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> >> >> index 7141d49..0557fa4 100644
> >> >> --- a/libavcodec/h263dec.c
> >> >> +++ b/libavcodec/h263dec.c
> >> >> @@ -169,10 +169,20 @@ static int decode_slice(MpegEncContext *s){
> >> >>      ff_set_qscale(s, s->qscale);
> >> >>
> >> >>      if (s->avctx->hwaccel) {
> >> >> +        int ret;
> >> >> +
> >> >>          const uint8_t *start= s->gb.buffer + get_bits_count(&s->gb)/8;
> >> >> -        const uint8_t *end  = ff_h263_find_resync_marker(s, start + 1, s->gb.buffer_end);
> >> >> +        const uint8_t *end  = ff_h263_find_marker(s, start + 1, s->gb.buffer_end);
> >> >>          skip_bits_long(&s->gb, 8*(end - start));
> >> >> -        return s->avctx->hwaccel->decode_slice(s->avctx, start, end - start);
> >> >> +        ret = s->avctx->hwaccel->decode_slice(s->avctx, start, end - start);
> >> >> +
> >> >
> >> >> +        /* Next frame detected */
> >> >> +        if (end <= s->gb.buffer_end-2){
> >> >> +            if (!end[0] && !end[1] && (end[2] == 1)){
> >> >> +                s->mb_y = s->mb_height;
> >> >> +            }
> >> >> +        }
> >> >
> >> > that searches for a next startcode not a next frame
> >>
> >> Right.. had forgotten to change that comment. Attached is the correct
> >> version. Thank you.
> >
> > I think the patches are ok
> >
> > As this patchset is about VAAPI basically, gwenole can you take a
> > look too?
> 
> ping

hmm, as theres no reply from gwenole :(

can you explain how the bug and fix can be reproduced, so i can
test it before applying ?
which player, command line and hardware do i need to test this ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- 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/20121122/c2e6efc8/attachment.asc>


More information about the ffmpeg-devel mailing list