[FFmpeg-devel] [PATCH]Packed B-frames vs VDPAU. part 2

Michael Niedermayer michaelni
Tue Mar 2 01:13:08 CET 2010


On Mon, Mar 01, 2010 at 11:28:39PM +0100, Carl Eugen Hoyos wrote:
> Hi!
>
> When trying to decode packed B-frames with VDPAU, libavcodec currently 
> passes wrong buf and buf_size to the library.
>
> Please comment, Carl Eugen

>  h263dec.c |   11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 24a03831d44c04501fdfb2d58329e850b3d29029  patchpacked2.diff
> Index: libavcodec/h263dec.c
> ===================================================================
> --- libavcodec/h263dec.c	(revision 22131)
> +++ libavcodec/h263dec.c	(working copy)
> @@ -337,6 +337,8 @@
>      MpegEncContext *s = avctx->priv_data;
>      int ret;
>      AVFrame *pict = data;
> +    const uint8_t *vdpau_buf;
> +    int vdpau_bufsize;
>  
>  #ifdef PRINT_FRAME_TIME
>  uint64_t time= rdtsc();
> @@ -378,8 +380,13 @@
>  
>      if(s->bitstream_buffer_size && (s->divx_packed || buf_size<20)){ //divx 5.01+/xvid frame reorder
>          init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size*8);
> -    }else
> +        vdpau_buf = s->bitstream_buffer;
> +        vdpau_bufsize = s->bitstream_buffer_size;
> +    }else{
>          init_get_bits(&s->gb, buf, buf_size*8);
> +        vdpau_buf = buf;
> +        vdpau_bufsize = buf_size;
> +    }
>      s->bitstream_buffer_size=0;
>  
>      if (!s->context_initialized) {
> @@ -618,7 +625,7 @@
>          return -1;
>  
>      if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
> -        ff_vdpau_mpeg4_decode_picture(s, buf, buf_size);
> +        ff_vdpau_mpeg4_decode_picture(s, vdpau_buf, vdpau_bufsize);
>          goto frame_end;
>      }

any reason why you dont use the buffer/size from s->gb ?
also the start_frame call below looks like it needs a similar upgrade

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- 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/20100302/63090abb/attachment.pgp>



More information about the ffmpeg-devel mailing list