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 5BEF2447A0 for ; Fri, 23 Sep 2022 23:20:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 09F2C68BBAB; Sat, 24 Sep 2022 02:20:43 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8642268BB88 for ; Sat, 24 Sep 2022 02:20:36 +0300 (EEST) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id 3EB3A106015B for ; Fri, 23 Sep 2022 23:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1663975236; 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:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=EbJk1hbAnYrpt0+VbSW4NzRM2+aQepny5LHUMw+uk/w=; b=SrHR8+PQUma9abjCroxaYPFoctbC/9aT/KAqZ2eHC5z1gLjlQy9HVGwNOZXK1eup qmxs2kWwMja6TKpvdIGlgPC45BU+6NYHQ/A03/JtcRMg6QCdCKIaC1HhDfO2yhM7M93 IUuDNJS4isJgChpfxFVIAkAbhWO0RjHDriU1VN3vplA8L0E5e4bP9/t8GTZm75MQ0s0 /tN0bKtm+TwxrC2mugxBgB7RCk71QzLnAIZJnodZUMK5ZLGCUXj06265mWcfTxeUp6p b6T3RUlGDQ2yWhpXfwa35Oz8Oy1uviQ+JqUG0KR9f0Zfw4HLDl5wwhOq8u6FbBAuUu9 e1Y7nCIDyw== Date: Sat, 24 Sep 2022 01:20:36 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_48009_1425018319.1663975236235" Subject: [FFmpeg-devel] [PATCH 6/6] wmaprodec: convert to lavu/tx 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" Archived-At: List-Archive: List-Post: ------=_Part_48009_1425018319.1663975236235 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Patch attached. ------=_Part_48009_1425018319.1663975236235 Content-Type: text/x-diff; charset=us-ascii; name=0006-wmaprodec-convert-to-lavu-tx.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0006-wmaprodec-convert-to-lavu-tx.patch >From 4ad73f29065051c68991eb96aeae7f771039209a Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 24 Sep 2022 01:08:00 +0200 Subject: [PATCH 6/6] wmaprodec: convert to lavu/tx --- libavcodec/wmaprodec.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 701dfa955c..68e17e0743 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -89,6 +89,7 @@ #include #include "libavutil/audio_fifo.h" +#include "libavutil/tx.h" #include "libavutil/ffmath.h" #include "libavutil/float_dsp.h" #include "libavutil/intfloat.h" @@ -185,7 +186,8 @@ typedef struct WMAProDecodeCtx { uint8_t frame_data[MAX_FRAMESIZE + AV_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data PutBitContext pb; ///< context for filling the frame_data buffer - FFTContext mdct_ctx[WMAPRO_BLOCK_SIZES]; ///< MDCT context per block size + AVTXContext *tx[WMAPRO_BLOCK_SIZES]; ///< MDCT context per block size + av_tx_fn tx_fn[WMAPRO_BLOCK_SIZES]; DECLARE_ALIGNED(32, float, tmp)[WMAPRO_BLOCK_MAX_SIZE]; ///< IMDCT output buffer const float* windows[WMAPRO_BLOCK_SIZES]; ///< windows for the different block sizes @@ -287,7 +289,7 @@ static av_cold int decode_end(WMAProDecodeCtx *s) av_freep(&s->fdsp); for (i = 0; i < WMAPRO_BLOCK_SIZES; i++) - ff_mdct_end(&s->mdct_ctx[i]); + av_tx_uninit(&s->tx[i]); return 0; } @@ -552,12 +554,13 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx, int nu return AVERROR(ENOMEM); /** init MDCT, FIXME: only init needed sizes */ - for (int i = 0; i < WMAPRO_BLOCK_SIZES; i++) { - ret = ff_mdct_init(&s->mdct_ctx[i], WMAPRO_BLOCK_MIN_BITS + 1 + i, 1, - 1.0 / (1 << (WMAPRO_BLOCK_MIN_BITS + i - 1)) - / (1ll << (s->bits_per_sample - 1))); - if (ret < 0) - return ret; + for (i = 0; i < WMAPRO_BLOCK_SIZES; i++) { + const float scale = 1.0 / (1 << (WMAPRO_BLOCK_MIN_BITS + i - 1)) + / (1ll << (s->bits_per_sample - 1)); + int err = av_tx_init(&s->tx[i], &s->tx_fn[i], AV_TX_FLOAT_MDCT, 1, + 1 << (WMAPRO_BLOCK_MIN_BITS + i), &scale, 0); + if (err < 0) + return err; } /** init MDCT windows: simple sine window */ @@ -1386,7 +1389,8 @@ static int decode_subframe(WMAProDecodeCtx *s) get_bits_count(&s->gb) - s->subframe_offset); if (transmit_coeffs) { - FFTContext *mdct = &s->mdct_ctx[av_log2(subframe_len) - WMAPRO_BLOCK_MIN_BITS]; + AVTXContext *tx = s->tx[av_log2(subframe_len) - WMAPRO_BLOCK_MIN_BITS]; + av_tx_fn tx_fn = s->tx_fn[av_log2(subframe_len) - WMAPRO_BLOCK_MIN_BITS]; /** reconstruct the per channel data */ inverse_channel_transform(s); for (i = 0; i < s->channels_for_cur_subframe; i++) { @@ -1412,7 +1416,7 @@ static int decode_subframe(WMAProDecodeCtx *s) } /** apply imdct (imdct_half == DCTIV with reverse) */ - mdct->imdct_half(mdct, s->channel[c].coeffs, s->tmp); + tx_fn(tx, s->channel[c].coeffs, s->tmp, sizeof(float)); } } -- 2.37.2.609.g9ff673ca1a ------=_Part_48009_1425018319.1663975236235 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". ------=_Part_48009_1425018319.1663975236235--