Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
d501f614
Commit
d501f614
authored
Feb 21, 2008
by
Jean-Marc Valin
Browse files
Doing intra-frame prediction backwards (and a few comments)
parent
5e219637
Changes
3
Hide whitespace changes
Inline
Side-by-side
libcelt/bands.c
View file @
d501f614
...
...
@@ -39,7 +39,7 @@
#include "vq.h"
#include "cwrs.h"
/* Applies a series of rotations so that pulses are spread like a two-sided
/*
*
Applies a series of rotations so that pulses are spread like a two-sided
exponential. The effect of this is to reduce the tonal noise created by the
sparse spectrum resulting from the pulse codebook */
static
void
exp_rotation
(
float
*
X
,
int
len
,
float
theta
,
int
dir
,
int
stride
,
int
iter
)
...
...
libcelt/celt.c
View file @
d501f614
...
...
@@ -154,7 +154,7 @@ void celt_encoder_destroy(CELTEncoder *st)
celt_free
(
st
);
}
/** Apply window and compute the MDCT for all sub-frames and all channels in a frame */
static
float
compute_mdcts
(
mdct_lookup
*
mdct_lookup
,
float
*
window
,
float
*
in
,
float
*
out
,
int
N
,
int
B
,
int
C
)
{
int
i
,
c
;
...
...
@@ -182,6 +182,7 @@ static float compute_mdcts(mdct_lookup *mdct_lookup, float *window, float *in, f
return
E
;
}
/** Compute the IMDCT and apply window for all sub-frames and all channels in a frame */
static
void
compute_inv_mdcts
(
mdct_lookup
*
mdct_lookup
,
float
*
window
,
float
*
X
,
float
*
out_mem
,
float
*
mdct_overlap
,
int
N
,
int
overlap
,
int
B
,
int
C
)
{
int
i
,
c
,
N4
;
...
...
@@ -506,6 +507,8 @@ void celt_decoder_destroy(CELTDecoder *st)
celt_free
(
st
);
}
/** Handles lost packets by just copying past data with the same offset as the last
pitch period */
static
void
celt_decode_lost
(
CELTDecoder
*
st
,
short
*
pcm
)
{
int
i
,
c
,
N
,
B
,
C
;
...
...
libcelt/vq.c
View file @
d501f614
...
...
@@ -367,8 +367,8 @@ void intra_prediction(float *x, float *W, int N, int K, float *Y, float *P, int
float
score
;
for
(
j
=
0
;
j
<
N
;
j
++
)
{
xy
+=
x
[
j
]
*
Y
[
i
+
j
];
yy
+=
Y
[
i
+
j
]
*
Y
[
i
+
j
];
xy
+=
x
[
j
]
*
Y
[
i
+
N
-
j
-
1
];
yy
+=
Y
[
i
+
N
-
j
-
1
]
*
Y
[
i
+
N
-
j
-
1
];
}
score
=
xy
*
xy
/
(.
001
+
yy
);
if
(
score
>
best_score
)
...
...
@@ -397,7 +397,7 @@ void intra_prediction(float *x, float *W, int N, int K, float *Y, float *P, int
E
=
1e-10
;
for
(
j
=
0
;
j
<
N
;
j
++
)
{
P
[
j
]
=
s
*
Y
[
best
+
j
];
P
[
j
]
=
s
*
Y
[
best
+
N
-
j
-
1
];
E
+=
P
[
j
]
*
P
[
j
];
}
E
=
pred_gain
/
sqrt
(
E
);
...
...
@@ -444,7 +444,7 @@ void intra_unquant(float *x, int N, int K, float *Y, float *P, int B, int N0, ec
E
=
1e-10
;
for
(
j
=
0
;
j
<
N
;
j
++
)
{
P
[
j
]
=
s
*
Y
[
best
+
j
];
P
[
j
]
=
s
*
Y
[
best
+
N
-
j
-
1
];
E
+=
P
[
j
]
*
P
[
j
];
}
E
=
pred_gain
/
sqrt
(
E
);
...
...
Write
Preview
Supports
Markdown
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