Go to the documentation of this file.
38 #define SIN(s, n, x) (s->costab[(n) - (x)])
41 #define COS(s, n, x) (s->costab[x])
45 int n = 1 <<
ctx->nbits;
49 for (
i = 1;
i < n / 2;
i++) {
50 float tmp1 =
data[
i ];
51 float tmp2 =
data[n -
i];
55 tmp1 = (tmp1 - tmp2) * 0.5
f;
65 for (
i = 1;
i < n - 2;
i += 2) {
75 int n = 1 <<
ctx->nbits;
77 float next = -0.5f * (
data[0] -
data[n]);
79 for (
i = 0;
i < n / 2;
i++) {
81 float tmp2 =
data[n -
i];
90 tmp1 = (tmp1 + tmp2) * 0.5
f;
99 for (
i = 3;
i <= n;
i += 2)
105 int n = 1 <<
ctx->nbits;
108 float next =
data[n - 1];
109 float inv_n = 1.0f / n;
111 for (
i = n - 2;
i >= 2;
i -= 2) {
112 float val1 =
data[
i];
118 data[
i + 1] =
s * val1 -
c * val2;
125 for (
i = 0;
i < n / 2;
i++) {
126 float tmp1 =
data[
i] * inv_n;
127 float tmp2 =
data[n -
i - 1] * inv_n;
128 float csc =
ctx->csc2[
i] * (tmp1 - tmp2);
131 data[
i] = tmp1 + csc;
132 data[n -
i - 1] = tmp1 - csc;
138 int n = 1 <<
ctx->nbits;
142 for (
i = 0;
i < n / 2;
i++) {
143 float tmp1 =
data[
i];
144 float tmp2 =
data[n -
i - 1];
148 tmp1 = (tmp1 + tmp2) * 0.5
f;
156 next =
data[1] * 0.5;
159 for (
i = n - 2;
i >= 0;
i -= 2) {
160 float inr =
data[
i ];
161 float ini =
data[
i + 1];
168 next +=
s * inr -
c * ini;
183 memset(
s, 0,
sizeof(*
s));
193 s->costab = ff_cos_tabs[nbits + 2];
203 for (
i = 0;
i < n / 2;
i++)
204 s->csc2[
i] = 0.5 / sin((
M_PI / (2 * n) * (2 *
i + 1)));
#define ff_init_ff_cos_tabs
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
av_cold void ff_rdft_end(RDFTContext *s)
static void dct_calc_I_c(DCTContext *ctx, FFTSample *data)
static void dct32_func(DCTContext *ctx, FFTSample *data)
static void dct_calc_II_c(DCTContext *ctx, FFTSample *data)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
void ff_dct_init_x86(DCTContext *s)
static void dst_calc_I_c(DCTContext *ctx, FFTSample *data)
static void dct_calc_III_c(DCTContext *ctx, FFTSample *data)
av_cold void ff_dct_end(DCTContext *s)
av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
Set up a real FFT.
void ff_dct32_float(float *dst, const float *src)
av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
Set up DCT.
#define i(width, name, range_min, range_max)
#define av_malloc_array(a, b)
static uint32_t inverse(uint32_t v)
find multiplicative inverse modulo 2 ^ 32