From patchwork Tue Oct 24 04:37:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 44343 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1b28:b0:15d:8365:d4b8 with SMTP id ch40csp1829553pzb; Mon, 23 Oct 2023 21:37:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgDTq+hDj6x2qFveCHbF1OptCNm2RXAvKO/DybVqLn99M3I6rrCUqxJOtOUnaU0LU/tG2z X-Received: by 2002:a05:6402:520b:b0:53d:a4e5:67d0 with SMTP id s11-20020a056402520b00b0053da4e567d0mr9342239edd.13.1698122233541; Mon, 23 Oct 2023 21:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698122233; cv=none; d=google.com; s=arc-20160816; b=frLGRG3nCeQ60v9T/DMUdRA7PWZgT4JCcDrLlXTL5526dyQPXJnB7kuw3l4QsKhVf0 5sae0fAmviC663y7/gvAZn5kfPkTAFLTGhZ/GehDyad3Rr3e9FeUAmE02YsXE3cLbzTg CELRM+lWKJ5P2yddtui4c9t1hBbxI75ha8ZmeHZ7L6xkJmg7Mq2tD9sFd7FkmStC47TN zFL48GtmZ5dXBYANPnAIA/qxEpBfjXyLMzzaQMuXIOc5BL52a+kFKOa8VZh/yzA+pM0z BpOCxuvv43WciHXsMjCwoza2Qq/fdBfj/fWp7bboEn63V3H55Q5vmvJBzwDwgoVIG9Cd PDkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:to:from:date:dkim-signature:delivered-to; bh=XbtorCJvr/cN3nfMkxF6GPJJ5dX7eLymyam4wyUYJZM=; fh=Q46kXK7oI5D1Jhi90JBr53c7NIaTxGaU4KPeRZyM/hI=; b=kp+Wmjfx1+P468puaXjsO39VZ+ExcrEV5Gd1d336zHrt4Cer7rUeDIuC66tH1YhuYt jVaPapqQgLJ7GEzJV9W4FPDKAITOVZmaLZblVSkfIZi0tz7JnbQBvxmKNuptUlW9ILSA aoOx6y0lGn85DpUEGuFycTZoupaQHAwsu79mTlTBsN8VJdlHZV3dEanZzrL0uhB/SZ4t xMPKuLDSwOQNieTgkmkd0FtLcB9dPIBThxDHzBKCXngI+TaEoxeeXzzcIEelCyqpN1V7 TDSYy28wexPRTBZGXTMK8ukyLJVcn/lOOxkV5gSFyB5bWqWXKsqii8kDgCNMpK4boiZ3 7goA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b=2FcaUwxQ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dz11-20020a0564021d4b00b0053ec694f5e0si4087222edb.574.2023.10.23.21.37.13; Mon, 23 Oct 2023 21:37:13 -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=@lynne.ee header.s=s1 header.b=2FcaUwxQ; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 259B468C9C4; Tue, 24 Oct 2023 07:37:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C183F680B12 for ; Tue, 24 Oct 2023 07:37:03 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 6779E10602D1 for ; Tue, 24 Oct 2023 04:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1698122223; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=Eth3aOUKT2UPD5G+LMFLhhV/Q6yjA0kpUI92W25FAOw=; b=2FcaUwxQHTxU/o4+60C/LLsGOjDCfkYCTiJM2tR8IbFJsjtNU2QCJmdS9+tPHATC bciaIiGlrnVKVqU8A7ovaVVxN1s76RPQUaPlKJvbXugBFoedEjPZwULxlSvNup9L4Mu m+C8XMoy5ElD5jBWT20mqZoK3bj3FsXZWgdLxcO288IS3BF3CE5+cTL1yYQzNzVlJCy mUDHtI/5n0EDkoFTDzxHO0TQhiGa+ditFjCvTfMjk9mvDGltoYQQm4uRy661EUrx0X0 RrowwGQWOPIJKDSmVzPzL4S5wiTCvgyPUwwusG40D5RbttTnwPEfRqCZmgQrP7fd+Fe 0raCuqidTA== Date: Tue, 24 Oct 2023 06:37:03 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] vulkan_decode: use coded_width/height instead of the non-coded width and h 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: Kdh5njlZFTI1 Fixes several samples. There may be issues with cropping, but so far, I have not found any in my samples set. Patch attached. From b928053158ec5f63d3c07a9daa9b802cb9229858 Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 24 Oct 2023 06:33:07 +0200 Subject: [PATCH] vulkan_decode: use coded_width/height instead of the non-coded width and height Fixes several samples. There may be issues with cropping, but so far, I have not found any in my samples set. --- libavcodec/vulkan_decode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index e6a0646139..3b9576c0a9 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -872,10 +872,10 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ " separate_references" : ""); /* Check if decoding is possible with the given parameters */ - if (avctx->width < caps->minCodedExtent.width || - avctx->height < caps->minCodedExtent.height || - avctx->width > caps->maxCodedExtent.width || - avctx->height > caps->maxCodedExtent.height) + if (avctx->coded_width < caps->minCodedExtent.width || + avctx->coded_height < caps->minCodedExtent.height || + avctx->coded_width > caps->maxCodedExtent.width || + avctx->coded_height > caps->maxCodedExtent.height) return AVERROR(EINVAL); if (!(avctx->hwaccel_flags & AV_HWACCEL_FLAG_IGNORE_LEVEL) && @@ -1027,8 +1027,8 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) frames_ctx->user_opaque = prof; frames_ctx->free = free_profile_data; - frames_ctx->width = avctx->width; - frames_ctx->height = avctx->height; + frames_ctx->width = avctx->coded_width; + frames_ctx->height = avctx->coded_height; frames_ctx->format = AV_PIX_FMT_VULKAN; hwfc->format[0] = vkfmt; @@ -1224,8 +1224,8 @@ int ff_vk_decode_init(AVCodecContext *avctx) dpb_frames = (AVHWFramesContext *)ctx->dpb_hwfc_ref->data; dpb_frames->format = s->frames->format; dpb_frames->sw_format = s->frames->sw_format; - dpb_frames->width = s->frames->width; - dpb_frames->height = s->frames->height; + dpb_frames->width = avctx->coded_width; + dpb_frames->height = avctx->coded_height; dpb_hwfc = dpb_frames->hwctx; dpb_hwfc->create_pnext = (void *)ff_vk_find_struct(ctx->s.hwfc->create_pnext, -- 2.42.0