From patchwork Sun Aug 14 16:48:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 37269 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp879862pzi; Sun, 14 Aug 2022 09:48:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR5OXDmvU8nyxuYqH1PqUw1EbTn5Bg0yuzCZu0LkEExrpxWQSWQWrr9Wls3X6TK3nE75c9IR X-Received: by 2002:a17:907:2c62:b0:730:d9b9:aabb with SMTP id ib2-20020a1709072c6200b00730d9b9aabbmr8013953ejc.84.1660495739354; Sun, 14 Aug 2022 09:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660495739; cv=none; d=google.com; s=arc-20160816; b=WHcmJmw0MFeipoOxvhol49yj138akxaWGv38YyU/ah7UGgHdjxY0muEtqYFho21Zr7 GA7fLeB8AXwu7ec/Eajgl6Z4FbwxdReznn7AWeOlE7K/pKTt6hd3DmHAGLY7FMwFtFCV q40P1Jvojuzuh5mVnTUiku6BG5d/2EIBw73AXlOi61X0p5lG3UUqx/U/2i13iagDk2iv UzuCuSUWEwwOTX+6YKqWB5GmOPEe9Zd+DeBYH7U3ZKKCpWlTjQ+eC5ALPnEFqYTMcWoy hwuieT5De2mUO5xkp29W++ErT0t6eR4xQ2S0qBbbcicapp+PkQ1T5Kaelane7gyzys7t YYKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=KGzEnEwzbqen9iKksD8wcq87gmGrd6QN9eNV2fBGpUc=; b=hxfvbOvk4AgPUbzy63z3gRZMyifFLw4kCkpMDIM5DaW03sF63h7NthfbtCDgYaMj3f 88RJW0+ypwmblOjcYDI0IF0J6/HMQoHyy5XFZDvMfpoTnnB0F1NH9DbkSeAmK5Ja+4It HVjuLo38LlxePJ7wsmj3aePZTL/fZDbQ9i+c9q+3hedrgFiRwhkqqCGy3NCsRurOk23l LWMbenD+EvKf2gugQJJJFlpXWLBCMbWeO+cnKvW5shCyUZxCVEyA9SOn31lrwK2GvoZ3 sLpY2z3swGV3Xdb5r3oQrYXZwXkZDH2JK5+y63np9cJf0iSTNTlVSeI7tqQMU75NORGL iBmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=EFchXw+y; 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=rothenpieler.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hg2-20020a1709072cc200b0072642bbc8cfsi4978838ejc.914.2022.08.14.09.48.58; Sun, 14 Aug 2022 09:48:59 -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=@rothenpieler.org header.s=mail header.b=EFchXw+y; 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=rothenpieler.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0CADB68B8C8; Sun, 14 Aug 2022 19:48:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AD01D68B485 for ; Sun, 14 Aug 2022 19:48:46 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 1D3942AEB83; Sun, 14 Aug 2022 18:48:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1660495726; bh=hIA6fXAMgpIjKVN47QgW6IcamIRVV4SEKeeSRuuBMr0=; h=From:To:Cc:Subject:Date; b=EFchXw+yaI2YOoEae6OeU7YFwPVd4pHgyIlOT4Kr5thuy32fXsRE5ZTzQ3dtVAM/g 2DX7iOlKTXVWP7L2TaUmA86IZaUZWnHcnkYBsvvE455YT4ZkQdBfZ4Y4nKmSCq/tFP d/CovlOCbX7tl6kacNPdrI1sfCyHws+NdFGX0GPuJ4hBjRZ+8Sl75Hn9R6UPyljm6F ic7kaNvFam2LfDM4Lab2aR6VEixR9CDIGT2OCqvJwvNE8FxIOIKc4FOudpkm7m1+Bq LjQKtybqBSDAsjTKICO5tttWY3U/0XiKIk5FuxcyEzk6mINXc2wArxwuwNGd2IEn8G 4mB2slWRD9rMQ== From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sun, 14 Aug 2022 18:48:27 +0200 Message-Id: <20220814164833.19965-1-timo@rothenpieler.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/7] avutil: move half-precision float helper to avutil 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 Cc: Timo Rothenpieler Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Cg6GuYC/sJae --- libavcodec/exr.c | 2 +- libavcodec/exrenc.c | 2 +- libavcodec/pnmdec.c | 3 ++- libavcodec/pnmenc.c | 2 +- {libavcodec => libavutil}/float2half.h | 6 +++--- {libavcodec => libavutil}/half2float.h | 6 +++--- 6 files changed, 11 insertions(+), 10 deletions(-) rename {libavcodec => libavutil}/float2half.h (96%) rename {libavcodec => libavutil}/half2float.h (96%) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 3a6b9c3014..5c6ca9adbf 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -41,6 +41,7 @@ #include "libavutil/avstring.h" #include "libavutil/opt.h" #include "libavutil/color_utils.h" +#include "libavutil/half2float.h" #include "avcodec.h" #include "bytestream.h" @@ -53,7 +54,6 @@ #include "exrdsp.h" #include "get_bits.h" #include "internal.h" -#include "half2float.h" #include "mathops.h" #include "thread.h" diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c index 8cf7827bb6..56c084d483 100644 --- a/libavcodec/exrenc.c +++ b/libavcodec/exrenc.c @@ -31,11 +31,11 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" +#include "libavutil/float2half.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" #include "encode.h" -#include "float2half.h" enum ExrCompr { EXR_RAW, diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 130407df25..9383dc8e60 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -21,12 +21,13 @@ #include "config_components.h" +#include "libavutil/half2float.h" + #include "avcodec.h" #include "codec_internal.h" #include "internal.h" #include "put_bits.h" #include "pnm.h" -#include "half2float.h" static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval) { diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index b16c93c88f..7ce534d06e 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -24,10 +24,10 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" +#include "libavutil/float2half.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "float2half.h" typedef struct PHMEncContext { uint16_t basetable[512]; diff --git a/libavcodec/float2half.h b/libavutil/float2half.h similarity index 96% rename from libavcodec/float2half.h rename to libavutil/float2half.h index e05125088c..d6aaab8278 100644 --- a/libavcodec/float2half.h +++ b/libavutil/float2half.h @@ -16,8 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVCODEC_FLOAT2HALF_H -#define AVCODEC_FLOAT2HALF_H +#ifndef AVUTIL_FLOAT2HALF_H +#define AVUTIL_FLOAT2HALF_H #include @@ -64,4 +64,4 @@ static uint16_t float2half(uint32_t f, uint16_t *basetable, uint8_t *shifttable) return h; } -#endif /* AVCODEC_FLOAT2HALF_H */ +#endif /* AVUTIL_FLOAT2HALF_H */ diff --git a/libavcodec/half2float.h b/libavutil/half2float.h similarity index 96% rename from libavcodec/half2float.h rename to libavutil/half2float.h index 7df6747e50..1f6deade07 100644 --- a/libavcodec/half2float.h +++ b/libavutil/half2float.h @@ -16,8 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVCODEC_HALF2FLOAT_H -#define AVCODEC_HALF2FLOAT_H +#ifndef AVUTIL_HALF2FLOAT_H +#define AVUTIL_HALF2FLOAT_H #include @@ -71,4 +71,4 @@ static uint32_t half2float(uint16_t h, const uint32_t *mantissatable, const uint return f; } -#endif /* AVCODEC_HALF2FLOAT_H */ +#endif /* AVUTIL_HALF2FLOAT_H */