From patchwork Wed May 15 01:56:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogender Gupta X-Patchwork-Id: 13117 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id C725344848D for ; Wed, 15 May 2019 04:56:47 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A020B68A0C1; Wed, 15 May 2019 04:56:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 98DEC68A08B for ; Wed, 15 May 2019 04:56:40 +0300 (EEST) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 14 May 2019 18:56:44 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 14 May 2019 18:56:38 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 14 May 2019 18:56:38 -0700 Received: from HQMAIL110.nvidia.com (172.18.146.15) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 15 May 2019 01:56:37 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by hqmail110.nvidia.com (172.18.146.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 15 May 2019 01:56:37 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.57) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 15 May 2019 01:56:37 +0000 Received: from BL0PR12MB2482.namprd12.prod.outlook.com (52.132.11.145) by BL0PR12MB2498.namprd12.prod.outlook.com (52.132.11.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.25; Wed, 15 May 2019 01:56:36 +0000 Received: from BL0PR12MB2482.namprd12.prod.outlook.com ([fe80::8574:7376:f61f:56e8]) by BL0PR12MB2482.namprd12.prod.outlook.com ([fe80::8574:7376:f61f:56e8%7]) with mapi id 15.20.1878.024; Wed, 15 May 2019 01:56:35 +0000 From: Yogender Gupta To: Philip Langdale , "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH 3/3] avfilter/vf_scale_cuda: Simplify output plane addressing Thread-Index: AQHVCgLrJwzW7OZR10ansPJhWdM5SaZrbqvA Date: Wed, 15 May 2019 01:56:35 +0000 Message-ID: References: <20190514031222.9760-1-philipl@overt.org> <20190514031222.9760-4-philipl@overt.org> In-Reply-To: <20190514031222.9760-4-philipl@overt.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ygupta@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2019-05-15T01:56:33.9690629Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic; Sensitivity=Unrestricted authentication-results: spf=none (sender IP is ) smtp.mailfrom=ygupta@nvidia.com; x-originating-ip: [183.82.16.4] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 97cfe8e3-2cee-4f4c-3f77-08d6d8d88ffc x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:BL0PR12MB2498; x-ms-traffictypediagnostic: BL0PR12MB2498: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:318; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(346002)(39860400002)(366004)(396003)(13464003)(189003)(199004)(66066001)(25786009)(486006)(99286004)(476003)(102836004)(53546011)(8936002)(55016002)(256004)(446003)(11346002)(76176011)(7696005)(6436002)(110136005)(9686003)(6506007)(316002)(33656002)(74316002)(71190400001)(71200400001)(81166006)(86362001)(52536014)(64756008)(66446008)(66476007)(66556008)(478600001)(73956011)(76116006)(2906002)(6246003)(66946007)(5660300002)(229853002)(3846002)(68736007)(6116002)(8676002)(186003)(2501003)(305945005)(53936002)(14454004)(81156014)(7736002)(26005)(78486014); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR12MB2498; H:BL0PR12MB2482.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: H2gH8uWX8g43575G3Srlo6UVebwyFh5vMtjBeaLS0+qefXJZOwOPUBHfSK61Ox6Zn5fo9bVbwyIqqCXFK4AigX4HFJ4UUaBtx6eq6QRpfOv2D9jL6UIrB0stti9TpWiNlDZy+qigm3dIf1bb33pmsFeK3K6CAKMvTS0JCrwW1OnvL7OttXlBma690l+pItrLOAuTX7/p8hV7rovE+r8/9/Bsf73ed/L99VbdWQhbOaTyntE9bQps0SIJ7YPQRR2bP0CoLoCNHTG1PQrJfcvkI2+3OCo5uZQSU9QAbzHfeMNIb3Z/ywDCDhU1B4QkqUHWapW+0in28HyhZ7p2XIC5KuUGzbAkc+O3Va5IjxBS/TGJxQHxDKwr8cGjwuhyt7K7wwIgfVPQxa3h58XACHk/2aZD1Cin5i3m9itBy40mcFw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 97cfe8e3-2cee-4f4c-3f77-08d6d8d88ffc X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 01:56:35.8493 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2498 X-OriginatorOrg: Nvidia.com Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1557885405; bh=piOhLj6/IepiIoULE0zn7++hpYF3KyVQ/P4iV+fOgeI=; h=X-PGP-Universal:From:To:Subject:Thread-Topic:Thread-Index:Date: Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:msip_labels:authentication-results: x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-microsoft-antispam: x-ms-traffictypediagnostic:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-forefront-prvs: x-forefront-antispam-report:received-spf: x-ms-exchange-senderadcheck:x-microsoft-antispam-message-info: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type:Content-Transfer-Encoding; b=NR74KIyExg2dj6TX5+MELz7uF/GSwuvpOcIXhWtRU05EYMAj5sQVV6PNYesMTjXP8 +t7FIcjomy2GblLlqZPGgOzyV7MiO1PwqYcbeFaIS445COMkC/kAImhdO+QJzSjdw5 L7oKmB6a9V5w9nd72vrlzmrnZA5AN8WDKd+gxayFoSPdtdF38NHB/0zMEpWvZbBJ/N xSi03b5FDK955JLgqDKrxEWMCVQLriaZh6VF7+/GXjfAkNfPbL+Lr0MNe75ql29c94 QjPCBgRHnMkErS0DeE3xRrFjqwtqORfQEGSoH2MdWpDfV3Xpa0ILTOnV7181/IzrQJ hzMUEGECBxLkA== Subject: Re: [FFmpeg-devel] [PATCH 3/3] avfilter/vf_scale_cuda: Simplify output plane addressing X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Yes, this looks better and should have been this way. Thanks, Yogender -----Original Message----- From: Philip Langdale Sent: Tuesday, May 14, 2019 8:42 AM To: ffmpeg-devel@ffmpeg.org Cc: Yogender Gupta ; Philip Langdale Subject: [PATCH 3/3] avfilter/vf_scale_cuda: Simplify output plane addressing I'm not sure why this was written the way it was originally. We initialise the plane addresses correctly in hwcontext_cuda so why try and play games to calculate the plane offsets directly in this code? --- libavfilter/vf_scale_cuda.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.20.1 ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- diff --git a/libavfilter/vf_scale_cuda.c b/libavfilter/vf_scale_cuda.c index a833dcd1a4..b7cdb81081 100644 --- a/libavfilter/vf_scale_cuda.c +++ b/libavfilter/vf_scale_cuda.c @@ -390,12 +390,12 @@ static int scalecuda_resize(AVFilterContext *ctx, out->data[0], out->width, out->height, out->linesize[0], 1); call_resize_kernel(ctx, s->cu_func_uchar, 1, - in->data[0]+in->linesize[0]*in->height, in->width/2, in->height/2, in->linesize[0]/2, - out->data[0]+out->linesize[0]*out->height, out->width/2, out->height/2, out->linesize[0]/2, + in->data[1], in->width/2, in->height/2, in->linesize[0]/2, + out->data[1], out->width/2, out->height/2, + out->linesize[0]/2, 1); call_resize_kernel(ctx, s->cu_func_uchar, 1, - in->data[0]+ ALIGN_UP((in->linesize[0]*in->height*5)/4, s->tex_alignment), in->width/2, in->height/2, in->linesize[0]/2, - out->data[0]+(out->linesize[0]*out->height*5)/4, out->width/2, out->height/2, out->linesize[0]/2, + in->data[2], in->width/2, in->height/2, in->linesize[0]/2, + out->data[2], out->width/2, out->height/2, + out->linesize[0]/2, 1); break; case AV_PIX_FMT_YUV444P: @@ -404,12 +404,12 @@ static int scalecuda_resize(AVFilterContext *ctx, out->data[0], out->width, out->height, out->linesize[0], 1); call_resize_kernel(ctx, s->cu_func_uchar, 1, - in->data[0]+in->linesize[0]*in->height, in->width, in->height, in->linesize[0], - out->data[0]+out->linesize[0]*out->height, out->width, out->height, out->linesize[0], + in->data[1], in->width, in->height, in->linesize[0], + out->data[1], out->width, out->height, + out->linesize[0], 1); call_resize_kernel(ctx, s->cu_func_uchar, 1, - in->data[0]+in->linesize[0]*in->height*2, in->width, in->height, in->linesize[0], - out->data[0]+out->linesize[0]*out->height*2, out->width, out->height, out->linesize[0], + in->data[2], in->width, in->height, in->linesize[0], + out->data[2], out->width, out->height, + out->linesize[0], 1); break; case AV_PIX_FMT_YUV444P16: @@ -433,7 +433,7 @@ static int scalecuda_resize(AVFilterContext *ctx, 1); call_resize_kernel(ctx, s->cu_func_uchar2, 2, in->data[1], in->width/2, in->height/2, in->linesize[1], - out->data[0] + out->linesize[0] * ((out->height + 31) & ~0x1f), out->width/2, out->height/2, out->linesize[1]/2, + out->data[1], out->width/2, out->height/2, + out->linesize[1]/2, 1); break; case AV_PIX_FMT_P010LE: @@ -443,7 +443,7 @@ static int scalecuda_resize(AVFilterContext *ctx, 2); call_resize_kernel(ctx, s->cu_func_ushort2, 2, in->data[1], in->width / 2, in->height / 2, in->linesize[1]/2, - out->data[0] + out->linesize[0] * ((out->height + 31) & ~0x1f), out->width / 2, out->height / 2, out->linesize[1] / 4, + out->data[1], out->width / 2, out->height / + 2, out->linesize[1] / 4, 2); break; case AV_PIX_FMT_P016LE: @@ -453,7 +453,7 @@ static int scalecuda_resize(AVFilterContext *ctx, 2); call_resize_kernel(ctx, s->cu_func_ushort2, 2, in->data[1], in->width / 2, in->height / 2, in->linesize[1] / 2, - out->data[0] + out->linesize[0] * ((out->height + 31) & ~0x1f), out->width / 2, out->height / 2, out->linesize[1] / 4, + out->data[1], out->width / 2, out->height / + 2, out->linesize[1] / 4, 2); break; default: