FFmpeg
Data Structures | Macros | Functions | Variables
tx.c File Reference
#include "cpu.h"
#include "qsort.h"
#include "bprint.h"
#include "tx_priv.h"

Go to the source code of this file.

Data Structures

struct  TXCodeletMatch
 

Macros

#define TYPE_IS(type, x)
 

Functions

static av_always_inline int mulinv (int n, int m)
 
int ff_tx_gen_compound_mapping (AVTXContext *s, int n, int m)
 
static int split_radix_permutation (int i, int len, int inv)
 
int ff_tx_gen_ptwo_revtab (AVTXContext *s, int invert_lookup)
 
int ff_tx_gen_ptwo_inplace_revtab_idx (AVTXContext *s)
 
static void parity_revtab_generator (int *revtab, int n, int inv, int offset, int is_dual, int dual_high, int len, int basis, int dual_stride, int inv_lookup)
 
int ff_tx_gen_split_radix_parity_revtab (AVTXContext *s, int invert_lookup, int basis, int dual_stride)
 
static void reset_ctx (AVTXContext *s)
 
av_cold void av_tx_uninit (AVTXContext **ctx)
 Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL. More...
 
static av_cold int ff_tx_null_init (AVTXContext *s, const FFTXCodelet *cd, uint64_t flags, FFTXCodeletOptions *opts, int len, int inv, const void *scale)
 
static void ff_tx_null (AVTXContext *s, void *_out, void *_in, ptrdiff_t stride)
 
static void print_flags (AVBPrint *bp, uint64_t f)
 
static void print_type (AVBPrint *bp, enum AVTXType type)
 
static void print_cd_info (const FFTXCodelet *cd, int prio, int print_prio)
 
static void print_tx_structure (AVTXContext *s, int depth)
 
static int cmp_matches (TXCodeletMatch *a, TXCodeletMatch *b)
 
static int check_cd_factors (const FFTXCodelet *cd, int len)
 
av_cold int ff_tx_init_subtx (AVTXContext *s, enum AVTXType type, uint64_t flags, FFTXCodeletOptions *opts, int len, int inv, const void *scale)
 
av_cold int av_tx_init (AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
 Initialize a transform context with the given configuration (i)MDCTs with an odd length are currently not supported. More...
 

Variables

static const FFTXCodelet ff_tx_null_def
 
static const FFTXCodelet *const ff_tx_null_list []
 

Macro Definition Documentation

◆ TYPE_IS

#define TYPE_IS (   type,
 
)
Value:
(((x) == AV_TX_FLOAT_ ## type) || \
((x) == AV_TX_DOUBLE_ ## type) || \
((x) == AV_TX_INT32_ ## type))

Definition at line 25 of file tx.c.

Function Documentation

◆ mulinv()

static av_always_inline int mulinv ( int  n,
int  m 
)
static

Definition at line 31 of file tx.c.

Referenced by ff_tx_gen_compound_mapping().

◆ ff_tx_gen_compound_mapping()

int ff_tx_gen_compound_mapping ( AVTXContext s,
int  n,
int  m 
)

Definition at line 42 of file tx.c.

Referenced by ff_tx_fft_pfa_init(), and ff_tx_mdct_pfa_init().

◆ split_radix_permutation()

static int split_radix_permutation ( int  i,
int  len,
int  inv 
)
inlinestatic

Definition at line 96 of file tx.c.

Referenced by ff_tx_gen_ptwo_revtab(), and parity_revtab_generator().

◆ ff_tx_gen_ptwo_revtab()

int ff_tx_gen_ptwo_revtab ( AVTXContext s,
int  invert_lookup 
)

Definition at line 107 of file tx.c.

Referenced by ff_tx_fft_sr_codelet_init().

◆ ff_tx_gen_ptwo_inplace_revtab_idx()

int ff_tx_gen_ptwo_inplace_revtab_idx ( AVTXContext s)

Definition at line 125 of file tx.c.

Referenced by ff_tx_fft_sr_init().

◆ parity_revtab_generator()

static void parity_revtab_generator ( int revtab,
int  n,
int  inv,
int  offset,
int  is_dual,
int  dual_high,
int  len,
int  basis,
int  dual_stride,
int  inv_lookup 
)
static

Definition at line 167 of file tx.c.

Referenced by ff_tx_gen_split_radix_parity_revtab().

◆ ff_tx_gen_split_radix_parity_revtab()

int ff_tx_gen_split_radix_parity_revtab ( AVTXContext s,
int  invert_lookup,
int  basis,
int  dual_stride 
)

Definition at line 210 of file tx.c.

◆ reset_ctx()

static void reset_ctx ( AVTXContext s)
static

Definition at line 231 of file tx.c.

Referenced by av_tx_uninit(), and ff_tx_init_subtx().

◆ av_tx_uninit()

av_cold void av_tx_uninit ( AVTXContext **  ctx)

Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL.

Definition at line 251 of file tx.c.

Referenced by common_uninit(), config_output(), decode_close(), fir_to_phase(), free_tx_refs(), load_data(), qdmc_decode_close(), siren_close(), uninit(), uninit_segment(), yae_release_buffers(), and yae_reset().

◆ ff_tx_null_init()

static av_cold int ff_tx_null_init ( AVTXContext s,
const FFTXCodelet cd,
uint64_t  flags,
FFTXCodeletOptions opts,
int  len,
int  inv,
const void *  scale 
)
static

Definition at line 260 of file tx.c.

◆ ff_tx_null()

static void ff_tx_null ( AVTXContext s,
void *  _out,
void *  _in,
ptrdiff_t  stride 
)
static

Definition at line 271 of file tx.c.

◆ print_flags()

static void print_flags ( AVBPrint *  bp,
uint64_t  f 
)
static

Definition at line 296 of file tx.c.

Referenced by ff_tx_init_subtx(), and print_cd_info().

◆ print_type()

static void print_type ( AVBPrint *  bp,
enum AVTXType  type 
)
static

Definition at line 320 of file tx.c.

Referenced by ff_tx_init_subtx(), and print_cd_info().

◆ print_cd_info()

static void print_cd_info ( const FFTXCodelet cd,
int  prio,
int  print_prio 
)
static

Definition at line 336 of file tx.c.

Referenced by ff_tx_init_subtx(), and print_tx_structure().

◆ print_tx_structure()

static void print_tx_structure ( AVTXContext s,
int  depth 
)
static

Definition at line 375 of file tx.c.

Referenced by av_tx_init().

◆ cmp_matches()

static int cmp_matches ( TXCodeletMatch a,
TXCodeletMatch b 
)
static

Definition at line 394 of file tx.c.

Referenced by ff_tx_init_subtx().

◆ check_cd_factors()

static int check_cd_factors ( const FFTXCodelet cd,
int  len 
)
inlinestatic

Definition at line 400 of file tx.c.

Referenced by ff_tx_init_subtx().

◆ ff_tx_init_subtx()

av_cold int ff_tx_init_subtx ( AVTXContext s,
enum AVTXType  type,
uint64_t  flags,
FFTXCodeletOptions opts,
int  len,
int  inv,
const void *  scale 
)

◆ av_tx_init()

av_cold int av_tx_init ( AVTXContext **  ctx,
av_tx_fn tx,
enum AVTXType  type,
int  inv,
int  len,
const void *  scale,
uint64_t  flags 
)

Initialize a transform context with the given configuration (i)MDCTs with an odd length are currently not supported.

Parameters
ctxthe context to allocate, will be NULL on error
txpointer to the transform function pointer to set
typetype the type of transform
invwhether to do an inverse or a forward transform
lenthe size of the transform in samples
scalepointer to the value to scale the output if supported by type
flagsa bitmask of AVTXFlags or 0
Returns
0 on success, negative error code on failure

Definition at line 649 of file tx.c.

Referenced by config_input(), config_output(), config_props(), convert_coeffs(), decode_init(), equ_init(), fir_to_phase(), init_segment(), load_data(), qdmc_decode_init(), siren_init(), and yae_reset().

Variable Documentation

◆ ff_tx_null_def

const FFTXCodelet ff_tx_null_def
static
Initial value:
= {
.name = NULL_IF_CONFIG_SMALL("null"),
.function = ff_tx_null,
.type = TX_TYPE_ANY,
.factors[0] = TX_FACTOR_ANY,
.min_len = 1,
.max_len = 1,
.init = ff_tx_null_init,
.cpu_flags = FF_TX_CPU_FLAGS_ALL,
.prio = FF_TX_PRIO_MAX,
}

Definition at line 276 of file tx.c.

◆ ff_tx_null_list

const FFTXCodelet* const ff_tx_null_list[]
static
Initial value:

Definition at line 290 of file tx.c.

Referenced by ff_tx_init_subtx().

ff_tx_null_def
static const FFTXCodelet ff_tx_null_def
Definition: tx.c:276
FF_TX_CPU_FLAGS_ALL
#define FF_TX_CPU_FLAGS_ALL
Definition: tx_priv.h:196
ff_tx_null_init
static av_cold int ff_tx_null_init(AVTXContext *s, const FFTXCodelet *cd, uint64_t flags, FFTXCodeletOptions *opts, int len, int inv, const void *scale)
Definition: tx.c:260
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
FF_TX_ALIGNED
#define FF_TX_ALIGNED
Definition: tx_priv.h:144
TX_TYPE_ANY
#define TX_TYPE_ANY
Definition: tx_priv.h:172
NULL
#define NULL
Definition: coverity.c:32
AV_TX_INPLACE
@ AV_TX_INPLACE
Performs an in-place transformation on the input.
Definition: tx.h:122
ff_tx_null
static void ff_tx_null(AVTXContext *s, void *_out, void *_in, ptrdiff_t stride)
Definition: tx.c:271
FF_TX_OUT_OF_PLACE
#define FF_TX_OUT_OF_PLACE
Definition: tx_priv.h:143
FF_TX_PRIO_MAX
@ FF_TX_PRIO_MAX
Definition: tx_priv.h:156
AV_TX_UNALIGNED
@ AV_TX_UNALIGNED
Relaxes alignment requirement for the in and out arrays of av_tx_fn().
Definition: tx.h:128
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
TX_FACTOR_ANY
#define TX_FACTOR_ANY
Definition: tx_priv.h:178