From 303b3b627ef0c0f78cca92dc1c8d6d6e800a0643 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Wed, 30 Dec 2009 22:40:24 -0500 Subject: fixed-point: starting conversion of the new PLC --- libcelt/celt.c | 7 ++++--- libcelt/plc.c | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libcelt/celt.c b/libcelt/celt.c index 2e206e7..527e323 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -55,6 +55,7 @@ #include #define LPC_ORDER 24 +/* #define NEW_PLC */ #if !defined(FIXED_POINT) || defined(NEW_PLC) #include "plc.c" #endif @@ -1286,7 +1287,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p for (c=0;cout_mem[i*C+c]; + exc[i] = SHR32(st->out_mem[i*C+c], SIG_SHIFT); if (st->loss_count == 0) { @@ -1340,7 +1341,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p offset -= pitch_index; decay *= decay; } - e[i] = decay*exc[offset+i]; + e[i] = decay*SHL32(EXTEND32(exc[offset+i]), SIG_SHIFT); S1 += st->out_mem[offset+i]*1.*st->out_mem[offset+i]; } diff --git a/libcelt/plc.c b/libcelt/plc.c index 8eb12d5..8d6d9a5 100644 --- a/libcelt/plc.c +++ b/libcelt/plc.c @@ -42,12 +42,16 @@ int p if (error<.00001*ac[0]) break; } +#ifdef FIXED_POINT + for (i=0;i