Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 04/30] avcodec: remove deprecated FF_API_AVFFT
Date: Sun, 23 Feb 2025 19:06:04 -0300
Message-ID: <20250223220630.18756-5-jamrial@gmail.com> (raw)
In-Reply-To: <20250223220630.18756-1-jamrial@gmail.com>

Deprecated since 2023-09-01.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/Makefile        |   2 -
 libavcodec/avfft.c         | 268 -------------------------------------
 libavcodec/avfft.h         | 149 ---------------------
 libavcodec/version_major.h |   1 -
 4 files changed, 420 deletions(-)
 delete mode 100644 libavcodec/avfft.c
 delete mode 100644 libavcodec/avfft.h

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 9630074205..9a6393d9a1 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -5,7 +5,6 @@ HEADERS = ac3_parser.h                                                  \
           adts_parser.h                                                 \
           avcodec.h                                                     \
           avdct.h                                                       \
-          avfft.h                                                       \
           bsf.h                                                         \
           codec.h                                                       \
           codec_desc.h                                                  \
@@ -31,7 +30,6 @@ OBJS = ac3_parser.o                                                     \
        allcodecs.o                                                      \
        avcodec.o                                                        \
        avdct.o                                                          \
-       avfft.o                                                          \
        packet.o                                                         \
        bitstream.o                                                      \
        bitstream_filters.o                                              \
diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
deleted file mode 100644
index f6787937f6..0000000000
--- a/libavcodec/avfft.c
+++ /dev/null
@@ -1,268 +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
- */
-
-#include <stddef.h>
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/macros.h"
-#include "libavutil/mem.h"
-#include "libavutil/tx.h"
-#include "avfft.h"
-
-typedef struct AVTXWrapper {
-    AVTXContext *ctx;
-    av_tx_fn fn;
-
-    AVTXContext *ctx2;
-    av_tx_fn fn2;
-
-    ptrdiff_t stride;
-    int len;
-    int inv;
-
-    float *tmp;
-    int out_of_place;
-} AVTXWrapper;
-
-/* FFT */
-
-FFTContext *av_fft_init(int nbits, int inverse)
-{
-    int ret;
-    float scale = 1.0f;
-    AVTXWrapper *s = av_mallocz(sizeof(*s));
-    if (!s)
-        return NULL;
-
-    ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_FFT, inverse, 1 << nbits,
-                     &scale, AV_TX_INPLACE);
-    if (ret < 0) {
-        av_free(s);
-        return NULL;
-    }
-
-    return (FFTContext *)s;
-}
-
-void av_fft_permute(FFTContext *s, FFTComplex *z)
-{
-    /* Empty */
-}
-
-void av_fft_calc(FFTContext *s, FFTComplex *z)
-{
-    AVTXWrapper *w = (AVTXWrapper *)s;
-    w->fn(w->ctx, z, (void *)z, sizeof(AVComplexFloat));
-}
-
-av_cold void av_fft_end(FFTContext *s)
-{
-    if (s) {
-        AVTXWrapper *w = (AVTXWrapper *)s;
-        av_tx_uninit(&w->ctx);
-        av_tx_uninit(&w->ctx2);
-        av_free(w);
-    }
-}
-
-FFTContext *av_mdct_init(int nbits, int inverse, double scale)
-{
-    int ret;
-    float scale_f = scale;
-    AVTXWrapper *s = av_mallocz(sizeof(*s));
-    if (!s)
-        return NULL;
-
-    ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1), &scale_f, 0);
-    if (ret < 0) {
-        av_free(s);
-        return NULL;
-    }
-
-    if (inverse) {
-        ret = av_tx_init(&s->ctx2, &s->fn2, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1),
-                         &scale_f, AV_TX_FULL_IMDCT);
-        if (ret < 0) {
-            av_tx_uninit(&s->ctx);
-            av_free(s);
-            return NULL;
-        }
-    }
-
-    return (FFTContext *)s;
-}
-
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    AVTXWrapper *w = (AVTXWrapper *)s;
-    w->fn2(w->ctx2, output, (void *)input, sizeof(float));
-}
-
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    AVTXWrapper *w = (AVTXWrapper *)s;
-    w->fn(w->ctx, output, (void *)input, sizeof(float));
-}
-
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    AVTXWrapper *w = (AVTXWrapper *)s;
-    w->fn(w->ctx, output, (void *)input, sizeof(float));
-}
-
-av_cold void av_mdct_end(FFTContext *s)
-{
-    if (s) {
-        AVTXWrapper *w = (AVTXWrapper *)s;
-        av_tx_uninit(&w->ctx2);
-        av_tx_uninit(&w->ctx);
-        av_free(w);
-    }
-}
-
-RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans)
-{
-    int ret;
-    float scale = trans == IDFT_C2R ? 0.5f : 1.0f;
-    AVTXWrapper *s;
-
-    /* The other 2 modes are unconventional, do not form an orthogonal
-     * transform, have never been useful, and so they're not implemented. */
-    if (trans != IDFT_C2R && trans != DFT_R2C)
-        return NULL;
-
-    s = av_mallocz(sizeof(*s));
-    if (!s)
-        return NULL;
-
-    ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_RDFT, trans == IDFT_C2R,
-                     1 << nbits, &scale, 0x0);
-    if (ret < 0) {
-        av_free(s);
-        return NULL;
-    }
-
-    s->stride = (trans == DFT_C2R) ? sizeof(AVComplexFloat) : sizeof(float);
-    s->len = 1 << nbits;
-    s->inv = trans == IDFT_C2R;
-
-    s->tmp = av_malloc((s->len + 2)*sizeof(float));
-    if (!s->tmp) {
-        av_tx_uninit(&s->ctx);
-        av_free(s);
-        return NULL;
-    }
-
-    return (RDFTContext *)s;
-}
-
-void av_rdft_calc(RDFTContext *s, FFTSample *data)
-{
-    AVTXWrapper *w = (AVTXWrapper *)s;
-    float *src = w->inv ? w->tmp : (float *)data;
-    float *dst = w->inv ? (float *)data : w->tmp;
-
-    if (w->inv) {
-        memcpy(src, data, w->len*sizeof(float));
-
-        src[w->len] = src[1];
-        src[1] = 0.0f;
-    }
-
-    w->fn(w->ctx, dst, (void *)src, w->stride);
-
-    if (!w->inv) {
-        dst[1] = dst[w->len];
-        memcpy(data, dst, w->len*sizeof(float));
-    }
-}
-
-av_cold void av_rdft_end(RDFTContext *s)
-{
-    if (s) {
-        AVTXWrapper *w = (AVTXWrapper *)s;
-        av_tx_uninit(&w->ctx);
-        av_free(w->tmp);
-        av_free(w);
-    }
-}
-
-DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
-{
-    int ret;
-    const float scale_map[] = {
-        [DCT_II] = 0.5f,
-        [DCT_III] = 1.0f / (1 << nbits),
-        [DCT_I] = 0.5f,
-        [DST_I] = 2.0f,
-    };
-    static const enum AVTXType type_map[] = {
-        [DCT_II] = AV_TX_FLOAT_DCT,
-        [DCT_III] = AV_TX_FLOAT_DCT,
-        [DCT_I] = AV_TX_FLOAT_DCT_I,
-        [DST_I] = AV_TX_FLOAT_DST_I,
-    };
-
-    AVTXWrapper *s = av_mallocz(sizeof(*s));
-    if (!s)
-        return NULL;
-
-    s->len = (1 << nbits);
-    s->out_of_place = (inverse == DCT_I) || (inverse == DST_I);
-
-    ret = av_tx_init(&s->ctx, &s->fn, type_map[inverse],
-                     (inverse == DCT_III), 1 << (nbits - (inverse == DCT_III)),
-                     &scale_map[inverse], s->out_of_place ? 0 : AV_TX_INPLACE);
-    if (ret < 0) {
-        av_free(s);
-        return NULL;
-    }
-
-    if (s->out_of_place) {
-        s->tmp = av_malloc((1 << (nbits + 1))*sizeof(float));
-        if (!s->tmp) {
-            av_tx_uninit(&s->ctx);
-            av_free(s);
-            return NULL;
-        }
-    }
-
-    return (DCTContext *)s;
-}
-
-void av_dct_calc(DCTContext *s, FFTSample *data)
-{
-    AVTXWrapper *w = (AVTXWrapper *)s;
-    if (w->out_of_place) {
-        memcpy(w->tmp, data, w->len*sizeof(float));
-        w->fn(w->ctx, (void *)data, w->tmp, sizeof(float));
-    } else {
-        w->fn(w->ctx, data, (void *)data, sizeof(float));
-    }
-}
-
-av_cold void av_dct_end(DCTContext *s)
-{
-    if (s) {
-        AVTXWrapper *w = (AVTXWrapper *)s;
-        av_tx_uninit(&w->ctx);
-        av_free(w->tmp);
-        av_free(w);
-    }
-}
diff --git a/libavcodec/avfft.h b/libavcodec/avfft.h
deleted file mode 100644
index e3a0da1eb9..0000000000
--- a/libavcodec/avfft.h
+++ /dev/null
@@ -1,149 +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
- */
-
-#ifndef AVCODEC_AVFFT_H
-#define AVCODEC_AVFFT_H
-
-#include "libavutil/attributes.h"
-#include "version_major.h"
-#if FF_API_AVFFT
-
-/**
- * @file
- * @ingroup lavc_fft
- * FFT functions
- */
-
-/**
- * @defgroup lavc_fft FFT functions
- * @ingroup lavc_misc
- *
- * @{
- */
-
-typedef float FFTSample;
-
-typedef struct FFTComplex {
-    FFTSample re, im;
-} FFTComplex;
-
-typedef struct FFTContext FFTContext;
-
-/**
- * Set up a complex FFT.
- * @param nbits           log2 of the length of the input array
- * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
- * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT
- */
-attribute_deprecated
-FFTContext *av_fft_init(int nbits, int inverse);
-
-/**
- * Do the permutation needed BEFORE calling ff_fft_calc().
- * @deprecated without replacement
- */
-attribute_deprecated
-void av_fft_permute(FFTContext *s, FFTComplex *z);
-
-/**
- * Do a complex FFT with the parameters defined in av_fft_init(). The
- * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
- * @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation
- */
-attribute_deprecated
-void av_fft_calc(FFTContext *s, FFTComplex *z);
-
-attribute_deprecated
-void av_fft_end(FFTContext *s);
-
-/**
- * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT,
- * with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc.
- */
-attribute_deprecated
-FFTContext *av_mdct_init(int nbits, int inverse, double scale);
-attribute_deprecated
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-attribute_deprecated
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
-attribute_deprecated
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-attribute_deprecated
-void av_mdct_end(FFTContext *s);
-
-/* Real Discrete Fourier Transform */
-
-enum RDFTransformType {
-    DFT_R2C,
-    IDFT_C2R,
-    IDFT_R2C,
-    DFT_C2R,
-};
-
-typedef struct RDFTContext RDFTContext;
-
-/**
- * Set up a real FFT.
- * @param nbits           log2 of the length of the input array
- * @param trans           the type of transform
- *
- * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT
- */
-attribute_deprecated
-RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
-attribute_deprecated
-void av_rdft_calc(RDFTContext *s, FFTSample *data);
-attribute_deprecated
-void av_rdft_end(RDFTContext *s);
-
-/* Discrete Cosine Transform */
-
-typedef struct DCTContext DCTContext;
-
-enum DCTTransformType {
-    DCT_II = 0,
-    DCT_III,
-    DCT_I,
-    DST_I,
-};
-
-/**
- * Set up DCT.
- *
- * @param nbits           size of the input array:
- *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
- *                        (1 << nbits) + 1 for DCT-I
- * @param type            the type of transform
- *
- * @note the first element of the input of DST-I is ignored
- *
- * @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT
- */
-attribute_deprecated
-DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
-attribute_deprecated
-void av_dct_calc(DCTContext *s, FFTSample *data);
-attribute_deprecated
-void av_dct_end (DCTContext *s);
-
-/**
- * @}
- */
-
-#endif /* FF_API_AVFFT */
-#endif /* AVCODEC_AVFFT_H */
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index ee3277cb76..dd92e1fbc5 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -39,7 +39,6 @@
 
 #define FF_API_INIT_PACKET         (LIBAVCODEC_VERSION_MAJOR < 62)
 
-#define FF_API_AVFFT               (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_FF_PROFILE_LEVEL    (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_AVCODEC_CLOSE       (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_BUFFER_MIN_SIZE     (LIBAVCODEC_VERSION_MAJOR < 62)
-- 
2.48.1

_______________________________________________
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".

  parent reply	other threads:[~2025-02-23 22:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-23 22:06 [FFmpeg-devel] [PATCH 00/31] Major library soname bump James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 01/30] avcodec: remove deprecated FF_API_SUBFRAMES James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 02/30] avcodec: remove deprecated FF_API_TICKS_PER_FRAME James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 03/30] avcodec: remove deprecated FF_API_DROPCHANGED James Almer
2025-02-23 22:06 ` James Almer [this message]
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 05/30] avcodec: remove deprecated FF_API_FF_PROFILE_LEVEL James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 06/30] avcodec: remove deprecated FF_API_AVCODEC_CLOSE James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 07/30] avcodec: remove deprecated FF_API_BUFFER_MIN_SIZE James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 08/30] avcodec: remove deprecated FF_API_VDPAU_ALLOC_GET_SET James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 09/30] avcodec: remove deprecated FF_API_QUALITY_FACTOR James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 10/30] avcodec/version_major: postpone some deprecations until the next bump James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 11/30] avdevice: remove deprecated FF_API_BKTR_DEVICE James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 12/30] avdevice: remove deprecated FF_API_OPENGL_DEVICE James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 13/30] avdevice: remove deprecated FF_API_SDL2_DEVICE James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 14/30] avdevice/version_major: postpone some deprecations until the next bump James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 15/30] avformat: remove deprecated FF_API_LAVF_SHORTEST James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 16/30] avformat: remove deprecated FF_API_ALLOW_FLUSH James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 17/30] avformat: remove deprecated FF_API_AVSTREAM_SIDE_DATA James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 18/30] avformat: remove deprecated FF_API_GET_DUR_ESTIMATE_METHOD James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 19/30] avformat/version_major: postpone some deprecations until the next bump James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 20/30] avfilter: remove deprecated FF_API_LINK_PUBLIC James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 21/30] avfilter/version_major: postpone some deprecations until the next bump James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 22/30] avutil: remove deprecated FF_API_HDR_VIVID_THREE_SPLINE James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 23/30] avutil: remove deprecated FF_API_FRAME_PKT James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 24/30] avutil: remove deprecated FF_API_INTERLACED_FRAME James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 25/30] avutil: remove deprecated FF_API_FRAME_KEY James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 26/30] avutil: remove deprecated FF_API_PALETTE_HAS_CHANGED James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 27/30] avutil: remove deprecated FF_API_VULKAN_CONTIGUOUS_MEMORY James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 28/30] avutil: remove deprecated FF_API_H274_FILM_GRAIN_VCS James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 29/30] avutil/version_major: postpone some deprecations until the next bump James Almer
2025-02-23 22:06 ` [FFmpeg-devel] [PATCH 30/30] libs: bump major version for all libraries James Almer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250223220630.18756-5-jamrial@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git