/* these coefficients dequantize intraframe Y plane coefficients
* (note: same as JPEG) */
-static const int8_t vp31_intra_y_dequant[64] = {
+static const uint8_t vp31_intra_y_dequant[64] = {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
/* these coefficients dequantize intraframe C plane coefficients
* (note: same as JPEG) */
-static const int8_t vp31_intra_c_dequant[64] = {
+static const uint8_t vp31_intra_c_dequant[64] = {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
};
/* these coefficients dequantize interframe coefficients (all planes) */
-static const int8_t vp31_inter_dequant[64] = {
+static const uint8_t vp31_inter_dequant[64] = {
16, 16, 16, 20, 24, 28, 32, 40,
16, 16, 20, 24, 28, 32, 40, 48,
16, 20, 24, 28, 32, 40, 48, 64,
};
/* only tokens 0..6 indicate eob runs */
-static const uint8_t eob_run_base[7] = {
- 1, 2, 3, 4, 8, 16, 0
-};
-static const uint8_t eob_run_get_bits[7] = {
- 0, 0, 0, 2, 3, 4, 12
+static const struct {
+ uint8_t base, bits;
+} eob_run_table[7] = {
+ {1, 0}, {2, 0}, {3, 0}, {4, 2}, {8, 3}, {16, 4}, {0, 12}
};
static const uint8_t zero_run_base[32] = {
coeff_table_token_31
};
-static const uint16_t dc_bias[16][32][2] = {
+static const uint16_t vp3_bias[5 * 16][32][2] = {
{ /* DC bias table 0 */
{ 0x2D, 6 },
{ 0x26, 7 },
{ 0x151, 9 },
{ 0x150, 9 },
{ 0x2A9, 10 }
- }
-};
-
-static const uint16_t ac_bias_0[16][32][2] = {
+ },
{ /* AC bias group 1, table 0 */
{ 0x8, 5 },
{ 0x25, 7 },
{ 0x38, 7 },
{ 0x3D, 6 },
{ 0x79, 7 }
- }
-};
-
-static const uint16_t ac_bias_1[16][32][2] = {
+ },
{ /* AC bias group 2, table 0 */
{ 0xB, 5 },
{ 0x2B, 7 },
{ 0xB, 6 },
{ 0x5F, 7 },
{ 0xBD, 8 }
- }
-};
-
-static const uint16_t ac_bias_2[16][32][2] = {
+ },
{ /* AC bias group 3, table 0 */
{ 0x3, 4 },
{ 0x9, 6 },
{ 0x1B, 5 },
{ 0x35B7, 14 },
{ 0x35B6, 14 }
- }
-};
-
-static const uint16_t ac_bias_3[16][32][2] = {
+ },
{ /* AC bias group 4, table 0 */
{ 0x0, 3 },
{ 0x10, 5 },