// 10th added for get_scale_factors
// llth added for decode
// @LATTICE("IS1D*,RO<IS1D,IS1D<SI2,SI2<SI1,SI<P2S,SF1<CH0,SF0*,SFB_SH<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SI1<SF2,SF2<SFB,SF1<BR,LR*,OUT<LR,LR<RO,NZ*,SI<SF1,SI1<NZ,NZ<SI,SI1<SBI,SBI<SI,BUF<FT,SF1<SF0,SF0<HD1,BR<ST,ST,FT<SP,SP<OUT,OUT<SI1,SI1<SI,P2S<CH0,CH0<MAX0,MAX0<BR1,FS<BR1,BR1<BR,BR<HD1,HD1<HD,OUT*,BR1*,SI1*,MAX0*,CH0*,RAW,TS,F,C,K,LY,VAR,IR,IP,CSH,GLSFD3,GLSFD4,GLSFD5,GLSFF4,GLSFF2,GLSFF3,GLSFF1,GSF4,GSF5,GSF1,GSF2,GSF3,HD2,HD3,BT,GR,RO6,RO5,RO9,RO8,RO7,RO4,RO1,RO3,RO2,SH,ME,TMP2,S,LSF,J")
-@LATTICE("SI0*,INIT*,ISR*,ISP*,HD<CH0,LR<ISR,ISR<ISP,SI1<SF2,NS*,CH0<ST,ST<INIT,IS1D*,RO1<RO,RO1*,RO<IS1D,IS1D<SI2,SI2<SI1,BR<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SF2<SFB,LR*,OUT<LR,ISP<RO1,NZ*,SI<SI0,SI0<SF15,SF15<SF1,BR1<NZ,NZ<BR,SI1<RT,RT<SBI,SBI<SI,BUF<FT,SF1<HD1,SF1<HD1,FT<SP,SP<OUT,OUT<SI1,SI1<SI,SFB_SH<BR1,BR1<BR,HD1<HD,OUT*,BR1*,SI1*,CH0*")
+@LATTICE("SI0*,INIT*,ISR*,ISP*,HD<CH0,LR<ISR,ISR<ISP,SI1<SF2,NS*,CH0<ST,ST<INIT,IS1D*,RO1<RO,RO1*,RO<IS1D,IS1D<SI2,SI2<SI1,BR<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SF2<SFB,LR*,TSOUT*,OUT1<PREV,PREV<RAWFULL,RAWFULL<RAWOUT,RAWOUT<TSOUT,TSOUT<OUT0,OUT0<LR,ISP<RO1,NZ*,SI<SI0,SI0<SF15,SF15<SF1,BR1<NZ,NZ<BR,SI1<RT,RT<SBI,SBI<SI,BUF<FT,SF1<HD1,SF1<HD1,FT<SP,SP<OUT1,SI1<SI,SFB_SH<BR1,BR1<BR,HD1<HD,OUT0*,OUT1*,BR1*,SI1*,CH0*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN,RETURNLOC=OUT")
final class LayerIIIDecoder implements FrameDecoder {
static final double d43 = (4.0 / 3.0);
private float[][][] ro;
@LOC("LR")
private float[][][] lr;
- @LOC("OUT")
+ @LOC("OUT0")
private float[] inter; // 576 samples
- @LOC("OUT")
+ @LOC("OUT1")
private float[] out_1d; // 576 samples
- @LOC("OUT")
+ @LOC("PREV")
private float[][] prevblck;
@LOC("LR")
@LOC("INIT")
private boolean initialized = false;
- @LOC("OUT")
+ @LOC("RAWFULL")
float[][] raw_full; // 18 left shfited since it will be copied into prevblck!
// constructor for the linear type system
public LayerIIIDecoder(Header h, @DELEGATE @LOC("VAR") SynthesisFilter filtera,
@DELEGATE @LOC("VAR") SynthesisFilter filterb, @LOC("VAR") int which_ch0) {
+ filter_pos = 11;
raw_full = new float[2][SBLIMIT * SSLIMIT];
filter1 = filtera;
private float[] samples1 = new float[32];
@LOC("SP")
private float[] samples2 = new float[32];
+ @LOC("SI1")
+ private int filter_pos;
/*
* location hierarchy of decode() {header} {stream} {si} {br, flush_main,
SSJAVA.arrayinit(k, 2, SBLIMIT * SSLIMIT, 0);
SSJAVA.arrayinit(is_1d, 0);
SSJAVA.arrayinit(tsOutCopy, 0);
+ SSJAVA.arrayinit(scalefac_buffer, 0);
CheckSumHuff = 0;
// prevblck = new float[2][SBLIMIT * SSLIMIT];
si = new III_side_info_t();
@LOC("THIS,LayerIIIDecoder.HD1") int version = header.version();
// additional codes for the definitely written property
+ filter_pos = (filter_pos + 4) & 0xf;
filter1.vidx = 1;
filter2.vidx = 1;
- // filter1.actual_write_pos=0;
- // filter2.actual_write_pos=0;
+ filter1.actual_write_pos = filter_pos;
+ filter2.actual_write_pos = filter_pos;
//
// System.out.println("filter1="+filter1.vidx+" "+filter1.actual_write_pos);
// 'first_channel' >
// the body
- // in the body
- // read set= lr,ch,gr,out_1d, sb18, ss, SSLIMIT, out_1d
- // write set= out_1d
-
reorder(/* lr[ch], */ch, gr);
antialias(ch, gr);
sb++; // sb should be loc*
}
filter1.input_samples(samples1);
+ // System.out.println("filter1 writepos=" + filter1.actual_write_pos
+ // + " vidx=" + filter1.vidx);
filter1.calculate_pcm_samples();
}
} else {
filter2.calculate_pcm_samples();
}
}
-
+ // System.out.println("#END CH=" + ch + " actual_write_pos=" +
+ // filter1.actual_write_pos);
} // channels
// TODO
// prevblck[chidx][sidx] = raw_full[chidx][sidx];
// }
// }
-
+ // System.out.println("#END GR=" + gr + " actual_write_pos=" +
+ // filter1.actual_write_pos);
} // granule
+ // System.out.println("#END FRAME actual_write_pos=" +
+ // filter1.actual_write_pos);
+
+ filter1.clear();
+ filter2.clear();
+
// System.out.println("Counter = ................................."+counter);
// if (counter < 609)
// {
}
}
- for (@LOC("THIS,LayerIIIDecoder.NS") int x = 0; x < 45; x++)
- // why 45, not 54?
- scalefac_buffer[x] = 0;
+ // for (@LOC("THIS,LayerIIIDecoder.NS") int x = 0; x < 45; x++)
+ // // why 45, not 54?
+ // scalefac_buffer[x] = 0;
m = 0;
for (@LOC("THIS,LayerIIIDecoder.NS") int i = 0; i < 4; i++) {
for (ss = 0; ss < 8; ss++) {
@LOC("THIS,LayerIIIDecoder.SI1") int src_idx1 = sb18 + 17 - ss;
@LOC("THIS,LayerIIIDecoder.SI1") int src_idx2 = sb18 + 18 + ss;
- @LOC("THIS,LayerIIIDecoder.OUT") float bu = inter[src_idx1];
- @LOC("THIS,LayerIIIDecoder.OUT") float bd = inter[src_idx2];
+ @LOC("THIS,LayerIIIDecoder.OUT0") float bu = inter[src_idx1];
+ @LOC("THIS,LayerIIIDecoder.OUT0") float bd = inter[src_idx2];
inter[src_idx1] = (bu * cs[ss]) - (bd * ca[ss]);
inter[src_idx2] = (bd * cs[ss]) + (bu * ca[ss]);
}
// MDM: tsOutCopy and rawout do not need initializing, so the arrays
// can be reused.
- @LOC("OUT")
+ @LOC("TSOUT")
float[] tsOutCopy = new float[18];
- @LOC("OUT")
+ @LOC("RAWOUT")
float[] rawout = new float[36];
@LATTICE("THIS<SB,SB*,THISLOC=THIS")
// tsOut = out_1d;
// Modif E.B 02/22/99
- for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
- tsOutCopy[cc] = out_1d[cc + sb18];
+ for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++) {
+ // tsOutCopy[cc] = out_1d[cc + sb18];
+ tsOutCopy[cc] = inter[cc + sb18];
+ }
inv_mdct(bt);
- for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
+ for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++) {
out_1d[cc + sb18] = tsOutCopy[cc];
+ }
+
// Fin Modif
// overlap addition
// @LOC("IN") int block_type) {//remove alias
// ssjava
@LATTICE("THIS,THISLOC=THIS")
- public void inv_mdct(@LOC("THIS,LayerIIIDecoder.OUT") int block_type) {
+ public void inv_mdct(@LOC("THIS,LayerIIIDecoder.TSOUT") int block_type) {
// float[] win_bt;
- @LOC("THIS,LayerIIIDecoder.OUT") int i;
-
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_0;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_1;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_2;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_3;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_4;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_5;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_6;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_7;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_8;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_9;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_10;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_11;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_12;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_13;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_14;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_15;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_16;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_17;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") int i;
+
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_0;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_1;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_2;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_3;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_4;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_5;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_6;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_7;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_8;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_9;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_10;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_11;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_12;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_13;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_14;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_15;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_16;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmpf_17;
tmpf_0 =
tmpf_1 =
rawout[34] = 0.0f;
rawout[35] = 0.0f;
- @LOC("THIS,LayerIIIDecoder.OUT") int six_i = 0;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") int six_i = 0;
for (i = 0; i < 3; i++) {
// 12 point IMDCT
tsOutCopy[9 + i] += tsOutCopy[3 + i];
// 3 point IDCT on even indices
- @LOC("THIS,LayerIIIDecoder.OUT") float pp1;
- @LOC("THIS,LayerIIIDecoder.OUT") float pp2;
- @LOC("THIS,LayerIIIDecoder.OUT") float sum;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float pp1;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float pp2;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float sum;
pp2 = tsOutCopy[12 + i] * 0.500000000f;
pp1 = tsOutCopy[6 + i] * 0.866025403f;
sum = tsOutCopy[0 + i] + pp2;
tmpf_5 *= 0.517638090f;
// Output butterflies on 2 3 point IDCT's (for 6 point IDCT)
- @LOC("THIS,LayerIIIDecoder.OUT") float save = tmpf_0;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float save = tmpf_0;
tmpf_0 += tmpf_5;
tmpf_5 = save - tmpf_5;
save = tmpf_1;
tsOutCopy[5] += tsOutCopy[3];
tsOutCopy[3] += tsOutCopy[1];
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp0;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp1;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp2;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp3;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp4;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp0_;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp1_;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp2_;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp3_;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp0o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp1o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp2o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp3o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp4o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp0_o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp1_o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp2_o;
- @LOC("THIS,LayerIIIDecoder.OUT") float tmp3_o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp0;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp1;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp2;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp3;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp4;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp0_;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp1_;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp2_;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp3_;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp0o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp1o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp2o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp3o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp4o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp0_o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp1_o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp2_o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float tmp3_o;
// Fast 9 Point Inverse Discrete Cosine Transform
//
// 9 point IDCT on even indices
// 5 points on odd indices (not realy an IDCT)
- @LOC("THIS,LayerIIIDecoder.OUT") float i00 = tsOutCopy[0] + tsOutCopy[0];
- @LOC("THIS,LayerIIIDecoder.OUT") float iip12 = i00 + tsOutCopy[12];
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float i00 = tsOutCopy[0] + tsOutCopy[0];
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float iip12 = i00 + tsOutCopy[12];
tmp0 =
iip12 + tsOutCopy[4] * 1.8793852415718f + tsOutCopy[8] * 1.532088886238f + tsOutCopy[16]
tmp4 = tsOutCopy[0] - tsOutCopy[4] + tsOutCopy[8] - tsOutCopy[12] + tsOutCopy[16];
// 4 points on even indices
- @LOC("THIS,LayerIIIDecoder.OUT") float i66_ = tsOutCopy[6] * 1.732050808f; // Sqrt[3]
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float i66_ = tsOutCopy[6] * 1.732050808f; // Sqrt[3]
tmp0_ =
tsOutCopy[2] * 1.9696155060244f + i66_ + tsOutCopy[10] * 1.2855752193731f + tsOutCopy[14]
// 9 point IDCT on odd indices
// 5 points on odd indices (not realy an IDCT)
- @LOC("THIS,LayerIIIDecoder.OUT") float i0 = tsOutCopy[0 + 1] + tsOutCopy[0 + 1];
- @LOC("THIS,LayerIIIDecoder.OUT") float i0p12 = i0 + tsOutCopy[12 + 1];
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float i0 = tsOutCopy[0 + 1] + tsOutCopy[0 + 1];
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float i0p12 = i0 + tsOutCopy[12 + 1];
tmp0o =
i0p12 + tsOutCopy[4 + 1] * 1.8793852415718f + tsOutCopy[8 + 1] * 1.532088886238f
(tsOutCopy[0 + 1] - tsOutCopy[4 + 1] + tsOutCopy[8 + 1] - tsOutCopy[12 + 1] + tsOutCopy[16 + 1]) * 0.707106781f; // Twiddled
// 4 points on even indices
- @LOC("THIS,LayerIIIDecoder.OUT") float i6_ = tsOutCopy[6 + 1] * 1.732050808f; // Sqrt[3]
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float i6_ = tsOutCopy[6 + 1] * 1.732050808f; // Sqrt[3]
tmp0_o =
tsOutCopy[2 + 1] * 1.9696155060244f + i6_ + tsOutCopy[10 + 1] * 1.2855752193731f
// and
// twiddle factors for 36 point IDCT
- @LOC("THIS,LayerIIIDecoder.OUT") float e;
- @LOC("THIS,LayerIIIDecoder.OUT") float o;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float e;
+ @LOC("THIS,LayerIIIDecoder.TSOUT") float o;
e = tmp0 + tmp0_;
o = (tmp0o + tmp0_o) * 0.501909918f;
tmpf_0 = e + o;
* from 32, 44.1 or 48 kHz to 8 kHz, if ULAW is defined. Frequencies above 4 kHz\r
* are removed by ignoring higher subbands.\r
*/\r
-@LATTICE("OUT<V1,V1<V,V<NEWV,NEWV<SAMPLE,SAMPLE<EQ,EQ<IDX,NEWV*,IDX*")\r
+@LATTICE("OUT<V2,V2<V1,V1<V,V<NEWV,NEWV<SAMPLE,SAMPLE<EQ,EQ<IDX,V*,NEWV*,IDX*")\r
@METHODDEFAULT("OUT<THIS,THIS<C,C<IN,C*,THISLOC=THIS,GLOBALLOC=THIS")\r
final class SynthesisFilter {\r
\r
@LOC("IDX")\r
public int vidx;\r
+ @LOC("V1")\r
+ public float[] v1;\r
+ @LOC("V1")\r
+ public float[] v2;\r
+\r
@LOC("V")\r
- private float[] v1;\r
+ public float[] prev1;\r
@LOC("V")\r
- private float[] v2;\r
+ public float[] prev2;\r
+\r
// private float[] actual_v; // v1 or v2\r
@LOC("IDX")\r
public int actual_write_pos; // 0-15\r
\r
v1 = new float[512];\r
v2 = new float[512];\r
+ prev1 = new float[512];\r
+ prev2 = new float[512];\r
samples = new float[32];\r
channel = channelnumber;\r
scalefactor = factor;\r
v1[464 + pos] = new_v18;\r
v1[480 + pos] = new_v17;\r
v1[496 + pos] = new_v16;\r
+\r
+ /*\r
+ * setup PREV\r
+ */\r
+\r
+ prev2[0 + pos] = new_v0;\r
+ prev2[16 + pos] = new_v1;\r
+ prev2[32 + pos] = new_v2;\r
+ prev2[48 + pos] = new_v3;\r
+ prev2[64 + pos] = new_v4;\r
+ prev2[80 + pos] = new_v5;\r
+ prev2[96 + pos] = new_v6;\r
+ prev2[112 + pos] = new_v7;\r
+ prev2[128 + pos] = new_v8;\r
+ prev2[144 + pos] = new_v9;\r
+ prev2[160 + pos] = new_v10;\r
+ prev2[176 + pos] = new_v11;\r
+ prev2[192 + pos] = new_v12;\r
+ prev2[208 + pos] = new_v13;\r
+ prev2[224 + pos] = new_v14;\r
+ prev2[240 + pos] = new_v15;\r
+\r
+ // V[16] is always 0.0:\r
+ prev2[256 + pos] = 0.0f;\r
+\r
+ // insert V[17-31] (== -new_v[15-1]) into actual v:\r
+ prev2[272 + pos] = -new_v15;\r
+ prev2[288 + pos] = -new_v14;\r
+ prev2[304 + pos] = -new_v13;\r
+ prev2[320 + pos] = -new_v12;\r
+ prev2[336 + pos] = -new_v11;\r
+ prev2[352 + pos] = -new_v10;\r
+ prev2[368 + pos] = -new_v9;\r
+ prev2[384 + pos] = -new_v8;\r
+ prev2[400 + pos] = -new_v7;\r
+ prev2[416 + pos] = -new_v6;\r
+ prev2[432 + pos] = -new_v5;\r
+ prev2[448 + pos] = -new_v4;\r
+ prev2[464 + pos] = -new_v3;\r
+ prev2[480 + pos] = -new_v2;\r
+ prev2[496 + pos] = -new_v1;\r
+\r
+ // insert V[32] (== -new_v[0]) into other v:\r
+ // dest = (actual_v == v1) ? v2 : v1;\r
+\r
+ prev1[0 + pos] = -new_v0;\r
+ // insert V[33-48] (== new_v[16-31]) into other v:\r
+ prev1[16 + pos] = new_v16;\r
+ prev1[32 + pos] = new_v17;\r
+ prev1[48 + pos] = new_v18;\r
+ prev1[64 + pos] = new_v19;\r
+ prev1[80 + pos] = new_v20;\r
+ prev1[96 + pos] = new_v21;\r
+ prev1[112 + pos] = new_v22;\r
+ prev1[128 + pos] = new_v23;\r
+ prev1[144 + pos] = new_v24;\r
+ prev1[160 + pos] = new_v25;\r
+ prev1[176 + pos] = new_v26;\r
+ prev1[192 + pos] = new_v27;\r
+ prev1[208 + pos] = new_v28;\r
+ prev1[224 + pos] = new_v29;\r
+ prev1[240 + pos] = new_v30;\r
+ prev1[256 + pos] = new_v31;\r
+\r
+ // insert V[49-63] (== new_v[30-16]) into other v:\r
+ prev1[272 + pos] = new_v30;\r
+ prev1[288 + pos] = new_v29;\r
+ prev1[304 + pos] = new_v28;\r
+ prev1[320 + pos] = new_v27;\r
+ prev1[336 + pos] = new_v26;\r
+ prev1[352 + pos] = new_v25;\r
+ prev1[368 + pos] = new_v24;\r
+ prev1[384 + pos] = new_v23;\r
+ prev1[400 + pos] = new_v22;\r
+ prev1[416 + pos] = new_v21;\r
+ prev1[432 + pos] = new_v20;\r
+ prev1[448 + pos] = new_v19;\r
+ prev1[464 + pos] = new_v18;\r
+ prev1[480 + pos] = new_v17;\r
+ prev1[496 + pos] = new_v16;\r
}\r
\r
private void compute_new_v1_v2() {\r
v2[464 + pos] = new_v18;\r
v2[480 + pos] = new_v17;\r
v2[496 + pos] = new_v16;\r
+\r
+ /*\r
+ * setup PREV\r
+ */\r
+\r
+ prev1[0 + pos] = new_v0;\r
+ prev1[16 + pos] = new_v1;\r
+ prev1[32 + pos] = new_v2;\r
+ prev1[48 + pos] = new_v3;\r
+ prev1[64 + pos] = new_v4;\r
+ prev1[80 + pos] = new_v5;\r
+ prev1[96 + pos] = new_v6;\r
+ prev1[112 + pos] = new_v7;\r
+ prev1[128 + pos] = new_v8;\r
+ prev1[144 + pos] = new_v9;\r
+ prev1[160 + pos] = new_v10;\r
+ prev1[176 + pos] = new_v11;\r
+ prev1[192 + pos] = new_v12;\r
+ prev1[208 + pos] = new_v13;\r
+ prev1[224 + pos] = new_v14;\r
+ prev1[240 + pos] = new_v15;\r
+\r
+ // V[16] is always 0.0:\r
+ prev1[256 + pos] = 0.0f;\r
+\r
+ // insert V[17-31] (== -new_v[15-1]) into actual v:\r
+ prev1[272 + pos] = -new_v15;\r
+ prev1[288 + pos] = -new_v14;\r
+ prev1[304 + pos] = -new_v13;\r
+ prev1[320 + pos] = -new_v12;\r
+ prev1[336 + pos] = -new_v11;\r
+ prev1[352 + pos] = -new_v10;\r
+ prev1[368 + pos] = -new_v9;\r
+ prev1[384 + pos] = -new_v8;\r
+ prev1[400 + pos] = -new_v7;\r
+ prev1[416 + pos] = -new_v6;\r
+ prev1[432 + pos] = -new_v5;\r
+ prev1[448 + pos] = -new_v4;\r
+ prev1[464 + pos] = -new_v3;\r
+ prev1[480 + pos] = -new_v2;\r
+ prev1[496 + pos] = -new_v1;\r
+\r
+ // insert V[32] (== -new_v[0]) into other v:\r
+ // dest = (actual_v == v1) ? v2 : v1;\r
+\r
+ prev2[0 + pos] = -new_v0;\r
+ // insert V[33-48] (== new_v[16-31]) into other v:\r
+ prev2[16 + pos] = new_v16;\r
+ prev2[32 + pos] = new_v17;\r
+ prev2[48 + pos] = new_v18;\r
+ prev2[64 + pos] = new_v19;\r
+ prev2[80 + pos] = new_v20;\r
+ prev2[96 + pos] = new_v21;\r
+ prev2[112 + pos] = new_v22;\r
+ prev2[128 + pos] = new_v23;\r
+ prev2[144 + pos] = new_v24;\r
+ prev2[160 + pos] = new_v25;\r
+ prev2[176 + pos] = new_v26;\r
+ prev2[192 + pos] = new_v27;\r
+ prev2[208 + pos] = new_v28;\r
+ prev2[224 + pos] = new_v29;\r
+ prev2[240 + pos] = new_v30;\r
+ prev2[256 + pos] = new_v31;\r
+\r
+ // insert V[49-63] (== new_v[30-16]) into other v:\r
+ prev2[272 + pos] = new_v30;\r
+ prev2[288 + pos] = new_v29;\r
+ prev2[304 + pos] = new_v28;\r
+ prev2[320 + pos] = new_v27;\r
+ prev2[336 + pos] = new_v26;\r
+ prev2[352 + pos] = new_v25;\r
+ prev2[368 + pos] = new_v24;\r
+ prev2[384 + pos] = new_v23;\r
+ prev2[400 + pos] = new_v22;\r
+ prev2[416 + pos] = new_v21;\r
+ prev2[432 + pos] = new_v20;\r
+ prev2[448 + pos] = new_v19;\r
+ prev2[464 + pos] = new_v18;\r
+ prev2[480 + pos] = new_v17;\r
+ prev2[496 + pos] = new_v16;\r
}\r
\r
/**\r
\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
// final float[] dp = d16[i];\r
pcm_sample =\r
(float) (((v1[0 + dvp] * d16[i][0]) + (v1[15 + dvp] * d16[i][1])\r
\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
// final float[] dp = d16[i];\r
pcm_sample =\r
(float) (((v2[0 + dvp] * d16[i][0]) + (v2[15 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[1 + dvp] * d16[i][0]) + (v1[0 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[1 + dvp] * d16[i][0]) + (v2[0 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[2 + dvp] * d16[i][0]) + (v1[1 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[2 + dvp] * d16[i][0]) + (v2[1 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[3 + dvp] * d16[i][0]) + (v1[2 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[3 + dvp] * d16[i][0]) + (v2[2 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[4 + dvp] * d16[i][0]) + (v1[3 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[4 + dvp] * d16[i][0]) + (v2[3 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[5 + dvp] * d16[i][0]) + (v1[4 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[5 + dvp] * d16[i][0]) + (v2[4 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[6 + dvp] * d16[i][0]) + (v1[5 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[6 + dvp] * d16[i][0]) + (v2[5 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[7 + dvp] * d16[i][0]) + (v1[6 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[7 + dvp] * d16[i][0]) + (v2[6 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[8 + dvp] * d16[i][0]) + (v1[7 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[8 + dvp] * d16[i][0]) + (v2[7 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[9 + dvp] * d16[i][0]) + (v1[8 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[9 + dvp] * d16[i][0]) + (v2[8 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[10 + dvp] * d16[i][0]) + (v1[9 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[10 + dvp] * d16[i][0]) + (v2[9 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[11 + dvp] * d16[i][0]) + (v1[10 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[11 + dvp] * d16[i][0]) + (v2[10 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[12 + dvp] * d16[i][0]) + (v1[11 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[12 + dvp] * d16[i][0]) + (v2[11 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[13 + dvp] * d16[i][0]) + (v1[12 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[13 + dvp] * d16[i][0]) + (v2[12 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[14 + dvp] * d16[i][0]) + (v1[13 + dvp] * d16[i][1])\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[14 + dvp] * d16[i][0]) + (v2[13 + dvp] * d16[i][1])\r
\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
// final float d16[i][] = d16[i];\r
pcm_sample =\r
(float) (((v1[15 + dvp] * d16[i][0]) + (v1[14 + dvp] * d16[i][1])\r
\r
// fat chance of having this loop unroll\r
for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
- @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V2") float pcm_sample;\r
// final float d16[i][] = d16[i];\r
pcm_sample =\r
(float) (((v2[15 + dvp] * d16[i][0]) + (v2[14 + dvp] * d16[i][1])\r
*/\r
}\r
\r
+ @LATTICE("THIS<C,C*,THISLOC=THIS")\r
+ public void clear() {\r
+ // clear out v1,v2\r
+ SSJAVA.arrayinit(v1, 0);\r
+ SSJAVA.arrayinit(v2, 0);\r
+ // copy previous v1,v2\r
+ for (@LOC("THIS,SynthesisFilter.V") int i = 0; i < prev1.length; i++) {\r
+ v1[i] = prev1[i];\r
+ }\r
+ for (@LOC("THIS,SynthesisFilter.V") int i = 0; i < prev2.length; i++) {\r
+ v2[i] = prev2[i];\r
+ }\r
+ // clear out previous buffer\r
+ SSJAVA.arrayinit(prev1, 0);\r
+ SSJAVA.arrayinit(prev2, 0);\r
+ }\r
+\r
/**\r
* Calculate 32 PCM samples and put the into the Obuffer-object.\r
*/\r
// System.out.println("3.actual_v=" + (actual_v == v1) + " vidx=" + vidx);\r
\r
actual_write_pos = (actual_write_pos + 1) & 0xf;\r
-// System.out.println("actual_write_pos="+actual_write_pos);\r
+ // System.out.println("actual_write_pos="+actual_write_pos);\r
// actual_v = (actual_v == v1) ? v2 : v1;\r
\r
if (vidx == 1) {\r
* d[] split into subarrays of length 16. This provides for more faster access\r
* by allowing a block of 16 to be addressed with constant offset.\r
**/\r
- //TODO CONST\r
+ // TODO CONST\r
@LOC("V")\r
- private final static float d16[][] = null; \r
+ private final static float d16[][] = null;\r
\r
/**\r
* Converts a 1D array into a number of smaller arrays. This is used to\r