⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decode.dsp

📁 作者:Analog Devices,Inc 平台:ADSP21xx 编程语言:ASM 说明:ADSP21xx用AD的16位定点DSP作音频压缩器性价比不错
💻 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 + -