|
|
|
@ -8,7 +8,7 @@ internal class Av1InverseTransformer |
|
|
|
/// <summary>
|
|
|
|
/// SVT: svt_aom_inv_transform_recon8bit
|
|
|
|
/// </summary>
|
|
|
|
public static void Reconstruct8Bit(Span<int> coefficientsBuffer, Span<byte> reconstructionBufferRead, int reconstructionReadStride, Span<byte> reconstructionBufferWrite, int reconstructionWriteStride, Av1TransformSize transformSize, Av1TransformType transformType, int plane, int numberOfCoefficients, bool isLossless) |
|
|
|
public static void Reconstruct8Bit(Span<int> coefficientsBuffer, Span<byte> reconstructionBuffer, int reconstructionStride, Av1TransformSize transformSize, Av1TransformType transformType, int plane, int numberOfCoefficients, bool isLossless) |
|
|
|
{ |
|
|
|
Av1TransformFunctionParameters transformFunctionParameters = new() |
|
|
|
{ |
|
|
|
@ -20,33 +20,31 @@ internal class Av1InverseTransformer |
|
|
|
Is16BitPipeline = false |
|
|
|
}; |
|
|
|
|
|
|
|
if (reconstructionBufferRead != reconstructionBufferWrite) |
|
|
|
{ |
|
|
|
/* When output pointers to read and write are differents, |
|
|
|
* then kernel copy also all buffer from read to write, |
|
|
|
* and cannot be limited by End Of Buffer calculations. */ |
|
|
|
transformFunctionParameters.EndOfBuffer = GetMaxEndOfBuffer(transformSize); |
|
|
|
} |
|
|
|
|
|
|
|
Av1InverseTransformerFactory.InverseTransformAdd( |
|
|
|
coefficientsBuffer, reconstructionBufferRead, reconstructionReadStride, reconstructionBufferWrite, reconstructionWriteStride, transformFunctionParameters); |
|
|
|
coefficientsBuffer, reconstructionBuffer, reconstructionStride, reconstructionBuffer, reconstructionStride, transformFunctionParameters); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// SVT: av1_get_max_eob
|
|
|
|
/// SVT: svt_aom_inv_transform_recon8bit
|
|
|
|
/// </summary>
|
|
|
|
private static int GetMaxEndOfBuffer(Av1TransformSize transformSize) |
|
|
|
public static void Reconstruct8Bit(Span<int> coefficientsBuffer, Span<byte> reconstructionBufferRead, int reconstructionReadStride, Span<byte> reconstructionBufferWrite, int reconstructionWriteStride, Av1TransformSize transformSize, Av1TransformType transformType, int plane, int numberOfCoefficients, bool isLossless) |
|
|
|
{ |
|
|
|
if (transformSize is Av1TransformSize.Size64x64 or Av1TransformSize.Size64x32 or Av1TransformSize.Size32x64) |
|
|
|
Av1TransformFunctionParameters transformFunctionParameters = new() |
|
|
|
{ |
|
|
|
return 1024; |
|
|
|
} |
|
|
|
TransformType = transformType, |
|
|
|
TransformSize = transformSize, |
|
|
|
EndOfBuffer = numberOfCoefficients, |
|
|
|
IsLossless = isLossless, |
|
|
|
BitDepth = 8, |
|
|
|
Is16BitPipeline = false |
|
|
|
}; |
|
|
|
|
|
|
|
if (transformSize is Av1TransformSize.Size16x64 or Av1TransformSize.Size64x16) |
|
|
|
{ |
|
|
|
return 512; |
|
|
|
} |
|
|
|
/* When output pointers to read and write are differents, |
|
|
|
* then kernel copy also all buffer from read to write, |
|
|
|
* and cannot be limited by End Of Buffer calculations. */ |
|
|
|
transformFunctionParameters.EndOfBuffer = Av1InverseTransformMath.GetMaxEndOfBuffer(transformSize); |
|
|
|
|
|
|
|
return transformSize.GetSize2d(); |
|
|
|
Av1InverseTransformerFactory.InverseTransformAdd( |
|
|
|
coefficientsBuffer, reconstructionBufferRead, reconstructionReadStride, reconstructionBufferWrite, reconstructionWriteStride, transformFunctionParameters); |
|
|
|
} |
|
|
|
} |
|
|
|
|