From patchwork Fri Oct 28 21:46:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 39042 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:85a8:b0:a2:d5a7:ad9d with SMTP id s40csp1037741pzd; Fri, 28 Oct 2022 14:47:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Wd0Y+PPR/Jc3PDj79OMpqOOFL6N07JRrjZfVlNO/Wyb2K2a2E++Bp7wUXHsWWW6rWC0nf X-Received: by 2002:a05:6402:428f:b0:454:c988:4bb1 with SMTP id g15-20020a056402428f00b00454c9884bb1mr1440602edc.196.1666993629761; Fri, 28 Oct 2022 14:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666993629; cv=none; d=google.com; s=arc-20160816; b=xskjlZ5ZozFQ8Ip1QnKEqkX8aAlsubE9jwVKph2HWUrXwJb4AXfKxCs09ptEPXmyZf UM+lkQ8fxZqqh9p0NUVKQ3zU/noFDxl3HNFQR6v6sfKY/YmFwQ+7uDjR70Kak55SThnD p2ByJZvPE4FfhmY3e/y2D0EqZ4op+KH1FvDx+bP2Z8D2YKAz5m+bCFuqmwogduX49kKD 3yhk/1Wg3eRxCULLok7StST5j9UNb0iGXe6pwVJjMf3gjH4JzshdytrM+Ya8g8m4V0as k6I3XXlsYWehoZF4Bdrx01EYUb40W5UZwzU/GwPP/ycZJaeM3+ybVa2tNxZSdzjk9ocD KZxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:to:from:date:dkim-signature:delivered-to; bh=GulBXmES5pFTnSmti++YOQsxfQZDNvXAp+iKZckwcYs=; b=l0m74lE1jidPzf9kkOmzP2fQVtPTwJAo69+bUqySs3VlILErblZiS3jVFhlWmCku62 J+a62DIRv7ZPgXOhFM9OMJ+OuQF0ITy1hfWiaGxpBSmcWIlQMLfwFCzhf9mDbmoCLQrn K/VLxvnLOsu0KcceRlbeVZFC2KY+CHoP9LE9EQi/L4HP9sZj6LYirIydfE9Et+rbreLj Kwg704HOdU/1edSg6ExEOjS0Mo3qO3lGZACYWwThfr6mt1O+FuVlWMpzxgTLK4yoX/3K sXTbNY6pum2hlif2CLTeRuLqOQrjE6vmYYJ3A1crti41Z4QfiXao+6HmySBcHYfzFZAz N/rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b=TsBQ9E7k; 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=lynne.ee Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id mp3-20020a1709071b0300b007ad9adabc6bsi4333275ejc.207.2022.10.28.14.47.08; Fri, 28 Oct 2022 14:47:09 -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=@lynne.ee header.s=s1 header.b=TsBQ9E7k; 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=lynne.ee Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3864A68BD2A; Sat, 29 Oct 2022 00:47:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0992568BCE1 for ; Sat, 29 Oct 2022 00:46:58 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 32D201060277 for ; Fri, 28 Oct 2022 21:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1666993618; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=AcLWD3jGyP8xVC2fhLTI1z3uxNYXwVOw6RuI/0FOPMc=; b=TsBQ9E7kO8+v+kPChpApGkzZRntZwOP/iCn7QthzApgWJc5dhChGg3/d7SarG0il ECohfy2E3onMo7+wPzXz3AbvJDJQOUgoN4lQEFeg0u7J/ZpyVi+3AYZamJTuwZpuGjp MPYyTbEDiDt7gxQYKlFPziPcdvc0X/6XLRg2hAszXzVuKtLZzIVK6QXRNtQOZfC5UbJ p8PPszYTPqDVEgvuKEQk2JWngWKDVIjr0m91vheiChQTJxj641Z6JhoM0NWIubJsszW UViRFm/aXNkaAG5O1mOspxLisyC/VbxgYHBr4+v3iguUDjarvtGovH1/HIEuCbeS4lX ZuQLfqbnuw== Date: Fri, 28 Oct 2022 23:46:58 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] aacdec: convert to lavu/tx and support fixed-point 960-sample decoding 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ctutOEJ2rHHk This patch replaces the transform used in AAC with lavu/tx and removes the limitation on only being able to decode 960-sample files with the float decoder. This commit also removes a whole bunch of unnecessary and slow lifting steps the decoder did to compensate for the poor accuracy of the old integer transformation code. Overall float decoder speedup on Zen 3 for 64kbps: 32% Patch attached. Note: lavu/tx's PFA 960pt transform currently has a bug that'll get fixed by my next patchset. The naive transforms are unaffected and may be used to test 960pt fixed-point decoding. From 95625b470fb61676e838310dc0108eb648f972a3 Mon Sep 17 00:00:00 2001 From: Lynne Date: Fri, 28 Oct 2022 21:36:10 +0200 Subject: [PATCH] aacdec: convert to lavu/tx and support fixed-point 960-sample decoding This patch replaces the transform used in AAC with lavu/tx and removes the limitation on only being able to decode 960-sample files with the float decoder. This commit also removes a whole bunch of unnecessary and slow lifting steps the decoder did to compensate for the poor accuracy of the old integer transformation code. Overall float decoder speedup on Zen 3 for 64kbps: 32% --- configure | 4 +- libavcodec/aac.h | 27 ++++--- libavcodec/aac_defines.h | 4 +- libavcodec/aacdec.c | 4 +- libavcodec/aacdec_fixed.c | 5 +- libavcodec/aacdec_template.c | 106 ++++++++++------------------ libavcodec/aacsbr.c | 1 - libavcodec/aacsbr_fixed.c | 1 - libavcodec/mips/aacdec_mips.c | 4 +- libavcodec/sinewin_fixed_tablegen.c | 3 + libavcodec/sinewin_fixed_tablegen.h | 6 ++ 11 files changed, 74 insertions(+), 91 deletions(-) diff --git a/configure b/configure index 70c9e41dcc..97a7cdd7fd 100755 --- a/configure +++ b/configure @@ -2763,8 +2763,8 @@ vc1dsp_select="h264chroma qpeldsp startcode" rdft_select="fft" # decoders / encoders -aac_decoder_select="adts_header mdct15 mdct mpeg4audio sinewin" -aac_fixed_decoder_select="adts_header mdct mpeg4audio" +aac_decoder_select="adts_header mpeg4audio sinewin" +aac_fixed_decoder_select="adts_header mpeg4audio" 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/aac.h b/libavcodec/aac.h index c8d6b17710..285d3b7482 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -36,11 +36,8 @@ #include "libavutil/float_dsp.h" #include "libavutil/fixed_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "avcodec.h" -#if !USE_FIXED -#include "mdct15.h" -#endif -#include "fft.h" #include "mpeg4audio.h" #include "sbr.h" @@ -326,16 +323,24 @@ struct AACContext { * @name Computed / set up during initialization * @{ */ - FFTContext mdct; - FFTContext mdct_small; - FFTContext mdct_ld; - FFTContext mdct_ltp; + AVTXContext *mdct120; + AVTXContext *mdct128; + AVTXContext *mdct480; + AVTXContext *mdct512; + AVTXContext *mdct960; + AVTXContext *mdct1024; + AVTXContext *mdct_ltp; + + av_tx_fn mdct120_fn; + av_tx_fn mdct128_fn; + av_tx_fn mdct480_fn; + av_tx_fn mdct512_fn; + av_tx_fn mdct960_fn; + av_tx_fn mdct1024_fn; + av_tx_fn mdct_ltp_fn; #if USE_FIXED AVFixedDSPContext *fdsp; #else - MDCT15Context *mdct120; - MDCT15Context *mdct480; - MDCT15Context *mdct960; AVFloatDSPContext *fdsp; #endif /* USE_FIXED */ int random_state; diff --git a/libavcodec/aac_defines.h b/libavcodec/aac_defines.h index a3c680b65c..21063c4d58 100644 --- a/libavcodec/aac_defines.h +++ b/libavcodec/aac_defines.h @@ -45,7 +45,7 @@ typedef int AAC_SIGNE; #define Q23(a) (int)((a) * 8388608.0 + 0.5) #define Q30(x) (int)((x)*1073741824.0 + 0.5) #define Q31(x) (int)((x)*2147483648.0 + 0.5) -#define RANGE15(x) x +#define TX_SCALE(x) ((x) * 128.0f) #define GET_GAIN(x, y) (-(y) * (1 << (x))) + 1024 #define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16) #define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26) @@ -94,7 +94,7 @@ typedef unsigned AAC_SIGNE; #define Q23(x) ((float)(x)) #define Q30(x) ((float)(x)) #define Q31(x) ((float)(x)) -#define RANGE15(x) (32768.0 * (x)) +#define TX_SCALE(x) ((x) / 32768.0f) #define GET_GAIN(x, y) powf((x), -(y)) #define AAC_MUL16(x, y) ((x) * (y)) #define AAC_MUL26(x, y) ((x) * (y)) diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 2fdfd6b221..ca31540d3c 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -32,16 +32,14 @@ * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) */ -#define FFT_FLOAT 1 #define USE_FIXED 0 +#define TX_TYPE AV_TX_FLOAT_MDCT #include "libavutil/float_dsp.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" #include "get_bits.h" -#include "fft.h" -#include "mdct15.h" #include "lpc.h" #include "kbdwin.h" #include "sinewin.h" diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 8c5dad2813..46f0ebf91b 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -58,15 +58,14 @@ * @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com ) */ -#define FFT_FLOAT 0 #define USE_FIXED 1 +#define TX_TYPE AV_TX_INT32_MDCT #include "libavutil/fixed_dsp.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" #include "get_bits.h" -#include "fft.h" #include "lpc.h" #include "kbdwin.h" #include "sinewin_fixed_tablegen.h" @@ -87,6 +86,8 @@ DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_long_1024))[1024]; DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_128))[128]; +DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_long_960))[960]; +DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_120))[120]; static av_always_inline void reset_predict_state(PredictorState *ps) { diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 4a9513d53e..cdf266dbfa 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -931,13 +931,6 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx, uint8_t layout_map[MAX_ELEM_ID*4][3]; int tags = 0; -#if USE_FIXED - if (get_bits1(gb)) { // frameLengthFlag - avpriv_report_missing_feature(avctx, "Fixed point 960/120 MDCT window"); - return AVERROR_PATCHWELCOME; - } - m4ac->frame_length_short = 0; -#else m4ac->frame_length_short = get_bits1(gb); if (m4ac->frame_length_short && m4ac->sbr == 1) { avpriv_report_missing_feature(avctx, "SBR with 960 frame length"); @@ -945,7 +938,6 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx, m4ac->sbr = 0; m4ac->ps = 0; } -#endif if (get_bits1(gb)) // dependsOnCoreCoder skip_bits(gb, 14); // coreCoderDelay @@ -1022,14 +1014,8 @@ static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx, m4ac->ps = 0; m4ac->sbr = 0; -#if USE_FIXED - if (get_bits1(gb)) { // frameLengthFlag - avpriv_request_sample(avctx, "960/120 MDCT window"); - return AVERROR_PATCHWELCOME; - } -#else m4ac->frame_length_short = get_bits1(gb); -#endif + res_flags = get_bits(gb, 3); if (res_flags) { avpriv_report_missing_feature(avctx, @@ -1256,9 +1242,10 @@ static av_cold void aac_static_table_init(void) 352); // window initialization -#if !USE_FIXED AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); + +#if !USE_FIXED 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); @@ -1276,6 +1263,7 @@ static AVOnce aac_table_init = AV_ONCE_INIT; static av_cold int aac_decode_init(AVCodecContext *avctx) { + float scale; AACContext *ac = avctx->priv_data; int ret; @@ -1348,21 +1336,25 @@ static av_cold int aac_decode_init(AVCodecContext *avctx) ac->random_state = 0x1f2e3d4c; - AAC_RENAME_32(ff_mdct_init)(&ac->mdct, 11, 1, 1.0 / RANGE15(1024.0)); - AAC_RENAME_32(ff_mdct_init)(&ac->mdct_ld, 10, 1, 1.0 / RANGE15(512.0)); - AAC_RENAME_32(ff_mdct_init)(&ac->mdct_small, 8, 1, 1.0 / RANGE15(128.0)); - AAC_RENAME_32(ff_mdct_init)(&ac->mdct_ltp, 11, 0, RANGE15(-2.0)); -#if !USE_FIXED - ret = ff_mdct15_init(&ac->mdct120, 1, 3, 1.0f/(16*1024*120*2)); - if (ret < 0) - return ret; - ret = ff_mdct15_init(&ac->mdct480, 1, 5, 1.0f/(16*1024*960)); - if (ret < 0) +#define MDCT_INIT(s, fn, len, sval) \ + scale = sval; \ + ret = av_tx_init(&s, &fn, TX_TYPE, 1, len, &scale, 0); \ + if (ret < 0) \ return ret; - ret = ff_mdct15_init(&ac->mdct960, 1, 6, 1.0f/(16*1024*960*2)); + + MDCT_INIT(ac->mdct120, ac->mdct120_fn, 120, TX_SCALE(1.0/120)) + MDCT_INIT(ac->mdct128, ac->mdct128_fn, 128, TX_SCALE(1.0/128)) + MDCT_INIT(ac->mdct480, ac->mdct480_fn, 480, TX_SCALE(1.0/480)) + MDCT_INIT(ac->mdct512, ac->mdct512_fn, 512, TX_SCALE(1.0/512)) + MDCT_INIT(ac->mdct960, ac->mdct960_fn, 960, TX_SCALE(1.0/960)) + MDCT_INIT(ac->mdct1024, ac->mdct1024_fn, 1024, TX_SCALE(1.0/1024)) +#undef MDCT_INIT + + /* LTP forward MDCT */ + scale = USE_FIXED ? -1.0 : -32786.0*2 + 36; + ret = av_tx_init(&ac->mdct_ltp, &ac->mdct_ltp_fn, TX_TYPE, 0, 1024, &scale, 0); if (ret < 0) return ret; -#endif return 0; } @@ -2691,7 +2683,7 @@ static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out, ac->fdsp->vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128); memset(in + 1024 + 576, 0, 448 * sizeof(*in)); } - ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in); + ac->mdct_ltp_fn(ac->mdct_ltp, out, in, sizeof(INTFLOAT)); } /** @@ -2783,13 +2775,9 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) // imdct if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { for (i = 0; i < 1024; i += 128) - ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i); + ac->mdct128_fn(ac->mdct128, buf + i, in + i, sizeof(INTFLOAT)); } else { - ac->mdct.imdct_half(&ac->mdct, buf, in); -#if USE_FIXED - for (i=0; i<1024; i++) - buf[i] = (buf[i] + 4LL) >> 3; -#endif /* USE_FIXED */ + ac->mdct1024_fn(ac->mdct1024, buf, in, sizeof(INTFLOAT)); } /* window overlapping @@ -2837,7 +2825,6 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) */ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) { -#if !USE_FIXED IndividualChannelStream *ics = &sce->ics; INTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; @@ -2852,9 +2839,9 @@ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) // imdct if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { for (i = 0; i < 8; i++) - ac->mdct120->imdct_half(ac->mdct120, buf + i * 120, in + i * 128, 1); + ac->mdct120_fn(ac->mdct120, buf + i * 120, in + i * 128, sizeof(INTFLOAT)); } else { - ac->mdct960->imdct_half(ac->mdct960, buf, in, 1); + ac->mdct960_fn(ac->mdct960, buf, in, sizeof(INTFLOAT)); } /* window overlapping @@ -2896,7 +2883,6 @@ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) } else { // LONG_STOP or ONLY_LONG memcpy( saved, buf + 480, 480 * sizeof(*saved)); } -#endif } static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce) { @@ -2905,17 +2891,9 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce) INTFLOAT *out = sce->ret; INTFLOAT *saved = sce->saved; INTFLOAT *buf = ac->buf_mdct; -#if USE_FIXED - int i; -#endif /* USE_FIXED */ // imdct - ac->mdct.imdct_half(&ac->mdct_ld, buf, in); - -#if USE_FIXED - for (i = 0; i < 1024; i++) - buf[i] = (buf[i] + 2) >> 2; -#endif /* USE_FIXED */ + ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT)); // window overlapping if (ics->use_kb_window[1]) { @@ -2954,20 +2932,15 @@ static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce) temp = in[i ]; in[i ] = -in[n - 1 - i]; in[n - 1 - i] = temp; temp = -in[i + 1]; in[i + 1] = in[n - 2 - i]; in[n - 2 - i] = temp; } -#if !USE_FIXED + if (n == 480) - ac->mdct480->imdct_half(ac->mdct480, buf, in, 1); + ac->mdct480_fn(ac->mdct480, buf, in, sizeof(INTFLOAT)); else -#endif - ac->mdct.imdct_half(&ac->mdct_ld, buf, in); - -#if USE_FIXED - for (i = 0; i < 1024; i++) - buf[i] = (buf[i] + 1) >> 1; -#endif /* USE_FIXED */ + ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT)); for (i = 0; i < n; i+=2) { - buf[i] = -buf[i]; + buf[i + 0] = -(USE_FIXED + 1)*buf[i + 0]; + buf[i + 1] = (USE_FIXED + 1)*buf[i + 1]; } // Like with the regular IMDCT at this point we still have the middle half // of a transform but with even symmetry on the left and odd symmetry on @@ -3529,15 +3502,14 @@ static av_cold int aac_decode_close(AVCodecContext *avctx) } } - ff_mdct_end(&ac->mdct); - ff_mdct_end(&ac->mdct_small); - ff_mdct_end(&ac->mdct_ld); - ff_mdct_end(&ac->mdct_ltp); -#if !USE_FIXED - ff_mdct15_uninit(&ac->mdct120); - ff_mdct15_uninit(&ac->mdct480); - ff_mdct15_uninit(&ac->mdct960); -#endif + av_tx_uninit(&ac->mdct120); + av_tx_uninit(&ac->mdct128); + av_tx_uninit(&ac->mdct480); + av_tx_uninit(&ac->mdct512); + av_tx_uninit(&ac->mdct960); + av_tx_uninit(&ac->mdct1024); + av_tx_uninit(&ac->mdct_ltp); + av_freep(&ac->fdsp); return 0; } diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index b74cd82ac0..47aa6cb3c1 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -31,7 +31,6 @@ #include "sbr.h" #include "aacsbr.h" #include "aacsbrdata.h" -#include "fft.h" #include "internal.h" #include "aacps.h" #include "sbrdsp.h" diff --git a/libavcodec/aacsbr_fixed.c b/libavcodec/aacsbr_fixed.c index ffa63f2647..cac472552e 100644 --- a/libavcodec/aacsbr_fixed.c +++ b/libavcodec/aacsbr_fixed.c @@ -60,7 +60,6 @@ #include "sbr.h" #include "aacsbr.h" #include "aacsbrdata.h" -#include "fft.h" #include "aacps.h" #include "sbrdsp.h" #include "libavutil/internal.h" diff --git a/libavcodec/mips/aacdec_mips.c b/libavcodec/mips/aacdec_mips.c index 7b5f18a5d8..cd357cedbc 100644 --- a/libavcodec/mips/aacdec_mips.c +++ b/libavcodec/mips/aacdec_mips.c @@ -126,9 +126,9 @@ static void imdct_and_windowing_mips(AACContext *ac, SingleChannelElement *sce) if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { for (i = 0; i < 1024; i += 128) - ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i); + ac->mdct128_fn(ac->mdct128, buf + i, in + i, sizeof(float)); } else - ac->mdct.imdct_half(&ac->mdct, buf, in); + ac->mdct1024_fn(ac->mdct1024, buf, in, sizeof(float)); /* window overlapping * NOTE: To simplify the overlapping code, all 'meaningless' short to long diff --git a/libavcodec/sinewin_fixed_tablegen.c b/libavcodec/sinewin_fixed_tablegen.c index 61e5274afa..15f0cc2072 100644 --- a/libavcodec/sinewin_fixed_tablegen.c +++ b/libavcodec/sinewin_fixed_tablegen.c @@ -35,8 +35,11 @@ int main(void) printf("SINETABLE("#size") = {\n"); \ write_int32_t_array(sine_ ## size ## _fixed, size); \ printf("};\n") + PRINT_TABLE(120); PRINT_TABLE(128); + PRINT_TABLE(480); PRINT_TABLE(512); + PRINT_TABLE(960); PRINT_TABLE(1024); return 0; } diff --git a/libavcodec/sinewin_fixed_tablegen.h b/libavcodec/sinewin_fixed_tablegen.h index c52c90bed7..056735704c 100644 --- a/libavcodec/sinewin_fixed_tablegen.h +++ b/libavcodec/sinewin_fixed_tablegen.h @@ -44,8 +44,11 @@ #include "libavutil/attributes.h" #define SINETABLE_CONST +SINETABLE( 120); SINETABLE( 128); +SINETABLE( 480); SINETABLE( 512); +SINETABLE( 960); SINETABLE(1024); #define SIN_FIX(a) (int)floor((a) * 0x80000000 + 0.5) @@ -59,8 +62,11 @@ static av_cold void sine_window_init_fixed(int *window, int n) static av_cold void init_sine_windows_fixed(void) { + sine_window_init_fixed(sine_120_fixed, 120); sine_window_init_fixed(sine_128_fixed, 128); + sine_window_init_fixed(sine_480_fixed, 480); sine_window_init_fixed(sine_512_fixed, 512); + sine_window_init_fixed(sine_960_fixed, 960); sine_window_init_fixed(sine_1024_fixed, 1024); } #endif /* CONFIG_HARDCODED_TABLES */ -- 2.37.2.609.g9ff673ca1a