summaryrefslogtreecommitdiff
path: root/src/analysis.h
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-02-20 04:08:04 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-02-20 04:08:34 -0500
commit51f4a32ec2b62fd7c53e7b901fefd38ff95e7cc2 (patch)
treee963338c7c0b091ed7d03512fb6d7b62d096ccc0 /src/analysis.h
parent10a34a5dd66ff45538ac3843eab7802d260e160f (diff)
downloadopus-51f4a32ec2b62fd7c53e7b901fefd38ff95e7cc2.tar.gz
Adds support for delayed decision
Variable duration option renamed to OPUS_SET_EXPERT_FRAME_DURATION, with new API. Also moves up the analysis to avoid having to do int->float conversion on large buffers.
Diffstat (limited to 'src/analysis.h')
-rw-r--r--src/analysis.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/analysis.h b/src/analysis.h
index 6f3689da..37a8bf40 100644
--- a/src/analysis.h
+++ b/src/analysis.h
@@ -28,10 +28,16 @@
#ifndef ANALYSIS_H
#define ANALYSIS_H
+#include "celt.h"
+#include "opus_private.h"
+
#define NB_FRAMES 8
#define NB_TBANDS 18
#define NB_TOT_BANDS 21
#define ANALYSIS_BUF_SIZE 720 /* 15 ms at 48 kHz */
+
+#define DETECT_SIZE 200
+
typedef struct {
float angle[240];
float d_angle[240];
@@ -55,9 +61,23 @@ typedef struct {
int last_transition;
int count;
int opus_bandwidth;
+ opus_val32 subframe_mem[3];
+ int analysis_offset;
+ float pspeech[DETECT_SIZE];
+ float pmusic[DETECT_SIZE];
+ int write_pos;
+ int read_pos;
+ int read_subframe;
+ AnalysisInfo info[DETECT_SIZE];
} TonalityAnalysisState;
void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info,
- CELTEncoder *celt_enc, const opus_val16 *x, int len, int C, int lsb_depth);
+ const CELTMode *celt_mode, const void *x, int len, int offset, int C, int lsb_depth, downmix_func downmix);
+
+void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, int len);
+
+int run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *pcm,
+ const void *analysis_pcm, int frame_size, int variable_duration, int C, opus_int32 Fs, int bitrate_bps,
+ int delay_compensation, int lsb_depth, downmix_func downmix, AnalysisInfo *analysis_info);
#endif