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

Michael Niedermayer michaelni at gmx.at
Mon Oct 22 16:46:54 CEST 2012


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?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- 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/20121022/9c8be82f/attachment.asc>


More information about the ffmpeg-devel mailing list