From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 38ED14379C for ; Thu, 28 Jul 2022 16:24:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C62C868B9B1; Thu, 28 Jul 2022 19:23:57 +0300 (EEST) Received: from mx0a-0060ff01.pphosted.com (mx0a-0060ff01.pphosted.com [205.220.162.71]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 46AD768B748 for ; Thu, 28 Jul 2022 19:23:51 +0300 (EEST) Received: from pps.filterd (m0240442.ppops.net [127.0.0.1]) by mx0b-0060ff01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26SGLBUT014296 for ; Thu, 28 Jul 2022 11:23:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mru.medical.canon; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=mru.medical.canon.01.04.2021; bh=xy68nkF7eKTqQakqu4L/aIZku1CQIcd/EciDhErcmyE=; b=H++abvYf191tH9FQ2mHCXEl/zOIfrjVMft4FIACL+Mm8RPIEhEO94/cO+JZVKW4J7qrT 0bbb+/n1qiqOUanSqDmNlr7mT/lAuODEurnWzYoiElyRKoAGn9uqKVilmjYRrV0oZHHO g3xUFxPxoX7ma7AcSmhJPAC9W1bHmk15pefgvQa6Gjm3FjQ3iUw3uQFTrtThXnp312Yq p1izet+gXT5yhNbWzYtAlIP03jw7tBH2jh5yShw+no9VIcBbuIy4Xm/lZd/uix0dCjsG 0iLxaFdK0fIUsJPwvgRGaxUszI15QXHr6E9bgT1zWrOPUj5oovMxLOb2kpDIQb+4jCNF PA== Received: from chiexc3.tmriusa.com (dns1.vancepublishing.com [199.48.74.5] (may be forged)) by mx0b-0060ff01.pphosted.com (PPS) with ESMTPS id 3hgd9vhfkj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 28 Jul 2022 11:23:47 -0500 Received: from CHIEXC3.TMRIUSA.COM (172.16.2.234) by CHIEXC3.TMRIUSA.COM (172.16.2.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.9; Thu, 28 Jul 2022 11:23:42 -0500 Received: from CHIEXC3.TMRIUSA.COM ([172.16.2.234]) by CHIEXC3.TMRIUSA.COM ([172.16.2.234]) with mapi id 15.02.1118.009; Thu, 28 Jul 2022 11:23:42 -0500 From: To: Thread-Topic: [PATCH] Allow exporting of RGB and BGR images to CUDA. Thread-Index: AdiTDPLP8QxaiQmES6622Aqz0u0eDAPkSh+w Date: Thu, 28 Jul 2022 16:23:42 +0000 Message-ID: <52a392ec033c4aecb6387ae59aa6f16f@MRU.MEDICAL.CANON> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.32.109] MIME-Version: 1.0 X-CrossPremisesHeadersFilteredBySendConnector: CHIEXC3.TMRIUSA.COM X-OrganizationHeadersPreserved: CHIEXC3.TMRIUSA.COM X-Proofpoint-ORIG-GUID: wiN1C-_oe74XJlOKTa4KR4Yvd_Lh3K3k X-Proofpoint-GUID: wiN1C-_oe74XJlOKTa4KR4Yvd_Lh3K3k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-28_06,2022-07-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 clxscore=1015 impostorscore=0 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207280074 Subject: Re: [FFmpeg-devel] [PATCH] Allow exporting of RGB and BGR images to CUDA. 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > -----Original Message----- > From: ffmpeg-devel On Behalf Of > dpeeters@MRU.MEDICAL.CANON > Sent: Friday, July 8, 2022 4:51 PM > To: ffmpeg-devel@ffmpeg.org > Subject: [EXTERNAL] [FFmpeg-devel] [PATCH] Allow exporting of RGB and > BGR images to CUDA. > > Use the step size when calculating the number of channels to allow for more > than two channels per plane. This allows the use of AV_PIX_FMT_0BGR32 > when using av_hwframe_transfer_data to transfer data from a Vulkan frame > to a CUDA frame. > > Signed-off-by: David Peeters > --- > libavutil/hwcontext_vulkan.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c > index 237caa4bc0..05e8fc5268 100644 > --- a/libavutil/hwcontext_vulkan.c > +++ b/libavutil/hwcontext_vulkan.c > @@ -2992,6 +2992,8 @@ static int > vulkan_export_to_cuda(AVHWFramesContext *hwfc, > const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(hwfc- > >sw_format); > VulkanDevicePriv *p = ctx->internal->priv; > FFVulkanFunctions *vk = &p->vkfn; > + int max_pixsteps[4]; > + int max_pixstep_comps[4]; > > AVHWFramesContext *cuda_fc = (AVHWFramesContext*)cuda_hwfc- > >data; > AVHWDeviceContext *cuda_cu = cuda_fc->device_ctx; @@ -3001,6 > +3003,8 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc, > CUarray_format cufmt = desc->comp[0].depth > 8 ? > CU_AD_FORMAT_UNSIGNED_INT16 : > CU_AD_FORMAT_UNSIGNED_INT8; > > + av_image_fill_max_pixsteps(max_pixsteps, max_pixstep_comps, desc); > + > dst_f = (AVVkFrame *)frame->data[0]; > > dst_int = dst_f->internal; > @@ -3023,7 +3027,9 @@ static int > vulkan_export_to_cuda(AVHWFramesContext *hwfc, > .arrayDesc = { > .Depth = 0, > .Format = cufmt, > - .NumChannels = 1 + ((planes == 2) && i), > + .NumChannels = desc->comp[max_pixstep_comps[i]].depth > 8 > + ? max_pixsteps[i] / 2 > + : max_pixsteps[i], > .Flags = 0, > }, > .numLevels = 1, > -- > 2.36.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://urldefense.com/v3/__https://ffmpeg.org/mailman/listinfo/ffmpeg- > devel__;!!Ai2CFrZnFhI!6NGwn- > Nv1AZn7qfPlMbwKHeDqU79spui_ApfLibprH2k3cVnA6ayxejFpL_xrg- > 8adz1jY9btFkZrg33AWLLDsXfE_uWCpvx$ > > To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org > with subject "unsubscribe". Ping. Are there any changes needed for this? _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".