summaryrefslogtreecommitdiffstats
path: root/media/libvorbis/lib/envelope.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /media/libvorbis/lib/envelope.h
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'media/libvorbis/lib/envelope.h')
-rw-r--r--media/libvorbis/lib/envelope.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/media/libvorbis/lib/envelope.h b/media/libvorbis/lib/envelope.h
new file mode 100644
index 0000000000..2ef60a82ca
--- /dev/null
+++ b/media/libvorbis/lib/envelope.h
@@ -0,0 +1,79 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+ * by the Xiph.Org Foundation https://xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: PCM data envelope analysis and manipulation
+
+ ********************************************************************/
+
+#ifndef _V_ENVELOPE_
+#define _V_ENVELOPE_
+
+#include "mdct.h"
+
+#define VE_PRE 16
+#define VE_WIN 4
+#define VE_POST 2
+#define VE_AMP (VE_PRE+VE_POST-1)
+
+#define VE_BANDS 7
+#define VE_NEARDC 15
+
+#define VE_MINSTRETCH 2 /* a bit less than short block */
+#define VE_MAXSTRETCH 12 /* one-third full block */
+
+typedef struct {
+ float ampbuf[VE_AMP];
+ int ampptr;
+
+ float nearDC[VE_NEARDC];
+ float nearDC_acc;
+ float nearDC_partialacc;
+ int nearptr;
+
+} envelope_filter_state;
+
+typedef struct {
+ int begin;
+ int end;
+ float *window;
+ float total;
+} envelope_band;
+
+typedef struct {
+ int ch;
+ int winlength;
+ int searchstep;
+ float minenergy;
+
+ mdct_lookup mdct;
+ float *mdct_win;
+
+ envelope_band band[VE_BANDS];
+ envelope_filter_state *filter;
+ int stretch;
+
+ int *mark;
+
+ long storage;
+ long current;
+ long curmark;
+ long cursor;
+} envelope_lookup;
+
+extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);
+extern void _ve_envelope_clear(envelope_lookup *e);
+extern long _ve_envelope_search(vorbis_dsp_state *v);
+extern void _ve_envelope_shift(envelope_lookup *e,long shift);
+extern int _ve_envelope_mark(vorbis_dsp_state *v);
+
+
+#endif