// Generated by scripts/generate-av1-inter-tables.py. Do not edit.
// AV1 normative inter defaults; each factory returns fresh mutable CDF rows.
// Source: https://github.com/mgvs/go-av1/tree/main/cdf
// _refs/go-av1/cdf/tables_mv_gen.go SHA-256: feae1191484cf7b23b5c1a02e2e4dcb5b7be8d91d740ba95a575986df7ed6b2f
// _refs/go-av1/cdf/tables_inter_gen.go SHA-256: 59b8ad4dee86f69fc461dc12e02d26098869ca665d9eac977b96793c777949dd
// _refs/go-av1/cdf/tables_interp_gen.go SHA-256: 8f0802cc4889517e99eb6f881a4543f5fd6dbf1b1fe57e2eeeebd2ec224a3355
// _refs/go-av1/cdf/tables_mm_gen.go SHA-256: a7d6e45337acb1ee55476079224c9a1250dfb4bf1667a0d49c7c81c745460396
// _refs/go-av1/cdf/tables_comp_gen.go SHA-256: e07ba99ae197604cc64d4bf5e3c3f512fb183d58efffc09000ed24f494e76ac8
// _refs/go-av1/cdf/tables_interintra_gen.go SHA-256: ac9a20591303c2e6237a279b65cb042b9070e44526dfea34e5c3cd17c05c7208
// _refs/go-av1/cdf/tables_intertx_gen.go SHA-256: cd91a79c2bc041846c69cae13b6b45454ec5c7302c6a8d775b5715bc040ab3ac
// _refs/go-av1/cdf/tables_wedge_gen.go SHA-256: a4af33027848e4cf41207184d580bd89e2bd5ce8ef5e800bd48facd4fe81bc1b
// _refs/go-av1/cdf/tables_ymode_gen.go SHA-256: 63844b587ccd9f033c419ca1abe3f5363acdf95891a5aaa5707cfd2774de985d
//
// BSD 2-Clause License
//
// Copyright (c) 2026, Oleksandr Zhabotynskyi
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

///|
/// Default_Single_Ref_Cdf: [reference-count context 0..2][decision symbol p 0..5]
/// of the `single_ref` tree, one binary symbol per row. The context compares the
/// number of available forward against backward reference frames.
/// Go source: DefaultSingleRefCdf in tables_mv_gen.go, shape 3x6x3.
let av1_single_ref : Array[Array[Array[Int]]] = [
  [
    [4897, 32768, 0],
    [1555, 32768, 0],
    [4236, 32768, 0],
    [8650, 32768, 0],
    [904, 32768, 0],
    [1444, 32768, 0],
  ],
  [
    [16973, 32768, 0],
    [16751, 32768, 0],
    [19647, 32768, 0],
    [24773, 32768, 0],
    [11014, 32768, 0],
    [15087, 32768, 0],
  ],
  [
    [29744, 32768, 0],
    [30279, 32768, 0],
    [31194, 32768, 0],
    [31895, 32768, 0],
    [26875, 32768, 0],
    [30304, 32768, 0],
  ],
]

///|
/// Fresh DefaultSingleRefCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_single_ref_cdfs() -> Array[Array[Array[Int]]] {
  [
    [
      [4897, 32768, 0],
      [1555, 32768, 0],
      [4236, 32768, 0],
      [8650, 32768, 0],
      [904, 32768, 0],
      [1444, 32768, 0],
    ],
    [
      [16973, 32768, 0],
      [16751, 32768, 0],
      [19647, 32768, 0],
      [24773, 32768, 0],
      [11014, 32768, 0],
      [15087, 32768, 0],
    ],
    [
      [29744, 32768, 0],
      [30279, 32768, 0],
      [31194, 32768, 0],
      [31895, 32768, 0],
      [26875, 32768, 0],
      [30304, 32768, 0],
    ],
  ]
}

///|
/// Default_New_Mv_Cdf: [new_mv context 0..5] built from the nearest-MV stack
/// count and the two reference frame distances; one binary symbol.
/// Go source: DefaultNewMvCdf in tables_mv_gen.go, shape 6x3.
let av1_new_mv : Array[Array[Int]] = [
  [24035, 32768, 0],
  [16630, 32768, 0],
  [15339, 32768, 0],
  [8386, 32768, 0],
  [12222, 32768, 0],
  [4676, 32768, 0],
]

///|
/// Fresh DefaultNewMvCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_new_mv_cdfs() -> Array[Array[Int]] {
  [
    [24035, 32768, 0],
    [16630, 32768, 0],
    [15339, 32768, 0],
    [8386, 32768, 0],
    [12222, 32768, 0],
    [4676, 32768, 0],
  ]
}

///|
/// Default_Zero_Mv_Cdf: [zero_mv context 0..1], set when a zero vector is
/// unlikely because the nearest candidate disagrees with the global motion; one
/// binary symbol.
/// Go source: DefaultZeroMvCdf in tables_mv_gen.go, shape 2x3.
let av1_zero_mv : Array[Array[Int]] = [[2175, 32768, 0], [1054, 32768, 0]]

///|
/// Fresh DefaultZeroMvCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_zero_mv_cdfs() -> Array[Array[Int]] {
  [[2175, 32768, 0], [1054, 32768, 0]]
}

///|
/// Default_Ref_Mv_Cdf: [ref_mv context 0..5] from the nearest-MV stack and the
/// compound reference ordering; one binary symbol selecting the stacked candidate.
/// Go source: DefaultRefMvCdf in tables_mv_gen.go, shape 6x3.
let av1_ref_mv : Array[Array[Int]] = [
  [23974, 32768, 0],
  [24188, 32768, 0],
  [17848, 32768, 0],
  [28622, 32768, 0],
  [24312, 32768, 0],
  [19923, 32768, 0],
]

///|
/// Fresh DefaultRefMvCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_ref_mv_cdfs() -> Array[Array[Int]] {
  [
    [23974, 32768, 0],
    [24188, 32768, 0],
    [17848, 32768, 0],
    [28622, 32768, 0],
    [24312, 32768, 0],
    [19923, 32768, 0],
  ]
}

///|
/// Default_Drl_Mode_Cdf: [depth reference list context 0..2] counting how many
/// neighbours share this block's reference frames; one binary symbol.
/// Go source: DefaultDrlModeCdf in tables_mv_gen.go, shape 3x3.
let av1_drl_mode : Array[Array[Int]] = [
  [13104, 32768, 0],
  [24560, 32768, 0],
  [18945, 32768, 0],
]

///|
/// Fresh DefaultDrlModeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_drl_mode_cdfs() -> Array[Array[Int]] {
  [[13104, 32768, 0], [24560, 32768, 0], [18945, 32768, 0]]
}

///|
/// Default_Mv_Joint_Cdf: the four joints naming which motion vector components
/// are nonzero. Stored once and replicated by the decoder as [mv_ctx][comp], with
/// mv_ctx 0 for inter and 1 for intra block copy.
/// Go source: DefaultMvJointCdf in tables_mv_gen.go, shape 5.
let av1_mv_joint : Array[Int] = [4096, 11264, 19328, 32768, 0]

///|
/// Fresh DefaultMvJointCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_joint_cdfs() -> Array[Int] {
  [4096, 11264, 19328, 32768, 0]
}

///|
/// Default_Mv_Sign_Cdf: the sign of a nonzero component; replicated as
/// [mv_ctx][comp].
/// Go source: DefaultMvSignCdf in tables_mv_gen.go, shape 3.
let av1_mv_sign : Array[Int] = [16384, 32768, 0]

///|
/// Fresh DefaultMvSignCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_sign_cdfs() -> Array[Int] {
  [16384, 32768, 0]
}

///|
/// Default_Mv_Class_Cdf: [comp][11 magnitude classes]. Both rows are identical in
/// the normative table, so the component index carries no information; the
/// decoder still replicates the rows as [mv_ctx][comp].
/// Go source: DefaultMvClassCdf in tables_mv_gen.go, shape 2x12.
let av1_mv_class : Array[Array[Int]] = [
  [
    28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757, 32762, 32767, 32768,
    0,
  ],
  [
    28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757, 32762, 32767, 32768,
    0,
  ],
]

///|
/// Fresh DefaultMvClassCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_class_cdfs() -> Array[Array[Int]] {
  [
    [
      28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757, 32762, 32767, 32768,
      0,
    ],
    [
      28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757, 32762, 32767, 32768,
      0,
    ],
  ]
}

///|
/// Default_Mv_Class0_Bit_Cdf: the leading class-0 sub-pel bit, read before the
/// class-0 fraction; replicated as [mv_ctx][comp].
/// Go source: DefaultMvClass0BitCdf in tables_mv_gen.go, shape 3.
let av1_mv_class0_bit : Array[Int] = [27648, 32768, 0]

///|
/// Fresh DefaultMvClass0BitCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_class0_bit_cdfs() -> Array[Int] {
  [27648, 32768, 0]
}

///|
/// Default_Mv_Class0_Fr_Cdf: [comp][mv_class0_bit 0..1] over the four sub-pel
/// positions of magnitude class 0; replicated per motion vector context.
/// Go source: DefaultMvClass0FrCdf in tables_mv_gen.go, shape 2x2x5.
let av1_mv_class0_fr : Array[Array[Array[Int]]] = [
  [[16384, 24576, 26624, 32768, 0], [12288, 21248, 24128, 32768, 0]],
  [[16384, 24576, 26624, 32768, 0], [12288, 21248, 24128, 32768, 0]],
]

///|
/// Fresh DefaultMvClass0FrCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_class0_fr_cdfs() -> Array[Array[Array[Int]]] {
  [
    [[16384, 24576, 26624, 32768, 0], [12288, 21248, 24128, 32768, 0]],
    [[16384, 24576, 26624, 32768, 0], [12288, 21248, 24128, 32768, 0]],
  ]
}

///|
/// Default_Mv_Class0_Hp_Cdf: the one-eighth-pel extension of class 0; replicated
/// as [mv_ctx][comp].
/// Go source: DefaultMvClass0HpCdf in tables_mv_gen.go, shape 3.
let av1_mv_class0_hp : Array[Int] = [20480, 32768, 0]

///|
/// Fresh DefaultMvClass0HpCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_class0_hp_cdfs() -> Array[Int] {
  [20480, 32768, 0]
}

///|
/// Default_Mv_Bit_Cdf: [bit index 0..9] of the magnitude bits used by classes 1..9;
/// the first ten rows cover the largest classes, so shorter classes read only a
/// prefix. Replicated as [mv_ctx][comp].
/// Go source: DefaultMvBitCdf in tables_mv_gen.go, shape 10x3.
let av1_mv_bit : Array[Array[Int]] = [
  [17408, 32768, 0],
  [17920, 32768, 0],
  [18944, 32768, 0],
  [20480, 32768, 0],
  [22528, 32768, 0],
  [24576, 32768, 0],
  [28672, 32768, 0],
  [29952, 32768, 0],
  [29952, 32768, 0],
  [30720, 32768, 0],
]

///|
/// Fresh DefaultMvBitCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_bit_cdfs() -> Array[Array[Int]] {
  [
    [17408, 32768, 0],
    [17920, 32768, 0],
    [18944, 32768, 0],
    [20480, 32768, 0],
    [22528, 32768, 0],
    [24576, 32768, 0],
    [28672, 32768, 0],
    [29952, 32768, 0],
    [29952, 32768, 0],
    [30720, 32768, 0],
  ]
}

///|
/// Default_Mv_Fr_Cdf: [comp] over the four quarter-pel fractions shared by
/// magnitude classes 1..9; replicated per motion vector context.
/// Go source: DefaultMvFrCdf in tables_mv_gen.go, shape 2x5.
let av1_mv_fr : Array[Array[Int]] = [
  [8192, 17408, 21248, 32768, 0],
  [8192, 17408, 21248, 32768, 0],
]

///|
/// Fresh DefaultMvFrCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_fr_cdfs() -> Array[Array[Int]] {
  [[8192, 17408, 21248, 32768, 0], [8192, 17408, 21248, 32768, 0]]
}

///|
/// Default_Mv_Hp_Cdf: the one-eighth-pel bit for classes 1..9; replicated as
/// [mv_ctx][comp].
/// Go source: DefaultMvHpCdf in tables_mv_gen.go, shape 3.
let av1_mv_hp : Array[Int] = [16384, 32768, 0]

///|
/// Fresh DefaultMvHpCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_mv_hp_cdfs() -> Array[Int] {
  [16384, 32768, 0]
}

///|
/// Default_Is_Inter_Cdf: [block context 0..3] from the above and left skip states;
/// one binary symbol.
/// Go source: DefaultIsInterCdf in tables_inter_gen.go, shape 4x3.
let av1_is_inter : Array[Array[Int]] = [
  [806, 32768, 0],
  [16662, 32768, 0],
  [20186, 32768, 0],
  [26538, 32768, 0],
]

///|
/// Fresh DefaultIsInterCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_is_inter_cdfs() -> Array[Array[Int]] {
  [[806, 32768, 0], [16662, 32768, 0], [20186, 32768, 0], [26538, 32768, 0]]
}

///|
/// Default_Skip_Mode_Cdf: [skip context 0..2] from the above and left neighbours;
/// one binary symbol.
/// Go source: DefaultSkipModeCdf in tables_inter_gen.go, shape 3x3.
let av1_skip_mode : Array[Array[Int]] = [
  [32621, 32768, 0],
  [20708, 32768, 0],
  [8127, 32768, 0],
]

///|
/// Fresh DefaultSkipModeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_skip_mode_cdfs() -> Array[Array[Int]] {
  [[32621, 32768, 0], [20708, 32768, 0], [8127, 32768, 0]]
}

///|
/// Default_Interp_Filter_Cdf: [context 0..15] assembled from the interpolation
/// direction, whether the second reference frame is forward, and the above/left
/// filter types; three symbols over the switchable sub-pel filters.
/// Go source: DefaultInterpFilterCdf in tables_interp_gen.go, shape 16x4.
let av1_interp_filter : Array[Array[Int]] = [
  [31935, 32720, 32768, 0],
  [5568, 32719, 32768, 0],
  [422, 2938, 32768, 0],
  [28244, 32608, 32768, 0],
  [31206, 31953, 32768, 0],
  [4862, 32121, 32768, 0],
  [770, 1152, 32768, 0],
  [20889, 25637, 32768, 0],
  [31910, 32724, 32768, 0],
  [4120, 32712, 32768, 0],
  [305, 2247, 32768, 0],
  [27403, 32636, 32768, 0],
  [31022, 32009, 32768, 0],
  [2963, 32093, 32768, 0],
  [601, 943, 32768, 0],
  [14969, 21398, 32768, 0],
]

///|
/// Fresh DefaultInterpFilterCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_interp_filter_cdfs() -> Array[Array[Int]] {
  [
    [31935, 32720, 32768, 0],
    [5568, 32719, 32768, 0],
    [422, 2938, 32768, 0],
    [28244, 32608, 32768, 0],
    [31206, 31953, 32768, 0],
    [4862, 32121, 32768, 0],
    [770, 1152, 32768, 0],
    [20889, 25637, 32768, 0],
    [31910, 32724, 32768, 0],
    [4120, 32712, 32768, 0],
    [305, 2247, 32768, 0],
    [27403, 32636, 32768, 0],
    [31022, 32009, 32768, 0],
    [2963, 32093, 32768, 0],
    [601, 943, 32768, 0],
    [14969, 21398, 32768, 0],
  ]
}

///|
/// Default_Use_Obmc_Cdf: [block mi_size 0..21]; one binary symbol.
/// Go source: DefaultUseObmcCdf in tables_mm_gen.go, shape 22x3.
let av1_use_obmc : Array[Array[Int]] = [
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [10437, 32768, 0],
  [9371, 32768, 0],
  [9301, 32768, 0],
  [17432, 32768, 0],
  [14423, 32768, 0],
  [15142, 32768, 0],
  [25817, 32768, 0],
  [22823, 32768, 0],
  [22083, 32768, 0],
  [30128, 32768, 0],
  [31014, 32768, 0],
  [31560, 32768, 0],
  [32638, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [23664, 32768, 0],
  [20901, 32768, 0],
  [24008, 32768, 0],
  [26879, 32768, 0],
]

///|
/// Fresh DefaultUseObmcCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_use_obmc_cdfs() -> Array[Array[Int]] {
  [
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [10437, 32768, 0],
    [9371, 32768, 0],
    [9301, 32768, 0],
    [17432, 32768, 0],
    [14423, 32768, 0],
    [15142, 32768, 0],
    [25817, 32768, 0],
    [22823, 32768, 0],
    [22083, 32768, 0],
    [30128, 32768, 0],
    [31014, 32768, 0],
    [31560, 32768, 0],
    [32638, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [23664, 32768, 0],
    [20901, 32768, 0],
    [24008, 32768, 0],
    [26879, 32768, 0],
  ]
}

///|
/// Default_Motion_Mode_Cdf: [block mi_size 0..21][3 symbols] selecting plain
/// interpolation, OBMC or smooth motion.
/// Go source: DefaultMotionModeCdf in tables_mm_gen.go, shape 22x4.
let av1_motion_mode : Array[Array[Int]] = [
  [10923, 21845, 32768, 0],
  [10923, 21845, 32768, 0],
  [10923, 21845, 32768, 0],
  [7651, 24760, 32768, 0],
  [4738, 24765, 32768, 0],
  [5391, 25528, 32768, 0],
  [19419, 26810, 32768, 0],
  [5123, 23606, 32768, 0],
  [11606, 24308, 32768, 0],
  [26260, 29116, 32768, 0],
  [20360, 28062, 32768, 0],
  [21679, 26830, 32768, 0],
  [29516, 30701, 32768, 0],
  [28898, 30397, 32768, 0],
  [30878, 31335, 32768, 0],
  [32507, 32558, 32768, 0],
  [10923, 21845, 32768, 0],
  [10923, 21845, 32768, 0],
  [28799, 31390, 32768, 0],
  [26431, 30774, 32768, 0],
  [28973, 31594, 32768, 0],
  [29742, 31203, 32768, 0],
]

///|
/// Fresh DefaultMotionModeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_motion_mode_cdfs() -> Array[Array[Int]] {
  [
    [10923, 21845, 32768, 0],
    [10923, 21845, 32768, 0],
    [10923, 21845, 32768, 0],
    [7651, 24760, 32768, 0],
    [4738, 24765, 32768, 0],
    [5391, 25528, 32768, 0],
    [19419, 26810, 32768, 0],
    [5123, 23606, 32768, 0],
    [11606, 24308, 32768, 0],
    [26260, 29116, 32768, 0],
    [20360, 28062, 32768, 0],
    [21679, 26830, 32768, 0],
    [29516, 30701, 32768, 0],
    [28898, 30397, 32768, 0],
    [30878, 31335, 32768, 0],
    [32507, 32558, 32768, 0],
    [10923, 21845, 32768, 0],
    [10923, 21845, 32768, 0],
    [28799, 31390, 32768, 0],
    [26431, 30774, 32768, 0],
    [28973, 31594, 32768, 0],
    [29742, 31203, 32768, 0],
  ]
}

///|
/// Default_Comp_Mode_Cdf: [compound context 0..4] from the above/left reference
/// frames; one binary symbol for single versus compound reference.
/// Go source: DefaultCompModeCdf in tables_comp_gen.go, shape 5x3.
let av1_comp_mode : Array[Array[Int]] = [
  [26828, 32768, 0],
  [24035, 32768, 0],
  [12031, 32768, 0],
  [10640, 32768, 0],
  [2901, 32768, 0],
]

///|
/// Fresh DefaultCompModeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_comp_mode_cdfs() -> Array[Array[Int]] {
  [
    [26828, 32768, 0],
    [24035, 32768, 0],
    [12031, 32768, 0],
    [10640, 32768, 0],
    [2901, 32768, 0],
  ]
}

///|
/// Default_Comp_Ref_Type_Cdf: [context 0..4] over the above/left compound
/// reference pairs; two symbols for unidirectional versus bidirectional compound.
/// Go source: DefaultCompRefTypeCdf in tables_comp_gen.go, shape 5x3.
let av1_comp_ref_type : Array[Array[Int]] = [
  [1198, 32768, 0],
  [2070, 32768, 0],
  [9166, 32768, 0],
  [7499, 32768, 0],
  [22475, 32768, 0],
]

///|
/// Fresh DefaultCompRefTypeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_comp_ref_type_cdfs() -> Array[Array[Int]] {
  [
    [1198, 32768, 0],
    [2070, 32768, 0],
    [9166, 32768, 0],
    [7499, 32768, 0],
    [22475, 32768, 0],
  ]
}

///|
/// Default_Uni_Comp_Ref_Cdf: [reference-count context 0..2][decision symbol p 0..2]
/// of the unidirectional compound reference tree; one binary symbol per row.
/// Go source: DefaultUniCompRefCdf in tables_comp_gen.go, shape 3x3x3.
let av1_uni_comp_ref : Array[Array[Array[Int]]] = [
  [[5284, 32768, 0], [3865, 32768, 0], [3128, 32768, 0]],
  [[23152, 32768, 0], [14173, 32768, 0], [15270, 32768, 0]],
  [[31774, 32768, 0], [25120, 32768, 0], [26710, 32768, 0]],
]

///|
/// Fresh DefaultUniCompRefCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_uni_comp_ref_cdfs() -> Array[Array[Array[Int]]] {
  [
    [[5284, 32768, 0], [3865, 32768, 0], [3128, 32768, 0]],
    [[23152, 32768, 0], [14173, 32768, 0], [15270, 32768, 0]],
    [[31774, 32768, 0], [25120, 32768, 0], [26710, 32768, 0]],
  ]
}

///|
/// Default_Comp_Ref_Cdf: [reference-count context 0..2][decision symbol p 0..2]
/// for the forward reference of a bidirectional compound block.
/// Go source: DefaultCompRefCdf in tables_comp_gen.go, shape 3x3x3.
let av1_comp_ref : Array[Array[Array[Int]]] = [
  [[4946, 32768, 0], [9468, 32768, 0], [1503, 32768, 0]],
  [[19891, 32768, 0], [22441, 32768, 0], [15160, 32768, 0]],
  [[30731, 32768, 0], [31059, 32768, 0], [27544, 32768, 0]],
]

///|
/// Fresh DefaultCompRefCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_comp_ref_cdfs() -> Array[Array[Array[Int]]] {
  [
    [[4946, 32768, 0], [9468, 32768, 0], [1503, 32768, 0]],
    [[19891, 32768, 0], [22441, 32768, 0], [15160, 32768, 0]],
    [[30731, 32768, 0], [31059, 32768, 0], [27544, 32768, 0]],
  ]
}

///|
/// Default_Comp_Bwd_Ref_Cdf: [reference-count context 0..2][decision symbol p 0..1]
/// for the backward reference of a bidirectional compound block.
/// Go source: DefaultCompBwdRefCdf in tables_comp_gen.go, shape 3x2x3.
let av1_comp_bwd_ref : Array[Array[Array[Int]]] = [
  [[2235, 32768, 0], [1423, 32768, 0]],
  [[17182, 32768, 0], [15175, 32768, 0]],
  [[30606, 32768, 0], [30489, 32768, 0]],
]

///|
/// Fresh DefaultCompBwdRefCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_comp_bwd_ref_cdfs() -> Array[Array[Array[Int]]] {
  [
    [[2235, 32768, 0], [1423, 32768, 0]],
    [[17182, 32768, 0], [15175, 32768, 0]],
    [[30606, 32768, 0], [30489, 32768, 0]],
  ]
}

///|
/// Default_Compound_Mode_Cdf: [context 0..7] over the reference frame distances;
/// eight symbols of the compound prediction mode tree.
/// Go source: DefaultCompoundModeCdf in tables_comp_gen.go, shape 8x9.
let av1_compound_mode : Array[Array[Int]] = [
  [7760, 13823, 15808, 17641, 19156, 20666, 26891, 32768, 0],
  [10730, 19452, 21145, 22749, 24039, 25131, 28724, 32768, 0],
  [10664, 20221, 21588, 22906, 24295, 25387, 28436, 32768, 0],
  [13298, 16984, 20471, 24182, 25067, 25736, 26422, 32768, 0],
  [18904, 23325, 25242, 27432, 27898, 28258, 30758, 32768, 0],
  [10725, 17454, 20124, 22820, 24195, 25168, 26046, 32768, 0],
  [17125, 24273, 25814, 27492, 28214, 28704, 30592, 32768, 0],
  [13046, 23214, 24505, 25942, 27435, 28442, 29330, 32768, 0],
]

///|
/// Fresh DefaultCompoundModeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_compound_mode_cdfs() -> Array[Array[Int]] {
  [
    [7760, 13823, 15808, 17641, 19156, 20666, 26891, 32768, 0],
    [10730, 19452, 21145, 22749, 24039, 25131, 28724, 32768, 0],
    [10664, 20221, 21588, 22906, 24295, 25387, 28436, 32768, 0],
    [13298, 16984, 20471, 24182, 25067, 25736, 26422, 32768, 0],
    [18904, 23325, 25242, 27432, 27898, 28258, 30758, 32768, 0],
    [10725, 17454, 20124, 22820, 24195, 25168, 26046, 32768, 0],
    [17125, 24273, 25814, 27492, 28214, 28704, 30592, 32768, 0],
    [13046, 23214, 24505, 25942, 27435, 28442, 29330, 32768, 0],
  ]
}

///|
/// Default_Comp_Group_Idx_Cdf: [context 0..5] accumulated from the above/left
/// neighbours; one binary symbol.
/// Go source: DefaultCompGroupIdxCdf in tables_comp_gen.go, shape 6x3.
let av1_comp_group_idx : Array[Array[Int]] = [
  [26607, 32768, 0],
  [22891, 32768, 0],
  [18840, 32768, 0],
  [24594, 32768, 0],
  [19934, 32768, 0],
  [22674, 32768, 0],
]

///|
/// Fresh DefaultCompGroupIdxCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_comp_group_idx_cdfs() -> Array[Array[Int]] {
  [
    [26607, 32768, 0],
    [22891, 32768, 0],
    [18840, 32768, 0],
    [24594, 32768, 0],
    [19934, 32768, 0],
    [22674, 32768, 0],
  ]
}

///|
/// Default_Compound_Idx_Cdf: [context 0..5] accumulated from the above/left
/// neighbours and the reference ordering; one binary symbol.
/// Go source: DefaultCompoundIdxCdf in tables_comp_gen.go, shape 6x3.
let av1_compound_idx : Array[Array[Int]] = [
  [18244, 32768, 0],
  [12865, 32768, 0],
  [7053, 32768, 0],
  [13259, 32768, 0],
  [9334, 32768, 0],
  [4644, 32768, 0],
]

///|
/// Fresh DefaultCompoundIdxCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_compound_idx_cdfs() -> Array[Array[Int]] {
  [
    [18244, 32768, 0],
    [12865, 32768, 0],
    [7053, 32768, 0],
    [13259, 32768, 0],
    [9334, 32768, 0],
    [4644, 32768, 0],
  ]
}

///|
/// Default_Inter_Intra_Cdf: [block size group 1..3]; two symbols deciding whether
/// the inter block also mixes in an intra prediction.
/// Go source: DefaultInterIntraCdf in tables_interintra_gen.go, shape 3x3.
let av1_inter_intra : Array[Array[Int]] = [
  [26887, 32768, 0],
  [27597, 32768, 0],
  [30237, 32768, 0],
]

///|
/// Fresh DefaultInterIntraCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_inter_intra_cdfs() -> Array[Array[Int]] {
  [[26887, 32768, 0], [27597, 32768, 0], [30237, 32768, 0]]
}

///|
/// Default_Inter_Intra_Mode_Cdf: [block size group 1..3][4 symbols] of the intra
/// mode blended into the inter block.
/// Go source: DefaultInterIntraModeCdf in tables_interintra_gen.go, shape 3x5.
let av1_inter_intra_mode : Array[Array[Int]] = [
  [1875, 11082, 27332, 32768, 0],
  [2473, 9996, 26388, 32768, 0],
  [4238, 11537, 25926, 32768, 0],
]

///|
/// Fresh DefaultInterIntraModeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_inter_intra_mode_cdfs() -> Array[Array[Int]] {
  [
    [1875, 11082, 27332, 32768, 0],
    [2473, 9996, 26388, 32768, 0],
    [4238, 11537, 25926, 32768, 0],
  ]
}

///|
/// Default_Wedge_Inter_Intra_Cdf: [block mi_size 0..21]; one binary symbol.
/// Go source: DefaultWedgeInterIntraCdf in tables_interintra_gen.go, shape 22x3.
let av1_wedge_inter_intra : Array[Array[Int]] = [
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [20036, 32768, 0],
  [24957, 32768, 0],
  [26704, 32768, 0],
  [27530, 32768, 0],
  [29564, 32768, 0],
  [29444, 32768, 0],
  [26872, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
]

///|
/// Fresh DefaultWedgeInterIntraCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_wedge_inter_intra_cdfs() -> Array[Array[Int]] {
  [
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [20036, 32768, 0],
    [24957, 32768, 0],
    [26704, 32768, 0],
    [27530, 32768, 0],
    [29564, 32768, 0],
    [29444, 32768, 0],
    [26872, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
  ]
}

///|
/// Default_Inter_Tx_Type_Set1_Cdf: [transform size class 0..1][16 transform types].
/// Go source: DefaultInterTxTypeSet1Cdf in tables_intertx_gen.go, shape 2x17.
let av1_inter_tx_type_set1 : Array[Array[Int]] = [
  [
    4458, 5560, 7695, 9709, 13330, 14789, 17537, 20266, 21504, 22848, 23934, 25474,
    27727, 28915, 30631, 32768, 0,
  ],
  [
    1645, 2573, 4778, 5711, 7807, 8622, 10522, 15357, 17674, 20408, 22517, 25010,
    27116, 28856, 30749, 32768, 0,
  ],
]

///|
/// Fresh DefaultInterTxTypeSet1Cdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_inter_tx_type_set1_cdfs() -> Array[Array[Int]] {
  [
    [
      4458, 5560, 7695, 9709, 13330, 14789, 17537, 20266, 21504, 22848, 23934, 25474,
      27727, 28915, 30631, 32768, 0,
    ],
    [
      1645, 2573, 4778, 5711, 7807, 8622, 10522, 15357, 17674, 20408, 22517, 25010,
      27116, 28856, 30749, 32768, 0,
    ],
  ]
}

///|
/// Default_Inter_Tx_Type_Set2_Cdf: one context-free CDF over 12 transform types.
/// Go source: DefaultInterTxTypeSet2Cdf in tables_intertx_gen.go, shape 13.
let av1_inter_tx_type_set2 : Array[Int] = [
  770, 2421, 5225, 12907, 15819, 18927, 21561, 24089, 26595, 28526, 30529, 32768,
  0,
]

///|
/// Fresh DefaultInterTxTypeSet2Cdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_inter_tx_type_set2_cdfs() -> Array[Int] {
  [
    770, 2421, 5225, 12907, 15819, 18927, 21561, 24089, 26595, 28526, 30529, 32768,
    0,
  ]
}

///|
/// Default_Inter_Tx_Type_Set3_Cdf: [transform size class 0..3]; two symbols.
/// Go source: DefaultInterTxTypeSet3Cdf in tables_intertx_gen.go, shape 4x3.
let av1_inter_tx_type_set3 : Array[Array[Int]] = [
  [16384, 32768, 0],
  [4167, 32768, 0],
  [1998, 32768, 0],
  [748, 32768, 0],
]

///|
/// Fresh DefaultInterTxTypeSet3Cdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_inter_tx_type_set3_cdfs() -> Array[Array[Int]] {
  [[16384, 32768, 0], [4167, 32768, 0], [1998, 32768, 0], [748, 32768, 0]]
}

///|
/// Default_Compound_Type_Cdf: [block mi_size 0..21][2 symbols] choosing the
/// distance-weighted wedge or the average.
/// Go source: DefaultCompoundTypeCdf in tables_wedge_gen.go, shape 22x3.
let av1_compound_type : Array[Array[Int]] = [
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [23431, 32768, 0],
  [13171, 32768, 0],
  [11470, 32768, 0],
  [9770, 32768, 0],
  [9100, 32768, 0],
  [8233, 32768, 0],
  [6172, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
  [11820, 32768, 0],
  [7701, 32768, 0],
  [16384, 32768, 0],
  [16384, 32768, 0],
]

///|
/// Fresh DefaultCompoundTypeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_compound_type_cdfs() -> Array[Array[Int]] {
  [
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [23431, 32768, 0],
    [13171, 32768, 0],
    [11470, 32768, 0],
    [9770, 32768, 0],
    [9100, 32768, 0],
    [8233, 32768, 0],
    [6172, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
    [11820, 32768, 0],
    [7701, 32768, 0],
    [16384, 32768, 0],
    [16384, 32768, 0],
  ]
}

///|
/// Default_Wedge_Index_Cdf: [block mi_size 0..21][16 symbols]; the high wedge bits
/// come from this CDF and the tail is read with ns(5).
/// Go source: DefaultWedgeIndexCdf in tables_wedge_gen.go, shape 22x17.
let av1_wedge_index : Array[Array[Int]] = [
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, 20359, 22362, 24127, 25702,
    27752, 29450, 31171, 32768, 0,
  ],
  [
    806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, 17367, 18452, 19422, 22839,
    26127, 29629, 32768, 0,
  ],
  [
    2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, 21332, 24520, 27470,
    29456, 30529, 31656, 32768, 0,
  ],
  [
    1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, 19163, 20961, 22884, 24471,
    26719, 28714, 30877, 32768, 0,
  ],
  [
    1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, 16730, 18114, 19313,
    22521, 26012, 29550, 32768, 0,
  ],
  [
    2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, 17270, 20533, 23434, 25972,
    27944, 29570, 31416, 32768, 0,
  ],
  [
    1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, 20638, 22038, 23963, 25311,
    26988, 28766, 31012, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, 24284, 24985, 25684, 27259,
    28883, 30911, 32768, 0,
  ],
  [
    1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, 25057, 27251, 29173,
    30089, 30960, 31933, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
  [
    2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
    26624, 28672, 30720, 32768, 0,
  ],
]

///|
/// Fresh DefaultWedgeIndexCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_wedge_index_cdfs() -> Array[Array[Int]] {
  [
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2438, 4440, 6599, 8663, 11005, 12874, 15751, 18094, 20359, 22362, 24127, 25702,
      27752, 29450, 31171, 32768, 0,
    ],
    [
      806, 3266, 6005, 6738, 7218, 7367, 7771, 14588, 16323, 17367, 18452, 19422,
      22839, 26127, 29629, 32768, 0,
    ],
    [
      2779, 3738, 4683, 7213, 7775, 8017, 8655, 14357, 17939, 21332, 24520, 27470,
      29456, 30529, 31656, 32768, 0,
    ],
    [
      1684, 3625, 5675, 7108, 9302, 11274, 14429, 17144, 19163, 20961, 22884, 24471,
      26719, 28714, 30877, 32768, 0,
    ],
    [
      1142, 3491, 6277, 7314, 8089, 8355, 9023, 13624, 15369, 16730, 18114, 19313,
      22521, 26012, 29550, 32768, 0,
    ],
    [
      2742, 4195, 5727, 8035, 8980, 9336, 10146, 14124, 17270, 20533, 23434, 25972,
      27944, 29570, 31416, 32768, 0,
    ],
    [
      1727, 3948, 6101, 7796, 9841, 12344, 15766, 18944, 20638, 22038, 23963, 25311,
      26988, 28766, 31012, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      154, 987, 1925, 2051, 2088, 2111, 2151, 23033, 23703, 24284, 24985, 25684,
      27259, 28883, 30911, 32768, 0,
    ],
    [
      1135, 1322, 1493, 2635, 2696, 2737, 2770, 21016, 22935, 25057, 27251, 29173,
      30089, 30960, 31933, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
    [
      2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384, 18432, 20480, 22528, 24576,
      26624, 28672, 30720, 32768, 0,
    ],
  ]
}

///|
/// Default_Y_Mode_Cdf: [size group 0..3][10 luma prediction modes]. An intra block
/// inside an inter frame selects its row by Size_Group[ MiSize ] instead of using
/// the above and left modes of an intra frame.
/// Go source: DefaultYModeCdf in tables_ymode_gen.go, shape 4x14.
let av1_y_mode : Array[Array[Int]] = [
  [
    22801, 23489, 24293, 24756, 25601, 26123, 26606, 27418, 27945, 29228, 29685,
    30349, 32768, 0,
  ],
  [
    18673, 19845, 22631, 23318, 23950, 24649, 25527, 27364, 28152, 29701, 29984,
    30852, 32768, 0,
  ],
  [
    19770, 20979, 23396, 23939, 24241, 24654, 25136, 27073, 27830, 29360, 29730,
    30659, 32768, 0,
  ],
  [
    20155, 21301, 22838, 23178, 23261, 23533, 23703, 24804, 25352, 26575, 27016,
    28049, 32768, 0,
  ],
]

///|
/// Fresh DefaultYModeCdf rows for one tile, so that probability adaptation cannot
/// corrupt these defaults. Retain the result for the tile's lifetime.
fn av1_y_mode_cdfs() -> Array[Array[Int]] {
  Array::makei(av1_y_mode.length(), i => Array::copy(av1_y_mode[i]))
}