OSUOSL/Nero are experiencing Internet connectivity problems. This affects us as we're hosted with OSUOSL. We apologize for the inconvenience.

Commit d2352ecb authored by Ola Hugosson's avatar Ola Hugosson Committed by Thomas Davies

lv_map_multi: add 2 more eob coeff contexts

The EOB coefficient cannot be 0 and for that reason it has special base_cdf contexts.
Before this commit there was two contexts (DC and AC). This commit adds two additional
contexts to separate the AC into 3 bands (i<=N/8, i<=N/4, i<=N/2).

Change-Id: If088b20fd891920b7ea7fc988d29bf6d86d93bfc
parent 736ddef5
......@@ -75,7 +75,7 @@ extern "C" {
#define SIG_COEF_CONTEXTS_2D 26
#define SIG_COEF_CONTEXTS_1D 16
#if CONFIG_LV_MAP_MULTI
#define SIG_COEF_CONTEXTS_EOB 2
#define SIG_COEF_CONTEXTS_EOB 4
#define SIG_COEF_CONTEXTS \
(SIG_COEF_CONTEXTS_2D + SIG_COEF_CONTEXTS_1D + SIG_COEF_CONTEXTS_EOB)
#else
......
......@@ -34,97 +34,105 @@ const aom_prob default_dc_sign[PLANE_TYPES][DC_SIGN_CONTEXTS] = {
#if CONFIG_LV_MAP_MULTI
const aom_prob default_coeff_base
[TX_SIZES][PLANE_TYPES][NUM_BASE_LEVELS][COEFF_BASE_CONTEXTS] = {
{ { { 139, 242, 199, 135, 87, 51, 245, 208, 138, 89, 60,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 240,
200, 108, 70, 56, 230, 199, 126, 66, 32, 242, 204,
128, 74, 45, 241, 203, 120, 62, 128, 128, 139, 242 },
{ 118, 230, 197, 147, 103, 60, 228, 202, 154, 110, 72,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 213,
196, 134, 94, 58, 199, 184, 130, 82, 40, 217, 186,
134, 86, 57, 204, 185, 127, 74, 128, 128, 118, 230 } },
{ { 203, 248, 223, 170, 105, 58, 252, 235, 195, 125, 72,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 253,
244, 209, 110, 85, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 203, 248 },
{ 170, 239, 210, 163, 112, 68, 239, 219, 175, 127, 84,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 246,
234, 184, 142, 154, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 170, 239 } } },
{ { { 119, 240, 196, 136, 90, 50, 247, 214, 159, 109, 64,
241, 201, 137, 91, 53, 239, 199, 136, 89, 52, 251,
230, 176, 121, 76, 231, 202, 142, 84, 39, 246, 221,
169, 111, 61, 248, 221, 152, 97, 60, 128, 119, 240 },
{ 98, 209, 182, 140, 100, 56, 234, 207, 166, 122, 73,
215, 189, 142, 103, 59, 216, 188, 140, 99, 59, 235,
216, 179, 137, 88, 214, 189, 141, 96, 46, 224, 200,
159, 117, 68, 221, 199, 152, 108, 68, 128, 98, 209 } },
{ { 195, 245, 212, 159, 108, 64, 251, 231, 186, 131, 80,
250, 228, 175, 108, 58, 244, 213, 163, 120, 82, 254,
245, 216, 159, 91, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 195, 245 },
{ 150, 207, 199, 164, 121, 76, 239, 221, 185, 142, 89,
231, 208, 162, 113, 69, 228, 205, 169, 136, 95, 246,
235, 204, 157, 110, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 150, 207 } } },
{ { { 93, 232, 185, 124, 81, 38, 244, 206, 147, 98, 53,
246, 210, 150, 100, 54, 244, 208, 146, 94, 44, 253,
236, 189, 135, 82, 228, 195, 130, 76, 35, 242, 220,
170, 114, 59, 253, 235, 184, 122, 68, 128, 93, 232 },
{ 80, 203, 169, 127, 86, 41, 228, 194, 151, 108, 58,
221, 195, 152, 110, 60, 220, 194, 149, 103, 48, 238,
221, 188, 147, 92, 205, 184, 130, 85, 41, 208, 195,
159, 120, 62, 233, 212, 173, 126, 76, 128, 80, 203 } },
{ { 187, 239, 199, 149, 109, 66, 250, 226, 179, 130, 82,
248, 218, 159, 100, 63, 251, 227, 184, 135, 91, 254,
241, 202, 150, 99, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 187, 239 },
{ 130, 202, 169, 146, 118, 73, 236, 217, 186, 146, 91,
215, 194, 154, 102, 77, 234, 216, 188, 145, 98, 245,
229, 201, 163, 110, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 130, 202 } } },
{ { { 102, 225, 171, 113, 74, 33, 243, 201, 139, 92, 44,
244, 208, 146, 99, 53, 247, 214, 158, 107, 52, 253,
233, 183, 131, 73, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 102, 225 },
{ 80, 190, 152, 116, 79, 34, 222, 187, 142, 101, 47,
211, 187, 148, 106, 56, 221, 200, 163, 118, 56, 236,
215, 181, 140, 78, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 80, 190 } },
{ { 166, 237, 184, 144, 106, 62, 245, 211, 167, 129, 93,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 254,
240, 205, 158, 112, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 166, 237 },
{ 91, 185, 133, 105, 95, 60, 213, 190, 164, 131, 107,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 242,
227, 203, 160, 127, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 91, 185 } } }
{ { { 139, 242, 199, 135, 87, 51, 245, 208, 138, 89, 60, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 240, 200, 108,
70, 56, 230, 199, 126, 66, 32, 242, 204, 128, 74, 45,
241, 203, 120, 62, 128, 128, 139, 180, 180, 242 },
{ 118, 230, 197, 147, 103, 60, 228, 202, 154, 110, 72, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 213, 196, 134,
94, 58, 199, 184, 130, 82, 40, 217, 186, 134, 86, 57,
204, 185, 127, 74, 128, 128, 118, 180, 180, 230 } },
{ { 203, 248, 223, 170, 105, 58, 252, 235, 195, 125, 72, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 253, 244, 209,
110, 85, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 203, 180, 180, 248 },
{ 170, 239, 210, 163, 112, 68, 239, 219, 175, 127, 84, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 246, 234, 184,
142, 154, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 170, 180, 180, 239 } } },
{ { { 119, 240, 196, 136, 90, 50, 247, 214, 159, 109, 64, 241,
201, 137, 91, 53, 239, 199, 136, 89, 52, 251, 230, 176,
121, 76, 231, 202, 142, 84, 39, 246, 221, 169, 111, 61,
248, 221, 152, 97, 60, 128, 119, 180, 180, 240 },
{ 98, 209, 182, 140, 100, 56, 234, 207, 166, 122, 73, 215,
189, 142, 103, 59, 216, 188, 140, 99, 59, 235, 216, 179,
137, 88, 214, 189, 141, 96, 46, 224, 200, 159, 117, 68,
221, 199, 152, 108, 68, 128, 98, 180, 180, 209 } },
{ { 195, 245, 212, 159, 108, 64, 251, 231, 186, 131, 80, 250,
228, 175, 108, 58, 244, 213, 163, 120, 82, 254, 245, 216,
159, 91, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 195, 180, 180, 245 },
{ 150, 207, 199, 164, 121, 76, 239, 221, 185, 142, 89, 231,
208, 162, 113, 69, 228, 205, 169, 136, 95, 246, 235, 204,
157, 110, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 150, 180, 180, 207 } } },
{ { { 93, 232, 185, 124, 81, 38, 244, 206, 147, 98, 53, 246,
210, 150, 100, 54, 244, 208, 146, 94, 44, 253, 236, 189,
135, 82, 228, 195, 130, 76, 35, 242, 220, 170, 114, 59,
253, 235, 184, 122, 68, 128, 93, 180, 180, 232 },
{ 80, 203, 169, 127, 86, 41, 228, 194, 151, 108, 58, 221,
195, 152, 110, 60, 220, 194, 149, 103, 48, 238, 221, 188,
147, 92, 205, 184, 130, 85, 41, 208, 195, 159, 120, 62,
233, 212, 173, 126, 76, 128, 80, 180, 180, 203 } },
{ { 187, 239, 199, 149, 109, 66, 250, 226, 179, 130, 82, 248,
218, 159, 100, 63, 251, 227, 184, 135, 91, 254, 241, 202,
150, 99, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 187, 180, 180, 239 },
{ 130, 202, 169, 146, 118, 73, 236, 217, 186, 146, 91, 215,
194, 154, 102, 77, 234, 216, 188, 145, 98, 245, 229, 201,
163, 110, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 130, 180, 180, 202 } } },
{ { { 102, 225, 171, 113, 74, 33, 243, 201, 139, 92, 44, 244,
208, 146, 99, 53, 247, 214, 158, 107, 52, 253, 233, 183,
131, 73, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 102, 180, 180, 225 },
{ 80, 190, 152, 116, 79, 34, 222, 187, 142, 101, 47, 211,
187, 148, 106, 56, 221, 200, 163, 118, 56, 236, 215, 181,
140, 78, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 80, 180, 180, 190 } },
{ { 166, 237, 184, 144, 106, 62, 245, 211, 167, 129, 93, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 254, 240, 205,
158, 112, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 166, 180, 180, 237 },
{ 91, 185, 133, 105, 95, 60, 213, 190, 164, 131, 107, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 242, 227, 203,
160, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 91, 180, 180, 185 } } }
};
const aom_prob default_nz_map[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS] = {
{ { 59, 183, 130, 76, 48, 28, 202, 153, 84, 54, 34, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 200, 163, 84, 61, 34, 182, 131, 71, 31,
16, 210, 156, 78, 36, 26, 220, 170, 73, 32, 128, 128, 1, 1 },
{ 96, 209, 171, 109, 59, 28, 223, 187, 128, 71, 35, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 215, 192, 135, 63, 73, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 1, 1 } },
{ { 49, 190, 129, 74, 46, 25, 206, 150, 90, 55, 32, 205, 142, 79, 48,
27, 191, 137, 78, 47, 27, 223, 181, 109, 63, 37, 204, 136, 82, 42,
19, 226, 169, 106, 58, 30, 231, 180, 96, 49, 29, 128, 1, 1 },
{ 86, 210, 159, 90, 56, 34, 223, 181, 114, 69, 40, 229, 182, 113, 59,
28, 218, 162, 96, 64, 42, 237, 207, 146, 92, 50, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 1, 1 } },
{ { 41, 187, 119, 66, 40, 20, 212, 144, 80, 49, 26, 226, 151, 84, 49,
27, 214, 146, 82, 47, 22, 237, 190, 115, 68, 40, 206, 126, 71, 37,
17, 227, 168, 103, 61, 29, 237, 197, 119, 63, 32, 128, 1, 1 },
{ 70, 207, 146, 82, 54, 35, 226, 167, 99, 65, 40, 238, 176, 96, 57,
29, 229, 171, 108, 69, 47, 244, 201, 124, 78, 48, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 1, 1 } },
{ { 40, 176, 107, 57, 37, 16, 216, 136, 73, 44, 22, 235, 145, 79, 49,
26, 227, 149, 84, 52, 26, 247, 195, 107, 64, 35, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 1, 1 },
{ 49, 210, 153, 95, 58, 31, 217, 151, 93, 64, 41, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 248, 197, 123, 79, 53, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 1, 1 } }
{ { 59, 183, 130, 76, 48, 28, 202, 153, 84, 54, 34, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 200, 163, 84,
61, 34, 182, 131, 71, 31, 16, 210, 156, 78, 36, 26,
220, 170, 73, 32, 128, 128, 1, 1, 1, 1 },
{ 96, 209, 171, 109, 59, 28, 223, 187, 128, 71, 35, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 215, 192, 135,
63, 73, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 1, 1, 1, 1 } },
{ { 49, 190, 129, 74, 46, 25, 206, 150, 90, 55, 32, 205,
142, 79, 48, 27, 191, 137, 78, 47, 27, 223, 181, 109,
63, 37, 204, 136, 82, 42, 19, 226, 169, 106, 58, 30,
231, 180, 96, 49, 29, 128, 1, 1, 1, 1 },
{ 86, 210, 159, 90, 56, 34, 223, 181, 114, 69, 40, 229,
182, 113, 59, 28, 218, 162, 96, 64, 42, 237, 207, 146,
92, 50, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 1, 1, 1, 1 } },
{ { 41, 187, 119, 66, 40, 20, 212, 144, 80, 49, 26, 226,
151, 84, 49, 27, 214, 146, 82, 47, 22, 237, 190, 115,
68, 40, 206, 126, 71, 37, 17, 227, 168, 103, 61, 29,
237, 197, 119, 63, 32, 128, 1, 1, 1, 1 },
{ 70, 207, 146, 82, 54, 35, 226, 167, 99, 65, 40, 238,
176, 96, 57, 29, 229, 171, 108, 69, 47, 244, 201, 124,
78, 48, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 1, 1, 1, 1 } },
{ { 40, 176, 107, 57, 37, 16, 216, 136, 73, 44, 22, 235,
145, 79, 49, 26, 227, 149, 84, 52, 26, 247, 195, 107,
64, 35, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 1, 1, 1, 1 },
{ 49, 210, 153, 95, 58, 31, 217, 151, 93, 64, 41, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 248, 197, 123,
79, 53, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 1, 1, 1, 1 } }
};
#else // CONFIG_LV_MAP_MULTI
#if USE_CAUSAL_BASE_CTX
......
......@@ -448,8 +448,12 @@ static INLINE int get_nz_map_ctx(const uint8_t *const levels,
const TX_TYPE tx_type) {
#endif
#if CONFIG_LV_MAP_MULTI
if (is_eob)
return scan[scan_idx] == 0 ? SIG_COEF_CONTEXTS - 2 : SIG_COEF_CONTEXTS - 1;
if (is_eob) {
if (scan_idx == 0) return SIG_COEF_CONTEXTS - 4;
if (scan_idx <= (height << bwl) / 8) return SIG_COEF_CONTEXTS - 3;
if (scan_idx <= (height << bwl) / 4) return SIG_COEF_CONTEXTS - 2;
return SIG_COEF_CONTEXTS - 1;
}
#endif
const int coeff_idx = scan[scan_idx];
const int row = coeff_idx >> bwl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment