From patchwork Tue Nov 14 19:47:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 6059 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp3721485jah; Tue, 14 Nov 2017 11:48:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMZN4gZZn3V1gtFqnHj40WfN+B1LkV6qkGWH9Bf0WaH4tIZC4uji80ns8wsexhf5O+7Ispvw X-Received: by 10.223.161.20 with SMTP id o20mr11684873wro.276.1510688921993; Tue, 14 Nov 2017 11:48:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510688921; cv=none; d=google.com; s=arc-20160816; b=MEFUFZHiZ7nXjyuXO2ooK0ZalVRmg8xymGtuZj5qv19LGlhVRJjP07aw1uIcLvx3GK Euq0J22jMRLqp1QaY8zHMVtK6alpxG8FUmigSyWBqA8x8rxBhoHMhzBDNOmLfCbz5mDk CZvAc4B/DTtmrdk5i+BQfs1BLnLFvNn1RfVvSfkP2Hl8Udqb9CXyTFabpfaj1URwn74f yrUVZ/YwVh/ruBqsMRxv+FSsX2ma0I2gRk6wjTzWoWAB/cs1WrPDn22PxYW/JPPwlmKM 6yqsRp5vxaer2iQZQXZbj2iTZZBbQ5OJf12y7e2nfL3h7QLMBhLvr7tJoTe6U3UQN9M4 F4Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=BI+8MeU3soQ99MXKgTWr/0uaV9mwxH9nefrlrPuSLOM=; b=JzxX1R4u61LB1SNDQn4LoBU4OfGiYgYFx0GWReVKaYSjOHSer1YKmZqzusZrZSBJZI YkV4G57Emt7Orh06mKRe+4q+XOe3EIY+robgwIB8nueQ/bE1DD4QSnJKPCKKxecOGSJ2 sDL1OEPWSdDHWcuU/7zFPl02zVEP1/Y8ZbFCqgk+HuovdSa0PssSXK3cIwYr06Wzi673 +y/c3updCqjy1vlcdI1XYdKEXZ2EQioy15aUj7jT5x6oBKSVf/i6UL2rCBxZIuTsf7rQ H2aeLNn2a9rfOEjzOfW/wev9D15nZTJJNKrXYMoeM7kIHU2WiFCK8/u4Yj3kw5TARTP8 in1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=O50AH0GG; 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 g14si17307939wra.332.2017.11.14.11.48.41; Tue, 14 Nov 2017 11:48:41 -0800 (PST) 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.20150623.gappssmtp.com header.s=20150623 header.b=O50AH0GG; 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 431DB68A189; Tue, 14 Nov 2017 21:47:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D80168A121 for ; Tue, 14 Nov 2017 21:47:30 +0200 (EET) Received: by mail-wm0-f49.google.com with SMTP id y80so23626815wmd.0 for ; Tue, 14 Nov 2017 11:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=leHCSv8RfhNSr9dNkpGnBHIwO6NKgEvDnFAsv9RrLsw=; b=O50AH0GGmtsEQ4YX+tmLCsEMl3XhJN562byYdDh1rmW/qSUb+leHruqsqQBQliUiG5 NVIttGxBmp0AxY8MnOAG/93ceTWXZg1YQB7bUIEtFts3Gf4ZNant/uLHu/wP0IbDgL4z eOuFfjm50GfgkVhKttW7heYOZphz752M5ITiqIekwwPYpVnLEBzYwt+vOeaslXD8WsTe d6+eJPuCGzKtjTwOX5LYzgmEIPJBga89BkkA2MSolPL2PUEaOe9tUGIJWKisv18v7GEU jqiA9KpnDNriRQvz2wGWMK8pQyGLhU1TzvKYp6zAm1v4+mlInWQ0TdheUFOACb+S4lEI /W2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=leHCSv8RfhNSr9dNkpGnBHIwO6NKgEvDnFAsv9RrLsw=; b=M0t34NNWhr3RJhvrdTm0jkarIZ1J1N065sKAd/r+prjz988SYDbS8K2PYjWjxeM3EF GkRzi8lCMvMn95xaTtMfJU5fJVPbpRVFaZ7Az2NFi7owSaNltlnzZMCweM+C83iKPDCN 4GrwnSz3LlfLkt51l6w3NMQKhsZctlh7X5HOniOGyvKmThxHlMLXNVxM0ILs3o1zv6Wv xBCj7UGfHyXNBr9RE6Wlmen0gMdXJQ21pYbUM0J9299VYhAw74vVLyA8dqAfkz2K+0dq /1yz05NiRbXH8YErSWI7+PN1TLifn/kBroO6cs+604c6uUOZ0w9zI/qnBbUq3b9Y10PW hiAw== X-Gm-Message-State: AJaThX6dTJ44wYlraqxpP7Byo8PcfE3dO1vPP0x2wR/zUQsICfjQ92kn 8g332not0Yo5Tp7voRagSc13/5ma X-Received: by 10.28.145.199 with SMTP id t190mr7434365wmd.40.1510688864804; Tue, 14 Nov 2017 11:47:44 -0800 (PST) Received: from rywe.jkqxz.net (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id v35sm38938226wrc.13.2017.11.14.11.47.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Nov 2017 11:47:44 -0800 (PST) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Nov 2017 19:47:25 +0000 Message-Id: <20171114194730.11052-11-sw@jkqxz.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171114194730.11052-1-sw@jkqxz.net> References: <20171114194730.11052-1-sw@jkqxz.net> Subject: [FFmpeg-devel] [PATCH 10/15] lavfi: Add infrastructure for building OpenCL source into libavfilter 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavfilter/Makefile | 6 ++++++ libavfilter/opencl_source.h | 22 ++++++++++++++++++++++ tools/cl2c | 20 ++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 libavfilter/opencl_source.h create mode 100755 tools/cl2c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 6ebdc1f173..4150efe5ca 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -404,3 +404,9 @@ TOOLS-$(CONFIG_LIBZMQ) += zmqsend clean:: $(RM) $(CLEANSUFFIXES:%=libavfilter/libmpcodecs/%) + +OPENCL = $(subst $(SRC_PATH)/,,$(wildcard $(SRC_PATH)/libavfilter/opencl/*.cl)) +.SECONDARY: $(OPENCL:.cl=.c) +libavfilter/opencl/%.c: TAG = OPENCL +libavfilter/opencl/%.c: $(SRC_PATH)/libavfilter/opencl/%.cl + $(M)$(SRC_PATH)/tools/cl2c $< $@ diff --git a/libavfilter/opencl_source.h b/libavfilter/opencl_source.h new file mode 100644 index 0000000000..8674a03a94 --- /dev/null +++ b/libavfilter/opencl_source.h @@ -0,0 +1,22 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_OPENCL_SOURCE_H +#define AVFILTER_OPENCL_SOURCE_H + +#endif /* AVFILTER_OPENCL_SOURCE_H */ diff --git a/tools/cl2c b/tools/cl2c new file mode 100755 index 0000000000..1ead940811 --- /dev/null +++ b/tools/cl2c @@ -0,0 +1,20 @@ +#!/bin/sh +# Convert an OpenCL source file into a C source file containing the +# OpenCL source as a C string. Also adds a #line directive so that +# compiler messages are useful. + +input="$1" +output="$2" + +name=$(basename "$input" | sed 's/.cl$//') + +cat >$output <>$output + +echo ";" >>$output