public static void HighbdIht16x16256Add(ReadOnlySpan <int> input, Span <ushort> dest, int stride, int txType, int bd) { int i, j; Span <int> output = stackalloc int[16 * 16]; Span <int> outptr = output; Span <int> tempIn = stackalloc int[16]; Span <int> tempOut = stackalloc int[16]; HighbdTransform2D ht = HighIht16[txType]; // Rows for (i = 0; i < 16; ++i) { ht.Rows(input, outptr, bd); input = input.Slice(16); outptr = output.Slice(16); } // Columns for (i = 0; i < 16; ++i) { for (j = 0; j < 16; ++j) { tempIn[j] = output[j * 16 + i]; } ht.Cols(tempIn, tempOut, bd); for (j = 0; j < 16; ++j) { dest[j * stride + i] = HighbdClipPixelAdd(dest[j * stride + i], BitUtils.RoundPowerOfTwo(tempOut[j], 6), bd); } } }
public static void HighbdIht8x864Add(ReadOnlySpan <int> input, Span <ushort> dest, int stride, int txType, int bd) { int i, j; Span <int> output = stackalloc int[8 * 8]; Span <int> outptr = output; Span <int> tempIn = stackalloc int[8]; Span <int> tempOut = stackalloc int[8]; HighbdTransform2D ht = HighIht8[txType]; // Inverse transform row vectors. for (i = 0; i < 8; ++i) { ht.Rows(input, outptr, bd); input = input.Slice(8); outptr = output.Slice(8); } // Inverse transform column vectors. for (i = 0; i < 8; ++i) { for (j = 0; j < 8; ++j) { tempIn[j] = output[j * 8 + i]; } ht.Cols(tempIn, tempOut, bd); for (j = 0; j < 8; ++j) { dest[j * stride + i] = HighbdClipPixelAdd(dest[j * stride + i], BitUtils.RoundPowerOfTwo(tempOut[j], 5), bd); } } }