36 #if CONFIG_LIBFREETYPE
38 #include FT_FREETYPE_H
43 #define BASEFREQ 20.01523126408007475
44 #define ENDFREQ 20495.59681441799654
45 #define TLENGTH "384*tc/(384+tc*f)"
46 #define TLENGTH_MIN 0.001
47 #define VOLUME_MAX 100.0
48 #define FONTCOLOR "st(0, (midi(f)-59.5)/12);" \
49 "st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));" \
50 "r(1-ld(1)) + b(ld(1))"
52 #define OFFSET(x) offsetof(ShowCQTContext, x)
53 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
98 for (k = 0; k < 4; k++)
107 for (k = 0; k < s->
cqt_len * 2; k++)
123 double log_base, log_end;
124 double rcp_n = 1.0 /
n;
132 log_base = log(base);
134 for (x = 0; x <
n; x++) {
135 double log_freq = log_base + (x + 0.5) * (log_end - log_base) * rcp_n;
136 freq[x] =
exp(log_freq);
142 double val,
double min,
double max,
143 double nan_replace,
int idx)
147 av_log(log_ctx, level,
"[%d] %s is nan, setting it to %g.\n",
148 idx, name, nan_replace);
150 }
else if (val < min) {
151 av_log(log_ctx, level,
"[%d] %s is too low (%g), setting it to %g.\n",
152 idx, name, val, min);
154 }
else if (val > max) {
155 av_log(log_ctx, level,
"[%d] %s it too high (%g), setting it to %g.\n",
156 idx, name, val, max);
164 double ret = 12200.0*12200.0 * (f*f*f*f);
165 ret /= (f*f + 20.6*20.6) * (f*f + 12200.0*12200.0) *
166 sqrt((f*f + 107.7*107.7) * (f*f + 737.9*737.9));
172 double ret = 12200.0*12200.0 * (f*f*f);
173 ret /= (f*f + 20.6*20.6) * (f*f + 12200.0*12200.0) * sqrt(f*f + 158.5*158.5);
179 double ret = 12200.0*12200.0 * (f*f);
180 ret /= (f*f + 20.6*20.6) * (f*f + 12200.0*12200.0);
186 const char *func_names[] = {
"a_weighting",
"b_weighting",
"c_weighting",
NULL };
187 const char *sono_names[] = {
"timeclamp",
"tc",
"frequency",
"freq",
"f",
"bar_v",
NULL };
188 const char *bar_names[] = {
"timeclamp",
"tc",
"frequency",
"freq",
"f",
"sono_v",
NULL };
204 for (x = 0; x < s->
cqt_len; x++) {
227 int len,
int fft_len)
230 for (k = 0; k <
len; k++) {
233 for (x = 0; x < coeffs[k].
len; x++) {
235 i = coeffs[k].
start + x;
237 a.
re += u * src[i].
re;
238 a.
im += u * src[i].
im;
239 b.re += u * src[j].
re;
240 b.im += u * src[j].
im;
255 int len,
int fft_len)
259 for (k = 0; k <
len; k++) {
263 for (x = 0; x < coeffs[
m].
len; x++) {
266 a.
re += u * src[i].
re;
267 a.
im += u * src[i].
im;
271 for (x = 0; x < coeffs[
m].
len; x++) {
274 b.re += u * src[i].
re;
275 b.im += u * src[i].
im;
291 const char *
var_names[] = {
"timeclamp",
"tc",
"frequency",
"freq",
"f",
NULL };
294 int nb_cqt_coeffs = 0, nb_cqt_coeffs_r = 0;
304 for (k = 0; k < s->
cqt_len; k++) {
306 double flen, center, tlength;
309 if (s->
freq[k] > 0.5 * rate)
314 flen = 8.0 * s->
fft_len / (tlength * rate);
316 start =
FFMAX(0, ceil(center - 0.5 * flen));
333 for (x = start; x <=
end; x++) {
334 int sign = (x & 1) ? (-1) : 1;
335 double y = 2.0 *
M_PI * (x - center) * (1.0 / flen);
337 double w = 0.355768 + 0.487396 * cos(y) + 0.144232 * cos(2*y) + 0.012604 * cos(3*y);
338 w *= sign * (1.0 / s->
fft_len);
355 for (k = 0; k < s->
cqt_len * 2; k++)
410 int tmp_w, tmp_h, ret;
412 if ((ret =
ff_load_image(tmp_data, tmp_linesize, &tmp_w, &tmp_h, &tmp_format,
422 tmp_format, s->
ctx)) < 0)
437 static double midi(
void *p,
double f)
439 return log2(f/440.0) * 12.0 + 69.0;
444 x = av_clipd(x, 0.0, 1.0);
445 return (
int)(x*255.0+0.5) << 16;
450 x = av_clipd(x, 0.0, 1.0);
451 return (
int)(x*255.0+0.5) << 8;
456 x = av_clipd(x, 0.0, 1.0);
457 return (
int)(x*255.0+0.5);
462 const char *
var_names[] = {
"timeclamp",
"tc",
"frequency",
"freq",
"f",
NULL };
463 const char *func_names[] = {
"midi",
"r",
"g",
"b",
NULL };
471 " please use axisfile option instead.\n");
486 for (x = 0; x < 1920; x++) {
489 uint8_t r = (color >> 16) & 0xFF,
g = (color >> 8) & 0xFF,
b = color & 0xFF;
492 for (y = 0; y < 32; y++) {
493 data[linesize * y + 4 * x] =
r;
494 data[linesize * y + 4 * x + 1] =
g;
495 data[linesize * y + 4 * x + 2] =
b;
496 data[linesize * y + 4 * x + 3] = 0;
508 #if CONFIG_LIBFREETYPE
509 const char *str =
"EF G A BC D ";
512 FT_Library lib =
NULL;
514 int font_width = 16, font_height = 32;
515 int font_repeat = font_width * 12;
516 int linear_hori_advance = font_width * 65536;
517 int non_monospace_warning = 0;
523 if (FT_Init_FreeType(&lib))
526 if (FT_New_Face(lib, s->
fontfile, 0, &face))
529 if (FT_Set_Char_Size(face, 16*64, 0, 0, 0))
532 if (FT_Load_Char(face,
'A', FT_LOAD_RENDER))
535 if (FT_Set_Char_Size(face, 16*64 * linear_hori_advance / face->glyph->linearHoriAdvance, 0, 0, 0))
538 for (x = 0; x < 12; x++) {
539 int sx, sy, rx, bx, by, dx, dy;
544 if (FT_Load_Char(face, str[x], FT_LOAD_RENDER))
547 if (face->glyph->advance.x != font_width*64 && !non_monospace_warning) {
549 non_monospace_warning = 1;
552 sy = font_height - 8 - face->glyph->bitmap_top;
553 for (rx = 0; rx < 10; rx++) {
554 sx = rx * font_repeat + x * font_width + face->glyph->bitmap_left;
555 for (by = 0; by < face->glyph->bitmap.rows; by++) {
559 if (dy >= font_height)
562 for (bx = 0; bx < face->glyph->bitmap.width; bx++) {
568 data[dy*linesize+4*dx+3] = face->glyph->bitmap.buffer[by*face->glyph->bitmap.width+bx];
575 FT_Done_FreeType(lib);
581 FT_Done_FreeType(lib);
592 const char *str =
"EF G A BC D ";
597 for (x = 0; x < 1920; x += 192) {
598 uint8_t *startptr = data + 4 * x;
599 for (u = 0; u < 12; u++) {
600 for (v = 0; v < 16; v++) {
601 uint8_t *p = startptr + 2 * v * linesize + 16 * 4 * u;
602 for (mask = 0x80;
mask; mask >>= 1, p += 8) {
660 return sqrtf(sqrtf(v));
661 return expf(logf(v) / g);
667 for (x = 0; x <
len; x++) {
677 for (x = 0; x <
len; x++) {
682 c[x].
yuv.
y = 65.481f * r + 128.553f * g + 24.966f *
b;
683 c[x].
yuv.
u = -37.797f * r - 74.203f * g + 112.0f *
b;
684 c[x].
yuv.
v = 112.0f * r - 93.786f * g - 18.214 *
b;
691 int x, y, w = out->
width;
692 float mul, ht, rcp_bar_h = 1.0f / bar_h;
696 for (y = 0; y < bar_h; y++) {
697 ht = (bar_h - y) * rcp_bar_h;
699 for (x = 0; x < w; x++) {
705 mul = (h[x] - ht) * rcp_h[x];
706 *lp++ = mul * c[x].
rgb.
r + 0.5f;
707 *lp++ = mul * c[x].
rgb.
g + 0.5f;
708 *lp++ = mul * c[x].
rgb.
b + 0.5f;
717 int x, y, yh, w = out->
width;
718 float mul, ht, rcp_bar_h = 1.0f / bar_h;
724 for (y = 0; y < bar_h; y += 2) {
726 ht = (bar_h - y) * rcp_bar_h;
730 for (x = 0; x < w; x += 2) {
736 mul = (h[x] - ht) * rcp_h[x];
737 *lpy++ = mul * c[x].
yuv.
y + 16.5f;
738 *lpu++ = mul * c[x].
yuv.
u + 128.5f;
739 *lpv++ = mul * c[x].
yuv.
v + 128.5f;
748 mul = (h[x+1] - ht) * rcp_h[x+1];
749 *lpy++ = mul * c[x+1].
yuv.
y + 16.5f;
750 *lpu++ = mul * c[x+1].
yuv.
u + 128.5f;
751 *lpv++ = mul * c[x+1].
yuv.
v + 128.5f;
757 mul = (h[x+1] - ht) * rcp_h[x+1];
758 *lpy++ = mul * c[x+1].
yuv.
y + 16.5f;
763 ht = (bar_h - (y+1)) * rcp_bar_h;
764 lpy = vy + (y+1) * lsy;
765 lpu = vu + (y+1) * lsu;
766 lpv = vv + (y+1) * lsv;
767 for (x = 0; x < w; x += 2) {
775 mul = (h[x] - ht) * rcp_h[x];
776 *lpy++ = mul * c[x].
yuv.
y + 16.5f;
777 *lpu++ = mul * c[x].
yuv.
u + 128.5f;
778 *lpv++ = mul * c[x].
yuv.
v + 128.5f;
784 mul = (h[x] - ht) * rcp_h[x];
785 *lpy++ = mul * c[x].
yuv.
y + 16.5f;
795 mul = (h[x+1] - ht) * rcp_h[x+1];
796 *lpy++ = mul * c[x+1].
yuv.
y + 16.5f;
797 *lpu++ = mul * c[x+1].
yuv.
u + 128.5f;
798 *lpv++ = mul * c[x+1].
yuv.
v + 128.5f;
804 mul = (h[x+1] - ht) * rcp_h[x+1];
805 *lpy++ = mul * c[x+1].
yuv.
y + 16.5f;
815 float a, rcp_255 = 1.0f / 255.0f;
818 for (y = 0; y <
h; y++) {
821 for (x = 0; x < w; x++) {
822 a = rcp_255 * lpa[3];
823 *lp++ = a * lpa[0] + (1.0f -
a) * c[x].rgb.r + 0.5f;
824 *lp++ = a * lpa[1] + (1.0f - a) * c[x].
rgb.
g + 0.5f;
825 *lp++ = a * lpa[2] + (1.0f -
a) * c[x].rgb.b + 0.5f;
835 float a, rcp_255 = 1.0f / 255.0f;
840 uint8_t *lpy, *lpu, *lpv, *lpay, *lpau, *lpav, *lpaa;
842 for (y = 0; y <
h; y += 2) {
844 lpy = vy + (off + y) * lsy;
845 lpu = vu + (offh + yh) * lsu;
846 lpv = vv + (offh + yh) * lsv;
847 lpay = vay + y * lsay;
848 lpau = vau + yh * lsau;
849 lpav = vav + yh * lsav;
850 lpaa = vaa + y * lsaa;
851 for (x = 0; x < w; x += 2) {
852 a = rcp_255 * (*lpaa++);
853 *lpy++ = a * (*lpay++) + (1.0f - a) * (c[x].
yuv.
y + 16.0f) + 0.5f;
854 *lpu++ = a * (*lpau++) + (1.0f - a) * (c[x].
yuv.
u + 128.0f) + 0.5f;
855 *lpv++ = a * (*lpav++) + (1.0f - a) * (c[x].
yuv.
v + 128.0f) + 0.5f;
857 a = rcp_255 * (*lpaa++);
858 *lpy++ = a * (*lpay++) + (1.0f - a) * (c[x+1].
yuv.
y + 16.0f) + 0.5f;
860 *lpu++ = a * (*lpau++) + (1.0f - a) * (c[x+1].
yuv.
u + 128.0f) + 0.5f;
861 *lpv++ = a * (*lpav++) + (1.0f - a) * (c[x+1].
yuv.
v + 128.0f) + 0.5f;
865 lpy = vy + (off + y + 1) * lsy;
866 lpu = vu + (off + y + 1) * lsu;
867 lpv = vv + (off + y + 1) * lsv;
868 lpay = vay + (y + 1) * lsay;
869 lpau = vau + (y + 1) * lsau;
870 lpav = vav + (y + 1) * lsav;
871 lpaa = vaa + (y + 1) * lsaa;
872 for (x = 0; x < out->
width; x += 2) {
874 a = rcp_255 * (*lpaa++);
875 *lpy++ = a * (*lpay++) + (1.0f - a) * (c[x].
yuv.
y + 16.0f) + 0.5f;
877 *lpu++ = a * (*lpau++) + (1.0f - a) * (c[x].
yuv.
u + 128.0f) + 0.5f;
878 *lpv++ = a * (*lpav++) + (1.0f - a) * (c[x].
yuv.
v + 128.0f) + 0.5f;
881 a = rcp_255 * (*lpaa++);
882 *lpy++ = a * (*lpay++) + (1.0f - a) * (c[x+1].
yuv.
y + 16.0f) + 0.5f;
884 *lpu++ = a * (*lpau++) + (1.0f - a) * (c[x+1].
yuv.
u + 128.0f) + 0.5f;
885 *lpv++ = a * (*lpav++) + (1.0f - a) * (c[x+1].
yuv.
v + 128.0f) + 0.5f;
900 for (y = 0; y <
h; y++) {
905 for (i = 1; i < nb_planes; i++) {
907 for (y = 0; y <
h; y += inc) {
917 int x, w = sono->
width;
920 for (x = 0; x < w; x++) {
921 *lp++ = c[x].
rgb.
r + 0.5f;
922 *lp++ = c[x].
rgb.
g + 0.5f;
923 *lp++ = c[x].
rgb.
b + 0.5f;
934 for (x = 0; x < w; x += 2) {
935 *lpy++ = c[x].
yuv.
y + 16.5f;
936 *lpu++ = c[x].
yuv.
u + 128.5f;
937 *lpv++ = c[x].
yuv.
v + 128.5f;
938 *lpy++ = c[x+1].
yuv.
y + 16.5f;
940 *lpu++ = c[x+1].
yuv.
u + 128.5f;
941 *lpv++ = c[x+1].
yuv.
v + 128.5f;
950 for (x = 0; x < s->
cqt_len; x++) {
954 float rcp_fcount = 1.0f / s->
fcount;
955 for (x = 0; x < s->
width; x++) {
957 for (i = 0; i < s->
fcount; i++)
959 s->
h_buf[x] = rcp_fcount * h;
962 for (x = 0; x < s->
width; x++) {
968 for (x = 0; x < s->
cqt_len; x++) {
974 float rcp_fcount = 1.0f / s->
fcount;
975 for (x = 0; x < s->
width; x++) {
977 for (i = 0; i < s->
fcount; i++) {
1137 av_log(ctx,
AV_LOG_INFO,
"video: %dx%d %s %d/%d fps, bar_h = %d, axis_h = %d, sono_h = %d.\n",
1236 int remaining, step, ret, x, i, j,
m;
1248 for (x = 0; x < (s->
fft_len-step); x++)
1256 audio_data = (
float*) insamples->
data[0];
1274 for (m = 0; m < s->
fft_len-step; m++)
1278 for (m = 0; m < remaining; m++) {
1322 .description =
NULL_IF_CONFIG_SMALL(
"Convert input audio to a CQT (Constant/Clamped Q Transform) spectrum video output."),
1327 .
inputs = showcqt_inputs,
1329 .priv_class = &showcqt_class,
const char const char void * val
This structure describes decoded (raw) audio or video data.
void(* update_sono)(AVFrame *sono, const ColorFloat *c, int idx)
ptrdiff_t const GLvoid * data
av_cold void av_fft_end(FFTContext *s)
static const AVOption showcqt_options[]
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
Main libavfilter public API header.
packed RGB 8:8:8, 24bpp, RGBRGB...
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
static int init_cqt(ShowCQTContext *s)
int h
agreed upon image height
static av_cold int init(AVFilterContext *ctx)
Miscellaneous utilities which make use of the libswscale library.
static av_cold void uninit(AVFilterContext *ctx)
const uint8_t avpriv_vga16_font[4096]
static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, int len)
void av_fft_permute(FFTContext *s, FFTComplex *z)
Do the permutation needed BEFORE calling ff_fft_calc().
static enum AVSampleFormat formats[]
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
static int render_default_font(AVFrame *tmp)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
#define AV_CH_LAYOUT_STEREO
static AVRational av_make_q(int num, int den)
Create a rational.
const char * name
Pad name.
static int render_freetype(ShowCQTContext *s, AVFrame *tmp)
AVFilterLink ** inputs
array of pointers to input links
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int init_axis_empty(ShowCQTContext *s)
static av_cold int end(AVCodecContext *avctx)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static double a_weighting(void *p, double f)
int ff_scale_image(uint8_t *dst_data[4], int dst_linesize[4], int dst_w, int dst_h, enum AVPixelFormat dst_pix_fmt, uint8_t *const src_data[4], int src_linesize[4], int src_w, int src_h, enum AVPixelFormat src_pix_fmt, void *log_ctx)
Scale image using libswscale.
static void draw_axis_rgb(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off)
static enum AVPixelFormat convert_axis_pixel_format(enum AVPixelFormat format)
#define AVERROR_EOF
End of file.
static const char *const var_names[]
static double b_func(void *p, double x)
static void update_sono_rgb(AVFrame *sono, const ColorFloat *c, int idx)
A filter pad used for either input or output.
A link between two filters.
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
int width
width and height of the video frame
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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
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. ...
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
void * priv
private data for use by the filter
static int init_axis_from_file(ShowCQTContext *s)
static double b_weighting(void *p, double f)
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().
struct AVFilterChannelLayouts * out_channel_layouts
FFTContext * av_fft_init(int nbits, int inverse)
Set up a complex FFT.
static void cqt_calc(FFTComplex *dst, const FFTComplex *src, const Coeffs *coeffs, int len, int fft_len)
AVFilterFormats * in_formats
Lists of formats and channel layouts supported by the input and output filters respectively.
static const AVFilterPad showcqt_outputs[]
void(* cqt_calc)(FFTComplex *dst, const FFTComplex *src, const Coeffs *coeffs, int len, int fft_len)
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static const AVFilterPad showcqt_inputs[]
int w
agreed upon image width
static void update_sono_yuv(AVFrame *sono, const ColorFloat *c, int idx)
#define AV_CH_LAYOUT_STEREO_DOWNMIX
static int init_axis_color(ShowCQTContext *s, AVFrame *tmp)
int ff_load_image(uint8_t *data[4], int linesize[4], int *w, int *h, enum AVPixelFormat *pix_fmt, const char *filename, void *log_ctx)
Load image from filename and put the resulting image in data.
static int init_axis_from_font(ShowCQTContext *s)
static void rgb_from_cqt(ColorFloat *c, const FFTComplex *v, float g, int len)
AVFilterContext * src
source filter
static double r_func(void *p, double x)
static const AVFilterPad outputs[]
AVFilterFormats * out_samplerates
int format
agreed upon media format
static double g_func(void *p, double x)
A list of supported channel layouts.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
static const uint8_t vars[2][12]
static void draw_sono(AVFrame *out, AVFrame *sono, int off, int idx)
#define AV_LOG_INFO
Standard information.
static const AVFilterPad inputs[]
AVSampleFormat
Audio sample formats.
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static AVFrame * alloc_frame_empty(enum AVPixelFormat format, int w, int h)
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
static const char * format
AVFILTER_DEFINE_CLASS(showcqt)
static av_always_inline float cbrtf(float x)
static double * create_freq_table(double base, double end, int n)
static int plot_cqt(AVFilterContext *ctx)
static double clip_with_log(void *log_ctx, const char *name, double val, double min, double max, double nan_replace, int idx)
static double midi(void *p, double f)
offset must point to AVRational
const char * name
Filter name.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
static void draw_bar_yuv(AVFrame *out, const float *h, const float *rcp_h, const ColorFloat *c, int bar_h)
static void common_uninit(ShowCQTContext *s)
offset must point to two consecutive integers
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
AVFilterLink ** outputs
array of pointers to output links
enum MovChannelLayoutTag * layouts
static enum AVPixelFormat pix_fmts[]
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
static int config_output(AVFilterLink *outlink)
void * av_calloc(size_t nmemb, size_t size)
Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vec...
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int request_frame(AVFilterLink *outlink)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
void(* draw_bar)(AVFrame *out, const float *h, const float *rcp_h, const ColorFloat *c, int bar_h)
enum AVPixelFormat format
static int query_formats(AVFilterContext *ctx)
static const int16_t coeffs[]
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
AVFilterContext * dst
dest filter
static int init_volume(ShowCQTContext *s)
static double c_weighting(void *p, double f)
static enum AVSampleFormat sample_fmts[]
static void draw_axis_yuv(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off)
static float calculate_gamma(float v, float g)
static void process_cqt(ShowCQTContext *s)
void(* draw_sono)(AVFrame *out, AVFrame *sono, int off, int idx)
#define av_malloc_array(a, b)
enum CoeffsType cqt_coeffs_type
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
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 draw_bar_rgb(AVFrame *out, const float *h, const float *rcp_h, const ColorFloat *c, int bar_h)
int nb_samples
number of audio samples (per channel) described by this frame
CGA/EGA/VGA ROM font data.
AVFilterFormats * out_formats
void(* draw_axis)(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off)
Miscellaneous utilities which make use of the libavformat library.
simple arithmetic expression evaluator