+/*
+ * Copyright (c) 2016, Alliance for Open Media. All rights reserved
+ *
+ * This source code is subject to the terms of the BSD 2 Clause License and
+ * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
There is no mention of GPL here.
+ * was not distributed with this source code in the LICENSE file, you can
+ * obtain it at www.aomedia.org/license/software. If the Alliance for Open
+ * Media Patent License 1.0 was not distributed with this source code in the
+ * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
+ */
+
+#include "hantro.h"
+#include "rockchip_av1_entropymode.h"
+
+#define AOM_ICDF ICDF
+#define AOM_CDF2(a0) AOM_ICDF(a0)
+#define AOM_CDF3(a0, a1) \
+ AOM_ICDF(a0), AOM_ICDF(a1)
+#define AOM_CDF4(a0, a1, a2) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2)
+#define AOM_CDF5(a0, a1, a2, a3) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3)
+#define AOM_CDF6(a0, a1, a2, a3, a4) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), AOM_ICDF(a4)
+#define AOM_CDF7(a0, a1, a2, a3, a4, a5) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), \
+ AOM_ICDF(a3), AOM_ICDF(a4), AOM_ICDF(a5)
+#define AOM_CDF8(a0, a1, a2, a3, a4, a5, a6) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), \
+ AOM_ICDF(a3), AOM_ICDF(a4), AOM_ICDF(a5), AOM_ICDF(a6)
+#define AOM_CDF9(a0, a1, a2, a3, a4, a5, a6, a7) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), \
+ AOM_ICDF(a4), AOM_ICDF(a5), AOM_ICDF(a6), AOM_ICDF(a7)
+#define AOM_CDF10(a0, a1, a2, a3, a4, a5, a6, a7, a8) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), \
+ AOM_ICDF(a4), AOM_ICDF(a5), AOM_ICDF(a6), AOM_ICDF(a7), AOM_ICDF(a8)
+#define AOM_CDF11(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), AOM_ICDF(a4), \
+ AOM_ICDF(a5), AOM_ICDF(a6), AOM_ICDF(a7), AOM_ICDF(a8), AOM_ICDF(a9)
+#define AOM_CDF12(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), AOM_ICDF(a4), AOM_ICDF(a5), \
+ AOM_ICDF(a6), AOM_ICDF(a7), AOM_ICDF(a8), AOM_ICDF(a9), AOM_ICDF(a10)
+#define AOM_CDF13(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), AOM_ICDF(a4), AOM_ICDF(a5), \
+ AOM_ICDF(a6), AOM_ICDF(a7), AOM_ICDF(a8), AOM_ICDF(a9), AOM_ICDF(a10), AOM_ICDF(a11)
+#define AOM_CDF14(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), AOM_ICDF(a4), \
+ AOM_ICDF(a5), AOM_ICDF(a6), AOM_ICDF(a7), AOM_ICDF(a8), AOM_ICDF(a9), \
+ AOM_ICDF(a10), AOM_ICDF(a11), AOM_ICDF(a12)
+#define AOM_CDF15(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), AOM_ICDF(a4), \
+ AOM_ICDF(a5), AOM_ICDF(a6), AOM_ICDF(a7), AOM_ICDF(a8), AOM_ICDF(a9), \
+ AOM_ICDF(a10), AOM_ICDF(a11), AOM_ICDF(a12), AOM_ICDF(a13)
+#define AOM_CDF16(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) \
+ AOM_ICDF(a0), AOM_ICDF(a1), AOM_ICDF(a2), AOM_ICDF(a3), AOM_ICDF(a4), \
+ AOM_ICDF(a5), AOM_ICDF(a6), AOM_ICDF(a7), AOM_ICDF(a8), AOM_ICDF(a9), \
+ AOM_ICDF(a10), AOM_ICDF(a11), AOM_ICDF(a12), AOM_ICDF(a13), AOM_ICDF(a14)
+
+const uint8_t av1_partition_probs[NUM_FRAME_TYPES][NUM_PARTITION_CONTEXTS][PARTITION_TYPES] = {
Weird, this doesn't seem to be used. I would expect this to be static as well.
+ /* 1 byte padding */
+ {
+ /* frame_type = keyframe */
+ /* 8x8 -> 4x4 */
+ { 158, 97, 94, 0} /* a/l both not split */,
+ { 93, 24, 99, 0} /* a split, l not split */,
+ { 85, 119, 44, 0} /* l split, a not split */,
+ { 62, 59, 67, 0} /* a/l both split */,
+ /* 16x16 -> 8x8 */
+ { 149, 53, 53, 0} /* a/l both not split */,
+ { 94, 20, 48, 0} /* a split, l not split */,
+ { 83, 53, 24, 0} /* l split, a not split */,
+ { 52, 18, 18, 0} /* a/l both split */,
+ /* 32x32 -> 16x16 */
+ { 150, 40, 39, 0} /* a/l both not split */,
+ { 78, 12, 26, 0} /* a split, l not split */,
+ { 67, 33, 11, 0} /* l split, a not split */,
+ { 24, 7, 5, 0} /* a/l both split */,
+ /* 64x64 -> 32x32 */
+ { 174, 35, 49, 0} /* a/l both not split */,
+ { 68, 11, 27, 0} /* a split, l not split */,
+ { 57, 15, 9, 0} /* l split, a not split */,
+ { 12, 3, 3, 0} /* a/l both split */
+ },
+ {
+ /* frame_type = interframe */
+ /* 8x8 -> 4x4 */
+ { 199, 122, 141, 0} /* a/l both not split */,
+ { 147, 63, 159, 0} /* a split, l not split */,
+ { 148, 133, 118, 0} /* l split, a not split */,
+ { 121, 104, 114, 0} /* a/l both split */,
+ /* 16x16 -> 8x8 */
+ { 174, 73, 87, 0} /* a/l both not split */,
+ { 92, 41, 83, 0} /* a split, l not split */,
+ { 82, 99, 50, 0} /* l split, a not split */,
+ { 53, 39, 39, 0} /* a/l both split */,
+ /* 32x32 -> 16x16 */
+ { 177, 58, 59, 0} /* a/l both not split */,
+ { 68, 26, 63, 0} /* a split, l not split */,
+ { 52, 79, 25, 0} /* l split, a not split */,
+ { 17, 14, 12, 0} /* a/l both split */,
+ /* 64x64 -> 32x32 */
+ { 222, 34, 30, 0} /* a/l both not split */,
+ { 72, 16, 44, 0} /* a split, l not split */,
+ { 58, 32, 12, 0} /* l split, a not split */,
+ { 10, 7, 6, 0} /* a/l both split */
+ }
+};
+
+/* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */
+const int8_t av1hwd_intra_mode_tree[] = {
Ditto.
+ -DC_PRED,
+ 2, /* 0 = DC_NODE */
+ -TM_PRED_AV1,
+ 4, /* 1 = TM_NODE */
+ -V_PRED,
+ 6, /* 2 = V_NODE */
+ 8,
+ 12, /* 3 = COM_NODE */
+ -H_PRED,
+ 10, /* 4 = H_NODE */
+ -D135_PRED,
+ -D117_PRED, /* 5 = D135_NODE */
+ -D45_PRED,
+ 14, /* 6 = D45_NODE */
+ -D63_PRED,
+ 16, /* 7 = D63_NODE */
+ -D153_PRED,
+ -D27_PRED /* 8 = D153_NODE */
+};
+
+const int8_t av1_sb_mv_ref_tree[6] = {
+ -ZEROMV, 2, -NEARESTMV,
+ 4, -NEARMV, -NEWMV
+};
+
+const int8_t av1hwd_partition_tree[6] = {
+ -PARTITION_NONE, 2, -PARTITION_HORZ,
+ 4, -PARTITION_VERT, -PARTITION_SPLIT
+};
+
+const int8_t av1_segment_tree[2 * MAX_MB_SEGMENTS - 2] = {
+ 2, 4, 6, 8, 10, 12, 0, -1, -2, -3, -4, -5, -6, -7
+};
+
+const uint8_t av1_default_tx_probs_32x32p[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 1] = {
+ { 3, 136, 37, },
+ { 5, 52, 13, },
+};
+
+const uint8_t av1_default_tx_probs_16x16p[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 2] = {
+ { 20, 152, },
+ { 15, 101, },
+};
+
+const uint8_t av1_default_tx_probs_8x8p[TX_SIZE_CONTEXTS][TX_SIZE_MAX_SB - 3] = {
+ { 100, },
+ { 66, },
+};
+
+const uint8_t av1_default_mbskip_probs[MBSKIP_CONTEXTS] = { 192, 128, 64};
+
+const uint8_t av1_default_intra_ext_tx_prob[EXT_TX_SIZES][TX_TYPES][TX_TYPES - 1] = {
+ { { 240, 85, 128}, { 4, 1, 248}, { 4, 1, 8}, { 4, 248, 128} },
+ { { 244, 85, 128}, { 8, 2, 248}, { 8, 2, 8}, { 8, 248, 128} },
+ { { 248, 85, 128}, { 16, 4, 248}, { 16, 4, 8}, { 16, 248, 128} },
+};
+
+const uint8_t av1_default_inter_ext_tx_prob[EXT_TX_SIZES][TX_TYPES - 1] = {
+ { 160, 85, 128 },
+ { 176, 85, 128 },
+ { 192, 85, 128 },
+};
+
+const uint8_t av1_default_motion_mode_prob[MOTION_MODE_CONTEXTS][MOTION_MODE_COUNT - 1] = {
+ { 151 }, { 153 }, { 144 }, { 178 },
+ { 165 }, { 160 }, { 207 }, { 195 },
+ { 168 }, { 244 }
+};
Same for (I think) all these non-static arrays above.
What's going on with that?