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 48F9143432 for ; Fri, 10 Jun 2022 15:50:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4DB9A68B1E6; Fri, 10 Jun 2022 18:50:56 +0300 (EEST) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 796CE68A6B5 for ; Fri, 10 Jun 2022 18:50:50 +0300 (EEST) Received: by mail-ej1-f47.google.com with SMTP id bg6so34466699ejb.0 for ; Fri, 10 Jun 2022 08:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=C7nf87xuG2VaIjAvvAxgOXOyO58B1RdJqXo705EcPx0=; b=ZGqeUhDsAJezzOqaup/jzkL0Kv6EFRI5xoQBqME/e4lcpoXOxz9t5vyKmmLzieTZeP AMiBexLzfElGlw/hVgX6qyXGE++xGLRjS2BajRpcRaSwbHpavR9z+Gbp0S4jtgunNwO6 JEWBN1CGJc15Azz/EgnpSZ7rOE8d9BgVPXc5oiZUJkKDMACC5oYUzOIH/3qujZ+lAklQ fL1eMV9BoJo7ke7FOcevaVRsz/eRD+L4ByKzl19ndfR7ZobbcNbDZ5ivXsQKvX1FaGbG wbwyFOzq0yg+l6x0EN3PJuKhdU8YMMCIcnozp7k0czWh0EJE1NPkT0TwumPmkSRYrrDV FqTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C7nf87xuG2VaIjAvvAxgOXOyO58B1RdJqXo705EcPx0=; b=zUSU7dFvxVvSSq2G+XQ4c1DEGbRuoidcSaRwuQYczlw3E9uVfoBQNbocB63zgPC+qV RI5Yv7D+aIB6ENVw+oIvJAQe5YXK37rxFWjru6hO64qfpK64gwCAknxGpPzxgW1E5zg+ OWERQ4zjCbZWQ47Iz+PmdnMoJZebeTKbbxlZDgOxmkhcGeSk/D32WMUcbowFSxppd9ew QsHo+2sXcxH8aguXwh9r2J8SV+pon1xjps4yHBF1zyUjXMiJ0PY0wa3MlMeWnzgidox7 zD+gGEXQex/ym0UqchQJoF0B8pfIsrkwTmVI4YqVJPOpW5hlQVbn0fPdwOBt5xDA+4lD +UyQ== X-Gm-Message-State: AOAM5314CFfQ6fpjt8g9PSiy5db0iWMDiypKl0FZ4afCnRPq3+swvuzs m56CpbWsLD5I7ReWuRLCuulR1qkgBE5ahealmWy8xx8o X-Google-Smtp-Source: ABdhPJyAyZb9TKH6XVrEkVHOVMNyX8dTIQqIowPzfSsNM6Q6qlJmGsbluR3jnYfiM3RYDaQqBUb+CUnt/fmDuEMuoWI= X-Received: by 2002:a17:906:7a08:b0:712:12f6:243a with SMTP id d8-20020a1709067a0800b0071212f6243amr5856101ejo.619.1654876249366; Fri, 10 Jun 2022 08:50:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Ronald S. Bultje" Date: Fri, 10 Jun 2022 11:50:37 -0400 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH 05/41] avcodec/videodsp: Make ff_emulated_edge_mc_16 static 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: Andreas Rheinhardt 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: Hi, On Thu, Jun 9, 2022 at 7:56 PM Andreas Rheinhardt < andreas.rheinhardt@outlook.com> wrote: > Only ff_emulated_edge_mc_8() is used outside of lavc/videodsp.c. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/videodsp.c | 4 ++++ > libavcodec/videodsp.h | 1 - > libavcodec/videodsp_template.c | 1 + > 3 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/videodsp.c b/libavcodec/videodsp.c > index 2198d46c15..02af046b81 100644 > --- a/libavcodec/videodsp.c > +++ b/libavcodec/videodsp.c > @@ -25,11 +25,15 @@ > #include "videodsp.h" > > #define BIT_DEPTH 8 > +#define STATIC > #include "videodsp_template.c" > +#undef STATIC > #undef BIT_DEPTH > > #define BIT_DEPTH 16 > +#define STATIC static > #include "videodsp_template.c" > +#undef STATIC > #undef BIT_DEPTH > > static void just_return(uint8_t *buf, ptrdiff_t stride, int h) > [..] > diff --git a/libavcodec/videodsp_template.c > b/libavcodec/videodsp_template.c > index 55123a5844..8bc3290248 100644 > --- a/libavcodec/videodsp_template.c > +++ b/libavcodec/videodsp_template.c > @@ -20,6 +20,7 @@ > */ > > #include "bit_depth_template.c" > +STATIC > void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src, > ptrdiff_t buf_linesize, > ptrdiff_t src_linesize, > -- > 2.34.1 > This splits the "staticness" over two places (i.e. to understand what STATIC means and/or why it exists, you have to look at two places), and also doesn't explain why we need "variable staticness" (i.e. one being static, but not the other one). Maybe you could use the following: #if BIT_DEPTH != 8 // we make a call to the 8-bit version in $fill_me_in_here$ static #endif void FUNC(ff_.. That way the meaning of STATIC is not obfuscated (I know, STATIC should be obvious, but it's still an indirection) and the reasoning is included also. Ronald _______________________________________________ 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".