summaryrefslogtreecommitdiff
path: root/gr-vocoder/lib/g7xx/g72x.h
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2019-08-07 21:45:12 +0200
committerMarcus Müller <marcus@hostalia.de>2019-08-09 23:04:28 +0200
commitf7bbf2c1d8d780294f3e016aff239ca35eb6516e (patch)
treee09ab6112e02b2215b2d59ac24d3d6ea2edac745 /gr-vocoder/lib/g7xx/g72x.h
parent78431dc6941e3acc67c858277dfe4a0ed583643c (diff)
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-vocoder/lib/g7xx/g72x.h')
-rw-r--r--gr-vocoder/lib/g7xx/g72x.h170
1 files changed, 64 insertions, 106 deletions
diff --git a/gr-vocoder/lib/g7xx/g72x.h b/gr-vocoder/lib/g7xx/g72x.h
index 6186788660..86dcadd217 100644
--- a/gr-vocoder/lib/g7xx/g72x.h
+++ b/gr-vocoder/lib/g7xx/g72x.h
@@ -31,11 +31,11 @@
*
*/
#ifndef _G72X_H
-#define _G72X_H
+#define _G72X_H
-#define AUDIO_ENCODING_ULAW (1) /* ISDN u-law */
-#define AUDIO_ENCODING_ALAW (2) /* ISDN A-law */
-#define AUDIO_ENCODING_LINEAR (3) /* PCM 2's-complement (0-center) */
+#define AUDIO_ENCODING_ULAW (1) /* ISDN u-law */
+#define AUDIO_ENCODING_ALAW (2) /* ISDN A-law */
+#define AUDIO_ENCODING_LINEAR (3) /* PCM 2's-complement (0-center) */
/*
* The following is the definition of the state structure
@@ -47,110 +47,68 @@
* included in this Recommendation.
*/
struct g72x_state {
- long yl; /* Locked or steady state step size multiplier. */
- short yu; /* Unlocked or non-steady state step size multiplier. */
- short dms; /* Short term energy estimate. */
- short dml; /* Long term energy estimate. */
- short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */
-
- short a[2]; /* Coefficients of pole portion of prediction filter. */
- short b[6]; /* Coefficients of zero portion of prediction filter. */
- short pk[2]; /*
- * Signs of previous two samples of a partially
- * reconstructed signal.
- */
- short dq[6]; /*
- * Previous 6 samples of the quantized difference
- * signal represented in an internal floating point
- * format.
- */
- short sr[2]; /*
- * Previous 2 samples of the quantized difference
- * signal represented in an internal floating point
- * format.
- */
- char td; /* delayed tone detect, new in 1988 version */
+ long yl; /* Locked or steady state step size multiplier. */
+ short yu; /* Unlocked or non-steady state step size multiplier. */
+ short dms; /* Short term energy estimate. */
+ short dml; /* Long term energy estimate. */
+ short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */
+
+ short a[2]; /* Coefficients of pole portion of prediction filter. */
+ short b[6]; /* Coefficients of zero portion of prediction filter. */
+ short pk[2]; /*
+ * Signs of previous two samples of a partially
+ * reconstructed signal.
+ */
+ short dq[6]; /*
+ * Previous 6 samples of the quantized difference
+ * signal represented in an internal floating point
+ * format.
+ */
+ short sr[2]; /*
+ * Previous 2 samples of the quantized difference
+ * signal represented in an internal floating point
+ * format.
+ */
+ char td; /* delayed tone detect, new in 1988 version */
};
/* External function definitions. */
-extern void g72x_init_state(struct g72x_state *);
-extern int g721_encoder(
- int sample,
- int in_coding,
- struct g72x_state *state_ptr);
-extern int g721_decoder(
- int code,
- int out_coding,
- struct g72x_state *state_ptr);
-extern int g723_24_encoder(
- int sample,
- int in_coding,
- struct g72x_state *state_ptr);
-extern int g723_24_decoder(
- int code,
- int out_coding,
- struct g72x_state *state_ptr);
-extern int g723_40_encoder(
- int sample,
- int in_coding,
- struct g72x_state *state_ptr);
-extern int g723_40_decoder(
- int code,
- int out_coding,
- struct g72x_state *state_ptr);
-
-
-extern int
-quantize(
- int d,
- int y,
- short *table,
- int size);
-extern int reconstruct(int,int,int);void
-
-extern update(
- int code_size,
- int y,
- int wi,
- int fi,
- int dq,
- int sr,
- int dqsez,
- struct g72x_state *state_ptr);
-extern int
-tandem_adjust_alaw(
- int sr,
- int se,
- int y,
- int i,
- int sign,
- short *qtab);
-
-extern int
-tandem_adjust_ulaw(
- int sr,
- int se,
- int y,
- int i,
- int sign,
- short *qtab);
-
-extern unsigned char
-linear2alaw(
- int pcm_val);
-
-extern int
-alaw2linear(
- unsigned char a_val);
-
-extern unsigned char
-linear2ulaw(int pcm_val);
-
-extern int ulaw2linear( unsigned char u_val);
-
-extern int predictor_zero(struct g72x_state *state_ptr);
-
-extern int predictor_pole( struct g72x_state *state_ptr);
-extern int step_size( struct g72x_state *state_ptr);
+extern void g72x_init_state(struct g72x_state*);
+extern int g721_encoder(int sample, int in_coding, struct g72x_state* state_ptr);
+extern int g721_decoder(int code, int out_coding, struct g72x_state* state_ptr);
+extern int g723_24_encoder(int sample, int in_coding, struct g72x_state* state_ptr);
+extern int g723_24_decoder(int code, int out_coding, struct g72x_state* state_ptr);
+extern int g723_40_encoder(int sample, int in_coding, struct g72x_state* state_ptr);
+extern int g723_40_decoder(int code, int out_coding, struct g72x_state* state_ptr);
+
+
+extern int quantize(int d, int y, short* table, int size);
+extern int reconstruct(int, int, int);
+void
+
+ extern update(int code_size,
+ int y,
+ int wi,
+ int fi,
+ int dq,
+ int sr,
+ int dqsez,
+ struct g72x_state* state_ptr);
+extern int tandem_adjust_alaw(int sr, int se, int y, int i, int sign, short* qtab);
+
+extern int tandem_adjust_ulaw(int sr, int se, int y, int i, int sign, short* qtab);
+
+extern unsigned char linear2alaw(int pcm_val);
+
+extern int alaw2linear(unsigned char a_val);
+
+extern unsigned char linear2ulaw(int pcm_val);
+
+extern int ulaw2linear(unsigned char u_val);
+
+extern int predictor_zero(struct g72x_state* state_ptr);
+
+extern int predictor_pole(struct g72x_state* state_ptr);
+extern int step_size(struct g72x_state* state_ptr);
#endif /* !_G72X_H */