FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
avf_showcqt.h
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
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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  */
20 
21 #ifndef AVFILTER_SHOWCQT_H
22 #define AVFILTER_SHOWCQT_H
23 
24 #include "libavcodec/avfft.h"
25 #include "avfilter.h"
26 #include "internal.h"
27 
28 typedef struct {
30  int start, len;
31 } Coeffs;
32 
33 typedef struct {
34  float r, g, b;
35 } RGBFloat;
36 
37 typedef struct {
38  float y, u, v;
39 } YUVFloat;
40 
41 typedef union {
44 } ColorFloat;
45 
46 typedef struct {
47  const AVClass *class;
52  int sono_idx;
54  int step;
58  int64_t next_pts;
59  double *freq;
65  int fft_bits;
66  int fft_len;
67  int cqt_len;
68  int cqt_align;
70  float *h_buf;
71  float *rcp_h_buf;
72  float *sono_v_buf;
73  float *bar_v_buf;
74  float cmatrix[3][3];
75  float cscheme_v[6];
76  /* callback */
77  void (*cqt_calc)(FFTComplex *dst, const FFTComplex *src, const Coeffs *coeffs,
78  int len, int fft_len);
79  void (*permute_coeffs)(float *v, int len);
80  void (*draw_bar)(AVFrame *out, const float *h, const float *rcp_h,
81  const ColorFloat *c, int bar_h, float bar_t);
82  void (*draw_axis)(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off);
83  void (*draw_sono)(AVFrame *out, AVFrame *sono, int off, int idx);
84  void (*update_sono)(AVFrame *sono, const ColorFloat *c, int idx);
85  /* performance debugging */
86  int64_t fft_time;
87  int64_t cqt_time;
90  int64_t alloc_time;
91  int64_t bar_time;
92  int64_t axis_time;
93  int64_t sono_time;
94  /* option */
95  int width, height;
97  int bar_h;
98  int axis_h;
99  int sono_h;
100  int fullhd; /* deprecated */
101  char *sono_v;
102  char *bar_v;
103  float sono_g;
104  float bar_g;
105  float bar_t;
106  double timeclamp;
107  double basefreq;
108  double endfreq;
109  float coeffclamp; /* deprecated - ignored */
110  char *tlength;
111  int count;
112  int fcount;
113  char *fontfile;
114  char *font;
115  char *fontcolor;
116  char *axisfile;
117  int axis;
118  int csp;
119  char *cscheme;
121 
123 
124 #endif
const char * s
Definition: avisynth_c.h:768
This structure describes decoded (raw) audio or video data.
Definition: frame.h:187
int64_t alloc_time
Definition: avf_showcqt.h:90
int start
Definition: avf_showcqt.h:30
Coeffs * coeffs
Definition: avf_showcqt.h:61
Main libavfilter public API header.
const char * g
Definition: vf_curves.c:112
YUVFloat yuv
Definition: avf_showcqt.h:43
const char * b
Definition: vf_curves.c:113
double timeclamp
Definition: avf_showcqt.h:106
int64_t axis_time
Definition: avf_showcqt.h:92
#define src
Definition: vp8dsp.c:254
float * rcp_h_buf
Definition: avf_showcqt.h:71
#define height
AVRational step_frac
Definition: avf_showcqt.h:55
int64_t cqt_time
Definition: avf_showcqt.h:87
double * freq
Definition: avf_showcqt.h:59
FFTComplex * cqt_result
Definition: avf_showcqt.h:64
float * sono_v_buf
Definition: avf_showcqt.h:72
static void cqt_calc(FFTComplex *dst, const FFTComplex *src, const Coeffs *coeffs, int len, int fft_len)
Definition: avf_showcqt.c:268
float FFTSample
Definition: avfft.h:35
AVFrame * axis_frame
Definition: avf_showcqt.h:49
AVRational rate
Definition: avf_showcqt.h:96
Definition: fft.h:88
char * fontcolor
Definition: avf_showcqt.h:115
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
FFTComplex * fft_data
Definition: avf_showcqt.h:62
RGBFloat rgb
Definition: avf_showcqt.h:42
int64_t process_cqt_time
Definition: avf_showcqt.h:88
static void draw_sono(AVFrame *out, AVFrame *sono, int off, int idx)
Definition: avf_showcqt.c:1026
FFTComplex * fft_result
Definition: avf_showcqt.h:63
FFT functions.
static const char * format
Definition: movenc.c:47
Describe the class of an AVClass context structure.
Definition: log.h:67
int64_t next_pts
Definition: avf_showcqt.h:58
Rational number (pair of numerator and denominator).
Definition: rational.h:58
float * h_buf
Definition: avf_showcqt.h:70
FFTSample * val
Definition: avf_showcqt.h:29
void ff_showcqt_init_x86(ShowCQTContext *s)
#define u(width,...)
float * bar_v_buf
Definition: avf_showcqt.h:73
int64_t sono_time
Definition: avf_showcqt.h:93
FFTContext * fft_ctx
Definition: avf_showcqt.h:60
static double c[64]
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:89
static const int16_t coeffs[]
int len
ColorFloat * c_buf
Definition: avf_showcqt.h:69
An instance of a filter.
Definition: avfilter.h:323
FILE * out
Definition: movenc.c:54
internal API functions
AVFilterContext * ctx
Definition: avf_showcqt.h:48
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
int64_t fft_time
Definition: avf_showcqt.h:86
int64_t bar_time
Definition: avf_showcqt.h:91