[FFmpeg-devel] [PATCH V3 2/2] avcodec: add av1 VAAPI decoder

Wang, Fei W fei.w.wang at intel.com
Fri Oct 2 17:46:51 EEST 2020


> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of James
> Almer
> Sent: Wednesday, September 30, 2020 1:10 AM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH V3 2/2] avcodec: add av1 VAAPI decoder
> 
> On 9/9/2020 12:39 AM, Fei Wang wrote:
> > +static int vaapi_av1_decode_slice(AVCodecContext *avctx,
> > +                                  const uint8_t *buffer,
> > +                                  uint32_t size) {
> > +    const AV1DecContext *s = avctx->priv_data;
> > +    VAAPIDecodePicture *pic = s->cur_frame.hwaccel_picture_private;
> > +    VASliceParameterBufferAV1 slice_param;
> > +    uint32_t offset;
> > +    int err = 0;
> > +
> > +    for (int i = s->tg_start; i <= s->tg_end; i++) {
> > +        memset(&slice_param, 0, sizeof(VASliceParameterBufferAV1));
> > +        offset = s->tile_group_info[i].tile_offset;
> > +
> > +        slice_param = (VASliceParameterBufferAV1) {
> > +            .slice_data_size = s->tile_group_info[i].tile_size,
> > +            .slice_data_offset = 0,
> > +            .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
> > +            .tile_row = s->tile_group_info[i].tile_row,
> > +            .tile_column = s->tile_group_info[i].tile_column,
> > +            .tg_start = s->tg_start,
> > +            .tg_end = s->tg_end,
> > +        };
> > +
> > +        err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &slice_param,
> > +                                                sizeof(VASliceParameterBufferAV1),
> > +                                                buffer + offset,
> 
> Could this be simplified by setting slice_param.slice_data_offset to
> s->tile_group_info[i].tile_offset, and passing buffer here alone?

Applied to V4, thanks for your comments.

> 
> > +                                                s->tile_group_info[i].tile_size);
> > +        if (err) {
> > +            ff_vaapi_decode_cancel(avctx, pic);
> > +            return err;
> > +        }
> > +    }
> > +
> > +    return 0;
> > +}
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email ffmpeg-devel-request at ffmpeg.org
> with subject "unsubscribe".


More information about the ffmpeg-devel mailing list