50 enum ColorMode {
CHANNEL,
INTENSITY,
RAINBOW,
MORELAND,
NEBULAE,
FIRE,
FIERY,
FRUIT,
COOL,
MAGMA,
GREEN,
VIRIDIS,
PLASMA,
CIVIDIS,
TERRAIN,
NB_CLMODES };
103 #define OFFSET(x) offsetof(ShowSpectrumContext, x) 104 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM 189 { 0.13, .03587126228984074, .1573300977624594, -.02548747583751842 },
190 { 0.30, .18572281794568020, .1772436246393981, .17475554840414750 },
191 { 0.60, .28184980583656130, -.1593064119945782, .47132074554608920 },
192 { 0.73, .65830621175547810, -.3716070802232764, .24352759331252930 },
193 { 0.78, .76318535758242900, -.4307467689263783, .16866496622310430 },
194 { 0.91, .95336363636363640, -.2045454545454546, .03313636363636363 },
198 { 0.13, 44/256., (189-128)/256., (138-128)/256. },
199 { 0.25, 29/256., (186-128)/256., (119-128)/256. },
200 { 0.38, 119/256., (194-128)/256., (53-128)/256. },
201 { 0.60, 111/256., (73-128)/256., (59-128)/256. },
202 { 0.73, 205/256., (19-128)/256., (149-128)/256. },
203 { 0.86, 135/256., (83-128)/256., (200-128)/256. },
204 { 1, 73/256., (95-128)/256., (225-128)/256. }},
206 { 0, 44/256., (181-128)/256., (112-128)/256. },
207 { 0.13, 126/256., (177-128)/256., (106-128)/256. },
208 { 0.25, 164/256., (163-128)/256., (109-128)/256. },
209 { 0.38, 200/256., (140-128)/256., (120-128)/256. },
210 { 0.60, 201/256., (117-128)/256., (141-128)/256. },
211 { 0.73, 177/256., (103-128)/256., (165-128)/256. },
212 { 0.86, 136/256., (100-128)/256., (183-128)/256. },
213 { 1, 68/256., (117-128)/256., (203-128)/256. }},
215 { 0, 10/256., (134-128)/256., (132-128)/256. },
216 { 0.23, 21/256., (137-128)/256., (130-128)/256. },
217 { 0.45, 35/256., (134-128)/256., (134-128)/256. },
218 { 0.57, 51/256., (130-128)/256., (139-128)/256. },
219 { 0.67, 104/256., (116-128)/256., (162-128)/256. },
220 { 0.77, 120/256., (105-128)/256., (188-128)/256. },
221 { 0.87, 140/256., (105-128)/256., (188-128)/256. },
225 { 0.23, 44/256., (132-128)/256., (127-128)/256. },
226 { 0.45, 62/256., (116-128)/256., (140-128)/256. },
227 { 0.57, 75/256., (105-128)/256., (152-128)/256. },
228 { 0.67, 95/256., (91-128)/256., (166-128)/256. },
229 { 0.77, 126/256., (74-128)/256., (172-128)/256. },
230 { 0.87, 164/256., (73-128)/256., (162-128)/256. },
234 { 0.23, 36/256., (116-128)/256., (163-128)/256. },
235 { 0.45, 52/256., (102-128)/256., (200-128)/256. },
236 { 0.57, 116/256., (84-128)/256., (196-128)/256. },
237 { 0.67, 157/256., (67-128)/256., (181-128)/256. },
238 { 0.77, 193/256., (40-128)/256., (155-128)/256. },
239 { 0.87, 221/256., (101-128)/256., (134-128)/256. },
243 { 0.20, 29/256., (136-128)/256., (119-128)/256. },
244 { 0.30, 60/256., (119-128)/256., (90-128)/256. },
245 { 0.40, 85/256., (91-128)/256., (85-128)/256. },
246 { 0.50, 116/256., (70-128)/256., (105-128)/256. },
247 { 0.60, 151/256., (50-128)/256., (146-128)/256. },
248 { 0.70, 191/256., (63-128)/256., (178-128)/256. },
249 { 1, 98/256., (80-128)/256., (221-128)/256. }},
256 { 0.10, 23/256., (175-128)/256., (120-128)/256. },
257 { 0.23, 43/256., (158-128)/256., (144-128)/256. },
258 { 0.35, 85/256., (138-128)/256., (179-128)/256. },
259 { 0.48, 96/256., (128-128)/256., (189-128)/256. },
260 { 0.64, 128/256., (103-128)/256., (214-128)/256. },
261 { 0.92, 205/256., (80-128)/256., (152-128)/256. },
269 { 0.10, 0x39/255., (0x9D -128)/255., (0x8F -128)/255. },
270 { 0.23, 0x5C/255., (0x9A -128)/255., (0x68 -128)/255. },
271 { 0.35, 0x69/255., (0x93 -128)/255., (0x57 -128)/255. },
272 { 0.48, 0x76/255., (0x88 -128)/255., (0x4B -128)/255. },
273 { 0.64, 0x8A/255., (0x72 -128)/255., (0x4F -128)/255. },
274 { 0.80, 0xA3/255., (0x50 -128)/255., (0x66 -128)/255. },
275 { 1, 0xCC/255., (0x2F -128)/255., (0x87 -128)/255. }},
278 { 0.10, 0x27/255., (0xC2 -128)/255., (0x82 -128)/255. },
279 { 0.58, 0x5B/255., (0x9A -128)/255., (0xAE -128)/255. },
280 { 0.70, 0x89/255., (0x44 -128)/255., (0xAB -128)/255. },
281 { 0.80, 0xB4/255., (0x2B -128)/255., (0x9E -128)/255. },
282 { 0.91, 0xD2/255., (0x38 -128)/255., (0x92 -128)/255. },
286 { 0.20, 0x28/255., (0x98 -128)/255., (0x6F -128)/255. },
287 { 0.50, 0x48/255., (0x95 -128)/255., (0x74 -128)/255. },
288 { 0.63, 0x69/255., (0x84 -128)/255., (0x7F -128)/255. },
289 { 0.76, 0x89/255., (0x75 -128)/255., (0x84 -128)/255. },
290 { 0.90, 0xCE/255., (0x35 -128)/255., (0x95 -128)/255. },
295 { 0.60, 1, -.5, -.5 },
296 { 0.85, 1, -.5, .5 },
383 const int ch = jobnr;
390 s->
fft_data[ch][n].
re = p[n] * window_func_lut[n];
395 float theta, phi, psi,
a,
b,
S,
c;
405 for (
int n = 0; n <
M; n++) {
406 h[n].
re =
cosf(n * n / 2.
f * phi);
407 h[n].
im =
sinf(n * n / 2.
f * phi);
410 for (
int n = M; n <
L; n++) {
415 for (
int n = L - N; n <
L; n++) {
416 h[n].
re =
cosf((L - n) * (L - n) / 2.
f * phi);
417 h[n].
im =
sinf((L - n) * (L - n) / 2.
f * phi);
420 for (
int n = 0; n <
N; n++) {
425 for (
int n = N; n <
L; n++) {
430 for (
int n = 0; n <
N; n++) {
431 psi = n * theta + n * n / 2.f * phi;
434 a = c * g[n].
re - S * g[n].
im;
435 b = S * g[n].
re + c * g[n].
im;
446 for (
int n = 0; n <
L; n++) {
449 a = c * h[n].
re - S * h[n].
im;
450 b = S * h[n].
re + c * h[n].
im;
459 for (
int k = 0; k <
M; k++) {
460 psi = k * k / 2.f * phi;
463 a = c * g[k].
re - S * g[k].
im;
464 b = S * g[k].
re + c * g[k].
im;
485 for (i = 0; txt[
i]; i++) {
489 for (char_y = font_height - 1; char_y >= 0; char_y--) {
491 for (mask = 0x80;
mask; mask >>= 1) {
492 if (font[txt[i] * font_height + font_height - 1 - char_y] & mask)
493 p[char_y] = ~p[char_y];
499 for (char_y = 0; char_y < font_height; char_y++) {
500 for (mask = 0x80;
mask; mask >>= 1) {
501 if (font[txt[i] * font_height + char_y] & mask)
512 float *yf,
float *uf,
float *vf)
574 float yf,
float uf,
float vf,
598 float lerpfrac = (a -
start) / (end - start);
623 else if (log10(seconds) > 6)
625 else if (log10(seconds) > 3)
640 const float b = logf(max / min) / (max -
min);
641 const float a = max /
expf(max * b);
643 return expf(value * b) *
a;
649 const float max_freq = sample_rate / 2;
650 const float hz_per_bin = max_freq / num_bins;
651 const float freq = hz_per_bin * bin;
652 const float scaled_freq =
log_scale(freq + 1, 21, max_freq) - 1;
654 return num_bins * scaled_freq / max_freq;
665 const float b = logf(max / min) / (max -
min);
666 const float a = max /
expf(max * b);
668 return logf(value / a) /
b;
674 const float max_freq = sample_rate / 2;
675 const float hz_per_bin = max_freq / num_bins;
676 const float freq = hz_per_bin * bin;
677 const float scaled_freq =
inv_log_scale(freq + 1, 21, max_freq) - 1;
679 return num_bins * scaled_freq / max_freq;
689 float spp = samples / (float)sz;
692 char chlayout_str[128];
713 for (x = 0; x < s->
w + 1; x++)
716 for (x = 0; x < s->
w + 1; x++)
718 for (y = 0; y < s->
h + 2; y++) {
727 for (y = 0; y <
h; y += 20) {
732 for (y = 0; y <
h; y += 40) {
738 for (x = 0; x < s->
w; x+=40)
741 for (x = 0; x < s->
w; x+=80)
744 for (x = 0; x < s->
w; x+=40) {
748 for (x = 0; x < s->
w; x+=80) {
751 for (y = 0; y <
h; y += 40) {
754 float hertz = s->
start + bin * range / (float)(1 << (
int)
ceil(
log2(h)));
771 char *units =
get_time(ctx, seconds, x);
784 for (y = 0; y < s->
h; y += 20) {
789 for (y = 0; y < s->
h; y += 40) {
796 for (x = 0; x <
w; x+=40)
799 for (x = 0; x <
w; x+=80)
802 for (x = 0; x <
w; x+=40) {
806 for (x = 0; x <
w; x+=80) {
809 for (x = 0; x < w - 79; x += 80) {
812 float hertz = s->
start + bin * range / (float)(1 << (
int)
ceil(
log2(w)));
829 char *units =
get_time(ctx, seconds, x);
843 for (y = 0; y <
h; y++) {
844 float out[3] = { 0., 127.5, 127.5};
853 pick_color(s, yf, uf, vf, y / (
float)h, lout);
863 for (y = 0; ch == 0 && y <
h; y += h / 10) {
912 a =
av_clipf(sqrtf(sqrtf(a)), 0, 1);
931 const int ch = jobnr;
939 for (y = 0; y <
h; y++) {
955 const int ch = jobnr;
963 for (y = 0; y < h && yy <
h; yy++) {
966 float delta = pos1 - pos0;
971 for (
float j = pos0; j < pos1 && y + j - pos0 <
h; j++) {
972 float row = (s->
mode ==
COMBINED) ? y + j - pos0 : ch * h + y + j - pos0;
974 float lerpfrac = (j - pos0) / delta;
976 pick_color(s, yf, uf, vf, lerpfrac * a1 + (1.
f-lerpfrac) * a0, out);
1004 if (!strcmp(ctx->
filter->
name,
"showspectrumpic"))
1025 for (fft_bits = 1; 1 << fft_bits < 2 *
h; fft_bits++);
1028 for (fft_bits = 1; 1 << fft_bits < 2 *
w; fft_bits++);
1074 "The window size might be too high.\n");
1080 "The window size might be too high.\n");
1156 for (i = 0; i < outlink->
h; i++) {
1157 memset(outpicref->
data[0] + i * outpicref->
linesize[0], 0, outlink->
w);
1158 memset(outpicref->
data[1] + i * outpicref->
linesize[1], 128, outlink->
w);
1159 memset(outpicref->
data[2] + i * outpicref->
linesize[2], 128, outlink->
w);
1206 #define RE(y, ch) s->fft_data[ch][y].re 1207 #define IM(y, ch) s->fft_data[ch][y].im 1208 #define MAGNITUDE(y, ch) hypotf(RE(y, ch), IM(y, ch)) 1209 #define PHASE(y, ch) atan2f(IM(y, ch), RE(y, ch)) 1216 const float f = s->
gain *
w;
1217 const int ch = jobnr;
1220 for (y = 0; y <
h; y++)
1230 const int ch = jobnr;
1234 for (y = 0; y <
h; y++)
1235 phases[y] = (
PHASE(y, ch) /
M_PI + 1) / 2;
1244 const float f = s->
gain *
w;
1249 for (y = 0; y <
h; y++)
1261 for (y = 0; y <
h; y++)
1262 magnitudes[y] *= scale;
1270 for (y = 0; y <
size; y++) {
1291 for (y = 0; y < z * 3; y++) {
1301 for (plane = 0; plane < 3; plane++) {
1302 for (y = 0; y < s->
h; y++) {
1305 memmove(p, p + 1, s->
w - 1);
1310 for (plane = 0; plane < 3; plane++) {
1311 for (y = 0; y < s->
h; y++) {
1314 memmove(p + 1, p, s->
w - 1);
1319 for (plane = 0; plane < 3; plane++) {
1323 for (y = 0; y < s->
h; y++) {
1330 for (plane = 0; plane < 3; plane++) {
1331 for (y = 1; y < s->
h; y++) {
1339 for (plane = 0; plane < 3; plane++) {
1340 for (y = s->
h - 1; y >= 1; y--) {
1348 for (plane = 0; plane < 3; plane++) {
1351 for (x = 0; x < s->
w; x++) {
1376 for (y = 0; y < 10; y++) {
1381 outlink->
w / 2 - 4 * strlen(units),
1385 for (y = 0; y < 10 * s->
old_len; y++) {
1391 outlink->
h / 2 - 4 * strlen(units),
1411 #if CONFIG_SHOWSPECTRUM_FILTER 1476 for (
int i = 0;
i < outlink->
h;
i++) {
1482 for (
int i = s->
xpos; i < outlink->
h;
i++) {
1512 static const AVFilterPad showspectrum_inputs[] = {
1520 static const AVFilterPad showspectrum_outputs[] = {
1530 .
name =
"showspectrum",
1535 .
inputs = showspectrum_inputs,
1536 .
outputs = showspectrum_outputs,
1538 .priv_class = &showspectrum_class,
1541 #endif // CONFIG_SHOWSPECTRUM_FILTER 1543 #if CONFIG_SHOWSPECTRUMPIC_FILTER 1545 static const AVOption showspectrumpic_options[] = {
1613 static int showspectrumpic_request_frame(
AVFilterLink *outlink)
1629 spf =
FFMAX(1, spf);
1631 spb = (samples / (spf * sz)) * spf;
1649 (s->
win_size - ret) *
sizeof(
float));
1657 if (consumed >= spb) {
1665 memset(s->
magnitudes[ch], 0, h *
sizeof(
float));
1693 static const AVFilterPad showspectrumpic_inputs[] = {
1697 .filter_frame = showspectrumpic_filter_frame,
1702 static const AVFilterPad showspectrumpic_outputs[] = {
1707 .request_frame = showspectrumpic_request_frame,
1713 .
name =
"showspectrumpic",
1714 .description =
NULL_IF_CONFIG_SMALL(
"Convert input audio to a spectrum video output single picture."),
1718 .
inputs = showspectrumpic_inputs,
1719 .
outputs = showspectrumpic_outputs,
1720 .priv_class = &showspectrumpic_class,
1724 #endif // CONFIG_SHOWSPECTRUMPIC_FILTER
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
AVAudioFifo * av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, int nb_samples)
Allocate an AVAudioFifo.
#define av_realloc_f(p, o, n)
This structure describes decoded (raw) audio or video data.
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
ptrdiff_t const GLvoid * data
av_cold void av_fft_end(FFTContext *s)
float rotation
color rotation
static int plot_channel_log(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Main libavfilter public API header.
static float get_log_hz(const int bin, const int num_bins, const float sample_rate)
FFTComplex ** fft_data
bins holder for each (displayed) channels
static int plot_channel_lin(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
int h
agreed upon image height
static int draw_legend(AVFilterContext *ctx, int samples)
void av_audio_fifo_free(AVAudioFifo *af)
Free an AVAudioFifo.
FF_FILTER_FORWARD_STATUS(inlink, outlink)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
float * window_func_lut
Window function LUT.
void av_fft_permute(FFTContext *s, FFTComplex *z)
Do the permutation needed BEFORE calling ff_fft_calc().
#define FF_ARRAY_ELEMS(a)
static void generate_window_func(float *lut, int N, int win_func, float *overlap)
int fft_bits
number of bits (FFT window size = 1<<fft_bits)
static int query_formats(AVFilterContext *ctx)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
static __device__ float ceil(float a)
AVFilterFormatsConfig outcfg
Lists of supported formats / etc.
int sliding
1 if sliding mode, 0 otherwise
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
int mode
channel display mode
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static void drawtext(AVFrame *pic, int x, int y, const char *txt, int o)
static const AVOption showspectrum_options[]
static int calc_channel_magnitudes(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
filter_frame For filters that do not use the activate() callback
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
GLsizei GLboolean const GLfloat * value
AVRational auto_frame_rate
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define u(width, name, range_min, range_max)
static int run_channel_fft(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int calc_channel_phases(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define AVERROR_EOF
End of file.
#define AV_LOG_VERBOSE
Detailed information.
static char * get_time(AVFilterContext *ctx, float seconds, int x)
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the ff_outlink_frame_wanted() function.If this function returns true
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
A filter pad used for either input or output.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
A link between two filters.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const uint8_t avpriv_cga_font[2048]
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
int sample_rate
samples per second
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
static const uint16_t mask[17]
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
float ** color_buffer
color buffer (3 * h * ch items)
void * priv
private data for use by the filter
enum AVColorRange color_range
MPEG vs JPEG YUV range.
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
float saturation
color saturation multiplier
float * combine_buffer
color combining buffer (3 * h items)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
simple assert() macros that are a bit more flexible than ISO C assert().
FFTContext * av_fft_init(int nbits, int inverse)
Set up a complex FFT.
Context for an Audio FIFO Buffer.
int w
agreed upon image width
char * av_asprintf(const char *fmt,...)
int av_audio_fifo_size(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for reading.
audio channel layout utility functions
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
static void acalc_magnitudes(ShowSpectrumContext *s)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
static float get_value(AVFilterContext *ctx, int ch, int y)
AVFilterContext * src
source filter
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
static const AVFilterPad outputs[]
int format
agreed upon media format
FFTContext ** ifft
Inverse Fast Fourier Transform context.
A list of supported channel layouts.
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout)
Return a description of a channel layout.
static float bin_pos(const int bin, const int num_bins, const float sample_rate)
static int config_output(AVFilterLink *outlink)
static void color_range(ShowSpectrumContext *s, int ch, float *yf, float *uf, float *vf)
AVSampleFormat
Audio sample formats.
static const struct ColorTable color_table[][8]
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVFilter ff_avf_showspectrum
static AVRational av_make_q(int num, int den)
Create an AVRational.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
static av_always_inline float cbrtf(float x)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Describe the class of an AVClass context structure.
int ff_outlink_get_status(AVFilterLink *link)
Get the status on an output link.
AVFILTER_DEFINE_CLASS(showspectrum)
Rational number (pair of numerator and denominator).
const char * name
Filter name.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
offset must point to two consecutive integers
AVFilterLink ** outputs
array of pointers to output links
enum MovChannelLayoutTag * layouts
static enum AVPixelFormat pix_fmts[]
int av_frame_make_writable(AVFrame *frame)
Ensure that the frame data is writable, avoiding data copy if possible.
#define flags(name, subs,...)
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
Write data to an AVAudioFifo.
static av_cold void uninit(AVFilterContext *ctx)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples)
Drain data from an AVAudioFifo.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
channel
Use these values when setting the channel map with ebur128_set_channel().
FFTContext ** fft
Fast Fourier Transform context.
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
uint64_t channel_layout
channel layout of current buffer (see libavutil/channel_layout.h)
int channels
Number of channels.
AVFilterFormatsConfig incfg
Lists of supported formats / etc.
avfilter_execute_func * execute
int(* plot_channel)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
AVFilterContext * dst
dest filter
int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples)
Peek data from an AVAudioFifo.
AVFilter ff_avf_showspectrumpic
static enum AVSampleFormat sample_fmts[]
Filter the word “frame” indicates either a video frame or a group of audio samples
static float log_scale(const float value, const float min, const float max)
static void scale_magnitudes(ShowSpectrumContext *s, float scale)
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
static void pick_color(ShowSpectrumContext *s, float yf, float uf, float vf, float a, float *out)
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
uint8_t ** extended_data
pointers to the data planes/channels.
int xpos
x position (current column)
void av_fft_calc(FFTContext *s, FFTComplex *z)
Do a complex FFT with the parameters defined in av_fft_init().
AVPixelFormat
Pixel format.
static void clear_combine_buffer(ShowSpectrumContext *s, int size)
static float inv_log_scale(const float value, const float min, const float max)
mode
Use these values in ebur128_init (or'ed).
int nb_samples
number of audio samples (per channel) described by this frame
const AVFilter * filter
the AVFilter of which this is an instance
FFTComplex ** fft_scratch
scratch buffers
CGA/EGA/VGA ROM font data.
int color_mode
display color scheme