Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
5f09ea56
Commit
5f09ea56
authored
Feb 26, 2008
by
Jean-Marc Valin
Browse files
celt_mask_t for masking curves
parent
8835a4df
Changes
8
Hide whitespace changes
Inline
Side-by-side
libcelt/arch.h
View file @
5f09ea56
...
...
@@ -54,7 +54,8 @@ typedef celt_int32_t celt_word32_t;
typedef
celt_word32_t
celt_sig_t
;
typedef
celt_word16_t
celt_norm_t
;
typedef
celt_word32_t
celt_ener_t
;
typedef
double
celt_pgain_t
;
typedef
float
celt_pgain_t
;
typedef
float
celt_mask_t
;
#define Q15ONE 32767
...
...
@@ -99,6 +100,7 @@ typedef float celt_sig_t;
typedef
float
celt_norm_t
;
typedef
float
celt_ener_t
;
typedef
float
celt_pgain_t
;
typedef
float
celt_mask_t
;
#define Q15ONE 1.0f
...
...
libcelt/bands.c
View file @
5f09ea56
...
...
@@ -210,7 +210,7 @@ void pitch_quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_p
/* Quantisation of the residual */
void
quant_bands
(
const
CELTMode
*
m
,
celt_norm_t
*
X
,
celt_norm_t
*
P
,
floa
t
*
W
,
int
total_bits
,
ec_enc
*
enc
)
void
quant_bands
(
const
CELTMode
*
m
,
celt_norm_t
*
X
,
celt_norm_t
*
P
,
celt_mask_
t
*
W
,
int
total_bits
,
ec_enc
*
enc
)
{
int
i
,
j
,
B
,
bits
;
const
int
*
eBands
=
m
->
eBands
;
...
...
libcelt/bands.h
View file @
5f09ea56
...
...
@@ -81,7 +81,7 @@ void pitch_quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_p
* @param total_bits Total number of bits that can be used for the frame (including the ones already spent)
* @param enc Entropy encoder
*/
void
quant_bands
(
const
CELTMode
*
m
,
celt_norm_t
*
X
,
celt_norm_t
*
P
,
floa
t
*
W
,
int
total_bits
,
ec_enc
*
enc
);
void
quant_bands
(
const
CELTMode
*
m
,
celt_norm_t
*
X
,
celt_norm_t
*
P
,
celt_mask_
t
*
W
,
int
total_bits
,
ec_enc
*
enc
);
/** Decoding of the residual spectrum
* @param m Mode data
...
...
libcelt/pitch.c
View file @
5f09ea56
...
...
@@ -52,13 +52,13 @@ void find_spectral_pitch(kiss_fftr_cfg fft, struct PsyDecay *decay, celt_sig_t *
VARDECL
(
celt_word32_t
*
yy
);
VARDECL
(
celt_word32_t
*
X
);
VARDECL
(
celt_word32_t
*
Y
);
VARDECL
(
floa
t
*
curve
);
VARDECL
(
celt_mask_
t
*
curve
);
int
n2
=
lag
/
2
;
ALLOC
(
xx
,
lag
*
C
,
celt_word32_t
);
ALLOC
(
yy
,
lag
*
C
,
celt_word32_t
);
ALLOC
(
X
,
lag
*
C
,
celt_word32_t
);
ALLOC
(
Y
,
lag
*
C
,
celt_word32_t
);
ALLOC
(
curve
,
n2
*
C
,
floa
t
);
ALLOC
(
curve
,
n2
*
C
,
celt_mask_
t
);
for
(
i
=
0
;
i
<
C
*
lag
;
i
++
)
xx
[
i
]
=
0
;
...
...
libcelt/psy.c
View file @
5f09ea56
...
...
@@ -76,7 +76,7 @@ void psydecay_clear(struct PsyDecay *decay)
celt_free
(
decay
->
decayL
);
}
static
void
spreading_func
(
struct
PsyDecay
*
d
,
float
*
psd
,
floa
t
*
mask
,
int
len
)
static
void
spreading_func
(
struct
PsyDecay
*
d
,
float
*
psd
,
celt_mask_
t
*
mask
,
int
len
)
{
int
i
;
float
mem
;
...
...
@@ -122,7 +122,7 @@ static void spreading_func(struct PsyDecay *d, float *psd, float *mask, int len)
}
/* Compute a marking threshold from the spectrum X. */
void
compute_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
floa
t
*
mask
,
int
len
)
void
compute_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
celt_mask_
t
*
mask
,
int
len
)
{
int
i
;
VARDECL
(
float
*
psd
);
...
...
@@ -137,7 +137,7 @@ void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int
}
void
compute_mdct_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
floa
t
*
mask
,
int
len
)
void
compute_mdct_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
celt_mask_
t
*
mask
,
int
len
)
{
int
i
;
VARDECL
(
float
*
psd
);
...
...
libcelt/psy.h
View file @
5f09ea56
...
...
@@ -45,9 +45,9 @@ void psydecay_init(struct PsyDecay *decay, int len, celt_int32_t Fs);
void
psydecay_clear
(
struct
PsyDecay
*
decay
);
/** Compute the masking curve for an input (DFT) spectrum X */
void
compute_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
floa
t
*
mask
,
int
len
);
void
compute_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
celt_mask_
t
*
mask
,
int
len
);
/** Compute the masking curve for an input (MDCT) spectrum X */
void
compute_mdct_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
floa
t
*
mask
,
int
len
);
void
compute_mdct_masking
(
struct
PsyDecay
*
decay
,
celt_word32_t
*
X
,
celt_mask_
t
*
mask
,
int
len
);
#endif
/* PSY_H */
libcelt/vq.c
View file @
5f09ea56
...
...
@@ -71,7 +71,7 @@ struct NBest {
float
yp
;
};
void
alg_quant
(
celt_norm_t
*
X
,
floa
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
P
,
float
alpha
,
ec_enc
*
enc
)
void
alg_quant
(
celt_norm_t
*
X
,
celt_mask_
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
P
,
float
alpha
,
ec_enc
*
enc
)
{
int
L
=
3
;
VARDECL
(
float
*
x
);
...
...
@@ -383,7 +383,7 @@ void alg_unquant(celt_norm_t *X, int N, int K, celt_norm_t *P, float alpha, ec_d
static
const
float
pg
[
11
]
=
{
1
.
f
,
.
75
f
,
.
65
f
,
0
.
6
f
,
0
.
6
f
,
.
6
f
,
.
55
f
,
.
55
f
,
.
5
f
,
.
5
f
,
.
5
f
};
void
intra_prediction
(
celt_norm_t
*
x
,
floa
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
Y
,
celt_norm_t
*
P
,
int
B
,
int
N0
,
ec_enc
*
enc
)
void
intra_prediction
(
celt_norm_t
*
x
,
celt_mask_
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
Y
,
celt_norm_t
*
P
,
int
B
,
int
N0
,
ec_enc
*
enc
)
{
int
i
,
j
;
int
best
=
0
;
...
...
libcelt/vq.h
View file @
5f09ea56
...
...
@@ -51,7 +51,7 @@
* @param alpha compression factor to apply in the pitch direction (magic!)
* @param enc Entropy encoder state
*/
void
alg_quant
(
celt_norm_t
*
X
,
floa
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
P
,
float
alpha
,
ec_enc
*
enc
);
void
alg_quant
(
celt_norm_t
*
X
,
celt_mask_
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
P
,
float
alpha
,
ec_enc
*
enc
);
/** Algebraic pulse decoder
* @param x Decoded normalised spectrum (returned)
...
...
@@ -75,7 +75,7 @@ void alg_unquant(celt_norm_t *X, int N, int K, celt_norm_t *P, float alpha, ec_d
* @param N0 Number of valid offsets
* @param enc Entropy encoder state
*/
void
intra_prediction
(
celt_norm_t
*
x
,
floa
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
Y
,
celt_norm_t
*
P
,
int
B
,
int
N0
,
ec_enc
*
enc
);
void
intra_prediction
(
celt_norm_t
*
x
,
celt_mask_
t
*
W
,
int
N
,
int
K
,
celt_norm_t
*
Y
,
celt_norm_t
*
P
,
int
B
,
int
N0
,
ec_enc
*
enc
);
void
intra_unquant
(
celt_norm_t
*
x
,
int
N
,
int
K
,
celt_norm_t
*
Y
,
celt_norm_t
*
P
,
int
B
,
int
N0
,
ec_dec
*
dec
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment