From patchwork Sat Apr 13 19:06:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 48049 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:670b:b0:1a9:af23:56c1 with SMTP id wh11csp980410pzb; Sat, 13 Apr 2024 12:06:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9G5UDrKNhhDk6BASHiZh/ZdQClMqmIoHWCR5yR33W5sPzaTfNxWet0DXi3EnKVmyprAy59lpPHkDM+na51eemcvRXp7ugbqQmRw== X-Google-Smtp-Source: AGHT+IEqSoL8Q5mP5deoGQe0DW/IMp3ZBbPJ4gzJe+gbBCDkYC7ZwHwbx2Cv2TNhPQ6Riufy70yE X-Received: by 2002:a50:d49c:0:b0:56c:1735:57a2 with SMTP id s28-20020a50d49c000000b0056c173557a2mr5291681edi.31.1713035203807; Sat, 13 Apr 2024 12:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713035203; cv=none; d=google.com; s=arc-20160816; b=D11YhYTFDsD0clYXDacspKH3bDs3IwDOQ88J8t1fK5+UFSGjPYx2zEZVsWu2BheTkU 2uOacGBXpWOSSf2xFUF7g0Sx4QjTAKz8lF25QbTPTZvwxpiDkU52Bj/YjuddZX6csMwA NaPM9hu2wCNYRWOgRK6ECJv4X9KUGpaEyS8oQwIEnGAnmZEX9Pj3Kv6fyPMcGhKLFM6S iJ86GMsvsdYzU41gAsLNobVn2STYSHFzLNZOe/Ct1oNPAZwCP2f0DY/vpCKzi4tsFmo2 MQhr0Ti0SdMyPeFpb7sB7IfPvy3+Hbj47M8OT2NwmwmOMNuRYhfeEf8KCl75DIcwzgvZ SAQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:in-reply-to:references:to:from:content-language :user-agent:mime-version:date:message-id:dkim-signature:delivered-to; bh=GAxJ7Wjv8A9TyRTYUSeEzj7OItOT51EKZppEmG1XfBU=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=cCZ7pqBeFuYYqM3DkJhR8RT9u7iJIxkUWZ1KMdpJtIKHvGmNvTmgF6JBN6y7X+B/MR u30LqEDuk0fqp3C1rym6eRok3MIJtWwPX1hWyr7VXB5Lj/LEbkjb9X7lIZPei8dumglm aUtX90TrHSQCafZ2WDhW4IZwdhyIte5Sk3RAIzGDKrQRKEBgMPNXCoo4hMbS7dChFRvL aYGpoYAWJsi/tVgZQ/tR7chteihu4X3Y+1fQuAgAdJsovqaYFWygynr3fiVu45kvkukX 0GXPNeLlssWm5C4UbZWeynNs9BoGVSLl1ldo+YLdMB+EsyuMEC9NUzV6eCYaeC/ztHYA Homw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20230601.gappssmtp.com header.s=20230601 header.b=20Mo3OOq; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m19-20020a50d7d3000000b0056e09e70426si3016142edj.6.2024.04.13.12.06.43; Sat, 13 Apr 2024 12:06:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20230601.gappssmtp.com header.s=20230601 header.b=20Mo3OOq; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6075468D34F; Sat, 13 Apr 2024 22:06:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC4A168D0CE for ; Sat, 13 Apr 2024 22:06:35 +0300 (EEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4183072951eso3018565e9.2 for ; Sat, 13 Apr 2024 12:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1713035195; x=1713639995; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GmFNdXeekgBHoZBzXzJ+33H6q6sjgRwpk/uH72ZmUbU=; b=20Mo3OOqQZWJ4KG+UuJzAZbj4QifFji0Wh2SeEsjyRHvirl6R6d74zDcPjoFng0XBf 83OtAPkSxB4BXWysUtOQsDbO733T6YdBC6F0+XRYk76dVThL/9U0J7oDmqs6MFWwdGyE KH6r2NXEqtBwVrQQyDEvqtonZ6Wm/v6IIwNH27V8Y1mveht/Q5tr5Zyku4xNBH9Z/XRg c0DvbJp5YmZx+iv13JXIrshRuoOZRnFJ++2dnAdSs+HzJ2/hRW3vvAIqYNTcQGB+DapH jDg4pfaMgYQ04Z3zgQw9CO5TyvlzS5Dk0YZEDe9t+To6w403/17FTFnIiHFPMu9jYN+n vPiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713035195; x=1713639995; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GmFNdXeekgBHoZBzXzJ+33H6q6sjgRwpk/uH72ZmUbU=; b=Qlq2og+E+63hNPITe/NgpD4xo1dIsgnyy2dVDg5AspMqUicqKGGZ/dS/x9mBQ+Aj36 v6xmoi1lXKiWppMF1+eua8YWrzwzOLMUj1Ne9wclH7IOUsqZJ7zGNbshpRLOJqPUC6kj BwEZTqZ9TacpZeHLodWYbvad4nEkoYyB0in86m8xO1FF0BjqU8xC+do/XU03fXL19XuS PVupsKpFZQvB2moQihLE1ffjxz9LNHiEopbADzlWAYgrQ3OzHqhpbGBu3Car1Zsd7kEq tJdFhrhMKow9P/CTVMNCwcPAgBCMQJhTrfKiLr8/TRA9dNZv15A1N3lqPzeaIj35U1yL J++Q== X-Gm-Message-State: AOJu0YzXsxZZ9FQQxe85/0L51aD1PR66ffVskuF7qAhHxS0B4WEBsQGC Z4NVuZjCY3H3gpHf413CdNv1BAnLUx/+zYY+VzJTiggGvafXOsSM2WhwVdIQvV423AgoELM7KSx Y X-Received: by 2002:a05:600c:1d08:b0:416:a44e:5f70 with SMTP id l8-20020a05600c1d0800b00416a44e5f70mr5844701wms.30.1713035194638; Sat, 13 Apr 2024 12:06:34 -0700 (PDT) Received: from [192.168.0.15] (cpc92302-cmbg19-2-0-cust1183.5-4.cable.virginm.net. [82.1.212.160]) by smtp.gmail.com with ESMTPSA id l14-20020a5d560e000000b00343cc702c56sm7153036wrv.47.2024.04.13.12.06.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Apr 2024 12:06:34 -0700 (PDT) Message-ID: <59cc87d5-df14-44fc-b7e4-a5e6728ab478@jkqxz.net> Date: Sat, 13 Apr 2024 20:06:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Mark Thompson To: FFmpeg development discussions and patches References: <610f344b-28e7-40f7-ac13-112069a72563@jkqxz.net> In-Reply-To: <610f344b-28e7-40f7-ac13-112069a72563@jkqxz.net> Subject: [FFmpeg-devel] [PATCH v2 2/2] lavc/vulkan_av1: Use av1dec reference order hint information X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dKunE68Mwa/d --- Changes over v1: fix the OrderHints field as well; move things into the loop over reference names rather than the loop over reference slots. libavcodec/vulkan_av1.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c index c9e398eaec..fcc9a4f03b 100644 --- a/libavcodec/vulkan_av1.c +++ b/libavcodec/vulkan_av1.c @@ -76,7 +76,7 @@ static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, StdVideoDecodeAV1ReferenceInfo *vkav1_std_ref, VkVideoDecodeAV1DpbSlotInfoKHR *vkav1_ref, /* Goes in ^ */ const AV1Frame *pic, int is_current, int has_grain, - int *saved_order_hints) + const uint8_t *saved_order_hints) { FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; AV1VulkanDecodePicture *hp = pic->hwaccel_picture_private; @@ -242,7 +242,6 @@ static int vk_av1_start_frame(AVCodecContext *avctx, const AV1RawFrameHeader *frame_header = s->raw_frame_header; const AV1RawFilmGrainParams *film_grain = &s->cur_frame.film_grain; - CodedBitstreamAV1Context *cbs_ctx = (CodedBitstreamAV1Context *)(s->cbc->priv_data); const int apply_grain = !(avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && film_grain->apply_grain; @@ -272,7 +271,7 @@ static int vk_av1_start_frame(AVCodecContext *avctx, ap->ref_frame_sign_bias_mask = 0x0; for (int i = 0; i < STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME; i++) - ap->ref_frame_sign_bias_mask |= cbs_ctx->ref_frame_sign_bias[i] << i; + ap->ref_frame_sign_bias_mask |= pic->ref_frame_sign_bias[i] << i; for (int i = 0; i < STD_VIDEO_AV1_REFS_PER_FRAME; i++) { const int idx = pic->raw_frame_header->ref_frame_idx[i]; @@ -294,7 +293,7 @@ static int vk_av1_start_frame(AVCodecContext *avctx, err = vk_av1_fill_pict(avctx, &ap->ref_src[ref_count], &vp->ref_slots[ref_count], &vp->refs[ref_count], &ap->std_refs[ref_count], &ap->vkav1_refs[ref_count], - ref_frame, 0, 0, cbs_ctx->ref[idx].saved_order_hints); + ref_frame, 0, 0, ref_frame->order_hints); if (err < 0) return err; @@ -491,8 +490,14 @@ static int vk_av1_start_frame(AVCodecContext *avctx, } } - for (int i = 0; i < STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME; i++) + for (int i = 0; i < STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME; i++) { + ap->std_pic_info.OrderHints[i] = pic->order_hints[i]; ap->loop_filter.loop_filter_ref_deltas[i] = frame_header->loop_filter_ref_deltas[i]; + ap->global_motion.GmType[i] = s->cur_frame.gm_type[i]; + for (int j = 0; j < STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS; j++) { + ap->global_motion.gm_params[i][j] = s->cur_frame.gm_params[i][j]; + } + } for (int i = 0; i < STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS; i++) { ap->cdef.cdef_y_pri_strength[i] = frame_header->cdef_y_pri_strength[i]; @@ -501,14 +506,6 @@ static int vk_av1_start_frame(AVCodecContext *avctx, ap->cdef.cdef_uv_sec_strength[i] = frame_header->cdef_uv_sec_strength[i]; } - for (int i = 0; i < STD_VIDEO_AV1_NUM_REF_FRAMES; i++) { - ap->std_pic_info.OrderHints[i] = frame_header->ref_order_hint[i]; - ap->global_motion.GmType[i] = s->cur_frame.gm_type[i]; - for (int j = 0; j < STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS; j++) { - ap->global_motion.gm_params[i][j] = s->cur_frame.gm_params[i][j]; - } - } - if (apply_grain) { for (int i = 0; i < STD_VIDEO_AV1_MAX_NUM_Y_POINTS; i++) { ap->film_grain.point_y_value[i] = film_grain->point_y_value[i];