Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Muhammad Faiz <mfcc64@gmail.com>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
24 #include "libavcodec/avfft.h"
25 #include "avfilter.h"
26 #include "internal.h"
28 typedef struct Coeffs {
30  int start, len;
31 } Coeffs;
33 typedef struct RGBFloat {
34  float r, g, b;
35 } RGBFloat;
37 typedef struct YUVFloat {
38  float y, u, v;
39 } YUVFloat;
41 typedef union {
44 } ColorFloat;
46 typedef struct ShowCQTContext {
47  const AVClass *class;
52  int sono_idx;
54  int step;
59  int64_t next_pts;
60  double *freq;
66  float *attack_data;
67  int fft_bits;
68  int fft_len;
69  int cqt_len;
70  int cqt_align;
72  float *h_buf;
73  float *rcp_h_buf;
74  float *sono_v_buf;
75  float *bar_v_buf;
76  float cmatrix[3][3];
77  float cscheme_v[6];
78  /* callback */
79  void (*cqt_calc)(FFTComplex *dst, const FFTComplex *src, const Coeffs *coeffs,
80  int len, int fft_len);
81  void (*permute_coeffs)(float *v, int len);
82  void (*draw_bar)(AVFrame *out, const float *h, const float *rcp_h,
83  const ColorFloat *c, int bar_h, float bar_t);
84  void (*draw_axis)(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off);
85  void (*draw_sono)(AVFrame *out, AVFrame *sono, int off, int idx);
86  void (*update_sono)(AVFrame *sono, const ColorFloat *c, int idx);
87  /* performance debugging */
88  int64_t fft_time;
89  int64_t cqt_time;
92  int64_t alloc_time;
93  int64_t bar_time;
94  int64_t axis_time;
95  int64_t sono_time;
96  /* option */
97  int width, height;
99  int bar_h;
100  int axis_h;
101  int sono_h;
102  int fullhd; /* deprecated */
103  char *sono_v;
104  char *bar_v;
105  float sono_g;
106  float bar_g;
107  float bar_t;
108  double timeclamp;
109  double attack;
110  double basefreq;
111  double endfreq;
112  float coeffclamp; /* deprecated - ignored */
113  char *tlength;
114  int count;
115  int fcount;
116  char *fontfile;
117  char *font;
118  char *fontcolor;
119  char *axisfile;
120  int axis;
121  int csp;
122  char *cscheme;
127 #endif
This structure describes decoded (raw) audio or video data.
Definition: frame.h:314
int64_t alloc_time
Definition: avf_showcqt.h:92
int start
Definition: avf_showcqt.h:30
Coeffs * coeffs
Definition: avf_showcqt.h:62
Main libavfilter public API header.
const char * g
Definition: vf_curves.c:117
YUVFloat yuv
Definition: avf_showcqt.h:43
double timeclamp
Definition: avf_showcqt.h:108
int64_t axis_time
Definition: avf_showcqt.h:94
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 format(the sample packing is implied by the sample format) and sample rate.The lists are not just lists
float * rcp_h_buf
Definition: avf_showcqt.h:73
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
Definition: undefined.txt:32
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:264
#define height
AVRational step_frac
Definition: avf_showcqt.h:55
int64_t cqt_time
Definition: avf_showcqt.h:89
double * freq
Definition: avf_showcqt.h:60
FFTComplex * cqt_result
Definition: avf_showcqt.h:65
int len
Definition: avf_showcqt.h:30
float * sono_v_buf
Definition: avf_showcqt.h:74
#define src
Definition: vp8dsp.c:255
static void cqt_calc(FFTComplex *dst, const FFTComplex *src, const Coeffs *coeffs, int len, int fft_len)
Definition: avf_showcqt.c:270
float FFTSample
Definition: avfft.h:35
AVFrame * axis_frame
Definition: avf_showcqt.h:49
AVRational rate
Definition: avf_showcqt.h:98
#define b
Definition: input.c:41
Definition: fft.h:83
char * fontcolor
Definition: avf_showcqt.h:118
#define s(width, name)
Definition: cbs_vp9.c:257
FFTComplex * fft_data
Definition: avf_showcqt.h:63
RGBFloat rgb
Definition: avf_showcqt.h:42
int64_t process_cqt_time
Definition: avf_showcqt.h:90
static void draw_sono(AVFrame *out, AVFrame *sono, int off, int idx)
Definition: avf_showcqt.c:1028
FFTComplex * fft_result
Definition: avf_showcqt.h:64
FFT functions.
Describe the class of an AVClass context structure.
Definition: log.h:67
int64_t next_pts
Definition: avf_showcqt.h:59
Rational number (pair of numerator and denominator).
Definition: rational.h:58
float * h_buf
Definition: avf_showcqt.h:72
FFTSample * val
Definition: avf_showcqt.h:29
void ff_showcqt_init_x86(ShowCQTContext *s)
float * attack_data
Definition: avf_showcqt.h:66
float * bar_v_buf
Definition: avf_showcqt.h:75
int64_t sono_time
Definition: avf_showcqt.h:95
FFTContext * fft_ctx
Definition: avf_showcqt.h:61
float y
Definition: avf_showcqt.h:38
AVFrame * sono_frame
Definition: avf_showcqt.h:50
float r
Definition: avf_showcqt.h:34
int64_t update_sono_time
Definition: avf_showcqt.h:91
ColorFloat * c_buf
Definition: avf_showcqt.h:71
An instance of a filter.
Definition: avfilter.h:341
FILE * out
Definition: movenc.c:54
internal API functions
int remaining_fill_max
Definition: avf_showcqt.h:58
AVFilterContext * ctx
Definition: avf_showcqt.h:48
Pixel format.
Definition: pixfmt.h:64
int64_t fft_time
Definition: avf_showcqt.h:88
int64_t bar_time
Definition: avf_showcqt.h:93