[FFmpeg-devel] [PATCH] HWAccel infrastructure (take 7.3)

Michael Niedermayer michaelni
Tue Feb 24 20:10:43 CET 2009


On Tue, Feb 24, 2009 at 08:03:39PM +0100, Gwenole Beauchesne wrote:
> Le 24 f?vr. 09 ? 19:40, Michael Niedermayer a ?crit :
> 
> >> @@ -160,8 +170,12 @@ static int decode_slice(MpegEncContext *s){
> >>
> >>     ff_set_qscale(s, s->qscale);
> >>
> >> -    if (s->avctx->hwaccel)
> >> -        return 0;
> >> +    if (s->avctx->hwaccel) {
> >> +        const uint8_t *start, *end;
> >> +        start = s->gb.buffer + get_bits_count(&s->gb)/8;
> >> +        end   = ff_h263_find_resync_marker(start + 1, s- 
> >> >gb.buffer_end);
> >> +        return s->avctx->hwaccel->decode_slice(s->avctx, start,  
> >> end - start);
> >> +    }
> >>
> >>     if(s->partitioned_frame){
> >>         const int qscale= s->qscale;
> >
> > rejected, this does a useless double scan also its more messy than  
> > needed.
> 
> Would it be OK to skip_bits(slice_size * 8)? Or what is your suggested  
> way?

skip_bits_long() is ok
but make sure that whatever is used to find the next slice / end is using
the byte based code


> 
> >> @@ -616,6 +630,11 @@ retry:
> >>     if(MPV_frame_start(s, avctx) < 0)
> >>         return -1;
> >>
> >> +    if (avctx->hwaccel) {
> >> +        if (avctx->hwaccel->start_frame(avctx, s->gb.buffer, s- 
> >> >gb.size_in_bits/8) < 0)
> >> +            return -1;
> >> +    }
> >> +
> >> #ifdef DEBUG
> >>     av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale);
> >> #endif
> >
> > its buf/buf_size
> 
> even when we get here again through the retry: label?

i think so


> 
> >> @@ -1644,6 +1654,12 @@ static int mpeg_field_start(MpegEncContext  
> >> *s){
> >>                 }
> >>             }
> >>     }
> >> +
> >> +    if (avctx->hwaccel) {
> >> +        if (avctx->hwaccel->start_frame(avctx, NULL, 0) < 0)
> >> +            return -1;
> >> +    }
> >> +
> >> // MPV_frame_start will call this function too,
> >> // but we need to call it on every field
> >>     if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
> >
> > NULL, 0 looks wrong
> 
> There is not that much info available otherwise. If I move down the  
> start_frame() back into decode_chunks(), are we guaranteed that the  
> buf/buf_size is complete frame? decode_chunks() can be called from  
> extradata buffer.

there will be no frame in extradata, just some headers that then would
be missing from every gop/keyframe

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090224/5efd68dd/attachment.pgp>



More information about the ffmpeg-devel mailing list