private float[][] k;
@LOC("NZ")
private int[] nonzero;
- @LOC("HD")
- private Header header;
+ // @LOC("HD")
+ // private Header header;
@LOC("FT")
private SynthesisFilter filter1;
@LOC("FT")
private SynthesisFilter filter2;
- @LOC("SP")
- private Obuffer buffer; // output buffer
+ // @LOC("SP")
+ // private Obuffer buffer; // output buffer
@LOC("CH0")
private int which_channels;
@LOC("BR")
private int part2_start;
- /**
- * Constructor.
- */
- // REVIEW: these constructor arguments should be moved to the
- // decodeFrame() method, where possible, so that one
- @LATTICE("THIS<VAR,THIS<I,THIS<J,J<CH,I*,J*,CH*,THISLOC=THIS,GLOBALLOC=THIS")
- public LayerIIIDecoder(@LOC("VAR") Header header0, @LOC("VAR") SynthesisFilter filtera,
- @LOC("VAR") SynthesisFilter filterb, @LOC("VAR") Obuffer buffer0, @LOC("VAR") int which_ch0) {
+ private boolean initialized = false;
+
+ // constructor for the linear type system
+ public LayerIIIDecoder(@DELEGATE @LOC("VAR") SynthesisFilter filtera,
+ @DELEGATE @LOC("VAR") SynthesisFilter filterb, @LOC("VAR") int which_ch0) {
+
+ filter1 = filtera;
+ filter2 = filterb;
huffcodetab.inithuff();
is_1d = new int[SBLIMIT * SSLIMIT + 4];
scalefac_buffer = new int[54];
// END OF scalefac_buffer
- header = header0;
- filter1 = filtera;
- filter2 = filterb;
- buffer = buffer0;
- which_channels = which_ch0;
+ }
+
+ private void init(Header header) {
frame_start = 0;
channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
br = new BitReserve();
si = new III_side_info_t();
+
+ initialized = true;
+
}
+ /**
+ * Constructor.
+ */
+ // REVIEW: these constructor arguments should be moved to the
+ // decodeFrame() method, where possible, so that one
+ // @LATTICE("THIS<VAR,THIS<I,THIS<J,J<CH,I*,J*,CH*,THISLOC=THIS,GLOBALLOC=THIS")
+ // public LayerIIIDecoder(@LOC("VAR") Header header0, @LOC("VAR")
+ // SynthesisFilter filtera,
+ // @LOC("VAR") SynthesisFilter filterb, @LOC("VAR") int which_ch0) {
+ //
+ // huffcodetab.inithuff();
+ // is_1d = new int[SBLIMIT * SSLIMIT + 4];
+ // ro = new float[2][SBLIMIT][SSLIMIT];
+ // lr = new float[2][SBLIMIT][SSLIMIT];
+ // out_1d = new float[SBLIMIT * SSLIMIT];
+ // prevblck = new float[2][SBLIMIT * SSLIMIT];
+ // k = new float[2][SBLIMIT * SSLIMIT];
+ // nonzero = new int[2];
+ //
+ // // removes unnecessary aliases
+ // // III_scalefact_t
+ // // III_scalefac_t = new temporaire2[2];
+ // // III_scalefac_t[0] = new temporaire2();
+ // // III_scalefac_t[1] = new temporaire2();
+ // // scalefac = III_scalefac_t;
+ //
+ // scalefac = new temporaire2[2];
+ // scalefac[0] = new temporaire2();
+ // scalefac[1] = new temporaire2();
+ //
+ // // L3TABLE INIT
+ //
+ // sfBandIndex = new SBI[9]; // SZD: MPEG2.5 +3 indices
+ // @LOC("VAR") int[] l0 =
+ // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+ // 284, 336, 396,
+ // 464, 522, 576 };
+ // @LOC("VAR") int[] s0 = { 0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132,
+ // 174, 192 };
+ // @LOC("VAR") int[] l1 =
+ // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 114, 136, 162, 194, 232,
+ // 278, 330, 394,
+ // 464, 540, 576 };
+ // @LOC("VAR") int[] s1 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136,
+ // 180, 192 };
+ // @LOC("VAR") int[] l2 =
+ // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+ // 284, 336, 396,
+ // 464, 522, 576 };
+ // @LOC("VAR") int[] s2 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134,
+ // 174, 192 };
+ //
+ // @LOC("VAR") int[] l3 =
+ // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196,
+ // 238, 288, 342,
+ // 418, 576 };
+ // @LOC("VAR") int[] s3 = { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136,
+ // 192 };
+ // @LOC("VAR") int[] l4 =
+ // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190,
+ // 230, 276, 330,
+ // 384, 576 };
+ // @LOC("VAR") int[] s4 = { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126,
+ // 192 };
+ // @LOC("VAR") int[] l5 =
+ // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240,
+ // 296, 364, 448,
+ // 550, 576 };
+ // @LOC("VAR") int[] s5 = { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138,
+ // 180, 192 };
+ // // SZD: MPEG2.5
+ // @LOC("VAR") int[] l6 =
+ // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+ // 284, 336, 396,
+ // 464, 522, 576 };
+ // @LOC("VAR") int[] s6 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134,
+ // 174, 192 };
+ // @LOC("VAR") int[] l7 =
+ // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+ // 284, 336, 396,
+ // 464, 522, 576 };
+ // @LOC("VAR") int[] s7 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134,
+ // 174, 192 };
+ // @LOC("VAR") int[] l8 =
+ // { 0, 12, 24, 36, 48, 60, 72, 88, 108, 132, 160, 192, 232, 280, 336, 400,
+ // 476, 566, 568,
+ // 570, 572, 574, 576 };
+ // @LOC("VAR") int[] s8 = { 0, 8, 16, 24, 36, 52, 72, 96, 124, 160, 162, 164,
+ // 166, 192 };
+ //
+ // sfBandIndex[0] = new SBI(l0, s0);
+ // sfBandIndex[1] = new SBI(l1, s1);
+ // sfBandIndex[2] = new SBI(l2, s2);
+ //
+ // sfBandIndex[3] = new SBI(l3, s3);
+ // sfBandIndex[4] = new SBI(l4, s4);
+ // sfBandIndex[5] = new SBI(l5, s5);
+ // // SZD: MPEG2.5
+ // sfBandIndex[6] = new SBI(l6, s6);
+ // sfBandIndex[7] = new SBI(l7, s7);
+ // sfBandIndex[8] = new SBI(l8, s8);
+ // // END OF L3TABLE INIT
+ //
+ // if (reorder_table == null) { // SZD: generate LUT
+ // reorder_table = new int[9][];
+ // for (@LOC("I") int i = 0; i < 9; i++)
+ // reorder_table[i] = reorder(sfBandIndex[i].s);
+ // }
+ //
+ // // Sftable
+ // @LOC("VAR") int[] ll0 = { 0, 6, 11, 16, 21 };
+ // @LOC("VAR") int[] ss0 = { 0, 6, 12 };
+ // sftable = new Sftable(ll0, ss0);
+ // // END OF Sftable
+ //
+ // // scalefac_buffer
+ // scalefac_buffer = new int[54];
+ // // END OF scalefac_buffer
+ //
+ // // header = header0;
+ // filter1 = filtera;
+ // filter2 = filterb;
+ // // buffer = buffer0;
+ // which_channels = which_ch0;
+ //
+ // frame_start = 0;
+ // channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
+ // max_gr = (header.version() == Header.MPEG1) ? 2 : 1;
+ //
+ // sfreq =
+ // header.sample_frequency()
+ // + ((header.version() == Header.MPEG1) ? 3 : (header.version() ==
+ // Header.MPEG25_LSF) ? 6
+ // : 0); // SZD
+ //
+ // if (channels == 2) {
+ // switch (which_channels) {
+ // case OutputChannels.LEFT_CHANNEL:
+ // case OutputChannels.DOWNMIX_CHANNELS:
+ // first_channel = last_channel = 0;
+ // break;
+ //
+ // case OutputChannels.RIGHT_CHANNEL:
+ // first_channel = last_channel = 1;
+ // break;
+ //
+ // case OutputChannels.BOTH_CHANNELS:
+ // default:
+ // first_channel = 0;
+ // last_channel = 1;
+ // break;
+ // }
+ // } else {
+ // first_channel = last_channel = 0;
+ // }
+ //
+ // for (@LOC("CH") int ch = 0; ch < 2; ch++)
+ // for (@LOC("J") int j = 0; j < 576; j++)
+ // prevblck[ch][j] = 0.0f;
+ //
+ // nonzero[0] = nonzero[1] = 576;
+ //
+ // br = new BitReserve();
+ // si = new III_side_info_t();
+ // }
+
/**
* Notify decoder that a seek is being made.
*/
br = new BitReserve();
}
- public void decodeFrame() {
- decode();
+ public void decodeFrame(Header header) {
+ decode(header);
}
/**
*/
// @LATTICE("BYTE<THIS,THIS<MAIN,MAIN<VAR,THIS<GR,GR<VAR,BYTE*,GR*,THISLOC=THIS,GLOBALLOC=VAR")
@LATTICE("VAR<THIS,C<THIS,THIS<IN,THISLOC=THIS,C*,VAR*")
- public void decode() {
+ public void decode(Header header) {
+
+ if (!initialized) {
+ init(header);
+ }
@LOC("THIS,LayerIIIDecoder.HD1") int nSlots = header.slots();
@LOC("C") int i;
// modifications for linear type
- get_side_info(header.getSideInfoBuffer());
+ get_side_info(header);
br = header.getBitReserve();
// here 'gr' and 'max_gr' should be higher than 'ch','channels', and more
// grab scale factors from the main data.
// following the scale factors is the actual compressed data
if (header.version() == Header.MPEG1)
- get_scale_factors(ch, gr); // no need to care from this side
+ get_scale_factors(header, ch, gr); // no need to care from this side
// here move scale factor data from 'br' buffer to 'scalefac' field
else
// MPEG-2 LSF, SZD: MPEG-2.5 LSF
- get_LSF_scale_factors(ch, gr); // no need to care from this side
+ get_LSF_scale_factors(header, ch, gr); // no need to care from this
+ // side
// here, decoding the compressed audio data
huffman_decode(ch, gr); // no need to care from this side
-// System.out.println("CheckSum HuffMan = " + CheckSumHuff);
+ // System.out.println("CheckSum HuffMan = " + CheckSumHuff);
dequantize_sample(/* ro[ch], */ch, gr); // no need to care from this
// side
}
- stereo(gr); // no need to care from this side
+ stereo(header, gr); // no need to care from this side
if ((which_channels == OutputChannels.DOWNMIX_CHANNELS) && (channels > 1)) {
do_downmix();
reorder(/* lr[ch], */ch, gr);
antialias(ch, gr);
-
-// float CheckSumOut1d=0;
-// for (int hb = 0;hb<576;hb++) {
-// CheckSumOut1d = CheckSumOut1d + out_1d[hb];
-// }
-// System.out.println("CheckSumOut1d = "+CheckSumOut1d);
-
+
+ // float CheckSumOut1d=0;
+ // for (int hb = 0;hb<576;hb++) {
+ // CheckSumOut1d = CheckSumOut1d + out_1d[hb];
+ // }
+ // System.out.println("CheckSumOut1d = "+CheckSumOut1d);
hybrid(ch, gr);
sb++; // sb should be loc*
}
filter1.input_samples(samples1);
- filter1.calculate_pcm_samples(buffer);
+ filter1.calculate_pcm_samples();
}
} else {
for (ss = 0; ss < SSLIMIT; ss++) { // Polyphase synthesis
sb++;
}
filter2.input_samples(samples2);
- filter2.calculate_pcm_samples(buffer);
+ filter2.calculate_pcm_samples();
}
}
// if (counter < 609)
// {
counter++; // count should be loc*
- buffer.write_buffer(1); // buffer!!!
+ // buffer.write_buffer(1); // buffer!!!
// }
// else if (counter == 609)
// {
* Reads the side info from the stream, assuming the entire. frame has been
* read already. Mono : 136 bits (= 17 bytes) Stereo : 256 bits (= 32 bytes)
*/
- private boolean get_side_info(SideInfoBuffer sib) {
+ private boolean get_side_info(Header header) {
+
+ SideInfoBuffer sib = header.getSideInfoBuffer();
+
int ch, gr;
// System.out.println("#get_side_info");
if (header.version() == Header.MPEG1) {
*
*/
@LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
- private void get_scale_factors(@LOC("THIS,LayerIIIDecoder.CH0") int ch,
+ private void get_scale_factors(Header header, @LOC("THIS,LayerIIIDecoder.CH0") int ch,
@LOC("THIS,LayerIIIDecoder.CH0") int gr) {
// gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias
// ssjava
@LATTICE("M<THIS,THIS<IN,THIS<C,C*,M*,THISLOC=THIS,GLOBALLOC=THIS")
- private void get_LSF_scale_data(@LOC("THIS,LayerIIIDecoder.CH0") int ch,
+ private void get_LSF_scale_data(Header header, @LOC("THIS,LayerIIIDecoder.CH0") int ch,
@LOC("THIS,LayerIIIDecoder.CH0") int gr) {
@LOC("THIS,LayerIIIDecoder.HD1") int mode_ext = header.mode_extension();
*
*/
@LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
- private void get_LSF_scale_factors(@LOC("THIS,LayerIIIDecoder.CH0") int ch,
+ private void get_LSF_scale_factors(Header header, @LOC("THIS,LayerIIIDecoder.CH0") int ch,
@LOC("THIS,LayerIIIDecoder.CH0") int gr) {
@LOC("THIS,LayerIIIDecoder.SFB_SH") int sfb;
@LOC("THIS,LayerIIIDecoder.SFB_SH") int window;
// gr_info_s gr_info = (si.ch[ch].gr[gr]); // remove alias
- get_LSF_scale_data(ch, gr);
+ get_LSF_scale_data(header, ch, gr);
if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) {
if (si.ch[ch].gr[gr].mixed_block_flag != 0) { // MIXED
index = 0;
// Read bigvalues area
for (int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i += 2) {
- if (i < region1Start)
- h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[0]];
- else if (i < region2Start)
- h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[1]];
- else
- h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[2]];
- huffcodetab.huffman_decoder(h, x, y, v, w, br);
+ int htIdx;
+ if (i < region1Start) {
+ htIdx = si.ch[ch].gr[gr].table_select[0];
+ // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[0]];
+ } else if (i < region2Start) {
+ htIdx = si.ch[ch].gr[gr].table_select[1];
+ // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[1]];
+ } else {
+ htIdx = si.ch[ch].gr[gr].table_select[2];
+ // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[2]];
+ }
+
+ huffcodetab.huffman_decoder(htIdx, x, y, v, w, br);
// if (index >= is_1d.length)
// System.out.println("i0="+i+"/"+(si.ch[ch].gr[gr].big_values<<1)+" Index="+index+" is_1d="+is_1d.length);
is_1d[index++] = y[0];
CheckSumHuff = CheckSumHuff + x[0] + y[0];
-// System.out.println("x = " + x[0] + " y = " + y[0]);
+ // System.out.println("x = " + x[0] + " y = " + y[0]);
}
// Read count1 area
- h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32];
+
+ int htIdx = si.ch[ch].gr[gr].count1table_select + 32;
+ // h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32];
num_bits = br.hsstell();
while ((num_bits < part2_3_end) && (index < 576)) {
- huffcodetab.huffman_decoder(h, x, y, v, w, br);
+ huffcodetab.huffman_decoder(htIdx, x, y, v, w, br);
is_1d[index++] = v[0];
is_1d[index++] = w[0];
// ssjava
@LATTICE("IO<THIS,THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
- private void stereo(@LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+ private void stereo(Header header, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
@LOC("THIS,LayerIIIDecoder.RO1") int sb;
@LOC("THIS,LayerIIIDecoder.RO1") int ss;
@LOC("THIS,LayerIIIDecoder.SI1") int ss;
@LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR2") int sb18lim;
- @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR1") gr_info_s gr_info =
- (si.ch[ch].gr[gr]);
+// @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR1") gr_info_s gr_info =
+// (si.ch[ch].gr[gr]);
// 31 alias-reduction operations between each pair of sub-bands
// with 8 butterflies between each pair
- if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)
- && !(gr_info.mixed_block_flag != 0))
+ if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)
+ && !(si.ch[ch].gr[gr].mixed_block_flag != 0))
return;
- if ((gr_info.window_switching_flag != 0) && (gr_info.mixed_block_flag != 0)
- && (gr_info.block_type == 2)) {
+ if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0)
+ && (si.ch[ch].gr[gr].block_type == 2)) {
sb18lim = 18;
} else {
sb18lim = 558;
}
@LATTICE("THIS<IN,THISLOC=THIS")
- public SBI(@LOC("IN") int[] thel, @LOC("IN") int[] thes) {
+ public SBI(@DELEGATE @LOC("IN") int[] thel, @DELEGATE @LOC("IN") int[] thes) {
l = thel;
s = thes;
}
}
@LATTICE("THIS<IN,THISLOC=THIS")
- public Sftable(@LOC("IN") int[] thel, @LOC("IN") int[] thes) {
+ public Sftable(@DELEGATE @LOC("IN") int[] thel, @DELEGATE @LOC("IN") int[] thes) {
l = thel;
s = thes;
}
* are removed by ignoring higher subbands.\r
*/\r
final class SynthesisFilter {\r
+ private int vcount = 0;\r
+ private int vidx = 1;\r
private float[] v1;\r
private float[] v2;\r
- private float[] actual_v; // v1 or v2\r
+ // private float[] actual_v; // v1 or v2\r
private int actual_write_pos; // 0-15\r
private float[] samples; // 32 new subband samples\r
private int channel;\r
* short values (raw pcm samples are in [-1.0, 1.0], if no violations occur).\r
*/\r
public SynthesisFilter(int channelnumber, float factor, float[] eq0) {\r
- \r
+\r
d16 = splitArray(d, 16);\r
\r
v1 = new float[512];\r
samples = new float[32];\r
channel = channelnumber;\r
scalefactor = factor;\r
- setEQ(eq);\r
+ // setEQ(eq);\r
// setQuality(HIGH_QUALITY);\r
\r
- reset();\r
- }\r
-\r
- public void setEQ(float[] eq0) {\r
- this.eq = eq0;\r
if (eq == null) {\r
eq = new float[32];\r
for (int i = 0; i < 32; i++)\r
throw new IllegalArgumentException("eq0");\r
}\r
\r
+ // reset();\r
+\r
+ for (int p = 0; p < 512; p++)\r
+ v1[p] = v2[p] = 0.0f;\r
+\r
+ for (int p2 = 0; p2 < 32; p2++)\r
+ samples[p2] = 0.0f;\r
+\r
+ // actual_v = v1;\r
+ actual_write_pos = 15;\r
+\r
}\r
\r
/*\r
for (int p2 = 0; p2 < 32; p2++)\r
samples[p2] = 0.0f;\r
\r
- actual_v = v1;\r
+ // actual_v = v1;\r
actual_write_pos = 15;\r
}\r
\r
}\r
}\r
\r
- /**\r
- * Compute new values via a fast cosine transform.\r
- */\r
- private void compute_new_v() {\r
- // p is fully initialized from x1\r
- // float[] p = _p;\r
- // pp is fully initialized from p\r
- // float[] pp = _pp;\r
-\r
- // float[] new_v = _new_v;\r
-\r
- // float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure\r
- // 3-A.2 in ISO DIS 11172-3\r
- // float[] p = new float[16];\r
- // float[] pp = new float[16];\r
-\r
- /*\r
- * for (int i=31; i>=0; i--) { new_v[i] = 0.0f; }\r
- */\r
+ private void compute_new_v2_v1() {\r
\r
float new_v0, new_v1, new_v2, new_v3, new_v4, new_v5, new_v6, new_v7, new_v8, new_v9;\r
float new_v10, new_v11, new_v12, new_v13, new_v14, new_v15, new_v16, new_v17, new_v18, new_v19;\r
// float[] p = new float[16];\r
// float[] pp = new float[16];\r
\r
- float[] s = samples;\r
-\r
- float s0 = s[0];\r
- float s1 = s[1];\r
- float s2 = s[2];\r
- float s3 = s[3];\r
- float s4 = s[4];\r
- float s5 = s[5];\r
- float s6 = s[6];\r
- float s7 = s[7];\r
- float s8 = s[8];\r
- float s9 = s[9];\r
- float s10 = s[10];\r
- float s11 = s[11];\r
- float s12 = s[12];\r
- float s13 = s[13];\r
- float s14 = s[14];\r
- float s15 = s[15];\r
- float s16 = s[16];\r
- float s17 = s[17];\r
- float s18 = s[18];\r
- float s19 = s[19];\r
- float s20 = s[20];\r
- float s21 = s[21];\r
- float s22 = s[22];\r
- float s23 = s[23];\r
- float s24 = s[24];\r
- float s25 = s[25];\r
- float s26 = s[26];\r
- float s27 = s[27];\r
- float s28 = s[28];\r
- float s29 = s[29];\r
- float s30 = s[30];\r
- float s31 = s[31];\r
+ // float[] s = samples;\r
+\r
+ float s0 = samples[0];\r
+ float s1 = samples[1];\r
+ float s2 = samples[2];\r
+ float s3 = samples[3];\r
+ float s4 = samples[4];\r
+ float s5 = samples[5];\r
+ float s6 = samples[6];\r
+ float s7 = samples[7];\r
+ float s8 = samples[8];\r
+ float s9 = samples[9];\r
+ float s10 = samples[10];\r
+ float s11 = samples[11];\r
+ float s12 = samples[12];\r
+ float s13 = samples[13];\r
+ float s14 = samples[14];\r
+ float s15 = samples[15];\r
+ float s16 = samples[16];\r
+ float s17 = samples[17];\r
+ float s18 = samples[18];\r
+ float s19 = samples[19];\r
+ float s20 = samples[20];\r
+ float s21 = samples[21];\r
+ float s22 = samples[22];\r
+ float s23 = samples[23];\r
+ float s24 = samples[24];\r
+ float s25 = samples[25];\r
+ float s26 = samples[26];\r
+ float s27 = samples[27];\r
+ float s28 = samples[28];\r
+ float s29 = samples[29];\r
+ float s30 = samples[30];\r
+ float s31 = samples[31];\r
\r
float p0 = s0 + s31;\r
float p1 = s1 + s30;\r
\r
// insert V[0-15] (== new_v[0-15]) into actual v:\r
// float[] x2 = actual_v + actual_write_pos;\r
- float dest[] = actual_v;\r
+ // float dest[] = actual_v; v2\r
\r
int pos = actual_write_pos;\r
\r
- dest[0 + pos] = new_v0;\r
- dest[16 + pos] = new_v1;\r
- dest[32 + pos] = new_v2;\r
- dest[48 + pos] = new_v3;\r
- dest[64 + pos] = new_v4;\r
- dest[80 + pos] = new_v5;\r
- dest[96 + pos] = new_v6;\r
- dest[112 + pos] = new_v7;\r
- dest[128 + pos] = new_v8;\r
- dest[144 + pos] = new_v9;\r
- dest[160 + pos] = new_v10;\r
- dest[176 + pos] = new_v11;\r
- dest[192 + pos] = new_v12;\r
- dest[208 + pos] = new_v13;\r
- dest[224 + pos] = new_v14;\r
- dest[240 + pos] = new_v15;\r
+ v2[0 + pos] = new_v0;\r
+ v2[16 + pos] = new_v1;\r
+ v2[32 + pos] = new_v2;\r
+ v2[48 + pos] = new_v3;\r
+ v2[64 + pos] = new_v4;\r
+ v2[80 + pos] = new_v5;\r
+ v2[96 + pos] = new_v6;\r
+ v2[112 + pos] = new_v7;\r
+ v2[128 + pos] = new_v8;\r
+ v2[144 + pos] = new_v9;\r
+ v2[160 + pos] = new_v10;\r
+ v2[176 + pos] = new_v11;\r
+ v2[192 + pos] = new_v12;\r
+ v2[208 + pos] = new_v13;\r
+ v2[224 + pos] = new_v14;\r
+ v2[240 + pos] = new_v15;\r
\r
// V[16] is always 0.0:\r
- dest[256 + pos] = 0.0f;\r
+ v2[256 + pos] = 0.0f;\r
\r
// insert V[17-31] (== -new_v[15-1]) into actual v:\r
- dest[272 + pos] = -new_v15;\r
- dest[288 + pos] = -new_v14;\r
- dest[304 + pos] = -new_v13;\r
- dest[320 + pos] = -new_v12;\r
- dest[336 + pos] = -new_v11;\r
- dest[352 + pos] = -new_v10;\r
- dest[368 + pos] = -new_v9;\r
- dest[384 + pos] = -new_v8;\r
- dest[400 + pos] = -new_v7;\r
- dest[416 + pos] = -new_v6;\r
- dest[432 + pos] = -new_v5;\r
- dest[448 + pos] = -new_v4;\r
- dest[464 + pos] = -new_v3;\r
- dest[480 + pos] = -new_v2;\r
- dest[496 + pos] = -new_v1;\r
+ v2[272 + pos] = -new_v15;\r
+ v2[288 + pos] = -new_v14;\r
+ v2[304 + pos] = -new_v13;\r
+ v2[320 + pos] = -new_v12;\r
+ v2[336 + pos] = -new_v11;\r
+ v2[352 + pos] = -new_v10;\r
+ v2[368 + pos] = -new_v9;\r
+ v2[384 + pos] = -new_v8;\r
+ v2[400 + pos] = -new_v7;\r
+ v2[416 + pos] = -new_v6;\r
+ v2[432 + pos] = -new_v5;\r
+ v2[448 + pos] = -new_v4;\r
+ v2[464 + pos] = -new_v3;\r
+ v2[480 + pos] = -new_v2;\r
+ v2[496 + pos] = -new_v1;\r
\r
// insert V[32] (== -new_v[0]) into other v:\r
- dest = (actual_v == v1) ? v2 : v1;\r
+ // dest = (actual_v == v1) ? v2 : v1;\r
\r
- dest[0 + pos] = -new_v0;\r
+ v1[0 + pos] = -new_v0;\r
// insert V[33-48] (== new_v[16-31]) into other v:\r
- dest[16 + pos] = new_v16;\r
- dest[32 + pos] = new_v17;\r
- dest[48 + pos] = new_v18;\r
- dest[64 + pos] = new_v19;\r
- dest[80 + pos] = new_v20;\r
- dest[96 + pos] = new_v21;\r
- dest[112 + pos] = new_v22;\r
- dest[128 + pos] = new_v23;\r
- dest[144 + pos] = new_v24;\r
- dest[160 + pos] = new_v25;\r
- dest[176 + pos] = new_v26;\r
- dest[192 + pos] = new_v27;\r
- dest[208 + pos] = new_v28;\r
- dest[224 + pos] = new_v29;\r
- dest[240 + pos] = new_v30;\r
- dest[256 + pos] = new_v31;\r
+ v1[16 + pos] = new_v16;\r
+ v1[32 + pos] = new_v17;\r
+ v1[48 + pos] = new_v18;\r
+ v1[64 + pos] = new_v19;\r
+ v1[80 + pos] = new_v20;\r
+ v1[96 + pos] = new_v21;\r
+ v1[112 + pos] = new_v22;\r
+ v1[128 + pos] = new_v23;\r
+ v1[144 + pos] = new_v24;\r
+ v1[160 + pos] = new_v25;\r
+ v1[176 + pos] = new_v26;\r
+ v1[192 + pos] = new_v27;\r
+ v1[208 + pos] = new_v28;\r
+ v1[224 + pos] = new_v29;\r
+ v1[240 + pos] = new_v30;\r
+ v1[256 + pos] = new_v31;\r
\r
// insert V[49-63] (== new_v[30-16]) into other v:\r
- dest[272 + pos] = new_v30;\r
- dest[288 + pos] = new_v29;\r
- dest[304 + pos] = new_v28;\r
- dest[320 + pos] = new_v27;\r
- dest[336 + pos] = new_v26;\r
- dest[352 + pos] = new_v25;\r
- dest[368 + pos] = new_v24;\r
- dest[384 + pos] = new_v23;\r
- dest[400 + pos] = new_v22;\r
- dest[416 + pos] = new_v21;\r
- dest[432 + pos] = new_v20;\r
- dest[448 + pos] = new_v19;\r
- dest[464 + pos] = new_v18;\r
- dest[480 + pos] = new_v17;\r
- dest[496 + pos] = new_v16;\r
- /*\r
- * } else { v1[0 + actual_write_pos] = -new_v0; // insert V[33-48] (==\r
- * new_v[16-31]) into other v: v1[16 + actual_write_pos] = new_v16; v1[32 +\r
- * actual_write_pos] = new_v17; v1[48 + actual_write_pos] = new_v18; v1[64 +\r
- * actual_write_pos] = new_v19; v1[80 + actual_write_pos] = new_v20; v1[96 +\r
- * actual_write_pos] = new_v21; v1[112 + actual_write_pos] = new_v22; v1[128\r
- * + actual_write_pos] = new_v23; v1[144 + actual_write_pos] = new_v24;\r
- * v1[160 + actual_write_pos] = new_v25; v1[176 + actual_write_pos] =\r
- * new_v26; v1[192 + actual_write_pos] = new_v27; v1[208 + actual_write_pos]\r
- * = new_v28; v1[224 + actual_write_pos] = new_v29; v1[240 +\r
- * actual_write_pos] = new_v30; v1[256 + actual_write_pos] = new_v31;\r
- * \r
- * // insert V[49-63] (== new_v[30-16]) into other v: v1[272 +\r
- * actual_write_pos] = new_v30; v1[288 + actual_write_pos] = new_v29; v1[304\r
- * + actual_write_pos] = new_v28; v1[320 + actual_write_pos] = new_v27;\r
- * v1[336 + actual_write_pos] = new_v26; v1[352 + actual_write_pos] =\r
- * new_v25; v1[368 + actual_write_pos] = new_v24; v1[384 + actual_write_pos]\r
- * = new_v23; v1[400 + actual_write_pos] = new_v22; v1[416 +\r
- * actual_write_pos] = new_v21; v1[432 + actual_write_pos] = new_v20; v1[448\r
- * + actual_write_pos] = new_v19; v1[464 + actual_write_pos] = new_v18;\r
- * v1[480 + actual_write_pos] = new_v17; v1[496 + actual_write_pos] =\r
- * new_v16; }\r
- */\r
+ v1[272 + pos] = new_v30;\r
+ v1[288 + pos] = new_v29;\r
+ v1[304 + pos] = new_v28;\r
+ v1[320 + pos] = new_v27;\r
+ v1[336 + pos] = new_v26;\r
+ v1[352 + pos] = new_v25;\r
+ v1[368 + pos] = new_v24;\r
+ v1[384 + pos] = new_v23;\r
+ v1[400 + pos] = new_v22;\r
+ v1[416 + pos] = new_v21;\r
+ v1[432 + pos] = new_v20;\r
+ v1[448 + pos] = new_v19;\r
+ v1[464 + pos] = new_v18;\r
+ v1[480 + pos] = new_v17;\r
+ v1[496 + pos] = new_v16;\r
}\r
\r
- /**\r
- * Compute new values via a fast cosine transform.\r
- */\r
- private void compute_new_v_old() {\r
- // p is fully initialized from x1\r
- // float[] p = _p;\r
- // pp is fully initialized from p\r
- // float[] pp = _pp;\r
-\r
- // float[] new_v = _new_v;\r
+ private void compute_new_v1_v2() {\r
\r
- float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure 3-A.2\r
- // in ISO DIS 11172-3\r
- float[] p = new float[16];\r
- float[] pp = new float[16];\r
+ float new_v0, new_v1, new_v2, new_v3, new_v4, new_v5, new_v6, new_v7, new_v8, new_v9;\r
+ float new_v10, new_v11, new_v12, new_v13, new_v14, new_v15, new_v16, new_v17, new_v18, new_v19;\r
+ float new_v20, new_v21, new_v22, new_v23, new_v24, new_v25, new_v26, new_v27, new_v28, new_v29;\r
+ float new_v30, new_v31;\r
\r
- for (int i = 31; i >= 0; i--) {\r
- new_v[i] = 0.0f;\r
- }\r
+ new_v0 =\r
+ new_v1 =\r
+ new_v2 =\r
+ new_v3 =\r
+ new_v4 =\r
+ new_v5 =\r
+ new_v6 =\r
+ new_v7 =\r
+ new_v8 =\r
+ new_v9 =\r
+ new_v10 =\r
+ new_v11 =\r
+ new_v12 =\r
+ new_v13 =\r
+ new_v14 =\r
+ new_v15 =\r
+ new_v16 =\r
+ new_v17 =\r
+ new_v18 =\r
+ new_v19 =\r
+ new_v20 =\r
+ new_v21 =\r
+ new_v22 =\r
+ new_v23 =\r
+ new_v24 =\r
+ new_v25 =\r
+ new_v26 =\r
+ new_v27 =\r
+ new_v28 =\r
+ new_v29 =\r
+ new_v30 =\r
+ new_v31 =\r
+ 0.0f;\r
\r
// float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure\r
// 3-A.2 in ISO DIS 11172-3\r
// float[] p = new float[16];\r
// float[] pp = new float[16];\r
\r
- float[] x1 = samples;\r
-\r
- p[0] = x1[0] + x1[31];\r
- p[1] = x1[1] + x1[30];\r
- p[2] = x1[2] + x1[29];\r
- p[3] = x1[3] + x1[28];\r
- p[4] = x1[4] + x1[27];\r
- p[5] = x1[5] + x1[26];\r
- p[6] = x1[6] + x1[25];\r
- p[7] = x1[7] + x1[24];\r
- p[8] = x1[8] + x1[23];\r
- p[9] = x1[9] + x1[22];\r
- p[10] = x1[10] + x1[21];\r
- p[11] = x1[11] + x1[20];\r
- p[12] = x1[12] + x1[19];\r
- p[13] = x1[13] + x1[18];\r
- p[14] = x1[14] + x1[17];\r
- p[15] = x1[15] + x1[16];\r
-\r
- pp[0] = p[0] + p[15];\r
- pp[1] = p[1] + p[14];\r
- pp[2] = p[2] + p[13];\r
- pp[3] = p[3] + p[12];\r
- pp[4] = p[4] + p[11];\r
- pp[5] = p[5] + p[10];\r
- pp[6] = p[6] + p[9];\r
- pp[7] = p[7] + p[8];\r
- pp[8] = (p[0] - p[15]) * cos1_32;\r
- pp[9] = (p[1] - p[14]) * cos3_32;\r
- pp[10] = (p[2] - p[13]) * cos5_32;\r
- pp[11] = (p[3] - p[12]) * cos7_32;\r
- pp[12] = (p[4] - p[11]) * cos9_32;\r
- pp[13] = (p[5] - p[10]) * cos11_32;\r
- pp[14] = (p[6] - p[9]) * cos13_32;\r
- pp[15] = (p[7] - p[8]) * cos15_32;\r
-\r
- p[0] = pp[0] + pp[7];\r
- p[1] = pp[1] + pp[6];\r
- p[2] = pp[2] + pp[5];\r
- p[3] = pp[3] + pp[4];\r
- p[4] = (pp[0] - pp[7]) * cos1_16;\r
- p[5] = (pp[1] - pp[6]) * cos3_16;\r
- p[6] = (pp[2] - pp[5]) * cos5_16;\r
- p[7] = (pp[3] - pp[4]) * cos7_16;\r
- p[8] = pp[8] + pp[15];\r
- p[9] = pp[9] + pp[14];\r
- p[10] = pp[10] + pp[13];\r
- p[11] = pp[11] + pp[12];\r
- p[12] = (pp[8] - pp[15]) * cos1_16;\r
- p[13] = (pp[9] - pp[14]) * cos3_16;\r
- p[14] = (pp[10] - pp[13]) * cos5_16;\r
- p[15] = (pp[11] - pp[12]) * cos7_16;\r
-\r
- pp[0] = p[0] + p[3];\r
- pp[1] = p[1] + p[2];\r
- pp[2] = (p[0] - p[3]) * cos1_8;\r
- pp[3] = (p[1] - p[2]) * cos3_8;\r
- pp[4] = p[4] + p[7];\r
- pp[5] = p[5] + p[6];\r
- pp[6] = (p[4] - p[7]) * cos1_8;\r
- pp[7] = (p[5] - p[6]) * cos3_8;\r
- pp[8] = p[8] + p[11];\r
- pp[9] = p[9] + p[10];\r
- pp[10] = (p[8] - p[11]) * cos1_8;\r
- pp[11] = (p[9] - p[10]) * cos3_8;\r
- pp[12] = p[12] + p[15];\r
- pp[13] = p[13] + p[14];\r
- pp[14] = (p[12] - p[15]) * cos1_8;\r
- pp[15] = (p[13] - p[14]) * cos3_8;\r
-\r
- p[0] = pp[0] + pp[1];\r
- p[1] = (pp[0] - pp[1]) * cos1_4;\r
- p[2] = pp[2] + pp[3];\r
- p[3] = (pp[2] - pp[3]) * cos1_4;\r
- p[4] = pp[4] + pp[5];\r
- p[5] = (pp[4] - pp[5]) * cos1_4;\r
- p[6] = pp[6] + pp[7];\r
- p[7] = (pp[6] - pp[7]) * cos1_4;\r
- p[8] = pp[8] + pp[9];\r
- p[9] = (pp[8] - pp[9]) * cos1_4;\r
- p[10] = pp[10] + pp[11];\r
- p[11] = (pp[10] - pp[11]) * cos1_4;\r
- p[12] = pp[12] + pp[13];\r
- p[13] = (pp[12] - pp[13]) * cos1_4;\r
- p[14] = pp[14] + pp[15];\r
- p[15] = (pp[14] - pp[15]) * cos1_4;\r
+ // float[] s = samples;\r
+\r
+ float s0 = samples[0];\r
+ float s1 = samples[1];\r
+ float s2 = samples[2];\r
+ float s3 = samples[3];\r
+ float s4 = samples[4];\r
+ float s5 = samples[5];\r
+ float s6 = samples[6];\r
+ float s7 = samples[7];\r
+ float s8 = samples[8];\r
+ float s9 = samples[9];\r
+ float s10 = samples[10];\r
+ float s11 = samples[11];\r
+ float s12 = samples[12];\r
+ float s13 = samples[13];\r
+ float s14 = samples[14];\r
+ float s15 = samples[15];\r
+ float s16 = samples[16];\r
+ float s17 = samples[17];\r
+ float s18 = samples[18];\r
+ float s19 = samples[19];\r
+ float s20 = samples[20];\r
+ float s21 = samples[21];\r
+ float s22 = samples[22];\r
+ float s23 = samples[23];\r
+ float s24 = samples[24];\r
+ float s25 = samples[25];\r
+ float s26 = samples[26];\r
+ float s27 = samples[27];\r
+ float s28 = samples[28];\r
+ float s29 = samples[29];\r
+ float s30 = samples[30];\r
+ float s31 = samples[31];\r
+\r
+ float p0 = s0 + s31;\r
+ float p1 = s1 + s30;\r
+ float p2 = s2 + s29;\r
+ float p3 = s3 + s28;\r
+ float p4 = s4 + s27;\r
+ float p5 = s5 + s26;\r
+ float p6 = s6 + s25;\r
+ float p7 = s7 + s24;\r
+ float p8 = s8 + s23;\r
+ float p9 = s9 + s22;\r
+ float p10 = s10 + s21;\r
+ float p11 = s11 + s20;\r
+ float p12 = s12 + s19;\r
+ float p13 = s13 + s18;\r
+ float p14 = s14 + s17;\r
+ float p15 = s15 + s16;\r
+\r
+ float pp0 = p0 + p15;\r
+ float pp1 = p1 + p14;\r
+ float pp2 = p2 + p13;\r
+ float pp3 = p3 + p12;\r
+ float pp4 = p4 + p11;\r
+ float pp5 = p5 + p10;\r
+ float pp6 = p6 + p9;\r
+ float pp7 = p7 + p8;\r
+ float pp8 = (p0 - p15) * cos1_32;\r
+ float pp9 = (p1 - p14) * cos3_32;\r
+ float pp10 = (p2 - p13) * cos5_32;\r
+ float pp11 = (p3 - p12) * cos7_32;\r
+ float pp12 = (p4 - p11) * cos9_32;\r
+ float pp13 = (p5 - p10) * cos11_32;\r
+ float pp14 = (p6 - p9) * cos13_32;\r
+ float pp15 = (p7 - p8) * cos15_32;\r
+\r
+ p0 = pp0 + pp7;\r
+ p1 = pp1 + pp6;\r
+ p2 = pp2 + pp5;\r
+ p3 = pp3 + pp4;\r
+ p4 = (pp0 - pp7) * cos1_16;\r
+ p5 = (pp1 - pp6) * cos3_16;\r
+ p6 = (pp2 - pp5) * cos5_16;\r
+ p7 = (pp3 - pp4) * cos7_16;\r
+ p8 = pp8 + pp15;\r
+ p9 = pp9 + pp14;\r
+ p10 = pp10 + pp13;\r
+ p11 = pp11 + pp12;\r
+ p12 = (pp8 - pp15) * cos1_16;\r
+ p13 = (pp9 - pp14) * cos3_16;\r
+ p14 = (pp10 - pp13) * cos5_16;\r
+ p15 = (pp11 - pp12) * cos7_16;\r
+\r
+ pp0 = p0 + p3;\r
+ pp1 = p1 + p2;\r
+ pp2 = (p0 - p3) * cos1_8;\r
+ pp3 = (p1 - p2) * cos3_8;\r
+ pp4 = p4 + p7;\r
+ pp5 = p5 + p6;\r
+ pp6 = (p4 - p7) * cos1_8;\r
+ pp7 = (p5 - p6) * cos3_8;\r
+ pp8 = p8 + p11;\r
+ pp9 = p9 + p10;\r
+ pp10 = (p8 - p11) * cos1_8;\r
+ pp11 = (p9 - p10) * cos3_8;\r
+ pp12 = p12 + p15;\r
+ pp13 = p13 + p14;\r
+ pp14 = (p12 - p15) * cos1_8;\r
+ pp15 = (p13 - p14) * cos3_8;\r
+\r
+ p0 = pp0 + pp1;\r
+ p1 = (pp0 - pp1) * cos1_4;\r
+ p2 = pp2 + pp3;\r
+ p3 = (pp2 - pp3) * cos1_4;\r
+ p4 = pp4 + pp5;\r
+ p5 = (pp4 - pp5) * cos1_4;\r
+ p6 = pp6 + pp7;\r
+ p7 = (pp6 - pp7) * cos1_4;\r
+ p8 = pp8 + pp9;\r
+ p9 = (pp8 - pp9) * cos1_4;\r
+ p10 = pp10 + pp11;\r
+ p11 = (pp10 - pp11) * cos1_4;\r
+ p12 = pp12 + pp13;\r
+ p13 = (pp12 - pp13) * cos1_4;\r
+ p14 = pp14 + pp15;\r
+ p15 = (pp14 - pp15) * cos1_4;\r
\r
// this is pretty insane coding\r
float tmp1;\r
- new_v[36 - 17] = -(new_v[4] = (new_v[12] = p[7]) + p[5]) - p[6];\r
- new_v[44 - 17] = -p[6] - p[7] - p[4];\r
- new_v[6] = (new_v[10] = (new_v[14] = p[15]) + p[11]) + p[13];\r
- new_v[34 - 17] = -(new_v[2] = p[15] + p[13] + p[9]) - p[14];\r
- new_v[38 - 17] = (tmp1 = -p[14] - p[15] - p[10] - p[11]) - p[13];\r
- new_v[46 - 17] = -p[14] - p[15] - p[12] - p[8];\r
- new_v[42 - 17] = tmp1 - p[12];\r
- new_v[48 - 17] = -p[0];\r
- new_v[0] = p[1];\r
- new_v[40 - 17] = -(new_v[8] = p[3]) - p[2];\r
-\r
- p[0] = (x1[0] - x1[31]) * cos1_64;\r
- p[1] = (x1[1] - x1[30]) * cos3_64;\r
- p[2] = (x1[2] - x1[29]) * cos5_64;\r
- p[3] = (x1[3] - x1[28]) * cos7_64;\r
- p[4] = (x1[4] - x1[27]) * cos9_64;\r
- p[5] = (x1[5] - x1[26]) * cos11_64;\r
- p[6] = (x1[6] - x1[25]) * cos13_64;\r
- p[7] = (x1[7] - x1[24]) * cos15_64;\r
- p[8] = (x1[8] - x1[23]) * cos17_64;\r
- p[9] = (x1[9] - x1[22]) * cos19_64;\r
- p[10] = (x1[10] - x1[21]) * cos21_64;\r
- p[11] = (x1[11] - x1[20]) * cos23_64;\r
- p[12] = (x1[12] - x1[19]) * cos25_64;\r
- p[13] = (x1[13] - x1[18]) * cos27_64;\r
- p[14] = (x1[14] - x1[17]) * cos29_64;\r
- p[15] = (x1[15] - x1[16]) * cos31_64;\r
-\r
- pp[0] = p[0] + p[15];\r
- pp[1] = p[1] + p[14];\r
- pp[2] = p[2] + p[13];\r
- pp[3] = p[3] + p[12];\r
- pp[4] = p[4] + p[11];\r
- pp[5] = p[5] + p[10];\r
- pp[6] = p[6] + p[9];\r
- pp[7] = p[7] + p[8];\r
- pp[8] = (p[0] - p[15]) * cos1_32;\r
- pp[9] = (p[1] - p[14]) * cos3_32;\r
- pp[10] = (p[2] - p[13]) * cos5_32;\r
- pp[11] = (p[3] - p[12]) * cos7_32;\r
- pp[12] = (p[4] - p[11]) * cos9_32;\r
- pp[13] = (p[5] - p[10]) * cos11_32;\r
- pp[14] = (p[6] - p[9]) * cos13_32;\r
- pp[15] = (p[7] - p[8]) * cos15_32;\r
-\r
- p[0] = pp[0] + pp[7];\r
- p[1] = pp[1] + pp[6];\r
- p[2] = pp[2] + pp[5];\r
- p[3] = pp[3] + pp[4];\r
- p[4] = (pp[0] - pp[7]) * cos1_16;\r
- p[5] = (pp[1] - pp[6]) * cos3_16;\r
- p[6] = (pp[2] - pp[5]) * cos5_16;\r
- p[7] = (pp[3] - pp[4]) * cos7_16;\r
- p[8] = pp[8] + pp[15];\r
- p[9] = pp[9] + pp[14];\r
- p[10] = pp[10] + pp[13];\r
- p[11] = pp[11] + pp[12];\r
- p[12] = (pp[8] - pp[15]) * cos1_16;\r
- p[13] = (pp[9] - pp[14]) * cos3_16;\r
- p[14] = (pp[10] - pp[13]) * cos5_16;\r
- p[15] = (pp[11] - pp[12]) * cos7_16;\r
-\r
- pp[0] = p[0] + p[3];\r
- pp[1] = p[1] + p[2];\r
- pp[2] = (p[0] - p[3]) * cos1_8;\r
- pp[3] = (p[1] - p[2]) * cos3_8;\r
- pp[4] = p[4] + p[7];\r
- pp[5] = p[5] + p[6];\r
- pp[6] = (p[4] - p[7]) * cos1_8;\r
- pp[7] = (p[5] - p[6]) * cos3_8;\r
- pp[8] = p[8] + p[11];\r
- pp[9] = p[9] + p[10];\r
- pp[10] = (p[8] - p[11]) * cos1_8;\r
- pp[11] = (p[9] - p[10]) * cos3_8;\r
- pp[12] = p[12] + p[15];\r
- pp[13] = p[13] + p[14];\r
- pp[14] = (p[12] - p[15]) * cos1_8;\r
- pp[15] = (p[13] - p[14]) * cos3_8;\r
-\r
- p[0] = pp[0] + pp[1];\r
- p[1] = (pp[0] - pp[1]) * cos1_4;\r
- p[2] = pp[2] + pp[3];\r
- p[3] = (pp[2] - pp[3]) * cos1_4;\r
- p[4] = pp[4] + pp[5];\r
- p[5] = (pp[4] - pp[5]) * cos1_4;\r
- p[6] = pp[6] + pp[7];\r
- p[7] = (pp[6] - pp[7]) * cos1_4;\r
- p[8] = pp[8] + pp[9];\r
- p[9] = (pp[8] - pp[9]) * cos1_4;\r
- p[10] = pp[10] + pp[11];\r
- p[11] = (pp[10] - pp[11]) * cos1_4;\r
- p[12] = pp[12] + pp[13];\r
- p[13] = (pp[12] - pp[13]) * cos1_4;\r
- p[14] = pp[14] + pp[15];\r
- p[15] = (pp[14] - pp[15]) * cos1_4;\r
+ new_v19/* 36-17 */= -(new_v4 = (new_v12 = p7) + p5) - p6;\r
+ new_v27/* 44-17 */= -p6 - p7 - p4;\r
+ new_v6 = (new_v10 = (new_v14 = p15) + p11) + p13;\r
+ new_v17/* 34-17 */= -(new_v2 = p15 + p13 + p9) - p14;\r
+ new_v21/* 38-17 */= (tmp1 = -p14 - p15 - p10 - p11) - p13;\r
+ new_v29/* 46-17 */= -p14 - p15 - p12 - p8;\r
+ new_v25/* 42-17 */= tmp1 - p12;\r
+ new_v31/* 48-17 */= -p0;\r
+ new_v0 = p1;\r
+ new_v23/* 40-17 */= -(new_v8 = p3) - p2;\r
+\r
+ p0 = (s0 - s31) * cos1_64;\r
+ p1 = (s1 - s30) * cos3_64;\r
+ p2 = (s2 - s29) * cos5_64;\r
+ p3 = (s3 - s28) * cos7_64;\r
+ p4 = (s4 - s27) * cos9_64;\r
+ p5 = (s5 - s26) * cos11_64;\r
+ p6 = (s6 - s25) * cos13_64;\r
+ p7 = (s7 - s24) * cos15_64;\r
+ p8 = (s8 - s23) * cos17_64;\r
+ p9 = (s9 - s22) * cos19_64;\r
+ p10 = (s10 - s21) * cos21_64;\r
+ p11 = (s11 - s20) * cos23_64;\r
+ p12 = (s12 - s19) * cos25_64;\r
+ p13 = (s13 - s18) * cos27_64;\r
+ p14 = (s14 - s17) * cos29_64;\r
+ p15 = (s15 - s16) * cos31_64;\r
+\r
+ pp0 = p0 + p15;\r
+ pp1 = p1 + p14;\r
+ pp2 = p2 + p13;\r
+ pp3 = p3 + p12;\r
+ pp4 = p4 + p11;\r
+ pp5 = p5 + p10;\r
+ pp6 = p6 + p9;\r
+ pp7 = p7 + p8;\r
+ pp8 = (p0 - p15) * cos1_32;\r
+ pp9 = (p1 - p14) * cos3_32;\r
+ pp10 = (p2 - p13) * cos5_32;\r
+ pp11 = (p3 - p12) * cos7_32;\r
+ pp12 = (p4 - p11) * cos9_32;\r
+ pp13 = (p5 - p10) * cos11_32;\r
+ pp14 = (p6 - p9) * cos13_32;\r
+ pp15 = (p7 - p8) * cos15_32;\r
+\r
+ p0 = pp0 + pp7;\r
+ p1 = pp1 + pp6;\r
+ p2 = pp2 + pp5;\r
+ p3 = pp3 + pp4;\r
+ p4 = (pp0 - pp7) * cos1_16;\r
+ p5 = (pp1 - pp6) * cos3_16;\r
+ p6 = (pp2 - pp5) * cos5_16;\r
+ p7 = (pp3 - pp4) * cos7_16;\r
+ p8 = pp8 + pp15;\r
+ p9 = pp9 + pp14;\r
+ p10 = pp10 + pp13;\r
+ p11 = pp11 + pp12;\r
+ p12 = (pp8 - pp15) * cos1_16;\r
+ p13 = (pp9 - pp14) * cos3_16;\r
+ p14 = (pp10 - pp13) * cos5_16;\r
+ p15 = (pp11 - pp12) * cos7_16;\r
+\r
+ pp0 = p0 + p3;\r
+ pp1 = p1 + p2;\r
+ pp2 = (p0 - p3) * cos1_8;\r
+ pp3 = (p1 - p2) * cos3_8;\r
+ pp4 = p4 + p7;\r
+ pp5 = p5 + p6;\r
+ pp6 = (p4 - p7) * cos1_8;\r
+ pp7 = (p5 - p6) * cos3_8;\r
+ pp8 = p8 + p11;\r
+ pp9 = p9 + p10;\r
+ pp10 = (p8 - p11) * cos1_8;\r
+ pp11 = (p9 - p10) * cos3_8;\r
+ pp12 = p12 + p15;\r
+ pp13 = p13 + p14;\r
+ pp14 = (p12 - p15) * cos1_8;\r
+ pp15 = (p13 - p14) * cos3_8;\r
+\r
+ p0 = pp0 + pp1;\r
+ p1 = (pp0 - pp1) * cos1_4;\r
+ p2 = pp2 + pp3;\r
+ p3 = (pp2 - pp3) * cos1_4;\r
+ p4 = pp4 + pp5;\r
+ p5 = (pp4 - pp5) * cos1_4;\r
+ p6 = pp6 + pp7;\r
+ p7 = (pp6 - pp7) * cos1_4;\r
+ p8 = pp8 + pp9;\r
+ p9 = (pp8 - pp9) * cos1_4;\r
+ p10 = pp10 + pp11;\r
+ p11 = (pp10 - pp11) * cos1_4;\r
+ p12 = pp12 + pp13;\r
+ p13 = (pp12 - pp13) * cos1_4;\r
+ p14 = pp14 + pp15;\r
+ p15 = (pp14 - pp15) * cos1_4;\r
\r
// manually doing something that a compiler should handle sucks\r
// coding like this is hard to read\r
float tmp2;\r
- new_v[5] = (new_v[11] = (new_v[13] = (new_v[15] = p[15]) + p[7]) + p[11]) + p[5] + p[13];\r
- new_v[7] = (new_v[9] = p[15] + p[11] + p[3]) + p[13];\r
- new_v[33 - 17] = -(new_v[1] = (tmp1 = p[13] + p[15] + p[9]) + p[1]) - p[14];\r
- new_v[35 - 17] = -(new_v[3] = tmp1 + p[5] + p[7]) - p[6] - p[14];\r
-\r
- new_v[39 - 17] = (tmp1 = -p[10] - p[11] - p[14] - p[15]) - p[13] - p[2] - p[3];\r
- new_v[37 - 17] = tmp1 - p[13] - p[5] - p[6] - p[7];\r
- new_v[41 - 17] = tmp1 - p[12] - p[2] - p[3];\r
- new_v[43 - 17] = tmp1 - p[12] - (tmp2 = p[4] + p[6] + p[7]);\r
- new_v[47 - 17] = (tmp1 = -p[8] - p[12] - p[14] - p[15]) - p[0];\r
- new_v[45 - 17] = tmp1 - tmp2;\r
+ new_v5 = (new_v11 = (new_v13 = (new_v15 = p15) + p7) + p11) + p5 + p13;\r
+ new_v7 = (new_v9 = p15 + p11 + p3) + p13;\r
+ new_v16/* 33-17 */= -(new_v1 = (tmp1 = p13 + p15 + p9) + p1) - p14;\r
+ new_v18/* 35-17 */= -(new_v3 = tmp1 + p5 + p7) - p6 - p14;\r
+\r
+ new_v22/* 39-17 */= (tmp1 = -p10 - p11 - p14 - p15) - p13 - p2 - p3;\r
+ new_v20/* 37-17 */= tmp1 - p13 - p5 - p6 - p7;\r
+ new_v24/* 41-17 */= tmp1 - p12 - p2 - p3;\r
+ new_v26/* 43-17 */= tmp1 - p12 - (tmp2 = p4 + p6 + p7);\r
+ new_v30/* 47-17 */= (tmp1 = -p8 - p12 - p14 - p15) - p0;\r
+ new_v28/* 45-17 */= tmp1 - tmp2;\r
\r
// insert V[0-15] (== new_v[0-15]) into actual v:\r
- x1 = new_v;\r
// float[] x2 = actual_v + actual_write_pos;\r
- float[] dest = actual_v;\r
-\r
- dest[0 + actual_write_pos] = x1[0];\r
- dest[16 + actual_write_pos] = x1[1];\r
- dest[32 + actual_write_pos] = x1[2];\r
- dest[48 + actual_write_pos] = x1[3];\r
- dest[64 + actual_write_pos] = x1[4];\r
- dest[80 + actual_write_pos] = x1[5];\r
- dest[96 + actual_write_pos] = x1[6];\r
- dest[112 + actual_write_pos] = x1[7];\r
- dest[128 + actual_write_pos] = x1[8];\r
- dest[144 + actual_write_pos] = x1[9];\r
- dest[160 + actual_write_pos] = x1[10];\r
- dest[176 + actual_write_pos] = x1[11];\r
- dest[192 + actual_write_pos] = x1[12];\r
- dest[208 + actual_write_pos] = x1[13];\r
- dest[224 + actual_write_pos] = x1[14];\r
- dest[240 + actual_write_pos] = x1[15];\r
+ // float dest[] = actual_v; actual_v=v1;\r
+\r
+ int pos = actual_write_pos;\r
+\r
+ v1[0 + pos] = new_v0;\r
+ v1[16 + pos] = new_v1;\r
+ v1[32 + pos] = new_v2;\r
+ v1[48 + pos] = new_v3;\r
+ v1[64 + pos] = new_v4;\r
+ v1[80 + pos] = new_v5;\r
+ v1[96 + pos] = new_v6;\r
+ v1[112 + pos] = new_v7;\r
+ v1[128 + pos] = new_v8;\r
+ v1[144 + pos] = new_v9;\r
+ v1[160 + pos] = new_v10;\r
+ v1[176 + pos] = new_v11;\r
+ v1[192 + pos] = new_v12;\r
+ v1[208 + pos] = new_v13;\r
+ v1[224 + pos] = new_v14;\r
+ v1[240 + pos] = new_v15;\r
\r
// V[16] is always 0.0:\r
- dest[256 + actual_write_pos] = 0.0f;\r
+ v1[256 + pos] = 0.0f;\r
\r
// insert V[17-31] (== -new_v[15-1]) into actual v:\r
- dest[272 + actual_write_pos] = -x1[15];\r
- dest[288 + actual_write_pos] = -x1[14];\r
- dest[304 + actual_write_pos] = -x1[13];\r
- dest[320 + actual_write_pos] = -x1[12];\r
- dest[336 + actual_write_pos] = -x1[11];\r
- dest[352 + actual_write_pos] = -x1[10];\r
- dest[368 + actual_write_pos] = -x1[9];\r
- dest[384 + actual_write_pos] = -x1[8];\r
- dest[400 + actual_write_pos] = -x1[7];\r
- dest[416 + actual_write_pos] = -x1[6];\r
- dest[432 + actual_write_pos] = -x1[5];\r
- dest[448 + actual_write_pos] = -x1[4];\r
- dest[464 + actual_write_pos] = -x1[3];\r
- dest[480 + actual_write_pos] = -x1[2];\r
- dest[496 + actual_write_pos] = -x1[1];\r
+ v1[272 + pos] = -new_v15;\r
+ v1[288 + pos] = -new_v14;\r
+ v1[304 + pos] = -new_v13;\r
+ v1[320 + pos] = -new_v12;\r
+ v1[336 + pos] = -new_v11;\r
+ v1[352 + pos] = -new_v10;\r
+ v1[368 + pos] = -new_v9;\r
+ v1[384 + pos] = -new_v8;\r
+ v1[400 + pos] = -new_v7;\r
+ v1[416 + pos] = -new_v6;\r
+ v1[432 + pos] = -new_v5;\r
+ v1[448 + pos] = -new_v4;\r
+ v1[464 + pos] = -new_v3;\r
+ v1[480 + pos] = -new_v2;\r
+ v1[496 + pos] = -new_v1;\r
\r
// insert V[32] (== -new_v[0]) into other v:\r
+ // dest = (actual_v == v1) ? v2 : v1;\r
\r
+ v2[0 + pos] = -new_v0;\r
+ // insert V[33-48] (== new_v[16-31]) into other v:\r
+ v2[16 + pos] = new_v16;\r
+ v2[32 + pos] = new_v17;\r
+ v2[48 + pos] = new_v18;\r
+ v2[64 + pos] = new_v19;\r
+ v2[80 + pos] = new_v20;\r
+ v2[96 + pos] = new_v21;\r
+ v2[112 + pos] = new_v22;\r
+ v2[128 + pos] = new_v23;\r
+ v2[144 + pos] = new_v24;\r
+ v2[160 + pos] = new_v25;\r
+ v2[176 + pos] = new_v26;\r
+ v2[192 + pos] = new_v27;\r
+ v2[208 + pos] = new_v28;\r
+ v2[224 + pos] = new_v29;\r
+ v2[240 + pos] = new_v30;\r
+ v2[256 + pos] = new_v31;\r
+\r
+ // insert V[49-63] (== new_v[30-16]) into other v:\r
+ v2[272 + pos] = new_v30;\r
+ v2[288 + pos] = new_v29;\r
+ v2[304 + pos] = new_v28;\r
+ v2[320 + pos] = new_v27;\r
+ v2[336 + pos] = new_v26;\r
+ v2[352 + pos] = new_v25;\r
+ v2[368 + pos] = new_v24;\r
+ v2[384 + pos] = new_v23;\r
+ v2[400 + pos] = new_v22;\r
+ v2[416 + pos] = new_v21;\r
+ v2[432 + pos] = new_v20;\r
+ v2[448 + pos] = new_v19;\r
+ v2[464 + pos] = new_v18;\r
+ v2[480 + pos] = new_v17;\r
+ v2[496 + pos] = new_v16;\r
}\r
\r
/**\r
\r
private float[] _tmpOut = new float[32];\r
\r
- private void compute_pcm_samples0(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- float pcm_sample;\r
- final float[] dp = d16[i];\r
- pcm_sample =\r
- (float) (((vp[0 + dvp] * dp[0]) + (vp[15 + dvp] * dp[1]) + (vp[14 + dvp] * dp[2])\r
- + (vp[13 + dvp] * dp[3]) + (vp[12 + dvp] * dp[4]) + (vp[11 + dvp] * dp[5])\r
- + (vp[10 + dvp] * dp[6]) + (vp[9 + dvp] * dp[7]) + (vp[8 + dvp] * dp[8])\r
- + (vp[7 + dvp] * dp[9]) + (vp[6 + dvp] * dp[10]) + (vp[5 + dvp] * dp[11])\r
- + (vp[4 + dvp] * dp[12]) + (vp[3 + dvp] * dp[13]) + (vp[2 + dvp] * dp[14]) + (vp[1 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
-\r
- dvp += 16;\r
- } // for\r
- }\r
-\r
- private void compute_pcm_samples1(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[1 + dvp] * dp[0]) + (vp[0 + dvp] * dp[1]) + (vp[15 + dvp] * dp[2])\r
- + (vp[14 + dvp] * dp[3]) + (vp[13 + dvp] * dp[4]) + (vp[12 + dvp] * dp[5])\r
- + (vp[11 + dvp] * dp[6]) + (vp[10 + dvp] * dp[7]) + (vp[9 + dvp] * dp[8])\r
- + (vp[8 + dvp] * dp[9]) + (vp[7 + dvp] * dp[10]) + (vp[6 + dvp] * dp[11])\r
- + (vp[5 + dvp] * dp[12]) + (vp[4 + dvp] * dp[13]) + (vp[3 + dvp] * dp[14]) + (vp[2 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples0() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ 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
+ + (v1[14 + dvp] * d16[i][2]) + (v1[13 + dvp] * d16[i][3])\r
+ + (v1[12 + dvp] * d16[i][4]) + (v1[11 + dvp] * d16[i][5])\r
+ + (v1[10 + dvp] * d16[i][6]) + (v1[9 + dvp] * d16[i][7])\r
+ + (v1[8 + dvp] * d16[i][8]) + (v1[7 + dvp] * d16[i][9])\r
+ + (v1[6 + dvp] * d16[i][10]) + (v1[5 + dvp] * d16[i][11])\r
+ + (v1[4 + dvp] * d16[i][12]) + (v1[3 + dvp] * d16[i][13])\r
+ + (v1[2 + dvp] * d16[i][14]) + (v1[1 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ 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
+ + (v2[14 + dvp] * d16[i][2]) + (v2[13 + dvp] * d16[i][3])\r
+ + (v2[12 + dvp] * d16[i][4]) + (v2[11 + dvp] * d16[i][5])\r
+ + (v2[10 + dvp] * d16[i][6]) + (v2[9 + dvp] * d16[i][7])\r
+ + (v2[8 + dvp] * d16[i][8]) + (v2[7 + dvp] * d16[i][9])\r
+ + (v2[6 + dvp] * d16[i][10]) + (v2[5 + dvp] * d16[i][11])\r
+ + (v2[4 + dvp] * d16[i][12]) + (v2[3 + dvp] * d16[i][13])\r
+ + (v2[2 + dvp] * d16[i][14]) + (v2[1 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples2(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[2 + dvp] * dp[0]) + (vp[1 + dvp] * dp[1]) + (vp[0 + dvp] * dp[2])\r
- + (vp[15 + dvp] * dp[3]) + (vp[14 + dvp] * dp[4]) + (vp[13 + dvp] * dp[5])\r
- + (vp[12 + dvp] * dp[6]) + (vp[11 + dvp] * dp[7]) + (vp[10 + dvp] * dp[8])\r
- + (vp[9 + dvp] * dp[9]) + (vp[8 + dvp] * dp[10]) + (vp[7 + dvp] * dp[11])\r
- + (vp[6 + dvp] * dp[12]) + (vp[5 + dvp] * dp[13]) + (vp[4 + dvp] * dp[14]) + (vp[3 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples1() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[1 + dvp] * d16[i][0]) + (v1[0 + dvp] * d16[i][1])\r
+ + (v1[15 + dvp] * d16[i][2]) + (v1[14 + dvp] * d16[i][3])\r
+ + (v1[13 + dvp] * d16[i][4]) + (v1[12 + dvp] * d16[i][5])\r
+ + (v1[11 + dvp] * d16[i][6]) + (v1[10 + dvp] * d16[i][7])\r
+ + (v1[9 + dvp] * d16[i][8]) + (v1[8 + dvp] * d16[i][9])\r
+ + (v1[7 + dvp] * d16[i][10]) + (v1[6 + dvp] * d16[i][11])\r
+ + (v1[5 + dvp] * d16[i][12]) + (v1[4 + dvp] * d16[i][13])\r
+ + (v1[3 + dvp] * d16[i][14]) + (v1[2 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[1 + dvp] * d16[i][0]) + (v2[0 + dvp] * d16[i][1])\r
+ + (v2[15 + dvp] * d16[i][2]) + (v2[14 + dvp] * d16[i][3])\r
+ + (v2[13 + dvp] * d16[i][4]) + (v2[12 + dvp] * d16[i][5])\r
+ + (v2[11 + dvp] * d16[i][6]) + (v2[10 + dvp] * d16[i][7])\r
+ + (v2[9 + dvp] * d16[i][8]) + (v2[8 + dvp] * d16[i][9])\r
+ + (v2[7 + dvp] * d16[i][10]) + (v2[6 + dvp] * d16[i][11])\r
+ + (v2[5 + dvp] * d16[i][12]) + (v2[4 + dvp] * d16[i][13])\r
+ + (v2[3 + dvp] * d16[i][14]) + (v2[2 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples3(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- int idx = 0;\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[3 + dvp] * dp[0]) + (vp[2 + dvp] * dp[1]) + (vp[1 + dvp] * dp[2])\r
- + (vp[0 + dvp] * dp[3]) + (vp[15 + dvp] * dp[4]) + (vp[14 + dvp] * dp[5])\r
- + (vp[13 + dvp] * dp[6]) + (vp[12 + dvp] * dp[7]) + (vp[11 + dvp] * dp[8])\r
- + (vp[10 + dvp] * dp[9]) + (vp[9 + dvp] * dp[10]) + (vp[8 + dvp] * dp[11])\r
- + (vp[7 + dvp] * dp[12]) + (vp[6 + dvp] * dp[13]) + (vp[5 + dvp] * dp[14]) + (vp[4 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples2() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[2 + dvp] * d16[i][0]) + (v1[1 + dvp] * d16[i][1])\r
+ + (v1[0 + dvp] * d16[i][2]) + (v1[15 + dvp] * d16[i][3])\r
+ + (v1[14 + dvp] * d16[i][4]) + (v1[13 + dvp] * d16[i][5])\r
+ + (v1[12 + dvp] * d16[i][6]) + (v1[11 + dvp] * d16[i][7])\r
+ + (v1[10 + dvp] * d16[i][8]) + (v1[9 + dvp] * d16[i][9])\r
+ + (v1[8 + dvp] * d16[i][10]) + (v1[7 + dvp] * d16[i][11])\r
+ + (v1[6 + dvp] * d16[i][12]) + (v1[5 + dvp] * d16[i][13])\r
+ + (v1[4 + dvp] * d16[i][14]) + (v1[3 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[2 + dvp] * d16[i][0]) + (v2[1 + dvp] * d16[i][1])\r
+ + (v2[0 + dvp] * d16[i][2]) + (v2[15 + dvp] * d16[i][3])\r
+ + (v2[14 + dvp] * d16[i][4]) + (v2[13 + dvp] * d16[i][5])\r
+ + (v2[12 + dvp] * d16[i][6]) + (v2[11 + dvp] * d16[i][7])\r
+ + (v2[10 + dvp] * d16[i][8]) + (v2[9 + dvp] * d16[i][9])\r
+ + (v2[8 + dvp] * d16[i][10]) + (v2[7 + dvp] * d16[i][11])\r
+ + (v2[6 + dvp] * d16[i][12]) + (v2[5 + dvp] * d16[i][13])\r
+ + (v2[4 + dvp] * d16[i][14]) + (v2[3 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples4(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[4 + dvp] * dp[0]) + (vp[3 + dvp] * dp[1]) + (vp[2 + dvp] * dp[2])\r
- + (vp[1 + dvp] * dp[3]) + (vp[0 + dvp] * dp[4]) + (vp[15 + dvp] * dp[5])\r
- + (vp[14 + dvp] * dp[6]) + (vp[13 + dvp] * dp[7]) + (vp[12 + dvp] * dp[8])\r
- + (vp[11 + dvp] * dp[9]) + (vp[10 + dvp] * dp[10]) + (vp[9 + dvp] * dp[11])\r
- + (vp[8 + dvp] * dp[12]) + (vp[7 + dvp] * dp[13]) + (vp[6 + dvp] * dp[14]) + (vp[5 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples3() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ int idx = 0;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[3 + dvp] * d16[i][0]) + (v1[2 + dvp] * d16[i][1])\r
+ + (v1[1 + dvp] * d16[i][2]) + (v1[0 + dvp] * d16[i][3])\r
+ + (v1[15 + dvp] * d16[i][4]) + (v1[14 + dvp] * d16[i][5])\r
+ + (v1[13 + dvp] * d16[i][6]) + (v1[12 + dvp] * d16[i][7])\r
+ + (v1[11 + dvp] * d16[i][8]) + (v1[10 + dvp] * d16[i][9])\r
+ + (v1[9 + dvp] * d16[i][10]) + (v1[8 + dvp] * d16[i][11])\r
+ + (v1[7 + dvp] * d16[i][12]) + (v1[6 + dvp] * d16[i][13])\r
+ + (v1[5 + dvp] * d16[i][14]) + (v1[4 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ int idx = 0;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[3 + dvp] * d16[i][0]) + (v2[2 + dvp] * d16[i][1])\r
+ + (v2[1 + dvp] * d16[i][2]) + (v2[0 + dvp] * d16[i][3])\r
+ + (v2[15 + dvp] * d16[i][4]) + (v2[14 + dvp] * d16[i][5])\r
+ + (v2[13 + dvp] * d16[i][6]) + (v2[12 + dvp] * d16[i][7])\r
+ + (v2[11 + dvp] * d16[i][8]) + (v2[10 + dvp] * d16[i][9])\r
+ + (v2[9 + dvp] * d16[i][10]) + (v2[8 + dvp] * d16[i][11])\r
+ + (v2[7 + dvp] * d16[i][12]) + (v2[6 + dvp] * d16[i][13])\r
+ + (v2[5 + dvp] * d16[i][14]) + (v2[4 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples5(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[5 + dvp] * dp[0]) + (vp[4 + dvp] * dp[1]) + (vp[3 + dvp] * dp[2])\r
- + (vp[2 + dvp] * dp[3]) + (vp[1 + dvp] * dp[4]) + (vp[0 + dvp] * dp[5])\r
- + (vp[15 + dvp] * dp[6]) + (vp[14 + dvp] * dp[7]) + (vp[13 + dvp] * dp[8])\r
- + (vp[12 + dvp] * dp[9]) + (vp[11 + dvp] * dp[10]) + (vp[10 + dvp] * dp[11])\r
- + (vp[9 + dvp] * dp[12]) + (vp[8 + dvp] * dp[13]) + (vp[7 + dvp] * dp[14]) + (vp[6 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples4() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[4 + dvp] * d16[i][0]) + (v1[3 + dvp] * d16[i][1])\r
+ + (v1[2 + dvp] * d16[i][2]) + (v1[1 + dvp] * d16[i][3]) + (v1[0 + dvp] * d16[i][4])\r
+ + (v1[15 + dvp] * d16[i][5]) + (v1[14 + dvp] * d16[i][6])\r
+ + (v1[13 + dvp] * d16[i][7]) + (v1[12 + dvp] * d16[i][8])\r
+ + (v1[11 + dvp] * d16[i][9]) + (v1[10 + dvp] * d16[i][10])\r
+ + (v1[9 + dvp] * d16[i][11]) + (v1[8 + dvp] * d16[i][12])\r
+ + (v1[7 + dvp] * d16[i][13]) + (v1[6 + dvp] * d16[i][14]) + (v1[5 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[4 + dvp] * d16[i][0]) + (v2[3 + dvp] * d16[i][1])\r
+ + (v2[2 + dvp] * d16[i][2]) + (v2[1 + dvp] * d16[i][3]) + (v2[0 + dvp] * d16[i][4])\r
+ + (v2[15 + dvp] * d16[i][5]) + (v2[14 + dvp] * d16[i][6])\r
+ + (v2[13 + dvp] * d16[i][7]) + (v2[12 + dvp] * d16[i][8])\r
+ + (v2[11 + dvp] * d16[i][9]) + (v2[10 + dvp] * d16[i][10])\r
+ + (v2[9 + dvp] * d16[i][11]) + (v2[8 + dvp] * d16[i][12])\r
+ + (v2[7 + dvp] * d16[i][13]) + (v2[6 + dvp] * d16[i][14]) + (v2[5 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples6(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[6 + dvp] * dp[0]) + (vp[5 + dvp] * dp[1]) + (vp[4 + dvp] * dp[2])\r
- + (vp[3 + dvp] * dp[3]) + (vp[2 + dvp] * dp[4]) + (vp[1 + dvp] * dp[5])\r
- + (vp[0 + dvp] * dp[6]) + (vp[15 + dvp] * dp[7]) + (vp[14 + dvp] * dp[8])\r
- + (vp[13 + dvp] * dp[9]) + (vp[12 + dvp] * dp[10]) + (vp[11 + dvp] * dp[11])\r
- + (vp[10 + dvp] * dp[12]) + (vp[9 + dvp] * dp[13]) + (vp[8 + dvp] * dp[14]) + (vp[7 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples5() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[5 + dvp] * d16[i][0]) + (v1[4 + dvp] * d16[i][1])\r
+ + (v1[3 + dvp] * d16[i][2]) + (v1[2 + dvp] * d16[i][3]) + (v1[1 + dvp] * d16[i][4])\r
+ + (v1[0 + dvp] * d16[i][5]) + (v1[15 + dvp] * d16[i][6])\r
+ + (v1[14 + dvp] * d16[i][7]) + (v1[13 + dvp] * d16[i][8])\r
+ + (v1[12 + dvp] * d16[i][9]) + (v1[11 + dvp] * d16[i][10])\r
+ + (v1[10 + dvp] * d16[i][11]) + (v1[9 + dvp] * d16[i][12])\r
+ + (v1[8 + dvp] * d16[i][13]) + (v1[7 + dvp] * d16[i][14]) + (v1[6 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[5 + dvp] * d16[i][0]) + (v2[4 + dvp] * d16[i][1])\r
+ + (v2[3 + dvp] * d16[i][2]) + (v2[2 + dvp] * d16[i][3]) + (v2[1 + dvp] * d16[i][4])\r
+ + (v2[0 + dvp] * d16[i][5]) + (v2[15 + dvp] * d16[i][6])\r
+ + (v2[14 + dvp] * d16[i][7]) + (v2[13 + dvp] * d16[i][8])\r
+ + (v2[12 + dvp] * d16[i][9]) + (v2[11 + dvp] * d16[i][10])\r
+ + (v2[10 + dvp] * d16[i][11]) + (v2[9 + dvp] * d16[i][12])\r
+ + (v2[8 + dvp] * d16[i][13]) + (v2[7 + dvp] * d16[i][14]) + (v2[6 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples7(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[7 + dvp] * dp[0]) + (vp[6 + dvp] * dp[1]) + (vp[5 + dvp] * dp[2])\r
- + (vp[4 + dvp] * dp[3]) + (vp[3 + dvp] * dp[4]) + (vp[2 + dvp] * dp[5])\r
- + (vp[1 + dvp] * dp[6]) + (vp[0 + dvp] * dp[7]) + (vp[15 + dvp] * dp[8])\r
- + (vp[14 + dvp] * dp[9]) + (vp[13 + dvp] * dp[10]) + (vp[12 + dvp] * dp[11])\r
- + (vp[11 + dvp] * dp[12]) + (vp[10 + dvp] * dp[13]) + (vp[9 + dvp] * dp[14]) + (vp[8 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples6() {\r
+\r
+ if (vidx == 1) {\r
+\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[6 + dvp] * d16[i][0]) + (v1[5 + dvp] * d16[i][1])\r
+ + (v1[4 + dvp] * d16[i][2]) + (v1[3 + dvp] * d16[i][3]) + (v1[2 + dvp] * d16[i][4])\r
+ + (v1[1 + dvp] * d16[i][5]) + (v1[0 + dvp] * d16[i][6])\r
+ + (v1[15 + dvp] * d16[i][7]) + (v1[14 + dvp] * d16[i][8])\r
+ + (v1[13 + dvp] * d16[i][9]) + (v1[12 + dvp] * d16[i][10])\r
+ + (v1[11 + dvp] * d16[i][11]) + (v1[10 + dvp] * d16[i][12])\r
+ + (v1[9 + dvp] * d16[i][13]) + (v1[8 + dvp] * d16[i][14]) + (v1[7 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[6 + dvp] * d16[i][0]) + (v2[5 + dvp] * d16[i][1])\r
+ + (v2[4 + dvp] * d16[i][2]) + (v2[3 + dvp] * d16[i][3]) + (v2[2 + dvp] * d16[i][4])\r
+ + (v2[1 + dvp] * d16[i][5]) + (v2[0 + dvp] * d16[i][6])\r
+ + (v2[15 + dvp] * d16[i][7]) + (v2[14 + dvp] * d16[i][8])\r
+ + (v2[13 + dvp] * d16[i][9]) + (v2[12 + dvp] * d16[i][10])\r
+ + (v2[11 + dvp] * d16[i][11]) + (v2[10 + dvp] * d16[i][12])\r
+ + (v2[9 + dvp] * d16[i][13]) + (v2[8 + dvp] * d16[i][14]) + (v2[7 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples8(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[8 + dvp] * dp[0]) + (vp[7 + dvp] * dp[1]) + (vp[6 + dvp] * dp[2])\r
- + (vp[5 + dvp] * dp[3]) + (vp[4 + dvp] * dp[4]) + (vp[3 + dvp] * dp[5])\r
- + (vp[2 + dvp] * dp[6]) + (vp[1 + dvp] * dp[7]) + (vp[0 + dvp] * dp[8])\r
- + (vp[15 + dvp] * dp[9]) + (vp[14 + dvp] * dp[10]) + (vp[13 + dvp] * dp[11])\r
- + (vp[12 + dvp] * dp[12]) + (vp[11 + dvp] * dp[13]) + (vp[10 + dvp] * dp[14]) + (vp[9 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples7() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[7 + dvp] * d16[i][0]) + (v1[6 + dvp] * d16[i][1])\r
+ + (v1[5 + dvp] * d16[i][2]) + (v1[4 + dvp] * d16[i][3]) + (v1[3 + dvp] * d16[i][4])\r
+ + (v1[2 + dvp] * d16[i][5]) + (v1[1 + dvp] * d16[i][6]) + (v1[0 + dvp] * d16[i][7])\r
+ + (v1[15 + dvp] * d16[i][8]) + (v1[14 + dvp] * d16[i][9])\r
+ + (v1[13 + dvp] * d16[i][10]) + (v1[12 + dvp] * d16[i][11])\r
+ + (v1[11 + dvp] * d16[i][12]) + (v1[10 + dvp] * d16[i][13])\r
+ + (v1[9 + dvp] * d16[i][14]) + (v1[8 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[7 + dvp] * d16[i][0]) + (v2[6 + dvp] * d16[i][1])\r
+ + (v2[5 + dvp] * d16[i][2]) + (v2[4 + dvp] * d16[i][3]) + (v2[3 + dvp] * d16[i][4])\r
+ + (v2[2 + dvp] * d16[i][5]) + (v2[1 + dvp] * d16[i][6]) + (v2[0 + dvp] * d16[i][7])\r
+ + (v2[15 + dvp] * d16[i][8]) + (v2[14 + dvp] * d16[i][9])\r
+ + (v2[13 + dvp] * d16[i][10]) + (v2[12 + dvp] * d16[i][11])\r
+ + (v2[11 + dvp] * d16[i][12]) + (v2[10 + dvp] * d16[i][13])\r
+ + (v2[9 + dvp] * d16[i][14]) + (v2[8 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples9(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
+ private void compute_pcm_samples8() {\r
\r
- pcm_sample =\r
- (float) (((vp[9 + dvp] * dp[0]) + (vp[8 + dvp] * dp[1]) + (vp[7 + dvp] * dp[2])\r
- + (vp[6 + dvp] * dp[3]) + (vp[5 + dvp] * dp[4]) + (vp[4 + dvp] * dp[5])\r
- + (vp[3 + dvp] * dp[6]) + (vp[2 + dvp] * dp[7]) + (vp[1 + dvp] * dp[8])\r
- + (vp[0 + dvp] * dp[9]) + (vp[15 + dvp] * dp[10]) + (vp[14 + dvp] * dp[11])\r
- + (vp[13 + dvp] * dp[12]) + (vp[12 + dvp] * dp[13]) + (vp[11 + dvp] * dp[14]) + (vp[10 + dvp] * dp[15])) * scalefactor);\r
+ if (vidx == 1) {\r
\r
- tmpOut[i] = pcm_sample;\r
+ // final float[] vp = actual_v;\r
\r
- dvp += 16;\r
- } // for\r
- }\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
\r
- private void compute_pcm_samples10(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
+ pcm_sample =\r
+ (float) (((v1[8 + dvp] * d16[i][0]) + (v1[7 + dvp] * d16[i][1])\r
+ + (v1[6 + dvp] * d16[i][2]) + (v1[5 + dvp] * d16[i][3]) + (v1[4 + dvp] * d16[i][4])\r
+ + (v1[3 + dvp] * d16[i][5]) + (v1[2 + dvp] * d16[i][6]) + (v1[1 + dvp] * d16[i][7])\r
+ + (v1[0 + dvp] * d16[i][8]) + (v1[15 + dvp] * d16[i][9])\r
+ + (v1[14 + dvp] * d16[i][10]) + (v1[13 + dvp] * d16[i][11])\r
+ + (v1[12 + dvp] * d16[i][12]) + (v1[11 + dvp] * d16[i][13])\r
+ + (v1[10 + dvp] * d16[i][14]) + (v1[9 + dvp] * d16[i][15])) * scalefactor);\r
\r
- pcm_sample =\r
- (float) (((vp[10 + dvp] * dp[0]) + (vp[9 + dvp] * dp[1]) + (vp[8 + dvp] * dp[2])\r
- + (vp[7 + dvp] * dp[3]) + (vp[6 + dvp] * dp[4]) + (vp[5 + dvp] * dp[5])\r
- + (vp[4 + dvp] * dp[6]) + (vp[3 + dvp] * dp[7]) + (vp[2 + dvp] * dp[8])\r
- + (vp[1 + dvp] * dp[9]) + (vp[0 + dvp] * dp[10]) + (vp[15 + dvp] * dp[11])\r
- + (vp[14 + dvp] * dp[12]) + (vp[13 + dvp] * dp[13]) + (vp[12 + dvp] * dp[14]) + (vp[11 + dvp] * dp[15])) * scalefactor);\r
+ _tmpOut[i] = pcm_sample;\r
\r
- tmpOut[i] = pcm_sample;\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
\r
- dvp += 16;\r
- } // for\r
- }\r
+ // final float[] vp = actual_v;\r
\r
- private void compute_pcm_samples11(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
+ pcm_sample =\r
+ (float) (((v2[8 + dvp] * d16[i][0]) + (v2[7 + dvp] * d16[i][1])\r
+ + (v2[6 + dvp] * d16[i][2]) + (v2[5 + dvp] * d16[i][3]) + (v2[4 + dvp] * d16[i][4])\r
+ + (v2[3 + dvp] * d16[i][5]) + (v2[2 + dvp] * d16[i][6]) + (v2[1 + dvp] * d16[i][7])\r
+ + (v2[0 + dvp] * d16[i][8]) + (v2[15 + dvp] * d16[i][9])\r
+ + (v2[14 + dvp] * d16[i][10]) + (v2[13 + dvp] * d16[i][11])\r
+ + (v2[12 + dvp] * d16[i][12]) + (v2[11 + dvp] * d16[i][13])\r
+ + (v2[10 + dvp] * d16[i][14]) + (v2[9 + dvp] * d16[i][15])) * scalefactor);\r
\r
- pcm_sample =\r
- (float) (((vp[11 + dvp] * dp[0]) + (vp[10 + dvp] * dp[1]) + (vp[9 + dvp] * dp[2])\r
- + (vp[8 + dvp] * dp[3]) + (vp[7 + dvp] * dp[4]) + (vp[6 + dvp] * dp[5])\r
- + (vp[5 + dvp] * dp[6]) + (vp[4 + dvp] * dp[7]) + (vp[3 + dvp] * dp[8])\r
- + (vp[2 + dvp] * dp[9]) + (vp[1 + dvp] * dp[10]) + (vp[0 + dvp] * dp[11])\r
- + (vp[15 + dvp] * dp[12]) + (vp[14 + dvp] * dp[13]) + (vp[13 + dvp] * dp[14]) + (vp[12 + dvp] * dp[15])) * scalefactor);\r
+ _tmpOut[i] = pcm_sample;\r
\r
- tmpOut[i] = pcm_sample;\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples12(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
-\r
- pcm_sample =\r
- (float) (((vp[12 + dvp] * dp[0]) + (vp[11 + dvp] * dp[1]) + (vp[10 + dvp] * dp[2])\r
- + (vp[9 + dvp] * dp[3]) + (vp[8 + dvp] * dp[4]) + (vp[7 + dvp] * dp[5])\r
- + (vp[6 + dvp] * dp[6]) + (vp[5 + dvp] * dp[7]) + (vp[4 + dvp] * dp[8])\r
- + (vp[3 + dvp] * dp[9]) + (vp[2 + dvp] * dp[10]) + (vp[1 + dvp] * dp[11])\r
- + (vp[0 + dvp] * dp[12]) + (vp[15 + dvp] * dp[13]) + (vp[14 + dvp] * dp[14]) + (vp[13 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples9() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[9 + dvp] * d16[i][0]) + (v1[8 + dvp] * d16[i][1])\r
+ + (v1[7 + dvp] * d16[i][2]) + (v1[6 + dvp] * d16[i][3]) + (v1[5 + dvp] * d16[i][4])\r
+ + (v1[4 + dvp] * d16[i][5]) + (v1[3 + dvp] * d16[i][6]) + (v1[2 + dvp] * d16[i][7])\r
+ + (v1[1 + dvp] * d16[i][8]) + (v1[0 + dvp] * d16[i][9])\r
+ + (v1[15 + dvp] * d16[i][10]) + (v1[14 + dvp] * d16[i][11])\r
+ + (v1[13 + dvp] * d16[i][12]) + (v1[12 + dvp] * d16[i][13])\r
+ + (v1[11 + dvp] * d16[i][14]) + (v1[10 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[9 + dvp] * d16[i][0]) + (v2[8 + dvp] * d16[i][1])\r
+ + (v2[7 + dvp] * d16[i][2]) + (v2[6 + dvp] * d16[i][3]) + (v2[5 + dvp] * d16[i][4])\r
+ + (v2[4 + dvp] * d16[i][5]) + (v2[3 + dvp] * d16[i][6]) + (v2[2 + dvp] * d16[i][7])\r
+ + (v2[1 + dvp] * d16[i][8]) + (v2[0 + dvp] * d16[i][9])\r
+ + (v2[15 + dvp] * d16[i][10]) + (v2[14 + dvp] * d16[i][11])\r
+ + (v2[13 + dvp] * d16[i][12]) + (v2[12 + dvp] * d16[i][13])\r
+ + (v2[11 + dvp] * d16[i][14]) + (v2[10 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples13(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
+ private void compute_pcm_samples10() {\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[10 + dvp] * d16[i][0]) + (v1[9 + dvp] * d16[i][1])\r
+ + (v1[8 + dvp] * d16[i][2]) + (v1[7 + dvp] * d16[i][3]) + (v1[6 + dvp] * d16[i][4])\r
+ + (v1[5 + dvp] * d16[i][5]) + (v1[4 + dvp] * d16[i][6]) + (v1[3 + dvp] * d16[i][7])\r
+ + (v1[2 + dvp] * d16[i][8]) + (v1[1 + dvp] * d16[i][9])\r
+ + (v1[0 + dvp] * d16[i][10]) + (v1[15 + dvp] * d16[i][11])\r
+ + (v1[14 + dvp] * d16[i][12]) + (v1[13 + dvp] * d16[i][13])\r
+ + (v1[12 + dvp] * d16[i][14]) + (v1[11 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[10 + dvp] * d16[i][0]) + (v2[9 + dvp] * d16[i][1])\r
+ + (v2[8 + dvp] * d16[i][2]) + (v2[7 + dvp] * d16[i][3]) + (v2[6 + dvp] * d16[i][4])\r
+ + (v2[5 + dvp] * d16[i][5]) + (v2[4 + dvp] * d16[i][6]) + (v2[3 + dvp] * d16[i][7])\r
+ + (v2[2 + dvp] * d16[i][8]) + (v2[1 + dvp] * d16[i][9])\r
+ + (v2[0 + dvp] * d16[i][10]) + (v2[15 + dvp] * d16[i][11])\r
+ + (v2[14 + dvp] * d16[i][12]) + (v2[13 + dvp] * d16[i][13])\r
+ + (v2[12 + dvp] * d16[i][14]) + (v2[11 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- pcm_sample =\r
- (float) (((vp[13 + dvp] * dp[0]) + (vp[12 + dvp] * dp[1]) + (vp[11 + dvp] * dp[2])\r
- + (vp[10 + dvp] * dp[3]) + (vp[9 + dvp] * dp[4]) + (vp[8 + dvp] * dp[5])\r
- + (vp[7 + dvp] * dp[6]) + (vp[6 + dvp] * dp[7]) + (vp[5 + dvp] * dp[8])\r
- + (vp[4 + dvp] * dp[9]) + (vp[3 + dvp] * dp[10]) + (vp[2 + dvp] * dp[11])\r
- + (vp[1 + dvp] * dp[12]) + (vp[0 + dvp] * dp[13]) + (vp[15 + dvp] * dp[14]) + (vp[14 + dvp] * dp[15])) * scalefactor);\r
+ }\r
\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples11() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[11 + dvp] * d16[i][0]) + (v1[10 + dvp] * d16[i][1])\r
+ + (v1[9 + dvp] * d16[i][2]) + (v1[8 + dvp] * d16[i][3]) + (v1[7 + dvp] * d16[i][4])\r
+ + (v1[6 + dvp] * d16[i][5]) + (v1[5 + dvp] * d16[i][6]) + (v1[4 + dvp] * d16[i][7])\r
+ + (v1[3 + dvp] * d16[i][8]) + (v1[2 + dvp] * d16[i][9])\r
+ + (v1[1 + dvp] * d16[i][10]) + (v1[0 + dvp] * d16[i][11])\r
+ + (v1[15 + dvp] * d16[i][12]) + (v1[14 + dvp] * d16[i][13])\r
+ + (v1[13 + dvp] * d16[i][14]) + (v1[12 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[11 + dvp] * d16[i][0]) + (v2[10 + dvp] * d16[i][1])\r
+ + (v2[9 + dvp] * d16[i][2]) + (v2[8 + dvp] * d16[i][3]) + (v2[7 + dvp] * d16[i][4])\r
+ + (v2[6 + dvp] * d16[i][5]) + (v2[5 + dvp] * d16[i][6]) + (v2[4 + dvp] * d16[i][7])\r
+ + (v2[3 + dvp] * d16[i][8]) + (v2[2 + dvp] * d16[i][9])\r
+ + (v2[1 + dvp] * d16[i][10]) + (v2[0 + dvp] * d16[i][11])\r
+ + (v2[15 + dvp] * d16[i][12]) + (v2[14 + dvp] * d16[i][13])\r
+ + (v2[13 + dvp] * d16[i][14]) + (v2[12 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples14(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
+ private void compute_pcm_samples12() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[12 + dvp] * d16[i][0]) + (v1[11 + dvp] * d16[i][1])\r
+ + (v1[10 + dvp] * d16[i][2]) + (v1[9 + dvp] * d16[i][3])\r
+ + (v1[8 + dvp] * d16[i][4]) + (v1[7 + dvp] * d16[i][5]) + (v1[6 + dvp] * d16[i][6])\r
+ + (v1[5 + dvp] * d16[i][7]) + (v1[4 + dvp] * d16[i][8]) + (v1[3 + dvp] * d16[i][9])\r
+ + (v1[2 + dvp] * d16[i][10]) + (v1[1 + dvp] * d16[i][11])\r
+ + (v1[0 + dvp] * d16[i][12]) + (v1[15 + dvp] * d16[i][13])\r
+ + (v1[14 + dvp] * d16[i][14]) + (v1[13 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[12 + dvp] * d16[i][0]) + (v2[11 + dvp] * d16[i][1])\r
+ + (v2[10 + dvp] * d16[i][2]) + (v2[9 + dvp] * d16[i][3])\r
+ + (v2[8 + dvp] * d16[i][4]) + (v2[7 + dvp] * d16[i][5]) + (v2[6 + dvp] * d16[i][6])\r
+ + (v2[5 + dvp] * d16[i][7]) + (v2[4 + dvp] * d16[i][8]) + (v2[3 + dvp] * d16[i][9])\r
+ + (v2[2 + dvp] * d16[i][10]) + (v2[1 + dvp] * d16[i][11])\r
+ + (v2[0 + dvp] * d16[i][12]) + (v2[15 + dvp] * d16[i][13])\r
+ + (v2[14 + dvp] * d16[i][14]) + (v2[13 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ }\r
\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- final float[] dp = d16[i];\r
- float pcm_sample;\r
+ private void compute_pcm_samples13() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[13 + dvp] * d16[i][0]) + (v1[12 + dvp] * d16[i][1])\r
+ + (v1[11 + dvp] * d16[i][2]) + (v1[10 + dvp] * d16[i][3])\r
+ + (v1[9 + dvp] * d16[i][4]) + (v1[8 + dvp] * d16[i][5]) + (v1[7 + dvp] * d16[i][6])\r
+ + (v1[6 + dvp] * d16[i][7]) + (v1[5 + dvp] * d16[i][8]) + (v1[4 + dvp] * d16[i][9])\r
+ + (v1[3 + dvp] * d16[i][10]) + (v1[2 + dvp] * d16[i][11])\r
+ + (v1[1 + dvp] * d16[i][12]) + (v1[0 + dvp] * d16[i][13])\r
+ + (v1[15 + dvp] * d16[i][14]) + (v1[14 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[13 + dvp] * d16[i][0]) + (v2[12 + dvp] * d16[i][1])\r
+ + (v2[11 + dvp] * d16[i][2]) + (v2[10 + dvp] * d16[i][3])\r
+ + (v2[9 + dvp] * d16[i][4]) + (v2[8 + dvp] * d16[i][5]) + (v2[7 + dvp] * d16[i][6])\r
+ + (v2[6 + dvp] * d16[i][7]) + (v2[5 + dvp] * d16[i][8]) + (v2[4 + dvp] * d16[i][9])\r
+ + (v2[3 + dvp] * d16[i][10]) + (v2[2 + dvp] * d16[i][11])\r
+ + (v2[1 + dvp] * d16[i][12]) + (v2[0 + dvp] * d16[i][13])\r
+ + (v2[15 + dvp] * d16[i][14]) + (v2[14 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- pcm_sample =\r
- (float) (((vp[14 + dvp] * dp[0]) + (vp[13 + dvp] * dp[1]) + (vp[12 + dvp] * dp[2])\r
- + (vp[11 + dvp] * dp[3]) + (vp[10 + dvp] * dp[4]) + (vp[9 + dvp] * dp[5])\r
- + (vp[8 + dvp] * dp[6]) + (vp[7 + dvp] * dp[7]) + (vp[6 + dvp] * dp[8])\r
- + (vp[5 + dvp] * dp[9]) + (vp[4 + dvp] * dp[10]) + (vp[3 + dvp] * dp[11])\r
- + (vp[2 + dvp] * dp[12]) + (vp[1 + dvp] * dp[13]) + (vp[0 + dvp] * dp[14]) + (vp[15 + dvp] * dp[15])) * scalefactor);\r
+ }\r
\r
- tmpOut[i] = pcm_sample;\r
+ private void compute_pcm_samples14() {\r
+\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v1[14 + dvp] * d16[i][0]) + (v1[13 + dvp] * d16[i][1])\r
+ + (v1[12 + dvp] * d16[i][2]) + (v1[11 + dvp] * d16[i][3])\r
+ + (v1[10 + dvp] * d16[i][4]) + (v1[9 + dvp] * d16[i][5])\r
+ + (v1[8 + dvp] * d16[i][6]) + (v1[7 + dvp] * d16[i][7]) + (v1[6 + dvp] * d16[i][8])\r
+ + (v1[5 + dvp] * d16[i][9]) + (v1[4 + dvp] * d16[i][10])\r
+ + (v1[3 + dvp] * d16[i][11]) + (v1[2 + dvp] * d16[i][12])\r
+ + (v1[1 + dvp] * d16[i][13]) + (v1[0 + dvp] * d16[i][14]) + (v1[15 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ // final float[] dp = d16[i];\r
+ float pcm_sample;\r
+\r
+ pcm_sample =\r
+ (float) (((v2[14 + dvp] * d16[i][0]) + (v2[13 + dvp] * d16[i][1])\r
+ + (v2[12 + dvp] * d16[i][2]) + (v2[11 + dvp] * d16[i][3])\r
+ + (v2[10 + dvp] * d16[i][4]) + (v2[9 + dvp] * d16[i][5])\r
+ + (v2[8 + dvp] * d16[i][6]) + (v2[7 + dvp] * d16[i][7]) + (v2[6 + dvp] * d16[i][8])\r
+ + (v2[5 + dvp] * d16[i][9]) + (v2[4 + dvp] * d16[i][10])\r
+ + (v2[3 + dvp] * d16[i][11]) + (v2[2 + dvp] * d16[i][12])\r
+ + (v2[1 + dvp] * d16[i][13]) + (v2[0 + dvp] * d16[i][14]) + (v2[15 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+\r
+ dvp += 16;\r
+ } // for\r
+ }\r
\r
- dvp += 16;\r
- } // for\r
}\r
\r
- private void compute_pcm_samples15(Obuffer buffer) {\r
- final float[] vp = actual_v;\r
-\r
- // int inc = v_inc;\r
- final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
-\r
- // fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- float pcm_sample;\r
- final float dp[] = d16[i];\r
- pcm_sample =\r
- (float) (((vp[15 + dvp] * dp[0]) + (vp[14 + dvp] * dp[1]) + (vp[13 + dvp] * dp[2])\r
- + (vp[12 + dvp] * dp[3]) + (vp[11 + dvp] * dp[4]) + (vp[10 + dvp] * dp[5])\r
- + (vp[9 + dvp] * dp[6]) + (vp[8 + dvp] * dp[7]) + (vp[7 + dvp] * dp[8])\r
- + (vp[6 + dvp] * dp[9]) + (vp[5 + dvp] * dp[10]) + (vp[4 + dvp] * dp[11])\r
- + (vp[3 + dvp] * dp[12]) + (vp[2 + dvp] * dp[13]) + (vp[1 + dvp] * dp[14]) + (vp[0 + dvp] * dp[15])) * scalefactor);\r
-\r
- tmpOut[i] = pcm_sample;\r
- dvp += 16;\r
- } // for\r
+ private void compute_pcm_samples15() {\r
+ if (vidx == 1) {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ 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
+ + (v1[13 + dvp] * d16[i][2]) + (v1[12 + dvp] * d16[i][3])\r
+ + (v1[11 + dvp] * d16[i][4]) + (v1[10 + dvp] * d16[i][5])\r
+ + (v1[9 + dvp] * d16[i][6]) + (v1[8 + dvp] * d16[i][7]) + (v1[7 + dvp] * d16[i][8])\r
+ + (v1[6 + dvp] * d16[i][9]) + (v1[5 + dvp] * d16[i][10])\r
+ + (v1[4 + dvp] * d16[i][11]) + (v1[3 + dvp] * d16[i][12])\r
+ + (v1[2 + dvp] * d16[i][13]) + (v1[1 + dvp] * d16[i][14]) + (v1[0 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+ dvp += 16;\r
+ } // for\r
+ } else {\r
+ // final float[] vp = actual_v;\r
+\r
+ // int inc = v_inc;\r
+ // final float[] tmpOut = _tmpOut;\r
+ int dvp = 0;\r
+\r
+ // fat chance of having this loop unroll\r
+ for (int i = 0; i < 32; i++) {\r
+ 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
+ + (v2[13 + dvp] * d16[i][2]) + (v2[12 + dvp] * d16[i][3])\r
+ + (v2[11 + dvp] * d16[i][4]) + (v2[10 + dvp] * d16[i][5])\r
+ + (v2[9 + dvp] * d16[i][6]) + (v2[8 + dvp] * d16[i][7]) + (v2[7 + dvp] * d16[i][8])\r
+ + (v2[6 + dvp] * d16[i][9]) + (v2[5 + dvp] * d16[i][10])\r
+ + (v2[4 + dvp] * d16[i][11]) + (v2[3 + dvp] * d16[i][12])\r
+ + (v2[2 + dvp] * d16[i][13]) + (v2[1 + dvp] * d16[i][14]) + (v2[0 + dvp] * d16[i][15])) * scalefactor);\r
+\r
+ _tmpOut[i] = pcm_sample;\r
+ dvp += 16;\r
+ } // for\r
+ }\r
+\r
}\r
\r
- private void compute_pcm_samples(Obuffer buffer) {\r
+ private void compute_pcm_samples() {\r
\r
switch (actual_write_pos) {\r
case 0:\r
- compute_pcm_samples0(buffer);\r
+ compute_pcm_samples0();\r
break;\r
case 1:\r
- compute_pcm_samples1(buffer);\r
+ compute_pcm_samples1();\r
break;\r
case 2:\r
- compute_pcm_samples2(buffer);\r
+ compute_pcm_samples2();\r
break;\r
case 3:\r
- compute_pcm_samples3(buffer);\r
+ compute_pcm_samples3();\r
break;\r
case 4:\r
- compute_pcm_samples4(buffer);\r
+ compute_pcm_samples4();\r
break;\r
case 5:\r
- compute_pcm_samples5(buffer);\r
+ compute_pcm_samples5();\r
break;\r
case 6:\r
- compute_pcm_samples6(buffer);\r
+ compute_pcm_samples6();\r
break;\r
case 7:\r
- compute_pcm_samples7(buffer);\r
+ compute_pcm_samples7();\r
break;\r
case 8:\r
- compute_pcm_samples8(buffer);\r
+ compute_pcm_samples8();\r
break;\r
case 9:\r
- compute_pcm_samples9(buffer);\r
+ compute_pcm_samples9();\r
break;\r
case 10:\r
- compute_pcm_samples10(buffer);\r
+ compute_pcm_samples10();\r
break;\r
case 11:\r
- compute_pcm_samples11(buffer);\r
+ compute_pcm_samples11();\r
break;\r
case 12:\r
- compute_pcm_samples12(buffer);\r
+ compute_pcm_samples12();\r
break;\r
case 13:\r
- compute_pcm_samples13(buffer);\r
+ compute_pcm_samples13();\r
break;\r
case 14:\r
- compute_pcm_samples14(buffer);\r
+ compute_pcm_samples14();\r
break;\r
case 15:\r
- compute_pcm_samples15(buffer);\r
+ compute_pcm_samples15();\r
break;\r
}\r
\r
- if (buffer != null) {\r
- buffer.appendSamples(channel, _tmpOut);\r
- }\r
+ // if (buffer != null) {\r
+ // buffer.appendSamples(channel, _tmpOut);\r
+ // }\r
+ SampleBufferWrapper.getOutput().appendSamples(channel, _tmpOut);\r
\r
/*\r
* // MDM: I was considering putting in quality control for // low-spec\r
* Calculate 32 PCM samples and put the into the Obuffer-object.\r
*/\r
\r
- public void calculate_pcm_samples(Obuffer buffer) {\r
- compute_new_v();\r
- compute_pcm_samples(buffer);\r
+ public void calculate_pcm_samples() {\r
+\r
+ if (vidx == 1) {\r
+ compute_new_v1_v2();\r
+ } else {\r
+ compute_new_v2_v1();\r
+ }\r
+\r
+ // System.out.println("1.actual_v=" + (actual_v == v1) + " vidx=" + vidx);\r
+ // compute_new_v();\r
+ // System.out.println("2.actual_v=" + (actual_v == v1) + " vidx=" + vidx);\r
+ compute_pcm_samples();\r
+ // System.out.println("3.actual_v=" + (actual_v == v1) + " vidx=" + vidx);\r
\r
actual_write_pos = (actual_write_pos + 1) & 0xf;\r
- actual_v = (actual_v == v1) ? v2 : v1;\r
+ // actual_v = (actual_v == v1) ? v2 : v1;\r
+\r
+ if (vidx == 1) {\r
+ vidx = 2;\r
+ } else {\r
+ vidx = 1;\r
+ }\r
\r
// initialize samples[]:\r
// for (register float *floatp = samples + 32; floatp > samples; )\r