/**
  *
  */
 public bool put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2)
 {
     if (allocation != 0)
     {
         sample = sample * factor + offset;          // requantization
         if (channels == (int)OutputChannels.Both)
         {
             float sample1 = sample * scalefactor,
                   sample2 = sample * channel2_scalefactor;
             filter1.input_sample(sample1, subbandnumber);
             filter2.input_sample(sample2, subbandnumber);
         }
         else if (channels == (int)OutputChannels.Left)
         {
             float sample1 = sample * scalefactor;
             filter1.input_sample(sample1, subbandnumber);
         }
         else
         {
             float sample2 = sample * channel2_scalefactor;
             filter1.input_sample(sample2, subbandnumber);
         }
     }
     return(true);
 }
        /// <summary>
        ///     *
        /// </summary>
        public override bool put_next_sample(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.input_sample(sample, subbandnumber);
                    filter2.input_sample(sample2, subbandnumber);
                }
                else if (channels == OutputChannels.LEFT_CHANNEL)
                {
                    if (groupnumber <= 4)
                        sample *= scalefactor1;
                    else if (groupnumber <= 8)
                        sample *= scalefactor2;
                    else
                        sample *= scalefactor3;
                    filter1.input_sample(sample, subbandnumber);
                }
                else
                {
                    if (groupnumber <= 4)
                        sample *= channel2_scalefactor1;
                    else if (groupnumber <= 8)
                        sample *= channel2_scalefactor2;
                    else
                        sample *= channel2_scalefactor3;
                    filter1.input_sample(sample, subbandnumber);
                }
            }

            if (++samplenumber == 3)
                return true;
            return false;
        }
Example #3
0
 /// <summary>
 ///     *
 /// </summary>
 public override bool put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2)
 {
     if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL))
     {
         float scaled_sample = (sample * factor + offset) * scalefactor;
         filter1.input_sample(scaled_sample, subbandnumber);
     }
     return true;
 }
 /**
  *
  */
 public override bool put_next_sample(OutputChannels channels, SynthesisFilter filter1, SynthesisFilter filter2)
 {
     if ((allocation != 0) && (channels != OutputChannels.Right))
     {
         float scaled_sample = (sample * factor + offset) * scalefactor;
         filter1.input_sample(scaled_sample, subbandnumber);
     }
     return(true);
 }
Example #5
0
        /// <summary>
        ///     *
        /// </summary>
        public override bool put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2)
        {
            if (allocation != 0 && channels != OutputChannels.RIGHT_CHANNEL)
            {
                float scaled_sample = (sample * factor + offset) * scalefactor;
                filter1.input_sample(scaled_sample, subbandnumber);
            }

            return(true);
        }
Example #6
0
 /// <summary>
 ///     *
 /// </summary>
 public override bool put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2)
 {
     base.put_next_sample(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.input_sample(sample2, subbandnumber);
         else
             filter1.input_sample(sample2, subbandnumber);
     }
     return true;
 }
 /// <summary>
 ///     *
 /// </summary>
 public override bool put_next_sample(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.input_sample(sample1, subbandnumber);
             filter2.input_sample(sample2, subbandnumber);
         }
         else if (channels == OutputChannels.LEFT_CHANNEL)
         {
             float sample1 = sample * scalefactor;
             filter1.input_sample(sample1, subbandnumber);
         }
         else
         {
             float sample2 = sample * channel2_scalefactor;
             filter1.input_sample(sample2, subbandnumber);
         }
     }
     return true;
 }
Example #8
0
 /// <summary>
 ///     *
 /// </summary>
 public override bool put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2)
 {
     base.put_next_sample(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.input_sample(sample2, subbandnumber);
         }
         else
         {
             filter1.input_sample(sample2, subbandnumber);
         }
     }
     return(true);
 }
        /// <summary>
        ///     *
        /// </summary>
        public override bool put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2)
        {
            bool returnvalue = base.put_next_sample(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.input_sample(sample, subbandnumber);
                }
                else
                {
                    filter1.input_sample(sample, subbandnumber);
                }
            }

            return(returnvalue);
        }
Example #10
0
        /// <summary>
        ///     *
        /// </summary>
        public override bool put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2)
        {
            bool returnvalue = base.put_next_sample(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.input_sample(sample, subbandnumber);
                else
                    filter1.input_sample(sample, subbandnumber);
            }
            return returnvalue;
        }
Example #11
0
        /// <summary>
        ///     *
        /// </summary>
        public override bool put_next_sample(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.input_sample(sample, subbandnumber);
                    filter2.input_sample(sample2, subbandnumber);
                }
                else if (channels == OutputChannels.LEFT_CHANNEL)
                {
                    if (groupnumber <= 4)
                    {
                        sample *= scalefactor1;
                    }
                    else if (groupnumber <= 8)
                    {
                        sample *= scalefactor2;
                    }
                    else
                    {
                        sample *= scalefactor3;
                    }

                    filter1.input_sample(sample, subbandnumber);
                }
                else
                {
                    if (groupnumber <= 4)
                    {
                        sample *= channel2_scalefactor1;
                    }
                    else if (groupnumber <= 8)
                    {
                        sample *= channel2_scalefactor2;
                    }
                    else
                    {
                        sample *= channel2_scalefactor3;
                    }

                    filter1.input_sample(sample, subbandnumber);
                }
            }

            if (++samplenumber == 3)
            {
                return(true);
            }

            return(false);
        }
Example #12
0
        /// <summary>
        ///     *
        /// </summary>
        public override bool put_next_sample(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.input_sample(sample, subbandnumber);
            }

            if (++samplenumber == 3)
                return true;
            return false;
        }