Skip to content
Snippets Groups Projects
Commit 03892c18 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

fixed-point: finished intra_prediction(). No float ops left in vq.c

parent 9455d1b1
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@ typedef celt_word32_t celt_mask_t;
#define SIG_SCALING_1 (1.f/16384.f)
#define SIG_SHIFT 14
#define NORM_SCALING 16384.f
#define NORM_SCALING 16384
#define NORM_SCALING_1 (1.f/16384.f)
#define NORM_SHIFT 14
......
......@@ -390,13 +390,13 @@ void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t
{
int j;
celt_word32_t xy=0, yy=0;
float score;
celt_word32_t score;
for (j=0;j<N;j++)
{
xy = MAC16_16(xy, x[j], Y[i+N-j-1]);
yy = MAC16_16(yy, Y[i+N-j-1], Y[i+N-j-1]);
}
score = 1.f*xy*xy/(.001+yy);
score = DIV32(MULT16_16(ROUND(xy,14),ROUND(xy,14)), ROUND(yy,14));
if (score > best_score)
{
best_score = score;
......@@ -420,7 +420,7 @@ void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t
pred_gain = pg[10];
else
pred_gain = pg[K];
E = 1e-10;
E = EPSILON;
for (j=0;j<N;j++)
{
P[j] = s*Y[best+N-j-1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment