[FFmpeg-devel] [PATCH] lavc/vaapi-vp9: add support for profile 2 (bpp > 8)

Ronald S. Bultje rsbultje at gmail.com
Tue Nov 29 05:11:31 EET 2016


Hi,

On Mon, Nov 28, 2016 at 7:26 PM, Mark Thompson <sw at jkqxz.net> wrote:

> On 28/11/16 21:22, Mathieu Velten wrote:
> > ---
> >  libavcodec/vaapi_vp9.c |  1 +
> >  libavcodec/vp9.c       | 32 +++++++++++++++++---------------
> >  libavcodec/vp9.h       |  1 +
> >  3 files changed, 19 insertions(+), 15 deletions(-)
>
> Nice :)
>
> Tested on Kaby Lake, works for me (woo 180fps 4K 10-bit decode).
>
> This should probably be split into two patches, though - one for the
> generic vp9 hwaccel support, a second then enabling it for VAAPI.
>
> > diff --git a/libavcodec/vaapi_vp9.c b/libavcodec/vaapi_vp9.c
> > index b360dcb..9b3e81a 100644
> > --- a/libavcodec/vaapi_vp9.c
> > +++ b/libavcodec/vaapi_vp9.c
> > @@ -38,6 +38,7 @@ static void fill_picture_parameters(AVCodecContext
>              *avctx,
> >      pp->first_partition_size = h->h.compressed_header_size;
> >
> >      pp->profile = h->h.profile;
> > +    pp->bit_depth = h->h.bpp;
> >
> >      pp->filter_level = h->h.filter.level;
> >      pp->sharpness_level = h->h.filter.sharpness;
> > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > index 0ec895a..ff526da 100644
> > --- a/libavcodec/vp9.c
> > +++ b/libavcodec/vp9.c
> > @@ -68,7 +68,7 @@ typedef struct VP9Context {
> >      ptrdiff_t y_stride, uv_stride;
> >
> >      uint8_t ss_h, ss_v;
> > -    uint8_t last_bpp, bpp, bpp_index, bytesperpixel;
> > +    uint8_t last_bpp, bpp_index, bytesperpixel;
> >      uint8_t last_keyframe;
> >      // sb_cols/rows, rows/cols and last_fmt are used for allocating all
> internal
> >      // arrays, and are thus per-thread. w/h and gf_fmt are synced
> between threads
> > @@ -258,7 +258,9 @@ static int update_size(AVCodecContext *ctx, int w,
> int h)
> >          if ((res = ff_set_dimensions(ctx, w, h)) < 0)
> >              return res;
> >
> > -        if (s->pix_fmt == AV_PIX_FMT_YUV420P) {
> > +        if (s->pix_fmt == AV_PIX_FMT_YUV420P ||
> > +            s->pix_fmt == AV_PIX_FMT_YUV420P10 ||
> > +            s->pix_fmt == AV_PIX_FMT_YUV420P12) {
> >  #if CONFIG_VP9_DXVA2_HWACCEL
> >              *fmtp++ = AV_PIX_FMT_DXVA2_VLD;
> >  #endif
>
> This is enabling it for DXVA2 and D3D11VA as well?  I'm guessing you
> probably didn't want to do that - I think it would be better with something
> more like <http://git.videolan.org/?p=ffmpeg.git;a=blob;f=
> libavcodec/hevc.c;hb=HEAD#l350>.


I'll let you guys figure out the details for this, but generic vp9.[ch]
changes are OK with me.

Thanks!
Ronald


More information about the ffmpeg-devel mailing list