Esempio n. 1
0
            public void IDCT2D8x4_RightPart()
            {
                float[] sourceArray       = Create8x8FloatData();
                var     expectedDestArray = new float[64];

                ReferenceImplementations.LLM_FloatingPoint_DCT.IDCT2D8x4_32f(sourceArray.AsSpan(4), expectedDestArray.AsSpan(4));

                var source = default(Block8x8F);

                source.LoadFrom(sourceArray);

                var dest = default(Block8x8F);

                FastFloatingPointDCT.IDCT8x4_RightPart(ref source, ref dest);

                var actualDestArray = new float[64];

                dest.CopyTo(actualDestArray);

                this.Print8x8Data(expectedDestArray);
                this.Output.WriteLine("**************");
                this.Print8x8Data(actualDestArray);

                Assert.Equal(expectedDestArray, actualDestArray);
            }
Esempio n. 2
0
            public void IDCT8x4_RightPart(int seed)
            {
                Span <float> src      = Create8x8RoundedRandomFloatData(-200, 200, seed);
                var          srcBlock = default(Block8x8F);

                srcBlock.LoadFrom(src);

                var destBlock = default(Block8x8F);

                var expectedDest = new float[64];

                // reference
                ReferenceImplementations.LLM_FloatingPoint_DCT.IDCT2D8x4_32f(src.Slice(4), expectedDest.AsSpan(4));

                // testee
                FastFloatingPointDCT.IDCT8x4_RightPart(ref srcBlock, ref destBlock);

                var actualDest = new float[64];

                destBlock.ScaledCopyTo(actualDest);

                Assert.Equal(actualDest, expectedDest, new ApproximateFloatComparer(1f));
            }
Esempio n. 3
0
            public void iDCT2D8x4_RightPart()
            {
                float[] sourceArray       = JpegFixture.Create8x8FloatData();
                float[] expectedDestArray = new float[64];

                ReferenceImplementations.LLM_FloatingPoint_DCT.iDCT2D8x4_32f(sourceArray.AsSpan().Slice(4), expectedDestArray.AsSpan().Slice(4));

                Block8x8F source = new Block8x8F();

                source.LoadFrom(sourceArray);

                Block8x8F dest = new Block8x8F();

                FastFloatingPointDCT.IDCT8x4_RightPart(ref source, ref dest);

                float[] actualDestArray = new float[64];
                dest.CopyTo(actualDestArray);

                this.Print8x8Data(expectedDestArray);
                this.Output.WriteLine("**************");
                this.Print8x8Data(actualDestArray);

                Assert.Equal(expectedDestArray, actualDestArray);
            }