Beispiel #1
0
 public static void SplitOddEven(Span <int> source, out Span <int> even, out Span <int> odd)
 {
     if ((source.Length & 1) == 1)
     {
         throw new ArgumentException($"The {nameof(source)}'s length must be even!");
     }
     source.ArrangeOddEven(out even, out odd);
 }
 public static void CDF53MultiLevel(Span <Int24> span)
 {
     if (!span.Length.IsPowerOfTwo())
     {
         throw new ArgumentException("The length of span must be power of 2!", nameof(span));
     }
     span.ArrangeOddEven(out Span <Int24> even, out Span <Int24> odd);
     do
     {
         CDF53Internal(even, odd);
         even.ArrangeOddEven(out var newEven, out odd);
         even = newEven;
     } while (even.Length > 1);
     CDF53Internal(even, odd);                   //Last Loop is equivalent to Haar transform
 }
 public static void HaarMultiLevel(Span <Int24> span)
 {
     if (!span.Length.IsPowerOfTwo())
     {
         throw new ArgumentException("The length of span must be power of 2!", nameof(span));
     }
     span.ArrangeOddEven(out Span <Int24> even, out Span <Int24> odd);
     do
     {
         HaarInternal(even, odd);
         even.ArrangeOddEven(out var newEven, out odd);
         even = newEven;
     } while (even.Length > 1);
     HaarInternal(even, odd);
 }