]> git.sesse.net Git - ffmpeg/blob - libavfilter/avf_showcqt.h
all: Add missing header guards
[ffmpeg] / libavfilter / avf_showcqt.h
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_AVF_SHOWCQT_H
22 #define AVFILTER_AVF_SHOWCQT_H
23
24 #include "libavcodec/avfft.h"
25 #include "avfilter.h"
26 #include "internal.h"
27
28 typedef struct {
29     FFTSample *val;
30     int start, len;
31 } Coeffs;
32
33 enum CoeffsType {
34     COEFFS_TYPE_DEFAULT,
35     COEFFS_TYPE_INTERLEAVE
36 };
37
38 typedef struct {
39     float r, g, b;
40 } RGBFloat;
41
42 typedef struct {
43     float y, u, v;
44 } YUVFloat;
45
46 typedef union {
47     RGBFloat rgb;
48     YUVFloat yuv;
49 } ColorFloat;
50
51 typedef struct {
52     const AVClass       *class;
53     AVFilterContext     *ctx;
54     AVFrame             *axis_frame;
55     AVFrame             *sono_frame;
56     enum AVPixelFormat  format;
57     int                 sono_idx;
58     int                 sono_count;
59     int                 step;
60     AVRational          step_frac;
61     int                 remaining_frac;
62     int                 remaining_fill;
63     int64_t             frame_count;
64     double              *freq;
65     FFTContext          *fft_ctx;
66     Coeffs              *coeffs;
67     FFTComplex          *fft_data;
68     FFTComplex          *fft_result;
69     FFTComplex          *cqt_result;
70     int                 fft_bits;
71     int                 fft_len;
72     int                 cqt_len;
73     int                 cqt_align;
74     enum CoeffsType     cqt_coeffs_type;
75     ColorFloat          *c_buf;
76     float               *h_buf;
77     float               *rcp_h_buf;
78     float               *sono_v_buf;
79     float               *bar_v_buf;
80     /* callback */
81     void                (*cqt_calc)(FFTComplex *dst, const FFTComplex *src, const Coeffs *coeffs,
82                                     int len, int fft_len);
83     void                (*draw_bar)(AVFrame *out, const float *h, const float *rcp_h,
84                                     const ColorFloat *c, int bar_h);
85     void                (*draw_axis)(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off);
86     void                (*draw_sono)(AVFrame *out, AVFrame *sono, int off, int idx);
87     void                (*update_sono)(AVFrame *sono, const ColorFloat *c, int idx);
88     /* option */
89     int                 width, height;
90     AVRational          rate;
91     int                 bar_h;
92     int                 axis_h;
93     int                 sono_h;
94     int                 fullhd; /* deprecated */
95     char                *sono_v;
96     char                *bar_v;
97     float               sono_g;
98     float               bar_g;
99     double              timeclamp;
100     double              basefreq;
101     double              endfreq;
102     float               coeffclamp; /* deprecated - ignored */
103     char                *tlength;
104     int                 count;
105     int                 fcount;
106     char                *fontfile;
107     char                *fontcolor;
108     char                *axisfile;
109     int                 axis;
110 } ShowCQTContext;
111
112 #endif