From patchwork Thu Jan 28 16:26:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25235 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 2368444BC03 for ; Thu, 28 Jan 2021 18:27:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E27C368A29C; Thu, 28 Jan 2021 18:27:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5F910689CFA for ; Thu, 28 Jan 2021 18:27:11 +0200 (EET) Received: by mail-ed1-f48.google.com with SMTP id d22so7318108edy.1 for ; Thu, 28 Jan 2021 08:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=V/hPKbyyDYMZy29tz8zeCKdSsR5xDP5MwxZGtBM/6z4=; b=CN83s5M84EOE/BGKuZOlzQ7an9IfKlBhZoh2Y+Kd3bvNw5QdISQtUewVG6bZV6qLaY 2cMjTYLw0Ght/IHPmdU4wXuJiPcBhgIDSEGj2AiIEBJ0CE9UbSQ7ZXWTMwRtisRzgTY0 ijZ8t6tj7bRmplEWF4eRaZWxauAvJQQpkKdQ4QtwrYmCD9INUmDJFCTmtSTLkUhRxcl6 IUHq1hyR3inXFSxJMkFVStkTTBSXJ3QCh3QIFSThD7uGFczqP4+7IYeo+QimZYptkUWK +D3Nf8HS2qMffbJKMXoa7P5PL7/KHZYHoDleCAD6lOtxuO6hHbDmCMjz+O/JmtxxxDLV BrHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=V/hPKbyyDYMZy29tz8zeCKdSsR5xDP5MwxZGtBM/6z4=; b=QUkm0mG82CgAZc6c5EeF0dvCwJNcGJeJotp2o3nnqKKOeTQI+aC3YGSmkyj+JD5yW1 miLmCfDn/mDoVx1s0e2F8+H/XaJXCfo9cRwwAZ/Rx7KuB3RYGlWzmKKWSueWHW68BguJ XQzhSflxuNsbEXyZkOmYrExNS5Rp6wogakrDnQXlFZv6uZ6QNW+ok07ge+EC50DaZCkl pWeWOpVzNo7OgVRMqt5juSn/kX3Ijsj/HgG14RpPGU3jo50lelvklS2ElOb5GOVFEdH5 VxQXIrnUp7d+f30ASVgngIJp3ZsMaf0bOn3O9cMRjjGqllZfKOdRNPAr/eOPTP+7LvAZ OSkg== X-Gm-Message-State: AOAM53361XEZIgWEklqXvEv1FowO/tqawk08evxxcHO74xHOeeZIqBZh BYZ8UDaRCHns2DupowS7hqTNJi6GMy8= X-Google-Smtp-Source: ABdhPJxmdItziU8eYb/1jpb+AjW5QnxBJq4qNEpK03inQ5Q2TRHmGbfnm0nDAWb6BohTg6tbkWntRQ== X-Received: by 2002:a50:ee94:: with SMTP id f20mr376046edr.222.1611851230493; Thu, 28 Jan 2021 08:27:10 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id dj25sm3185288edb.5.2021.01.28.08.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 08:27:08 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Jan 2021 17:26:41 +0100 Message-Id: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] avcodec/aac_defines: Make macro more general 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The floating point AAC decoder shares lots of stuff (mainly tables) with other components; this is not so much true for the fixed point AAC decoder: There are tables for which the fixed point decoder is the only user whereas the floating point analogue is shared with other components. This can be exploited to make the fixed point tables static and because this has only been done for several KBD tables, the macro is designed for them. This commit makes it more general. Signed-off-by: Andreas Rheinhardt --- libavcodec/aac_defines.h | 4 ++-- libavcodec/aacdec_fixed.c | 4 ++-- libavcodec/aacdec_template.c | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libavcodec/aac_defines.h b/libavcodec/aac_defines.h index 74ac011785..e94475ac54 100644 --- a/libavcodec/aac_defines.h +++ b/libavcodec/aac_defines.h @@ -34,7 +34,7 @@ #define AAC_RENAME(x) x ## _fixed #define AAC_RENAME_32(x) x ## _fixed_32 -#define AAC_KBD_RENAME(x) aac_ ## x ## _fixed +#define AAC_RENAME2(x) x ## _fixed typedef int INTFLOAT; typedef unsigned UINTFLOAT; ///< Equivalent to INTFLOAT, Used as temporal cast to avoid undefined sign overflow operations. typedef int64_t INT64FLOAT; @@ -84,7 +84,7 @@ typedef int AAC_SIGNE; #define AAC_RENAME(x) x #define AAC_RENAME_32(x) x -#define AAC_KBD_RENAME(x) ff_aac_ ## x +#define AAC_RENAME2(x) ff_ ## x typedef float INTFLOAT; typedef float UINTFLOAT; typedef float INT64FLOAT; diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 4d82b7b1aa..e555dac362 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -86,8 +86,8 @@ #include #include -DECLARE_ALIGNED(32, static int, AAC_KBD_RENAME(kbd_long_1024))[1024]; -DECLARE_ALIGNED(32, static int, AAC_KBD_RENAME(kbd_short_128))[128]; +DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_long_1024))[1024]; +DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_128))[128]; static av_always_inline void reset_predict_state(PredictorState *ps) { diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index fbe3074071..ea39f547b0 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1237,8 +1237,8 @@ static av_cold void aac_static_table_init(void) AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_120), 120); ff_aac_float_common_init(); #else - AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_long_1024), 4.0, 1024); - AAC_RENAME(ff_kbd_window_init)(AAC_KBD_RENAME(kbd_short_128), 6.0, 128); + AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); + AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); AAC_RENAME(ff_init_ff_sine_windows)(10); AAC_RENAME(ff_init_ff_sine_windows)( 7); #endif @@ -2644,10 +2644,10 @@ static void apply_tns(INTFLOAT coef_param[1024], TemporalNoiseShaping *tns, static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out, INTFLOAT *in, IndividualChannelStream *ics) { - const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) { ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024); @@ -2704,8 +2704,8 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce) IndividualChannelStream *ics = &sce->ics; INTFLOAT *saved = sce->saved; INTFLOAT *saved_ltp = sce->coeffs; - const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); int i; if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { @@ -2743,9 +2743,9 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) INTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; INTFLOAT *saved = sce->saved; - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_KBD_RENAME(kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); INTFLOAT *buf = ac->buf_mdct; INTFLOAT *temp = ac->temp; int i; From patchwork Thu Jan 28 16:26:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25236 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 3F71A44BC03 for ; Thu, 28 Jan 2021 18:27:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 25EE468A68F; Thu, 28 Jan 2021 18:27:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B8E968A67E for ; Thu, 28 Jan 2021 18:27:32 +0200 (EET) Received: by mail-ed1-f52.google.com with SMTP id c2so7278509edr.11 for ; Thu, 28 Jan 2021 08:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RlJCyCflgxdjtFla0XdnyiGoQpqkWRnKBttzcIV1u+4=; b=FDCkz9Up1OF4pvqQSOICoXF20nGMZV7pLIHNhTpV6ZPKftfCxkVWHXssLpFM/6SQi7 Ylt7IDpngF1PeRskqSDuTL5UTHplxOwdBcgzkSQ6O4BgAPfKMlNSwKP/fOIYfBOdgugR SoUi8vZz+T4jHDTalXaclQ4GnR3mgrHfHj0k9moJ8tjl7cSp4mLdqtWH5p9gMR/2FJF0 75YMPk5/mdCUWz6Z/Z+KUZs30RA0jCI1ZjugL/eAXs5bb8fHpvZLvmioqC3UjBeqUIah 8sSBBoCY1Ezv+RrGPorgwbM2wPpxISHCaaPf5EHtywlEDL1s1wH2HhvOQR33yQMkSoXT QC4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RlJCyCflgxdjtFla0XdnyiGoQpqkWRnKBttzcIV1u+4=; b=D1jSffPQnrMFap6/PC/Kb1lJtkfKuEV5trtz+VkQihUkg9OSlFT175HlwyNer37kb+ h4KFHX43eKGji0HHqH8b44dZ9LonAzmuRNkULHHW7zGe6Hhm2m+SykAnYwfRyEzSuzEG 0Ak8Gtt9/KaB8BVVnhke7bbZfNgY82fhu3GGyolJBvtD0K2Bfom654jZSzkvd61EntT4 i+8fjnu2LHQwTr/LokMKrEgpgcbQplC/w7fpxDlcVloq06M5B/+bJ67x7ChW62QAPpbA p1S8bNchAexkjRJI0BgPRczPAVtyLEjyqTMarjmC7HEvJuUvYU/ktIOvT87kv95lZdyL B3uQ== X-Gm-Message-State: AOAM53331vr2iIN9wikkGn7Pbqd8FsYH9YqGmEWWsLIh7BHMWH3WEMW0 UrStLLxWJZca8Zj0EWQLx8xkB+8WFWw= X-Google-Smtp-Source: ABdhPJxwfF1eKLNaRzhCYGov6PwezAtliUUXGcAWGlp0DbTSHIhA0roB54UzjaaMpp2oqfwvwtY4hA== X-Received: by 2002:a05:6402:5112:: with SMTP id m18mr327549edd.129.1611851251829; Thu, 28 Jan 2021 08:27:31 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id dj25sm3185288edb.5.2021.01.28.08.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 08:27:30 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Jan 2021 17:26:42 +0100 Message-Id: <20210128162646.2811269-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> References: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/6] ffbuild/common: Make deletion of templates possible 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" If a target to be built includes a template file, the target's .d file includes the template file as a prerequisite; if the code were changed so that the template file no longer exists, one would get an error from make that it has no rule for the template file target. Therefore add a dummy rule for template files to make deleting them possible. Signed-off-by: Andreas Rheinhardt --- ffbuild/common.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffbuild/common.mak b/ffbuild/common.mak index 13e13553b8..e070b6b5e2 100644 --- a/ffbuild/common.mak +++ b/ffbuild/common.mak @@ -107,7 +107,7 @@ COMPILE_MSA = $(call COMPILE,CC,MSAFLAGS) %.c %.h %.pc %.ver %.version: TAG = GEN # Dummy rule to stop make trying to rebuild removed or renamed headers -%.h: +%.h %_template.c: @: # Disable suffix rules. Most of the builtin rules are suffix rules, From patchwork Thu Jan 28 16:26:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25237 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 1D03944BC03 for ; Thu, 28 Jan 2021 18:27:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 01EFA68A753; Thu, 28 Jan 2021 18:27:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DA16268A711 for ; Thu, 28 Jan 2021 18:27:33 +0200 (EET) Received: by mail-ej1-f51.google.com with SMTP id w1so8633173ejf.11 for ; Thu, 28 Jan 2021 08:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fIo/c8sFaniRpiQze2B7booumo98KwzYw/DQJGjMHHw=; b=PWwfsZ8f01jQYXh3ezBMsIAdbFr5hdp6NZ8Wpo1e3Bz3vwydRWxJj4Kc/vCKRPI0tL Imns9HMRWYoOMd9oacBYctnUIZNbl8eGKxX3H1qU+EoAIplndUveNBmGSxG1l7BKJfKd HbbLkZnVsYGAyT5lxnY/eJjL/Zo5nIcEUItIJUHcqXhyTiqVPJyBeft83xyMVXEuPLlW LjsCDxfAyKc/MAaMoiPD9mb+lDlZ3yKcYx6h6hwz7muzE5wE221M40XmbzOpYwsl0am+ imYuZ20LM1Q9eA+Trx7Sfkl3xLbw7OzMkfdtj5WZQkjxI99LvgUp3ldPgIgSEmbSae40 +yuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fIo/c8sFaniRpiQze2B7booumo98KwzYw/DQJGjMHHw=; b=evlJI5pi3XLQvcCwJ3Md0AK8vrGNaxkk5YhzcQWucREEZk8C6t8i+SBkEGQxAUEl6W eXICxB+Bq0/LTSydVKcds2l68RgRexWMJySIez8nRYbGpewBYtW0HLHNboCZ9fl16/xK /eY2NSx94aGoQCEIEhwcwtEE1qYB8TGIRdvIxfWupH2x5M2JBM7JkEsduWNY01ijm/+M 9sgzju4xdrTMTa9qApqAqFsHLVqWMxLBhb/nWXpnJZwyFuYFZITrucTdb54dB1NrZ86q AB2uQrWVXKKWjUYk1256D1jVWWHTG27M+b9ahiHNtq1I7F90jSnVGvkfiFl5guFbIH8G cucA== X-Gm-Message-State: AOAM533Fa5I5XnBS41ddKa3sR/5yyBdK7JzHEEG/TIwWTjJsTbBZ4o2s 5m34EhyjPNnxyUwSfqhZnzs/snxGMfo= X-Google-Smtp-Source: ABdhPJzk2X7qqGWKDLUCyUz6oWZqgv7SvLn5WSOPNvoSNjkECRJluQzLhCGV/U0MpbEQkFpnRv9ryg== X-Received: by 2002:a17:906:5fc6:: with SMTP id k6mr194082ejv.252.1611851252859; Thu, 28 Jan 2021 08:27:32 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id dj25sm3185288edb.5.2021.01.28.08.27.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 08:27:32 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Jan 2021 17:26:43 +0100 Message-Id: <20210128162646.2811269-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> References: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/aacdec_fixed: Move fixed-point sinewin tables to its only user 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The fixed-point AAC decoder is the only user of the fixed-point sinewin tables from sinewin; and it only uses a few of them (about 10% when counting by size). This means that guarding initializing these tables by an AVOnce (as done in 3719122065863f701026632f610175980d42b05a) is unnecessary for them. Furthermore the array of pointers to the individual arrays is also unneeded. Therefore this commit moves these tables directly into aacdec_fixed.c; this is done by ridding the original sinewin.h and sinewin_tablegen.h headers completely of any fixed-point code at the cost of a bit of duplicated code (the alternative is an ugly ifdef-mess). This saves about 58KB from the binary when using hardcoded tables (as these tables are hardcoded in this scenario); when not using hardcoded tables, most of these savings only affect the .bss segment, but the rest (< 1KB) contains relocations (i.e. savings in .data.rel.ro). Signed-off-by: Andreas Rheinhardt --- configure | 2 +- libavcodec/Makefile | 4 +- libavcodec/aacdec_fixed.c | 2 +- libavcodec/aacdec_template.c | 27 +++++------ libavcodec/sinewin.c | 1 - libavcodec/sinewin.h | 13 ++--- libavcodec/sinewin_fixed.c | 21 -------- libavcodec/sinewin_fixed_tablegen.c | 22 ++++++++- libavcodec/sinewin_fixed_tablegen.h | 67 ++++++++++++++++++++++++++ libavcodec/sinewin_tablegen.c | 25 +++++++++- libavcodec/sinewin_tablegen.h | 33 +++++-------- libavcodec/sinewin_tablegen_template.c | 55 --------------------- 12 files changed, 143 insertions(+), 129 deletions(-) delete mode 100644 libavcodec/sinewin_fixed.c create mode 100644 libavcodec/sinewin_fixed_tablegen.h delete mode 100644 libavcodec/sinewin_tablegen_template.c diff --git a/configure b/configure index df298b4b9b..4ab3c1ea76 100755 --- a/configure +++ b/configure @@ -2652,7 +2652,7 @@ rdft_select="fft" # decoders / encoders aac_decoder_select="adts_header mdct15 mdct sinewin" -aac_fixed_decoder_select="adts_header mdct sinewin" +aac_fixed_decoder_select="adts_header mdct" aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin" aac_latm_decoder_select="aac_decoder aac_latm_parser" ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index e2cd18632f..49955fd02a 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -141,7 +141,7 @@ OBJS-$(CONFIG_RANGECODER) += rangecoder.o OBJS-$(CONFIG_RDFT) += rdft.o OBJS-$(CONFIG_RV34DSP) += rv34dsp.o OBJS-$(CONFIG_SHARED) += log2_tab.o reverse.o -OBJS-$(CONFIG_SINEWIN) += sinewin.o sinewin_fixed.o +OBJS-$(CONFIG_SINEWIN) += sinewin.o OBJS-$(CONFIG_SNAPPY) += snappy.o OBJS-$(CONFIG_STARTCODE) += startcode.o OBJS-$(CONFIG_TEXTUREDSP) += texturedsp.o @@ -1279,6 +1279,7 @@ $(GEN_HEADERS): $(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF) ifdef CONFIG_HARDCODED_TABLES $(SUBDIR)cbrt_data.o: $(SUBDIR)cbrt_tables.h $(SUBDIR)cbrt_data_fixed.o: $(SUBDIR)cbrt_fixed_tables.h +$(SUBDIR)aacdec_fixed.o: $(SUBDIR)sinewin_fixed_tables.h $(SUBDIR)aacps_float.o: $(SUBDIR)aacps_tables.h $(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h $(SUBDIR)aactab_fixed.o: $(SUBDIR)aac_fixed_tables.h @@ -1290,5 +1291,4 @@ $(SUBDIR)mpegaudiodec_float.o: $(SUBDIR)mpegaudio_tables.h $(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h $(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h $(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h -$(SUBDIR)sinewin_fixed.o: $(SUBDIR)sinewin_fixed_tables.h endif diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index e555dac362..c5d923a8b4 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -70,7 +70,7 @@ #include "fft.h" #include "lpc.h" #include "kbdwin.h" -#include "sinewin.h" +#include "sinewin_fixed_tablegen.h" #include "aac.h" #include "aactab.h" diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index ea39f547b0..e5d311141f 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -1235,14 +1235,13 @@ static av_cold void aac_static_table_init(void) AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_120), 120); + AAC_RENAME(ff_init_ff_sine_windows)(9); ff_aac_float_common_init(); #else AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); - AAC_RENAME(ff_init_ff_sine_windows)(10); - AAC_RENAME(ff_init_ff_sine_windows)( 7); + init_sine_windows_fixed(); #endif - AAC_RENAME(ff_init_ff_sine_windows)( 9); AAC_RENAME(ff_cbrt_tableinit)(); } @@ -2644,10 +2643,10 @@ static void apply_tns(INTFLOAT coef_param[1024], TemporalNoiseShaping *tns, static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out, INTFLOAT *in, IndividualChannelStream *ics) { - const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128); if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) { ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024); @@ -2704,8 +2703,8 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce) IndividualChannelStream *ics = &sce->ics; INTFLOAT *saved = sce->saved; INTFLOAT *saved_ltp = sce->coeffs; - const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128); int i; if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { @@ -2743,9 +2742,9 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) INTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; INTFLOAT *saved = sce->saved; - const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); - const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024); - const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME(ff_sine_128); + const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128); + const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024); + const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128); INTFLOAT *buf = ac->buf_mdct; INTFLOAT *temp = ac->temp; int i; @@ -2891,10 +2890,10 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce) if (ics->use_kb_window[1]) { // AAC LD uses a low overlap sine window instead of a KBD window memcpy(out, saved, 192 * sizeof(*out)); - ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, AAC_RENAME(ff_sine_128), 64); + ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, AAC_RENAME2(sine_128), 64); memcpy( out + 320, buf + 64, 192 * sizeof(*out)); } else { - ac->fdsp->vector_fmul_window(out, saved, buf, AAC_RENAME(ff_sine_512), 256); + ac->fdsp->vector_fmul_window(out, saved, buf, AAC_RENAME2(sine_512), 256); } // buffer update diff --git a/libavcodec/sinewin.c b/libavcodec/sinewin.c index 4532dc7354..1fa0e953f0 100644 --- a/libavcodec/sinewin.c +++ b/libavcodec/sinewin.c @@ -16,6 +16,5 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define USE_FIXED 0 #include "sinewin.h" #include "sinewin_tablegen.h" diff --git a/libavcodec/sinewin.h b/libavcodec/sinewin.h index e6de4dfe7b..fc4e69a58f 100644 --- a/libavcodec/sinewin.h +++ b/libavcodec/sinewin.h @@ -23,7 +23,6 @@ #include "config.h" #include "libavutil/mem_internal.h" -#include "libavcodec/aac_defines.h" #if CONFIG_HARDCODED_TABLES # define SINETABLE_CONST const @@ -31,24 +30,20 @@ # define SINETABLE_CONST #endif -#ifndef USE_FIXED -#define USE_FIXED 0 -#endif - #define SINETABLE(size) \ - SINETABLE_CONST DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size] + SINETABLE_CONST DECLARE_ALIGNED(32, float, ff_sine_##size)[size] /** * Generate a sine window. * @param window pointer to half window * @param n size of half window */ -void AAC_RENAME(ff_sine_window_init)(INTFLOAT *window, int n); +void ff_sine_window_init(float *window, int n); /** * initialize the specified entry of ff_sine_windows */ -void AAC_RENAME(ff_init_ff_sine_windows)(int index); +void ff_init_ff_sine_windows(int index); extern SINETABLE( 32); extern SINETABLE( 64); @@ -60,6 +55,6 @@ extern SINETABLE(2048); extern SINETABLE(4096); extern SINETABLE(8192); -extern SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[]; +extern SINETABLE_CONST float *const ff_sine_windows[]; #endif /* AVCODEC_SINEWIN_H */ diff --git a/libavcodec/sinewin_fixed.c b/libavcodec/sinewin_fixed.c deleted file mode 100644 index 27ead29e8e..0000000000 --- a/libavcodec/sinewin_fixed.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 - */ - -#define USE_FIXED 1 -#include "sinewin.h" -#include "sinewin_tablegen.h" diff --git a/libavcodec/sinewin_fixed_tablegen.c b/libavcodec/sinewin_fixed_tablegen.c index 977e6f3cbf..61e5274afa 100644 --- a/libavcodec/sinewin_fixed_tablegen.c +++ b/libavcodec/sinewin_fixed_tablegen.c @@ -20,5 +20,23 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define USE_FIXED 1 -#include "sinewin_tablegen_template.c" +#include "tableprint.h" + +#define BUILD_TABLES +#define CONFIG_HARDCODED_TABLES 0 +#include "sinewin_fixed_tablegen.h" + +int main(void) +{ + write_fileheader(); + + init_sine_windows_fixed(); +#define PRINT_TABLE(size) \ + printf("SINETABLE("#size") = {\n"); \ + write_int32_t_array(sine_ ## size ## _fixed, size); \ + printf("};\n") + PRINT_TABLE(128); + PRINT_TABLE(512); + PRINT_TABLE(1024); + return 0; +} diff --git a/libavcodec/sinewin_fixed_tablegen.h b/libavcodec/sinewin_fixed_tablegen.h new file mode 100644 index 0000000000..c52c90bed7 --- /dev/null +++ b/libavcodec/sinewin_fixed_tablegen.h @@ -0,0 +1,67 @@ +/* + * Header file for hardcoded sine windows + * + * Copyright (c) 2009 Reimar Döffinger + * + * 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 AVCODEC_SINEWIN_FIXED_TABLEGEN_H +#define AVCODEC_SINEWIN_FIXED_TABLEGEN_H + +#ifdef BUILD_TABLES +#undef DECLARE_ALIGNED +#define DECLARE_ALIGNED(align, type, name) type name +#else +#include "libavutil/mem_internal.h" +#endif + +#define SINETABLE(size) \ + static SINETABLE_CONST DECLARE_ALIGNED(32, int, sine_##size##_fixed)[size] + +#if CONFIG_HARDCODED_TABLES +#define init_sine_windows_fixed() +#define SINETABLE_CONST const +#include "libavcodec/sinewin_fixed_tables.h" +#else +// do not use libavutil/libm.h since this is compiled both +// for the host and the target and config.h is only valid for the target +#include +#include "libavutil/attributes.h" + +#define SINETABLE_CONST +SINETABLE( 128); +SINETABLE( 512); +SINETABLE(1024); + +#define SIN_FIX(a) (int)floor((a) * 0x80000000 + 0.5) + +// Generate a sine window. +static av_cold void sine_window_init_fixed(int *window, int n) +{ + for (int i = 0; i < n; i++) + window[i] = SIN_FIX(sinf((i + 0.5) * (M_PI / (2.0 * n)))); +} + +static av_cold void init_sine_windows_fixed(void) +{ + sine_window_init_fixed(sine_128_fixed, 128); + sine_window_init_fixed(sine_512_fixed, 512); + sine_window_init_fixed(sine_1024_fixed, 1024); +} +#endif /* CONFIG_HARDCODED_TABLES */ +#endif /* AVCODEC_SINEWIN_FIXED_TABLEGEN_H */ diff --git a/libavcodec/sinewin_tablegen.c b/libavcodec/sinewin_tablegen.c index dd602668ee..438030ea83 100644 --- a/libavcodec/sinewin_tablegen.c +++ b/libavcodec/sinewin_tablegen.c @@ -20,5 +20,26 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define USE_FIXED 0 -#include "sinewin_tablegen_template.c" +#define CONFIG_HARDCODED_TABLES 0 +#define BUILD_TABLES + +#define SINETABLE_CONST +#define SINETABLE(size) \ + float ff_sine_##size[size] +#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) +#include "sinewin_tablegen.h" +#include "tableprint.h" + +int main(void) +{ + write_fileheader(); + + for (int i = 5; i <= 13; i++) { + ff_init_ff_sine_windows(i); + printf("SINETABLE(%4i) = {\n", 1 << i); + write_float_array(ff_sine_windows[i], 1 << i); + printf("};\n"); + } + + return 0; +} diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h index ced3b7874c..6887d59cfe 100644 --- a/libavcodec/sinewin_tablegen.h +++ b/libavcodec/sinewin_tablegen.h @@ -27,7 +27,6 @@ // do not use libavutil/libm.h since this is compiled both // for the host and the target and config.h is only valid for the target #include -#include "libavcodec/aac_defines.h" #include "libavutil/attributes.h" #include "libavutil/common.h" @@ -46,38 +45,29 @@ SINETABLE(2048); SINETABLE(4096); SINETABLE(8192); #else -#if USE_FIXED -#include "libavcodec/sinewin_fixed_tables.h" -#else #include "libavcodec/sinewin_tables.h" #endif -#endif - -#if USE_FIXED -#define SIN_FIX(a) (int)floor((a) * 0x80000000 + 0.5) -#else -#define SIN_FIX(a) a -#endif -SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[] = { +SINETABLE_CONST float *const ff_sine_windows[] = { NULL, NULL, NULL, NULL, NULL, // unused - AAC_RENAME(ff_sine_32) , AAC_RENAME(ff_sine_64), AAC_RENAME(ff_sine_128), - AAC_RENAME(ff_sine_256), AAC_RENAME(ff_sine_512), AAC_RENAME(ff_sine_1024), - AAC_RENAME(ff_sine_2048), AAC_RENAME(ff_sine_4096), AAC_RENAME(ff_sine_8192), + ff_sine_32, ff_sine_64, ff_sine_128, + ff_sine_256, ff_sine_512, ff_sine_1024, + ff_sine_2048, ff_sine_4096, ff_sine_8192, }; // Generate a sine window. -av_cold void AAC_RENAME(ff_sine_window_init)(INTFLOAT *window, int n) { +av_cold void ff_sine_window_init(float *window, int n) +{ int i; for(i = 0; i < n; i++) - window[i] = SIN_FIX(sinf((i + 0.5) * (M_PI / (2.0 * n)))); + window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n))); } #if !CONFIG_HARDCODED_TABLES && !defined(BUILD_TABLES) #define INIT_FF_SINE_WINDOW_INIT_FUNC(index) \ static void init_ff_sine_window_ ## index(void) \ { \ - AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_windows)[index], 1 << index);\ + ff_sine_window_init(ff_sine_windows[index], 1 << index);\ } INIT_FF_SINE_WINDOW_INIT_FUNC(5) @@ -108,11 +98,12 @@ static AVOnce init_sine_window_once[9] = { }; #endif -av_cold void AAC_RENAME(ff_init_ff_sine_windows)(int index) { - assert(index >= 5 && index < FF_ARRAY_ELEMS(AAC_RENAME(ff_sine_windows))); +av_cold void ff_init_ff_sine_windows(int index) +{ + assert(index >= 5 && index < FF_ARRAY_ELEMS(ff_sine_windows)); #if !CONFIG_HARDCODED_TABLES #ifdef BUILD_TABLES - AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_windows)[index], 1 << index); + ff_sine_window_init(ff_sine_windows[index], 1 << index); #else ff_thread_once(&init_sine_window_once[index - 5], sine_window_init_func_array[index - 5]); #endif diff --git a/libavcodec/sinewin_tablegen_template.c b/libavcodec/sinewin_tablegen_template.c deleted file mode 100644 index 7c3c1d8af2..0000000000 --- a/libavcodec/sinewin_tablegen_template.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Generate a header file for hardcoded sine windows - * - * Copyright (c) 2009 Reimar Döffinger - * - * 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 - */ - -#include -#include "libavcodec/aac_defines.h" -#define CONFIG_HARDCODED_TABLES 0 -#define BUILD_TABLES - -#if USE_FIXED -#define WRITE_FUNC write_int32_t_array -#else -#define WRITE_FUNC write_float_array -#endif - -#define SINETABLE_CONST -#define SINETABLE(size) \ - INTFLOAT AAC_RENAME(ff_sine_##size)[size] -#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) -#include "sinewin_tablegen.h" -#include "tableprint.h" - -int main(void) -{ - int i; - - write_fileheader(); - - for (i = 5; i <= 13; i++) { - AAC_RENAME(ff_init_ff_sine_windows)(i); - printf("SINETABLE(%4i) = {\n", 1 << i); - WRITE_FUNC(AAC_RENAME(ff_sine_windows)[i], 1 << i); - printf("};\n"); - } - - return 0; -} From patchwork Thu Jan 28 16:26:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25238 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 40B3E44BC03 for ; Thu, 28 Jan 2021 18:27:42 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28BE868A764; Thu, 28 Jan 2021 18:27:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C149368A6BD for ; Thu, 28 Jan 2021 18:27:34 +0200 (EET) Received: by mail-ed1-f54.google.com with SMTP id g1so7313960edu.4 for ; Thu, 28 Jan 2021 08:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u1Lr8+1lY3dpJdJohwAReWD5zx71oMjLjhynUwRZ+xs=; b=gNwXtxwu/pP/rFFmNt0g/lPAAad2KoFuGGk9YEuA82c+yW7Qy2Q1QlnFFrOJdw3lrJ NLTe+UGNSafk8pnwadLKJwrJ9oN1cOhxAICUXcpSkdPZ5YRu8qeHgvSqEDAOL88yYLse futPdW2UudhLtnZCywLazBPbebYXomDO4vpJfLD0tHNqrN1O/IeaM6Ckr+iauYsbJu5m 0Flr+w1p3AkJIOFvHiZ1Iycr3NCedvpQXJ6QxmCItKoKz/zeM4FIy49bdyrklJNmv25z QbluPxQaAHY7118zO4a5qd7SLunbp6Fw86pHu/DS/NkjKHEI/2wwNrcpf27ryfk7P9r+ yscA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u1Lr8+1lY3dpJdJohwAReWD5zx71oMjLjhynUwRZ+xs=; b=Nusz/gD8boszfOxfDgaF/Zij+rLgCFVTYeJySfE4uR2HWDwwLmzgjC0BvcIjDlrN/r bAZxMKqhfiA/H8XJmowRooeDI+HGU0mMy0f8I0NizA4RuZOfKsuLAh180+mSjvlkY64L 1In0sU3Q3tlIMN9OQ+CYomu3vqId7sstfkmbAJmSHmGIINtjQIxXSJ/QvNPd8mQSZO2x VaewPKFB9iq/eN0LVtQy0tFAKeOdvMZpKVWigh3mbdNJGPIW7qU3jigRZtI4yfiOcFNv 60yGYc+bSR2YCCLZ94f7XN1uYGOJUan9TeK+ffSxzxCDi95DMJPiiN0xpXmhWIEJcHA7 HLHg== X-Gm-Message-State: AOAM530BG+oUxQIPRJK7utHa9p9hvj2KWXnE6JQF682wE8cj4w/v4D12 GWvCQHS5bjvOsDdfQsujHQV9RGY6BbE= X-Google-Smtp-Source: ABdhPJz30+mAJcq4tWsAIwgPgGoGXGlH71ns2O2P9KcgO5Ocy11fxE4yWDLdsUFIXarAFHobLc3ehg== X-Received: by 2002:a50:fd19:: with SMTP id i25mr344023eds.386.1611851254050; Thu, 28 Jan 2021 08:27:34 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id dj25sm3185288edb.5.2021.01.28.08.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 08:27:33 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Jan 2021 17:26:44 +0100 Message-Id: <20210128162646.2811269-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> References: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/6] avcodec/Makefile: Remove dependency for nonexistent files 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavcodec/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 49955fd02a..614a4b22e0 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1282,7 +1282,6 @@ $(SUBDIR)cbrt_data_fixed.o: $(SUBDIR)cbrt_fixed_tables.h $(SUBDIR)aacdec_fixed.o: $(SUBDIR)sinewin_fixed_tables.h $(SUBDIR)aacps_float.o: $(SUBDIR)aacps_tables.h $(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h -$(SUBDIR)aactab_fixed.o: $(SUBDIR)aac_fixed_tables.h $(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h $(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h $(SUBDIR)mpegaudiodec_common.o: $(SUBDIR)mpegaudiodec_common_tables.h From patchwork Thu Jan 28 16:26:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25239 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 72FFF44BC03 for ; Thu, 28 Jan 2021 18:27:43 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 58E8268A78A; Thu, 28 Jan 2021 18:27:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C6A2C68A764 for ; Thu, 28 Jan 2021 18:27:36 +0200 (EET) Received: by mail-ed1-f48.google.com with SMTP id d2so7331001edz.3 for ; Thu, 28 Jan 2021 08:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=44oyBNZLHXAH9a02twwC5lufdyBSr/SRzolyd7VZQiI=; b=JzdTcwHejWFJjxsX/RbMALomkTbiobc6rUCzERhtRyzdQlIpOknprqil1b31oCIZZy wt+TCiuRFjr5WwXeUqPjd+pIhPbvvB+1Nf641Tnccz1HvUZMzNS5x/oIZtmysqRsotCy WCWyZqkxoguPe2lOoU6VPyJk+9LzJIfLdnvkcSZz8tIYneyfqdDek1H4NQKGOgIjMR1a Re91L6ZWV3JogYM8JADL2d14s5QGkiYfOgcTxv/rotqFhkaBptrdTYuZGC/Bx+O8e2o1 A4MORH5iMQHI/iEWY+q745u63CMyM1SyStZL9hw6h6EWXYNmX3RPCyT9boAjLoz7xs6k k/lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=44oyBNZLHXAH9a02twwC5lufdyBSr/SRzolyd7VZQiI=; b=XmV6VIDasgxPyiRLHALmjkgmslUvYRXuqrvsfDajT044eKvTkESWAeZ5nbi1acXfQ0 Kk9Rxz12Y2yGtJm/OP5p7GRwIz7zlmmJFrCXLfa/Y2F5symhN60RvUPxXplO5faTxtO5 uNNPVfCErLzdZL3+NaHVGi6P21AZAjjszU7HUFzf/r5rs13x26pIomXgJSbc1sfImnEA DfJItAAO8oFCxPP2cfP0dK77BUcE/+CHJDR8WBJuNIHODQRoV2vAuhZZFe2WhYDFW4sf Sl2M5bsQoXOhhHbp3+lzjHY20tza9CzyWe6oEesCCVI1WBJHd4HZ3npi+bb9guFhNM7z 3zyQ== X-Gm-Message-State: AOAM5329zTp7+qgLIyF6fVtsLzY5/YTw+r0iEs7jqGyGUekD6bymJQCw r/i8NXWenMZ08tJKUc+1wQDtg4yftQo= X-Google-Smtp-Source: ABdhPJwqfqNETzwmv4xy9cjPq9m13n2BfnNf+XzmN6AQ3v5YZuLAh5HNwyZaM/3CUdmuZ7hkxA+2TA== X-Received: by 2002:aa7:d987:: with SMTP id u7mr395337eds.62.1611851255838; Thu, 28 Jan 2021 08:27:35 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id dj25sm3185288edb.5.2021.01.28.08.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 08:27:34 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Jan 2021 17:26:45 +0100 Message-Id: <20210128162646.2811269-5-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> References: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/6] avcodec/ac3enc: Share options and defaults 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Both AC-3 encoder share the same options, yet they are nevertheless duplicated in the binary; and the options applying to the EAC-3 encoder are a proper subset of the options for the AC-3 encoders, so that it can use the same options as the former by putting the options specific to AC-3 at the front. This commit implements this. Signed-off-by: Andreas Rheinhardt --- libavcodec/ac3enc.c | 59 ++++++++++++++++++++++ libavcodec/ac3enc.h | 9 +--- libavcodec/ac3enc_fixed.c | 7 +-- libavcodec/ac3enc_float.c | 6 +-- libavcodec/ac3enc_opts_template.c | 82 ------------------------------- libavcodec/eac3enc.c | 7 +-- 6 files changed, 67 insertions(+), 103 deletions(-) delete mode 100644 libavcodec/ac3enc_opts_template.c diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 9dafe0ef55..bae7405fff 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -69,6 +69,65 @@ static const float extmixlev_options[EXTMIXLEV_NUM_OPTIONS] = { LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB, LEVEL_MINUS_6DB, LEVEL_ZERO }; +/* The first two options apply only to the AC-3 encoders; + * the rest is also valid for EAC-3. When modifying it, + * it might be necessary to adapt said offset in eac3enc.c. */ +#define OFFSET(param) offsetof(AC3EncodeContext, options.param) +#define AC3ENC_PARAM (AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) +const AVOption ff_ac3_enc_options[] = { +/* AC-3 downmix levels */ +{"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM}, +{"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM}, +/* audio production information */ +{"mixing_level", "Mixing Level", OFFSET(mixing_level), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 111, AC3ENC_PARAM}, +{"room_type", "Room Type", OFFSET(room_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_SMALL_ROOM, AC3ENC_PARAM, "room_type"}, + {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, + {"large", "Large Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_LARGE_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, + {"small", "Small Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_SMALL_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, +/* Metadata Options */ +{"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, AC3ENC_PARAM}, +{"copyright", "Copyright Bit", OFFSET(copyright), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, +{"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), AV_OPT_TYPE_INT, {.i64 = -31 }, -31, -1, AC3ENC_PARAM}, +{"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsur_mode"}, + {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, + {"on", "Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, + {"off", "Not Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, +{"original", "Original Bit Stream", OFFSET(original), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, +/* extended bitstream information */ +{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_DPLII, AC3ENC_PARAM, "dmix_mode"}, + {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, + {"ltrt", "Lt/Rt Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LTRT }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, + {"loro", "Lo/Ro Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LORO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, + {"dplii", "Dolby Pro Logic II Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_DPLII }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, +{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, +{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, +{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, +{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, +{"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DSUREX_DPLIIZ, AC3ENC_PARAM, "dsurex_mode"}, + {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, + {"on", "Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, + {"off", "Not Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, + {"dpliiz", "Dolby Pro Logic IIz-encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DSUREX_DPLIIZ }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, +{"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dheadphone_mode"}, + {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, + {"on", "Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, + {"off", "Not Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, +{"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_ADCONV_HDCD, AC3ENC_PARAM, "ad_conv_type"}, + {"standard", "Standard (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_STANDARD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, + {"hdcd", "HDCD", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_HDCD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, +/* Other Encoding Options */ +{"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, AC3ENC_PARAM}, +{"channel_coupling", "Channel Coupling", OFFSET(channel_coupling), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, AC3ENC_OPT_ON, AC3ENC_PARAM, "channel_coupling"}, + {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"}, +{"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, 15, AC3ENC_PARAM, "cpl_start_band"}, + {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"}, +{NULL} +}; + +const AVCodecDefault ff_ac3_enc_defaults[] = { + { "b", "0" }, + { NULL } +}; /** * LUT for number of exponent groups. diff --git a/libavcodec/ac3enc.h b/libavcodec/ac3enc.h index ba62891371..c064ba4d63 100644 --- a/libavcodec/ac3enc.h +++ b/libavcodec/ac3enc.h @@ -43,13 +43,6 @@ #define AC3ENC_FLOAT 0 #endif -#define OFFSET(param) offsetof(AC3EncodeContext, options.param) -#define AC3ENC_PARAM (AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) - -#define AC3ENC_TYPE_AC3_FIXED 0 -#define AC3ENC_TYPE_AC3 1 -#define AC3ENC_TYPE_EAC3 2 - #if AC3ENC_FLOAT #include "libavutil/float_dsp.h" #define AC3_NAME(x) ff_ac3_float_ ## x @@ -273,6 +266,8 @@ typedef struct AC3EncodeContext { extern const uint64_t ff_ac3_channel_layouts[19]; +extern const AVOption ff_ac3_enc_options[]; +extern const AVCodecDefault ff_ac3_enc_defaults[]; int ff_ac3_encode_init(AVCodecContext *avctx); int ff_ac3_float_encode_init(AVCodecContext *avctx); diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c index 7a8a77fb93..8b1a062c66 100644 --- a/libavcodec/ac3enc_fixed.c +++ b/libavcodec/ac3enc_fixed.c @@ -35,13 +35,10 @@ #include "eac3enc.h" #include "kbdwin.h" -#define AC3ENC_TYPE AC3ENC_TYPE_AC3_FIXED -#include "ac3enc_opts_template.c" - static const AVClass ac3enc_class = { .class_name = "Fixed-Point AC-3 Encoder", .item_name = av_default_item_name, - .option = ac3_options, + .option = ff_ac3_enc_options, .version = LIBAVUTIL_VERSION_INT, }; @@ -145,5 +142,5 @@ AVCodec ff_ac3_fixed_encoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .supported_samplerates = ff_ac3_sample_rate_tab, .channel_layouts = ff_ac3_channel_layouts, - .defaults = ac3_defaults, + .defaults = ff_ac3_enc_defaults, }; diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index 74f3ab8d86..223874907f 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -34,12 +34,10 @@ #include "kbdwin.h" -#define AC3ENC_TYPE AC3ENC_TYPE_AC3 -#include "ac3enc_opts_template.c" static const AVClass ac3enc_class = { .class_name = "AC-3 Encoder", .item_name = av_default_item_name, - .option = ac3_options, + .option = ff_ac3_enc_options, .version = LIBAVUTIL_VERSION_INT, }; @@ -147,6 +145,6 @@ AVCodec ff_ac3_encoder = { .priv_class = &ac3enc_class, .supported_samplerates = ff_ac3_sample_rate_tab, .channel_layouts = ff_ac3_channel_layouts, - .defaults = ac3_defaults, + .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ac3enc_opts_template.c b/libavcodec/ac3enc_opts_template.c deleted file mode 100644 index 57b65a7a9f..0000000000 --- a/libavcodec/ac3enc_opts_template.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * AC-3 encoder options - * Copyright (c) 2011 Justin Ruggles - * - * 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 - */ - -#include "libavutil/opt.h" -#include "internal.h" -#include "ac3.h" - -static const AVOption ac3_options[] = { -/* Metadata Options */ -{"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, AC3ENC_PARAM}, -#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3 -/* AC-3 downmix levels */ -{"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM}, -{"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM}, -#endif -/* audio production information */ -{"mixing_level", "Mixing Level", OFFSET(mixing_level), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 111, AC3ENC_PARAM}, -{"room_type", "Room Type", OFFSET(room_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_SMALL_ROOM, AC3ENC_PARAM, "room_type"}, - {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, - {"large", "Large Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_LARGE_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, - {"small", "Small Room", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_SMALL_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, -/* other metadata options */ -{"copyright", "Copyright Bit", OFFSET(copyright), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, -{"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), AV_OPT_TYPE_INT, {.i64 = -31 }, -31, -1, AC3ENC_PARAM}, -{"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsur_mode"}, - {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, - {"on", "Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, - {"off", "Not Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, -{"original", "Original Bit Stream", OFFSET(original), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, -/* extended bitstream information */ -{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_DPLII, AC3ENC_PARAM, "dmix_mode"}, - {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, - {"ltrt", "Lt/Rt Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LTRT }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, - {"loro", "Lo/Ro Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LORO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, - {"dplii", "Dolby Pro Logic II Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_DPLII }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, -{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, -{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, -{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, -{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, -{"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DSUREX_DPLIIZ, AC3ENC_PARAM, "dsurex_mode"}, - {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, - {"on", "Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, - {"off", "Not Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, - {"dpliiz", "Dolby Pro Logic IIz-encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DSUREX_DPLIIZ }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, -{"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dheadphone_mode"}, - {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, - {"on", "Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, - {"off", "Not Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, -{"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_ADCONV_HDCD, AC3ENC_PARAM, "ad_conv_type"}, - {"standard", "Standard (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_STANDARD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, - {"hdcd", "HDCD", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_HDCD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, -/* Other Encoding Options */ -{"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, AC3ENC_PARAM}, -{"channel_coupling", "Channel Coupling", OFFSET(channel_coupling), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, AC3ENC_OPT_ON, AC3ENC_PARAM, "channel_coupling"}, - {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"}, -{"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, 15, AC3ENC_PARAM, "cpl_start_band"}, - {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"}, -{NULL} -}; - -static const AVCodecDefault ac3_defaults[] = { - { "b", "0" }, - { NULL } -}; diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c index 585588a480..356bb677c2 100644 --- a/libavcodec/eac3enc.c +++ b/libavcodec/eac3enc.c @@ -32,13 +32,10 @@ #include "eac3_data.h" -#define AC3ENC_TYPE AC3ENC_TYPE_EAC3 -#include "ac3enc_opts_template.c" - static const AVClass eac3enc_class = { .class_name = "E-AC-3 Encoder", .item_name = av_default_item_name, - .option = ac3_options, + .option = &ff_ac3_enc_options[2], /* First two options are AC-3 only. */ .version = LIBAVUTIL_VERSION_INT, }; @@ -265,6 +262,6 @@ AVCodec ff_eac3_encoder = { .priv_class = &eac3enc_class, .supported_samplerates = ff_ac3_sample_rate_tab, .channel_layouts = ff_ac3_channel_layouts, - .defaults = ac3_defaults, + .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; From patchwork Thu Jan 28 16:26:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25240 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 BD34244BC03 for ; Thu, 28 Jan 2021 18:27:45 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A11B768A71A; Thu, 28 Jan 2021 18:27:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C94EE68A6EB for ; Thu, 28 Jan 2021 18:27:37 +0200 (EET) Received: by mail-ed1-f44.google.com with SMTP id d2so7331086edz.3 for ; Thu, 28 Jan 2021 08:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RVU4V+Ojimo4LcpCwvYhv5gVHsxpb9Iu6O1HQRI48pg=; b=Hzq2WEgVaRtci91GCChKEiYGEIke93+C3gRuYulLfSmeJgBBcLfsYtpm8X2u2IqAWT J/KMryPKYfSsPm0hR4qXJclrE1d6ESKqQW5m2I4u+duEwNgVl4JfuSbH8XYYWNVcnhrV Q3YYRUyQ1v7AQaCbjK1sL3mfsDoNDZyJuL6hYzXYnB3Kk7++PK5talra5gpwwyqVBvws ClKJBez7PXmLfJrF0T6OLnc5mKaVBEx8a9J/s/6q9pBpkqCKfqlNZ6Rxec1abqCqD3kF 4NUadbhb0OHO9HJbzn07BIGP548DuOvpaggGZTyYlrnagjGV0uvEaW8OfnW2IrvIT5AW +onw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RVU4V+Ojimo4LcpCwvYhv5gVHsxpb9Iu6O1HQRI48pg=; b=nKGW19UAM2TMbHKEkTsoMKP4dQapHeB5qDXVE5+OofemUUelUSZ1p4OHglJ+GT4ud4 1mEDsOPssJozEc6HviJal9qklfSoNXsJbTQwMouZxR/HvAd0e0m089ZOSvAguvadRoif fvIxuu9sjTyny/aT6okZyzRt36G9KJMVa408BMxFp6JGDLNZGF27Yxe1IantleJP7sxg kJTgN5HR2CTayIh6pKrLNItR7/1hVZK2Ca4K6+vnX5tPaJjpgWKiSUC1JZ58o1wWmGIO EzjEgh+NFsJwmCqgoneJNYI5pBS/e84kDwCdyatolu46RnuuFyN9FDgRB8Jmji1FUH+O ePtg== X-Gm-Message-State: AOAM5331o9WTCK56O7SXE6+2tXfBhAHRIJ8mdYjhirxNX7jsSBz37TGN fTKiYOXX2YCnQtz93entZK3qHOdzpUQ= X-Google-Smtp-Source: ABdhPJzB9jRBraWUCoeLKl+8W1haTso1nWeVABT+RNSR9QAuaMV9nuPOd6xm9jnFezcuVC02A7XGUw== X-Received: by 2002:a50:ee94:: with SMTP id f20mr378319edr.222.1611851257143; Thu, 28 Jan 2021 08:27:37 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id dj25sm3185288edb.5.2021.01.28.08.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 08:27:36 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Jan 2021 17:26:46 +0100 Message-Id: <20210128162646.2811269-6-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> References: <20210128162646.2811269-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/6] avcodec/aacps_fixed_tablegen: Don't include config.h 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It is only valid for the target, not the host and therefore it must not be included when building the tables when hardcoded tables are enabled. Signed-off-by: Andreas Rheinhardt --- libavcodec/aacps_fixed_tablegen.h | 6 +++++- libavcodec/aacps_tablegen_template.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/aacps_fixed_tablegen.h b/libavcodec/aacps_fixed_tablegen.h index 356fb8b293..8fb1da5076 100644 --- a/libavcodec/aacps_fixed_tablegen.h +++ b/libavcodec/aacps_fixed_tablegen.h @@ -36,8 +36,12 @@ #else #include "libavutil/common.h" #include "libavutil/mathematics.h" -#include "libavutil/mem.h" +#ifdef BUILD_TABLES +#undef DECLARE_ALIGNED +#define DECLARE_ALIGNED(align, type, variable) type variable +#else #include "libavutil/mem_internal.h" +#endif #include "aac_defines.h" #include "libavutil/softfloat.h" diff --git a/libavcodec/aacps_tablegen_template.c b/libavcodec/aacps_tablegen_template.c index 341bd44409..e70edf884b 100644 --- a/libavcodec/aacps_tablegen_template.c +++ b/libavcodec/aacps_tablegen_template.c @@ -21,6 +21,7 @@ */ #include +#define BUILD_TABLES #define CONFIG_HARDCODED_TABLES 0 #include "aac_defines.h"