Go to the documentation of this file.
40 #define SIN(s, n, x) (s->costab[(n) - (x)])
43 #define COS(s, n, x) (s->costab[x])
47 int n = 1 <<
ctx->nbits;
51 for (
i = 1;
i < n / 2;
i++) {
52 float tmp1 =
data[
i ];
53 float tmp2 =
data[n -
i];
57 tmp1 = (tmp1 - tmp2) * 0.5
f;
67 for (
i = 1;
i < n - 2;
i += 2) {
77 int n = 1 <<
ctx->nbits;
79 float next = -0.5f * (
data[0] -
data[n]);
81 for (
i = 0;
i < n / 2;
i++) {
83 float tmp2 =
data[n -
i];
92 tmp1 = (tmp1 + tmp2) * 0.5
f;
101 for (
i = 3;
i <= n;
i += 2)
107 int n = 1 <<
ctx->nbits;
110 float next =
data[n - 1];
111 float inv_n = 1.0f / n;
113 for (
i = n - 2;
i >= 2;
i -= 2) {
114 float val1 =
data[
i];
120 data[
i + 1] =
s * val1 -
c * val2;
127 for (
i = 0;
i < n / 2;
i++) {
128 float tmp1 =
data[
i] * inv_n;
129 float tmp2 =
data[n -
i - 1] * inv_n;
130 float csc =
ctx->csc2[
i] * (tmp1 - tmp2);
133 data[
i] = tmp1 + csc;
134 data[n -
i - 1] = tmp1 - csc;
140 int n = 1 <<
ctx->nbits;
144 for (
i = 0;
i < n / 2;
i++) {
145 float tmp1 =
data[
i];
146 float tmp2 =
data[n -
i - 1];
150 tmp1 = (tmp1 + tmp2) * 0.5
f;
158 next =
data[1] * 0.5;
161 for (
i = n - 2;
i >= 0;
i -= 2) {
162 float inr =
data[
i ];
163 float ini =
data[
i + 1];
170 next +=
s * inr -
c * ini;
185 memset(
s, 0,
sizeof(*
s));
195 s->costab = ff_cos_tabs[nbits + 2];
205 for (
i = 0;
i < n / 2;
i++)
206 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)