?? decode.dsp
字號:
.module/boot=4 decode_parameters;
{ DECODE.DSP - decompresses the lpc parameters.
INPUT:
i1 -> k (reflection coeffs) l1 = 0
si = pitch
ax0 = gain
OUTPUT:
k's decoded inplace
si = pitch
ax0 = gain
The log coeded parameters are decompressed using:
k[i] = (10^(g[i]*4)+1)/(10^(g[i]*4)-1)
}
#include "lpc.h"
.const DELOG_ORDER = 8;
.var/pm delog_coeffs[2*DELOG_ORDER]; {Ci lsb, Ci msb, Ci-1 lsb .....}
.init delog_coeffs: <delog.cff>; {scaled down by 512 = 2^9}
.const LAR_ORDER = 16;
.var/pm lar_coeffs[2*LAR_ORDER]; {Ci lsb, Ci msb, Ci-1 lsb .....}
.init lar_coeffs: <dec.cff>; {scaled down by 1024 = 2^10}
.var/dm temp_pitch;
.var/dm temp_gain;
.entry decode;
.external poly_approx;
decode:
{decode }
{si = pitch}
se = -9;
sr = lshift si (lo);
dm(temp_pitch) = sr0;
{ax0 = gain}
sr1 = ax0;
ar = pass ax0;
if eq jump zero_gain;
my0 = 0x0000; {gain lsb}
my1 = ax0; {gain msb}
ax0 = DELOG_ORDER - 1;
i6 = ^delog_coeffs; l6 = 0;
call poly_approx; {log10 function}
si = mx0;
sr = lshift si by 9 (lo); {scale up by 512, comes with the coeff's}
sr = sr or ashift ar by 9 (hi);
zero_gain:
dm(temp_gain) = sr1;
cntr = 2 {N};
do dec_k until ce;
my0 = 0x0000; {k lsb}
my1 = dm(i1,m0); {k msb}
ax0 = LAR_ORDER - 1;
i6 = ^lar_coeffs; l6 = 0;
call poly_approx; {log area ratio function}
si = mx0;
sr = lshift si by 10 (lo); {scale up by 1024}
sr = sr or ashift ar by 10 (hi);
dec_k: dm(i1,m1) = sr1;
{setup return parameters}
si = dm(temp_pitch);
ax0 = dm(temp_gain);
rts;
.endmod;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -