/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) { float scaled_sample = (sample * factor + offset) * scalefactor; filter1.WriteSample(scaled_sample, subbandnumber); } return(true); }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if (allocation != 0) { sample = sample * factor + offset; // requantization if (channels == OutputChannels.BOTH_CHANNELS) { float sample1 = sample * scalefactor, sample2 = sample * channel2_scalefactor; filter1.WriteSample(sample1, subbandnumber); filter2.WriteSample(sample2, subbandnumber); } else if (channels == OutputChannels.LEFT_CHANNEL) { float sample1 = sample * scalefactor; filter1.WriteSample(sample1, subbandnumber); } else { float sample2 = sample * channel2_scalefactor; filter1.WriteSample(sample2, subbandnumber); } } return true; }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if (allocation != 0) { sample = sample * factor + offset; // requantization if (channels == OutputChannels.BOTH_CHANNELS) { float sample1 = sample * scalefactor, sample2 = sample * channel2_scalefactor; filter1.WriteSample(sample1, subbandnumber); filter2.WriteSample(sample2, subbandnumber); } else if (channels == OutputChannels.LEFT_CHANNEL) { var sample1 = sample * scalefactor; filter1.WriteSample(sample1, subbandnumber); } else { var sample2 = sample * channel2_scalefactor; filter1.WriteSample(sample2, subbandnumber); } } return(true); }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { base.PutNextSample(channels, filter1, filter2); if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) { float sample2 = (channel2_sample * channel2_factor + channel2_offset) * channel2_scalefactor; if (channels == OutputChannels.BOTH_CHANNELS) { filter2.WriteSample(sample2, subbandnumber); } else { filter1.WriteSample(sample2, subbandnumber); } } return(true); }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { bool returnvalue = base.PutNextSample(channels, filter1, filter2); if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) { float sample = channel2_samples[samplenumber - 1]; if (groupingtable[1] == null) { sample = (sample + channel2_d[0]) * channel2_c[0]; } if (groupnumber <= 4) { sample *= channel2_scalefactor1; } else if (groupnumber <= 8) { sample *= channel2_scalefactor2; } else { sample *= channel2_scalefactor3; } if (channels == OutputChannels.BOTH_CHANNELS) { filter2.WriteSample(sample, subbandnumber); } else { filter1.WriteSample(sample, subbandnumber); } } return(returnvalue); }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) { float sample = samples[samplenumber]; if (groupingtable[0] == null) sample = (sample + d[0]) * c[0]; if (groupnumber <= 4) sample *= scalefactor1; else if (groupnumber <= 8) sample *= scalefactor2; else sample *= scalefactor3; filter1.WriteSample(sample, subbandnumber); } if (++samplenumber == 3) return true; return false; }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if (allocation != 0) { float sample = samples[samplenumber]; if (groupingtable[0] == null) sample = (sample + d[0]) * c[0]; if (channels == OutputChannels.BOTH_CHANNELS) { float sample2 = sample; if (groupnumber <= 4) { sample *= scalefactor1; sample2 *= channel2_scalefactor1; } else if (groupnumber <= 8) { sample *= scalefactor2; sample2 *= channel2_scalefactor2; } else { sample *= scalefactor3; sample2 *= channel2_scalefactor3; } filter1.WriteSample(sample, subbandnumber); filter2.WriteSample(sample2, subbandnumber); } else if (channels == OutputChannels.LEFT_CHANNEL) { if (groupnumber <= 4) sample *= scalefactor1; else if (groupnumber <= 8) sample *= scalefactor2; else sample *= scalefactor3; filter1.WriteSample(sample, subbandnumber); } else { if (groupnumber <= 4) sample *= channel2_scalefactor1; else if (groupnumber <= 8) sample *= channel2_scalefactor2; else sample *= channel2_scalefactor3; filter1.WriteSample(sample, subbandnumber); } } if (++samplenumber == 3) return true; return false; }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if (allocation != 0) { float sample = samples[samplenumber]; if (groupingtable[0] == null) { sample = (sample + d[0]) * c[0]; } if (channels == OutputChannels.BOTH_CHANNELS) { float sample2 = sample; if (groupnumber <= 4) { sample *= scalefactor1; sample2 *= channel2_scalefactor1; } else if (groupnumber <= 8) { sample *= scalefactor2; sample2 *= channel2_scalefactor2; } else { sample *= scalefactor3; sample2 *= channel2_scalefactor3; } filter1.WriteSample(sample, subbandnumber); filter2.WriteSample(sample2, subbandnumber); } else if (channels == OutputChannels.LEFT_CHANNEL) { if (groupnumber <= 4) { sample *= scalefactor1; } else if (groupnumber <= 8) { sample *= scalefactor2; } else { sample *= scalefactor3; } filter1.WriteSample(sample, subbandnumber); } else { if (groupnumber <= 4) { sample *= channel2_scalefactor1; } else if (groupnumber <= 8) { sample *= channel2_scalefactor2; } else { sample *= channel2_scalefactor3; } filter1.WriteSample(sample, subbandnumber); } } if (++samplenumber == 3) { return(true); } return(false); }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { bool returnvalue = base.PutNextSample(channels, filter1, filter2); if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) { float sample = channel2_samples[samplenumber - 1]; if (groupingtable[1] == null) sample = (sample + channel2_d[0]) * channel2_c[0]; if (groupnumber <= 4) sample *= channel2_scalefactor1; else if (groupnumber <= 8) sample *= channel2_scalefactor2; else sample *= channel2_scalefactor3; if (channels == OutputChannels.BOTH_CHANNELS) filter2.WriteSample(sample, subbandnumber); else filter1.WriteSample(sample, subbandnumber); } return returnvalue; }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { base.PutNextSample(channels, filter1, filter2); if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) { float sample2 = (channel2_sample * channel2_factor + channel2_offset) * channel2_scalefactor; if (channels == OutputChannels.BOTH_CHANNELS) filter2.WriteSample(sample2, subbandnumber); else filter1.WriteSample(sample2, subbandnumber); } return true; }
/// <summary> /// * /// </summary> public override bool PutNextSample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) { float scaled_sample = (sample * factor + offset) * scalefactor; filter1.WriteSample(scaled_sample, subbandnumber); } return true; }