webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
analysis.h
Go to the documentation of this file.
1 /* Copyright (c) 2011 Xiph.Org Foundation
2  Written by Jean-Marc Valin */
3 /*
4  Redistribution and use in source and binary forms, with or without
5  modification, are permitted provided that the following conditions
6  are met:
7 
8  - Redistributions of source code must retain the above copyright
9  notice, this list of conditions and the following disclaimer.
10 
11  - Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in the
13  documentation and/or other materials provided with the distribution.
14 
15  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
19  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef ANALYSIS_H
29 #define ANALYSIS_H
30 
31 #include "celt.h"
32 #include "opus_private.h"
33 
34 #define NB_FRAMES 8
35 #define NB_TBANDS 18
36 #define NB_TOT_BANDS 21
37 #define ANALYSIS_BUF_SIZE 720 /* 15 ms at 48 kHz */
38 
39 #define DETECT_SIZE 200
40 
41 typedef struct {
42  int arch;
43 #define TONALITY_ANALYSIS_RESET_START angle
44  float angle[240];
45  float d_angle[240];
46  float d2_angle[240];
48  int mem_fill; /* number of usable samples in the buffer */
49  float prev_band_tonality[NB_TBANDS];
52  float lowE[NB_TBANDS];
53  float highE[NB_TBANDS];
54  float meanE[NB_TOT_BANDS];
55  float mem[32];
56  float cmean[8];
57  float std[9];
58  float music_prob;
59  float Etracker;
60  float lowECount;
61  int E_count;
64  int count;
65  float subframe_mem[3];
69  float pspeech[DETECT_SIZE];
72  float pmusic[DETECT_SIZE];
77  int write_pos;
78  int read_pos;
82 
90 
96 
97 void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, int len);
98 
99 void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *analysis_pcm,
100  int analysis_frame_size, int frame_size, int c1, int c2, int C, opus_int32 Fs,
101  int lsb_depth, downmix_func downmix, AnalysisInfo *analysis_info);
102 
103 #endif
int read_pos
Definition: analysis.h:78
int arch
Definition: analysis.h:42
int music_confidence_count
Definition: analysis.h:76
Definition: type_traits_unittest.cc:113
Contains all the functions for encoding and decoding audio.
int read_subframe
Definition: analysis.h:79
def info(msg, args, kwargs)
Definition: __init__.py:1165
Definition: videoengine_unittest.h:62
Definition: celt.h:53
#define CELTMode
Definition: celt.h:51
int E_count
Definition: analysis.h:61
float music_confidence
Definition: analysis.h:74
float prev_tonality
Definition: analysis.h:50
OPENSSL_EXPORT const ASN1_OBJECT int const unsigned char int len
Definition: x509.h:1053
void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, int len)
Definition: analysis.c:156
#define DETECT_SIZE
Definition: analysis.h:39
Definition: Platform.h:33
void tonality_analysis_init(TonalityAnalysisState *analysis)
Definition: analysis.c:141
int opus_int32
Definition: opus_types.h:146
int write_pos
Definition: analysis.h:77
void tonality_analysis_reset(TonalityAnalysisState *analysis)
Definition: analysis.c:149
int speech_confidence_count
Definition: analysis.h:75
int last_music
Definition: analysis.h:62
void(* downmix_func)(const void *, opus_val32 *, int, int, int, int, int)
Definition: opus_private.h:87
#define NB_FRAMES
Definition: analysis.h:34
int analysis_offset
Definition: analysis.h:66
float speech_confidence
Definition: analysis.h:73
#define ANALYSIS_BUF_SIZE
Definition: analysis.h:37
#define NB_TBANDS
Definition: analysis.h:35
int mem_fill
Definition: analysis.h:48
Definition: type_traits_unittest.cc:77
void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *analysis_pcm, int analysis_frame_size, int frame_size, int c1, int c2, int C, opus_int32 Fs, int lsb_depth, downmix_func downmix, AnalysisInfo *analysis_info)
Definition: analysis.c:646
float lowECount
Definition: analysis.h:60
int count
Definition: analysis.h:64
float opus_val32
Definition: arch.h:149
float Etracker
Definition: analysis.h:59
float music_prob
Definition: analysis.h:58
int last_transition
Definition: analysis.h:63
Definition: analysis.h:41
#define NB_TOT_BANDS
Definition: analysis.h:36