示例#1
0
        public static void TransformFDCT(
            ref JpegBlock8x8F src,
            ref JpegBlock8x8F dest,
            ref JpegBlock8x8F temp)
        {
            src.TransposeInto(ref temp);

            FDCT8x4_LeftPart(ref temp, ref dest);
            FDCT8x4_RightPart(ref temp, ref dest);

            dest.TransposeInto(ref temp);

            FDCT8x4_LeftPart(ref temp, ref dest);
            FDCT8x4_RightPart(ref temp, ref dest);

            dest.MultiplyInplace(C_0_125);
        }
示例#2
0
        public static void TransformIDCT(ref JpegBlock8x8F src, ref JpegBlock8x8F dest, ref JpegBlock8x8F temp)
        {
            // TODO: Transpose is a bottleneck now. We need full AVX support to optimize it:
            // https://github.com/dotnet/corefx/issues/22940
            src.TransposeInto(ref temp);

            IDCT8x4_LeftPart(ref temp, ref dest);
            IDCT8x4_RightPart(ref temp, ref dest);

            dest.TransposeInto(ref temp);

            IDCT8x4_LeftPart(ref temp, ref dest);
            IDCT8x4_RightPart(ref temp, ref dest);

            // TODO: What if we leave the blocks in a scaled-by-x8 state until final color packing?
            dest.MultiplyInplace(C_0_125);
        }
示例#3
0
        public static void TransformFDCT(
            ref JpegBlock8x8F src,
            ref JpegBlock8x8F dest,
            ref JpegBlock8x8F temp,
            bool offsetSourceByNeg128)
        {
            src.TransposeInto(ref temp);
            if (offsetSourceByNeg128)
            {
                temp.AddToAllInplace(new Vector4(-128));
            }

            FDCT8x4_LeftPart(ref temp, ref dest);
            FDCT8x4_RightPart(ref temp, ref dest);

            dest.TransposeInto(ref temp);

            FDCT8x4_LeftPart(ref temp, ref dest);
            FDCT8x4_RightPart(ref temp, ref dest);

            dest.MultiplyInplace(C_0_125);
        }