@ -18,12 +18,22 @@ internal static class Av1ScanOrderConstants
/// </summary>
public const int QuantizationMatrixLevelCount = 1 < < QuantizationMatrixLevelBitCount ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 4x4 transform.
/// </summary>
private static readonly short [ ] DefaultScan4x4 = [ 0 , 1 , 4 , 8 , 5 , 2 , 3 , 6 , 9 , 1 2 , 1 3 , 1 0 , 7 , 1 1 , 1 4 , 1 5 ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for an 8x8 transform.
/// </summary>
private static readonly short [ ] DefaultScan8x8 = [
0 , 1 , 8 , 1 6 , 9 , 2 , 3 , 1 0 , 1 7 , 2 4 , 3 2 , 2 5 , 1 8 , 1 1 , 4 , 5 , 1 2 , 1 9 , 2 6 , 3 3 , 4 0 , 4 8 ,
4 1 , 3 4 , 2 7 , 2 0 , 1 3 , 6 , 7 , 1 4 , 2 1 , 2 8 , 3 5 , 4 2 , 4 9 , 5 6 , 5 7 , 5 0 , 4 3 , 3 6 , 2 9 , 2 2 , 1 5 , 2 3 ,
3 0 , 3 7 , 4 4 , 5 1 , 5 8 , 5 9 , 5 2 , 4 5 , 3 8 , 3 1 , 3 9 , 4 6 , 5 3 , 6 0 , 6 1 , 5 4 , 4 7 , 5 5 , 6 2 , 6 3 ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 16x16 transform.
/// </summary>
private static readonly short [ ] DefaultScan16x16 = [
0 , 1 , 1 6 , 3 2 , 1 7 , 2 , 3 , 1 8 , 3 3 , 4 8 , 6 4 , 4 9 , 3 4 , 1 9 , 4 , 5 , 2 0 , 3 5 , 5 0 , 6 5 , 8 0 , 9 6 ,
8 1 , 6 6 , 5 1 , 3 6 , 2 1 , 6 , 7 , 2 2 , 3 7 , 5 2 , 6 7 , 8 2 , 9 7 , 1 1 2 , 1 2 8 , 1 1 3 , 9 8 , 8 3 , 6 8 , 5 3 , 3 8 , 2 3 ,
@ -38,6 +48,9 @@ internal static class Av1ScanOrderConstants
1 4 3 , 1 5 8 , 1 7 3 , 1 8 8 , 2 0 3 , 2 1 8 , 2 3 3 , 2 4 8 , 2 4 9 , 2 3 4 , 2 1 9 , 2 0 4 , 1 8 9 , 1 7 4 , 1 5 9 , 1 7 5 , 1 9 0 , 2 0 5 , 2 2 0 , 2 3 5 , 2 5 0 , 2 5 1 ,
2 3 6 , 2 2 1 , 2 0 6 , 1 9 1 , 2 0 7 , 2 2 2 , 2 3 7 , 2 5 2 , 2 5 3 , 2 3 8 , 2 2 3 , 2 3 9 , 2 5 4 , 2 5 5 ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 32x32 transform.
/// </summary>
private static readonly short [ ] DefaultScan32x32 = [
0 , 1 , 3 2 , 6 4 , 3 3 , 2 , 3 , 3 4 , 6 5 , 9 6 , 1 2 8 , 9 7 , 6 6 , 3 5 , 4 , 5 , 3 6 , 6 7 , 9 8 , 1 2 9 , 1 6 0 ,
1 9 2 , 1 6 1 , 1 3 0 , 9 9 , 6 8 , 3 7 , 6 , 7 , 3 8 , 6 9 , 1 0 0 , 1 3 1 , 1 6 2 , 1 9 3 , 2 2 4 , 2 5 6 , 2 2 5 , 1 9 4 , 1 6 3 , 1 3 2 , 1 0 1 ,
@ -89,14 +102,23 @@ internal static class Av1ScanOrderConstants
7 6 7 , 7 9 9 , 8 3 0 , 8 6 1 , 8 9 2 , 9 2 3 , 9 5 4 , 9 8 5 , 1 0 1 6 , 1 0 1 7 , 9 8 6 , 9 5 5 , 9 2 4 , 8 9 3 , 8 6 2 , 8 3 1 , 8 6 3 , 8 9 4 , 9 2 5 , 9 5 6 , 9 8 7 ,
1 0 1 8 , 1 0 1 9 , 9 8 8 , 9 5 7 , 9 2 6 , 8 9 5 , 9 2 7 , 9 5 8 , 9 8 9 , 1 0 2 0 , 1 0 2 1 , 9 9 0 , 9 5 9 , 9 9 1 , 1 0 2 2 , 1 0 2 3 ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 4x8 transform.
/// </summary>
private static readonly short [ ] DefaultScan4x8 = [
0 , 1 , 4 , 2 , 5 , 8 , 3 , 6 , 9 , 1 2 , 7 , 1 0 , 1 3 , 1 6 , 1 1 , 1 4 ,
1 7 , 2 0 , 1 5 , 1 8 , 2 1 , 2 4 , 1 9 , 2 2 , 2 5 , 2 8 , 2 3 , 2 6 , 2 9 , 2 7 , 3 0 , 3 1 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for an 8x4 transform.
/// </summary>
private static readonly short [ ] DefaultScan8x4 = [
0 , 8 , 1 , 1 6 , 9 , 2 , 2 4 , 1 7 , 1 0 , 3 , 2 5 , 1 8 , 1 1 , 4 , 2 6 , 1 9 ,
1 2 , 5 , 2 7 , 2 0 , 1 3 , 6 , 2 8 , 2 1 , 1 4 , 7 , 2 9 , 2 2 , 1 5 , 3 0 , 2 3 , 3 1 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for an 8x16 transform.
/// </summary>
private static readonly short [ ] DefaultScan8x16 = [
0 , 1 , 8 , 2 , 9 , 1 6 , 3 , 1 0 , 1 7 , 2 4 , 4 , 1 1 , 1 8 , 2 5 , 3 2 , 5 , 1 2 , 1 9 , 2 6 , 3 3 , 4 0 , 6 ,
1 3 , 2 0 , 2 7 , 3 4 , 4 1 , 4 8 , 7 , 1 4 , 2 1 , 2 8 , 3 5 , 4 2 , 4 9 , 5 6 , 1 5 , 2 2 , 2 9 , 3 6 , 4 3 , 5 0 , 5 7 , 6 4 ,
@ -105,6 +127,9 @@ internal static class Av1ScanOrderConstants
9 1 , 9 8 , 1 0 5 , 1 1 2 , 7 1 , 7 8 , 8 5 , 9 2 , 9 9 , 1 0 6 , 1 1 3 , 1 2 0 , 7 9 , 8 6 , 9 3 , 1 0 0 , 1 0 7 , 1 1 4 , 1 2 1 , 8 7 , 9 4 , 1 0 1 ,
1 0 8 , 1 1 5 , 1 2 2 , 9 5 , 1 0 2 , 1 0 9 , 1 1 6 , 1 2 3 , 1 0 3 , 1 1 0 , 1 1 7 , 1 2 4 , 1 1 1 , 1 1 8 , 1 2 5 , 1 1 9 , 1 2 6 , 1 2 7 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 16x8 transform.
/// </summary>
private static readonly short [ ] DefaultScan16x8 = [
0 , 1 6 , 1 , 3 2 , 1 7 , 2 , 4 8 , 3 3 , 1 8 , 3 , 6 4 , 4 9 , 3 4 , 1 9 , 4 , 8 0 , 6 5 , 5 0 , 3 5 , 2 0 , 5 , 9 6 ,
8 1 , 6 6 , 5 1 , 3 6 , 2 1 , 6 , 1 1 2 , 9 7 , 8 2 , 6 7 , 5 2 , 3 7 , 2 2 , 7 , 1 1 3 , 9 8 , 8 3 , 6 8 , 5 3 , 3 8 , 2 3 , 8 ,
@ -113,6 +138,9 @@ internal static class Av1ScanOrderConstants
5 9 , 4 4 , 2 9 , 1 4 , 1 2 0 , 1 0 5 , 9 0 , 7 5 , 6 0 , 4 5 , 3 0 , 1 5 , 1 2 1 , 1 0 6 , 9 1 , 7 6 , 6 1 , 4 6 , 3 1 , 1 2 2 , 1 0 7 , 9 2 ,
7 7 , 6 2 , 4 7 , 1 2 3 , 1 0 8 , 9 3 , 7 8 , 6 3 , 1 2 4 , 1 0 9 , 9 4 , 7 9 , 1 2 5 , 1 1 0 , 9 5 , 1 2 6 , 1 1 1 , 1 2 7 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 16x32 transform.
/// </summary>
private static readonly short [ ] DefaultScan16x32 = [
0 , 1 , 1 6 , 2 , 1 7 , 3 2 , 3 , 1 8 , 3 3 , 4 8 , 4 , 1 9 , 3 4 , 4 9 , 6 4 , 5 , 2 0 , 3 5 , 5 0 , 6 5 , 8 0 , 6 , 2 1 ,
3 6 , 5 1 , 6 6 , 8 1 , 9 6 , 7 , 2 2 , 3 7 , 5 2 , 6 7 , 8 2 , 9 7 , 1 1 2 , 8 , 2 3 , 3 8 , 5 3 , 6 8 , 8 3 , 9 8 , 1 1 3 , 1 2 8 , 9 ,
@ -138,6 +166,9 @@ internal static class Av1ScanOrderConstants
5 0 4 , 4 1 5 , 4 3 0 , 4 4 5 , 4 6 0 , 4 7 5 , 4 9 0 , 5 0 5 , 4 3 1 , 4 4 6 , 4 6 1 , 4 7 6 , 4 9 1 , 5 0 6 , 4 4 7 , 4 6 2 , 4 7 7 , 4 9 2 , 5 0 7 , 4 6 3 , 4 7 8 , 4 9 3 , 5 0 8 ,
4 7 9 , 4 9 4 , 5 0 9 , 4 9 5 , 5 1 0 , 5 1 1 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 32x16 transform.
/// </summary>
private static readonly short [ ] DefaultScan32x16 = [
0 , 3 2 , 1 , 6 4 , 3 3 , 2 , 9 6 , 6 5 , 3 4 , 3 , 1 2 8 , 9 7 , 6 6 , 3 5 , 4 , 1 6 0 , 1 2 9 , 9 8 , 6 7 , 3 6 , 5 , 1 9 2 , 1 6 1 ,
1 3 0 , 9 9 , 6 8 , 3 7 , 6 , 2 2 4 , 1 9 3 , 1 6 2 , 1 3 1 , 1 0 0 , 6 9 , 3 8 , 7 , 2 5 6 , 2 2 5 , 1 9 4 , 1 6 3 , 1 3 2 , 1 0 1 , 7 0 , 3 9 , 8 , 2 8 8 ,
@ -163,16 +194,25 @@ internal static class Av1ScanOrderConstants
2 8 7 , 5 0 5 , 4 7 4 , 4 4 3 , 4 1 2 , 3 8 1 , 3 5 0 , 3 1 9 , 5 0 6 , 4 7 5 , 4 4 4 , 4 1 3 , 3 8 2 , 3 5 1 , 5 0 7 , 4 7 6 , 4 4 5 , 4 1 4 , 3 8 3 , 5 0 8 , 4 7 7 , 4 4 6 , 4 1 5 ,
5 0 9 , 4 7 8 , 4 4 7 , 5 1 0 , 4 7 9 , 5 1 1 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 4x16 transform.
/// </summary>
private static readonly short [ ] DefaultScan4x16 = [
0 , 1 , 4 , 2 , 5 , 8 , 3 , 6 , 9 , 1 2 , 7 , 1 0 , 1 3 , 1 6 , 1 1 , 1 4 , 1 7 , 2 0 , 1 5 , 1 8 , 2 1 , 2 4 ,
1 9 , 2 2 , 2 5 , 2 8 , 2 3 , 2 6 , 2 9 , 3 2 , 2 7 , 3 0 , 3 3 , 3 6 , 3 1 , 3 4 , 3 7 , 4 0 , 3 5 , 3 8 , 4 1 , 4 4 , 3 9 , 4 2 ,
4 5 , 4 8 , 4 3 , 4 6 , 4 9 , 5 2 , 4 7 , 5 0 , 5 3 , 5 6 , 5 1 , 5 4 , 5 7 , 6 0 , 5 5 , 5 8 , 6 1 , 5 9 , 6 2 , 6 3 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 16x4 transform.
/// </summary>
private static readonly short [ ] DefaultScan16x4 = [
0 , 1 6 , 1 , 3 2 , 1 7 , 2 , 4 8 , 3 3 , 1 8 , 3 , 4 9 , 3 4 , 1 9 , 4 , 5 0 , 3 5 , 2 0 , 5 , 5 1 , 3 6 , 2 1 , 6 ,
5 2 , 3 7 , 2 2 , 7 , 5 3 , 3 8 , 2 3 , 8 , 5 4 , 3 9 , 2 4 , 9 , 5 5 , 4 0 , 2 5 , 1 0 , 5 6 , 4 1 , 2 6 , 1 1 , 5 7 , 4 2 ,
2 7 , 1 2 , 5 8 , 4 3 , 2 8 , 1 3 , 5 9 , 4 4 , 2 9 , 1 4 , 6 0 , 4 5 , 3 0 , 1 5 , 6 1 , 4 6 , 3 1 , 6 2 , 4 7 , 6 3 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for an 8x32 transform.
/// </summary>
private static readonly short [ ] DefaultScan8x32 = [
0 , 1 , 8 , 2 , 9 , 1 6 , 3 , 1 0 , 1 7 , 2 4 , 4 , 1 1 , 1 8 , 2 5 , 3 2 , 5 , 1 2 , 1 9 , 2 6 , 3 3 , 4 0 , 6 ,
1 3 , 2 0 , 2 7 , 3 4 , 4 1 , 4 8 , 7 , 1 4 , 2 1 , 2 8 , 3 5 , 4 2 , 4 9 , 5 6 , 1 5 , 2 2 , 2 9 , 3 6 , 4 3 , 5 0 , 5 7 , 6 4 ,
@ -187,6 +227,9 @@ internal static class Av1ScanOrderConstants
1 9 9 , 2 0 6 , 2 1 3 , 2 2 0 , 2 2 7 , 2 3 4 , 2 4 1 , 2 4 8 , 2 0 7 , 2 1 4 , 2 2 1 , 2 2 8 , 2 3 5 , 2 4 2 , 2 4 9 , 2 1 5 , 2 2 2 , 2 2 9 , 2 3 6 , 2 4 3 , 2 5 0 , 2 2 3 ,
2 3 0 , 2 3 7 , 2 4 4 , 2 5 1 , 2 3 1 , 2 3 8 , 2 4 5 , 2 5 2 , 2 3 9 , 2 4 6 , 2 5 3 , 2 4 7 , 2 5 4 , 2 5 5 , ] ;
/// <summary>
/// Maps default scan positions to raster coefficient indices for a 32x8 transform.
/// </summary>
private static readonly short [ ] DefaultScan32x8 = [
0 , 3 2 , 1 , 6 4 , 3 3 , 2 , 9 6 , 6 5 , 3 4 , 3 , 1 2 8 , 9 7 , 6 6 , 3 5 , 4 , 1 6 0 , 1 2 9 , 9 8 , 6 7 , 3 6 , 5 , 1 9 2 ,
1 6 1 , 1 3 0 , 9 9 , 6 8 , 3 7 , 6 , 2 2 4 , 1 9 3 , 1 6 2 , 1 3 1 , 1 0 0 , 6 9 , 3 8 , 7 , 2 2 5 , 1 9 4 , 1 6 3 , 1 3 2 , 1 0 1 , 7 0 , 3 9 , 8 ,
@ -201,12 +244,22 @@ internal static class Av1ScanOrderConstants
2 4 8 , 2 1 7 , 1 8 6 , 1 5 5 , 1 2 4 , 9 3 , 6 2 , 3 1 , 2 4 9 , 2 1 8 , 1 8 7 , 1 5 6 , 1 2 5 , 9 4 , 6 3 , 2 5 0 , 2 1 9 , 1 8 8 , 1 5 7 , 1 2 6 , 9 5 , 2 5 1 ,
2 2 0 , 1 8 9 , 1 5 8 , 1 2 7 , 2 5 2 , 2 2 1 , 1 9 0 , 1 5 9 , 2 5 3 , 2 2 2 , 1 9 1 , 2 5 4 , 2 2 3 , 2 5 5 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for a 4x4 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan4x4 = [ 0 , 4 , 8 , 1 2 , 1 , 5 , 9 , 1 3 , 2 , 6 , 1 0 , 1 4 , 3 , 7 , 1 1 , 1 5 ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for an 8x8 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x8 = [
0 , 8 , 1 6 , 2 4 , 3 2 , 4 0 , 4 8 , 5 6 , 1 , 9 , 1 7 , 2 5 , 3 3 , 4 1 , 4 9 , 5 7 , 2 , 1 0 , 1 8 , 2 6 , 3 4 , 4 2 ,
5 0 , 5 8 , 3 , 1 1 , 1 9 , 2 7 , 3 5 , 4 3 , 5 1 , 5 9 , 4 , 1 2 , 2 0 , 2 8 , 3 6 , 4 4 , 5 2 , 6 0 , 5 , 1 3 , 2 1 , 2 9 ,
3 7 , 4 5 , 5 3 , 6 1 , 6 , 1 4 , 2 2 , 3 0 , 3 8 , 4 6 , 5 4 , 6 2 , 7 , 1 5 , 2 3 , 3 1 , 3 9 , 4 7 , 5 5 , 6 3 ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for a 16x16 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan16x16 = [
0 , 1 6 , 3 2 , 4 8 , 6 4 , 8 0 , 9 6 , 1 1 2 , 1 2 8 , 1 4 4 , 1 6 0 , 1 7 6 , 1 9 2 , 2 0 8 , 2 2 4 , 2 4 0 , 1 , 1 7 , 3 3 , 4 9 , 6 5 , 8 1 ,
9 7 , 1 1 3 , 1 2 9 , 1 4 5 , 1 6 1 , 1 7 7 , 1 9 3 , 2 0 9 , 2 2 5 , 2 4 1 , 2 , 1 8 , 3 4 , 5 0 , 6 6 , 8 2 , 9 8 , 1 1 4 , 1 3 0 , 1 4 6 , 1 6 2 , 1 7 8 ,
@ -221,14 +274,23 @@ internal static class Av1ScanOrderConstants
2 0 5 , 2 2 1 , 2 3 7 , 2 5 3 , 1 4 , 3 0 , 4 6 , 6 2 , 7 8 , 9 4 , 1 1 0 , 1 2 6 , 1 4 2 , 1 5 8 , 1 7 4 , 1 9 0 , 2 0 6 , 2 2 2 , 2 3 8 , 2 5 4 , 1 5 , 3 1 ,
4 7 , 6 3 , 7 9 , 9 5 , 1 1 1 , 1 2 7 , 1 4 3 , 1 5 9 , 1 7 5 , 1 9 1 , 2 0 7 , 2 2 3 , 2 3 9 , 2 5 5 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for a 4x8 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan4x8 = [
0 , 4 , 8 , 1 2 , 1 6 , 2 0 , 2 4 , 2 8 , 1 , 5 , 9 , 1 3 , 1 7 , 2 1 , 2 5 , 2 9 ,
2 , 6 , 1 0 , 1 4 , 1 8 , 2 2 , 2 6 , 3 0 , 3 , 7 , 1 1 , 1 5 , 1 9 , 2 3 , 2 7 , 3 1 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for an 8x4 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x4 = [
0 , 8 , 1 6 , 2 4 , 1 , 9 , 1 7 , 2 5 , 2 , 1 0 , 1 8 , 2 6 , 3 , 1 1 , 1 9 , 2 7 ,
4 , 1 2 , 2 0 , 2 8 , 5 , 1 3 , 2 1 , 2 9 , 6 , 1 4 , 2 2 , 3 0 , 7 , 1 5 , 2 3 , 3 1 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for an 8x16 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x16 = [
0 , 8 , 1 6 , 2 4 , 3 2 , 4 0 , 4 8 , 5 6 , 6 4 , 7 2 , 8 0 , 8 8 , 9 6 , 1 0 4 , 1 1 2 , 1 2 0 , 1 , 9 , 1 7 , 2 5 , 3 3 , 4 1 ,
4 9 , 5 7 , 6 5 , 7 3 , 8 1 , 8 9 , 9 7 , 1 0 5 , 1 1 3 , 1 2 1 , 2 , 1 0 , 1 8 , 2 6 , 3 4 , 4 2 , 5 0 , 5 8 , 6 6 , 7 4 , 8 2 , 9 0 ,
@ -237,6 +299,9 @@ internal static class Av1ScanOrderConstants
6 9 , 7 7 , 8 5 , 9 3 , 1 0 1 , 1 0 9 , 1 1 7 , 1 2 5 , 6 , 1 4 , 2 2 , 3 0 , 3 8 , 4 6 , 5 4 , 6 2 , 7 0 , 7 8 , 8 6 , 9 4 , 1 0 2 , 1 1 0 ,
1 1 8 , 1 2 6 , 7 , 1 5 , 2 3 , 3 1 , 3 9 , 4 7 , 5 5 , 6 3 , 7 1 , 7 9 , 8 7 , 9 5 , 1 0 3 , 1 1 1 , 1 1 9 , 1 2 7 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for a 16x8 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan16x8 = [
0 , 1 6 , 3 2 , 4 8 , 6 4 , 8 0 , 9 6 , 1 1 2 , 1 , 1 7 , 3 3 , 4 9 , 6 5 , 8 1 , 9 7 , 1 1 3 , 2 , 1 8 , 3 4 , 5 0 , 6 6 , 8 2 ,
9 8 , 1 1 4 , 3 , 1 9 , 3 5 , 5 1 , 6 7 , 8 3 , 9 9 , 1 1 5 , 4 , 2 0 , 3 6 , 5 2 , 6 8 , 8 4 , 1 0 0 , 1 1 6 , 5 , 2 1 , 3 7 , 5 3 ,
@ -245,16 +310,25 @@ internal static class Av1ScanOrderConstants
1 1 , 2 7 , 4 3 , 5 9 , 7 5 , 9 1 , 1 0 7 , 1 2 3 , 1 2 , 2 8 , 4 4 , 6 0 , 7 6 , 9 2 , 1 0 8 , 1 2 4 , 1 3 , 2 9 , 4 5 , 6 1 , 7 7 , 9 3 ,
1 0 9 , 1 2 5 , 1 4 , 3 0 , 4 6 , 6 2 , 7 8 , 9 4 , 1 1 0 , 1 2 6 , 1 5 , 3 1 , 4 7 , 6 3 , 7 9 , 9 5 , 1 1 1 , 1 2 7 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for a 4x16 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan4x16 = [
0 , 4 , 8 , 1 2 , 1 6 , 2 0 , 2 4 , 2 8 , 3 2 , 3 6 , 4 0 , 4 4 , 4 8 , 5 2 , 5 6 , 6 0 , 1 , 5 , 9 , 1 3 , 1 7 , 2 1 ,
2 5 , 2 9 , 3 3 , 3 7 , 4 1 , 4 5 , 4 9 , 5 3 , 5 7 , 6 1 , 2 , 6 , 1 0 , 1 4 , 1 8 , 2 2 , 2 6 , 3 0 , 3 4 , 3 8 , 4 2 , 4 6 ,
5 0 , 5 4 , 5 8 , 6 2 , 3 , 7 , 1 1 , 1 5 , 1 9 , 2 3 , 2 7 , 3 1 , 3 5 , 3 9 , 4 3 , 4 7 , 5 1 , 5 5 , 5 9 , 6 3 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for a 16x4 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan16x4 = [
0 , 1 6 , 3 2 , 4 8 , 1 , 1 7 , 3 3 , 4 9 , 2 , 1 8 , 3 4 , 5 0 , 3 , 1 9 , 3 5 , 5 1 , 4 , 2 0 , 3 6 , 5 2 , 5 , 2 1 ,
3 7 , 5 3 , 6 , 2 2 , 3 8 , 5 4 , 7 , 2 3 , 3 9 , 5 5 , 8 , 2 4 , 4 0 , 5 6 , 9 , 2 5 , 4 1 , 5 7 , 1 0 , 2 6 , 4 2 , 5 8 ,
1 1 , 2 7 , 4 3 , 5 9 , 1 2 , 2 8 , 4 4 , 6 0 , 1 3 , 2 9 , 4 5 , 6 1 , 1 4 , 3 0 , 4 6 , 6 2 , 1 5 , 3 1 , 4 7 , 6 3 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for an 8x32 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x32 = [
0 , 8 , 1 6 , 2 4 , 3 2 , 4 0 , 4 8 , 5 6 , 6 4 , 7 2 , 8 0 , 8 8 , 9 6 , 1 0 4 , 1 1 2 , 1 2 0 , 1 2 8 , 1 3 6 , 1 4 4 , 1 5 2 , 1 6 0 , 1 6 8 ,
1 7 6 , 1 8 4 , 1 9 2 , 2 0 0 , 2 0 8 , 2 1 6 , 2 2 4 , 2 3 2 , 2 4 0 , 2 4 8 , 1 , 9 , 1 7 , 2 5 , 3 3 , 4 1 , 4 9 , 5 7 , 6 5 , 7 3 , 8 1 , 8 9 ,
@ -269,6 +343,9 @@ internal static class Av1ScanOrderConstants
2 3 0 , 2 3 8 , 2 4 6 , 2 5 4 , 7 , 1 5 , 2 3 , 3 1 , 3 9 , 4 7 , 5 5 , 6 3 , 7 1 , 7 9 , 8 7 , 9 5 , 1 0 3 , 1 1 1 , 1 1 9 , 1 2 7 , 1 3 5 , 1 4 3 ,
1 5 1 , 1 5 9 , 1 6 7 , 1 7 5 , 1 8 3 , 1 9 1 , 1 9 9 , 2 0 7 , 2 1 5 , 2 2 3 , 2 3 1 , 2 3 9 , 2 4 7 , 2 5 5 , ] ;
/// <summary>
/// Maps column-oriented scan positions to raster coefficient indices for a 32x8 transform.
/// </summary>
private static readonly short [ ] MatrixColumnScan32x8 = [
0 , 3 2 , 6 4 , 9 6 , 1 2 8 , 1 6 0 , 1 9 2 , 2 2 4 , 1 , 3 3 , 6 5 , 9 7 , 1 2 9 , 1 6 1 , 1 9 3 , 2 2 5 , 2 , 3 4 , 6 6 , 9 8 , 1 3 0 , 1 6 2 , 1 9 4 , 2 2 6 ,
3 , 3 5 , 6 7 , 9 9 , 1 3 1 , 1 6 3 , 1 9 5 , 2 2 7 , 4 , 3 6 , 6 8 , 1 0 0 , 1 3 2 , 1 6 4 , 1 9 6 , 2 2 8 , 5 , 3 7 , 6 9 , 1 0 1 , 1 3 3 , 1 6 5 , 1 9 7 , 2 2 9 ,
@ -282,12 +359,22 @@ internal static class Av1ScanOrderConstants
2 7 , 5 9 , 9 1 , 1 2 3 , 1 5 5 , 1 8 7 , 2 1 9 , 2 5 1 , 2 8 , 6 0 , 9 2 , 1 2 4 , 1 5 6 , 1 8 8 , 2 2 0 , 2 5 2 , 2 9 , 6 1 , 9 3 , 1 2 5 , 1 5 7 , 1 8 9 , 2 2 1 , 2 5 3 ,
3 0 , 6 2 , 9 4 , 1 2 6 , 1 5 8 , 1 9 0 , 2 2 2 , 2 5 4 , 3 1 , 6 3 , 9 5 , 1 2 7 , 1 5 9 , 1 9 1 , 2 2 3 , 2 5 5 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for a 4x4 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan4x4 = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for an 8x8 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan8x8 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
4 4 , 4 5 , 4 6 , 4 7 , 4 8 , 4 9 , 5 0 , 5 1 , 5 2 , 5 3 , 5 4 , 5 5 , 5 6 , 5 7 , 5 8 , 5 9 , 6 0 , 6 1 , 6 2 , 6 3 ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for a 16x16 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan16x16 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
@ -302,14 +389,23 @@ internal static class Av1ScanOrderConstants
2 2 0 , 2 2 1 , 2 2 2 , 2 2 3 , 2 2 4 , 2 2 5 , 2 2 6 , 2 2 7 , 2 2 8 , 2 2 9 , 2 3 0 , 2 3 1 , 2 3 2 , 2 3 3 , 2 3 4 , 2 3 5 , 2 3 6 , 2 3 7 , 2 3 8 , 2 3 9 , 2 4 0 , 2 4 1 ,
2 4 2 , 2 4 3 , 2 4 4 , 2 4 5 , 2 4 6 , 2 4 7 , 2 4 8 , 2 4 9 , 2 5 0 , 2 5 1 , 2 5 2 , 2 5 3 , 2 5 4 , 2 5 5 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for a 4x8 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan4x8 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 ,
1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for an 8x4 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan8x4 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 ,
1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for an 8x16 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan8x16 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
@ -318,6 +414,9 @@ internal static class Av1ScanOrderConstants
8 8 , 8 9 , 9 0 , 9 1 , 9 2 , 9 3 , 9 4 , 9 5 , 9 6 , 9 7 , 9 8 , 9 9 , 1 0 0 , 1 0 1 , 1 0 2 , 1 0 3 , 1 0 4 , 1 0 5 , 1 0 6 , 1 0 7 , 1 0 8 , 1 0 9 ,
1 1 0 , 1 1 1 , 1 1 2 , 1 1 3 , 1 1 4 , 1 1 5 , 1 1 6 , 1 1 7 , 1 1 8 , 1 1 9 , 1 2 0 , 1 2 1 , 1 2 2 , 1 2 3 , 1 2 4 , 1 2 5 , 1 2 6 , 1 2 7 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for a 16x8 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan16x8 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
@ -326,16 +425,25 @@ internal static class Av1ScanOrderConstants
8 8 , 8 9 , 9 0 , 9 1 , 9 2 , 9 3 , 9 4 , 9 5 , 9 6 , 9 7 , 9 8 , 9 9 , 1 0 0 , 1 0 1 , 1 0 2 , 1 0 3 , 1 0 4 , 1 0 5 , 1 0 6 , 1 0 7 , 1 0 8 , 1 0 9 ,
1 1 0 , 1 1 1 , 1 1 2 , 1 1 3 , 1 1 4 , 1 1 5 , 1 1 6 , 1 1 7 , 1 1 8 , 1 1 9 , 1 2 0 , 1 2 1 , 1 2 2 , 1 2 3 , 1 2 4 , 1 2 5 , 1 2 6 , 1 2 7 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for a 4x16 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan4x16 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
4 4 , 4 5 , 4 6 , 4 7 , 4 8 , 4 9 , 5 0 , 5 1 , 5 2 , 5 3 , 5 4 , 5 5 , 5 6 , 5 7 , 5 8 , 5 9 , 6 0 , 6 1 , 6 2 , 6 3 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for a 16x4 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan16x4 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
4 4 , 4 5 , 4 6 , 4 7 , 4 8 , 4 9 , 5 0 , 5 1 , 5 2 , 5 3 , 5 4 , 5 5 , 5 6 , 5 7 , 5 8 , 5 9 , 6 0 , 6 1 , 6 2 , 6 3 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for an 8x32 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan8x32 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
@ -350,6 +458,9 @@ internal static class Av1ScanOrderConstants
2 2 0 , 2 2 1 , 2 2 2 , 2 2 3 , 2 2 4 , 2 2 5 , 2 2 6 , 2 2 7 , 2 2 8 , 2 2 9 , 2 3 0 , 2 3 1 , 2 3 2 , 2 3 3 , 2 3 4 , 2 3 5 , 2 3 6 , 2 3 7 , 2 3 8 , 2 3 9 , 2 4 0 , 2 4 1 ,
2 4 2 , 2 4 3 , 2 4 4 , 2 4 5 , 2 4 6 , 2 4 7 , 2 4 8 , 2 4 9 , 2 5 0 , 2 5 1 , 2 5 2 , 2 5 3 , 2 5 4 , 2 5 5 , ] ;
/// <summary>
/// Maps row-oriented scan positions to raster coefficient indices for a 32x8 transform.
/// </summary>
private static readonly short [ ] MatrixRowScan32x8 = [
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 ,
2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 , 3 5 , 3 6 , 3 7 , 3 8 , 3 9 , 4 0 , 4 1 , 4 2 , 4 3 ,
@ -365,95 +476,427 @@ internal static class Av1ScanOrderConstants
2 4 2 , 2 4 3 , 2 4 4 , 2 4 5 , 2 4 6 , 2 4 7 , 2 4 8 , 2 4 9 , 2 5 0 , 2 5 1 , 2 5 2 , 2 5 3 , 2 5 4 , 2 5 5 , ] ;
// InverseScan is not used (yet) for AVIF coding, leave these arrays empty for now.
/// <summary>
/// The inverse mapping of the default coefficient scan for a 4x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan4x4 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for an 8x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan8x8 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 16x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan16x16 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 32x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan32x32 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 4x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan4x8 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for an 8x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan8x4 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for an 8x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan8x16 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 16x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan16x8 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 16x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan16x32 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 32x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan32x16 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 4x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan4x16 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 16x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan16x4 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for an 8x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan8x32 = [ ] ;
/// <summary>
/// The inverse mapping of the default coefficient scan for a 32x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultInverseScan32x8 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 4x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan4x4 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for an 8x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan8x8 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 16x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan16x16 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 32x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan32x32 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 4x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan4x8 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for an 8x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan8x4 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for an 8x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan8x16 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 16x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan16x8 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 16x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan16x32 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 32x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan32x16 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 4x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan4x16 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 16x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan16x4 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for an 8x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan8x32 = [ ] ;
/// <summary>
/// The inverse mapping of the column-oriented coefficient scan for a 32x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnInverseScan32x8 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 4x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan4x4 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for an 8x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan8x8 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 16x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan16x16 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 32x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan32x32 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 4x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan4x8 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for an 8x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan8x4 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for an 8x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan8x16 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 16x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan16x8 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 16x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan16x32 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 32x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan32x16 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 4x16 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan4x16 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 16x4 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan16x4 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for an 8x32 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan8x32 = [ ] ;
/// <summary>
/// The inverse mapping of the row-oriented coefficient scan for a 32x8 transform; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowInverseScan32x8 = [ ] ;
// Neighbors are not used (yet) for AVIF coding, leave these arrays empty for now.
/// <summary>
/// The entropy-neighbor lookup for the default 4x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan4x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 8x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan8x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 16x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan16x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 32x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan32x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 4x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan4x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 8x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan8x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 8x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan8x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 16x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan16x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 16x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan16x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 32x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan32x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 4x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan4x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 16x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan16x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 8x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan8x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the default 32x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] DefaultScan32x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 4x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan4x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 8x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 16x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan16x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 32x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan32x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 4x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan4x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 8x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 8x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 16x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan16x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 16x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan16x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 32x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan32x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 4x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan4x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 16x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan16x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 8x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan8x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the column-oriented 32x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixColumnScan32x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 4x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan4x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 8x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan8x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 16x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan16x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 32x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan32x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 4x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan4x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 8x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan8x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 8x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan8x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 16x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan16x8Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 16x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan16x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 32x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan32x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 4x16 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan4x16Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 16x4 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan16x4Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 8x32 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan8x32Neighbors = [ ] ;
/// <summary>
/// The entropy-neighbor lookup for the row-oriented 32x8 coefficient scan; reserved for AV1 syntax that still-image decoding does not consume.
/// </summary>
private static readonly short [ ] MatrixRowScan32x8Neighbors = [ ] ;
/// <summary>