Commit e2d8f183 authored by Dake He's avatar Dake He

[lv_map_multi] BR coding

1. Use separate contexts for transforms of size 32x32 and above.
2. Initialize cdf directly

Change-Id: I3373143788e81b2547d99e420e591892ef2641a2
parent 8be58fad
......@@ -343,69 +343,186 @@ static const aom_prob
#if CONFIG_LV_MAP_MULTI
const aom_prob default_coeff_lps[TX_SIZES][PLANE_TYPES][BR_CDF_SIZE -
1][LEVEL_CONTEXTS] = {
{ { { 87, 128, 170, 197, 212, 221, 233, 73, 90, 128, 162,
184, 196, 212, 64, 81, 115, 149, 173, 183, 207 },
{ 105, 132, 168, 194, 208, 219, 232, 93, 100, 129, 159,
178, 193, 210, 78, 94, 118, 146, 165, 182, 197 },
{ 118, 136, 167, 190, 206, 216, 231, 112, 111, 130, 155,
175, 188, 207, 103, 104, 122, 144, 163, 176, 195 } },
{ { 69, 108, 160, 197, 216, 222, 233, 50, 71, 119, 154,
181, 196, 207, 35, 58, 98, 135, 158, 184, 182 },
{ 91, 120, 163, 197, 211, 222, 232, 67, 82, 124, 157,
177, 189, 204, 57, 77, 104, 134, 154, 181, 219 },
{ 112, 130, 166, 194, 212, 219, 231, 97, 100, 128, 153,
181, 186, 199, 96, 90, 109, 119, 161, 148, 174 } } },
{ { { 101, 145, 185, 207, 218, 226, 237, 112, 112, 142, 170,
188, 200, 218, 63, 83, 116, 148, 170, 184, 205 },
{ 119, 149, 184, 205, 216, 224, 236, 139, 123, 144, 168,
185, 197, 217, 83, 95, 119, 147, 166, 181, 204 },
{ 133, 154, 182, 202, 214, 222, 236, 155, 134, 148, 168,
184, 195, 215, 97, 105, 124, 147, 164, 178, 201 } },
{ { 93, 125, 164, 191, 206, 216, 236, 70, 81, 116, 153,
175, 193, 216, 39, 62, 100, 138, 162, 182, 207 },
{ 105, 130, 162, 188, 202, 216, 232, 85, 92, 118, 149,
175, 191, 214, 55, 74, 103, 145, 163, 177, 205 },
{ 115, 136, 161, 185, 202, 213, 233, 99, 105, 128, 148,
168, 180, 209, 79, 83, 113, 140, 165, 175, 191 } } },
{ { { 111, 151, 188, 209, 220, 227, 241, 145, 145, 165, 186,
201, 210, 228, 73, 93, 123, 153, 174, 188, 211 },
{ 134, 155, 188, 208, 219, 226, 241, 173, 165, 171, 187,
200, 209, 227, 95, 108, 130, 154, 173, 187, 210 },
{ 154, 162, 189, 207, 217, 225, 240, 188, 181, 178, 188,
199, 208, 227, 112, 121, 137, 157, 173, 186, 209 } },
{ { 126, 155, 188, 208, 218, 220, 243, 142, 142, 157, 168,
189, 201, 224, 53, 65, 97, 117, 145, 169, 186 },
{ 144, 163, 188, 206, 217, 224, 239, 173, 165, 172, 175,
187, 211, 224, 88, 85, 97, 124, 145, 169, 194 },
{ 158, 170, 188, 203, 212, 220, 238, 179, 182, 183, 182,
193, 200, 226, 100, 108, 111, 128, 140, 163, 206 } } },
{ { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
{ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } } },
{ { { 88, 128, 170, 198, 212, 221, 233, 74, 90, 129, 162,
184, 196, 214, 63, 80, 114, 150, 174, 181, 206 },
{ 106, 132, 168, 194, 209, 219, 233, 95, 101, 129, 160,
180, 194, 210, 76, 92, 118, 146, 167, 181, 198 },
{ 120, 137, 168, 191, 206, 216, 231, 119, 113, 132, 157,
177, 188, 207, 97, 104, 123, 145, 164, 176, 196 } },
{ { 69, 107, 160, 197, 215, 223, 234, 48, 69, 117, 157,
184, 191, 204, 36, 56, 101, 139, 164, 181, 160 },
{ 91, 118, 162, 196, 211, 219, 230, 63, 84, 122, 158,
174, 190, 216, 60, 77, 105, 133, 152, 195, 187 },
{ 111, 129, 165, 196, 210, 220, 234, 76, 104, 128, 153,
175, 192, 204, 85, 85, 108, 135, 157, 144, 179 } } },
{ { { 100, 144, 184, 206, 218, 225, 237, 109, 111, 142, 170,
187, 200, 218, 61, 81, 115, 148, 169, 184, 205 },
{ 118, 148, 183, 204, 216, 224, 237, 135, 122, 144, 168,
185, 196, 216, 82, 93, 118, 146, 167, 180, 204 },
{ 134, 154, 183, 202, 214, 222, 235, 154, 134, 148, 167,
183, 195, 215, 99, 107, 124, 147, 164, 179, 201 } },
{ { 93, 124, 162, 189, 207, 219, 235, 70, 81, 115, 152,
177, 197, 215, 41, 60, 99, 141, 165, 178, 207 },
{ 106, 130, 161, 187, 204, 215, 234, 88, 95, 120, 152,
172, 193, 212, 52, 73, 102, 137, 166, 183, 195 },
{ 117, 136, 162, 186, 202, 214, 232, 90, 110, 130, 153,
165, 185, 212, 71, 84, 114, 141, 154, 178, 200 } } },
{ { { 107, 152, 190, 211, 222, 229, 242, 138, 140, 164, 186,
201, 210, 229, 68, 89, 122, 153, 175, 189, 212 },
{ 128, 157, 190, 210, 221, 229, 242, 171, 161, 170, 186,
200, 209, 228, 90, 105, 129, 154, 173, 187, 211 },
{ 147, 163, 191, 209, 220, 227, 241, 188, 178, 177, 188,
199, 208, 227, 108, 118, 136, 156, 173, 186, 210 } },
{ { 120, 153, 186, 207, 215, 223, 239, 138, 131, 142, 156,
175, 197, 213, 49, 63, 95, 123, 154, 172, 191 },
{ 136, 160, 185, 205, 216, 223, 237, 167, 156, 153, 161,
177, 193, 213, 83, 81, 97, 128, 152, 172, 189 },
{ 147, 165, 184, 201, 212, 218, 236, 178, 177, 171, 162,
182, 186, 215, 101, 85, 111, 134, 153, 168, 194 } } },
{ { { 122, 135, 175, 198, 209, 216, 240, 146, 155, 174, 191,
203, 210, 231, 83, 98, 126, 155, 176, 189, 216 },
{ 153, 141, 173, 195, 209, 215, 241, 166, 176, 184, 195,
204, 213, 231, 110, 116, 135, 157, 176, 188, 216 },
{ 180, 149, 172, 195, 209, 214, 241, 181, 191, 195, 201,
208, 214, 231, 126, 131, 143, 160, 176, 189, 216 } },
{ { 168, 138, 178, 200, 210, 221, 245, 140, 179, 213, 222,
234, 241, 246, 94, 116, 133, 133, 130, 159, 159 },
{ 193, 154, 172, 188, 199, 229, 244, 166, 189, 209, 224,
235, 234, 242, 128, 137, 130, 133, 156, 134, 124 },
{ 212, 182, 173, 187, 212, 220, 242, 178, 183, 204, 226,
230, 229, 241, 149, 155, 144, 170, 117, 145, 205 } } },
#if CONFIG_TX64X64
{ { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
{ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } } }
{ { { 122, 135, 175, 198, 209, 216, 240, 146, 155, 174, 191,
203, 210, 231, 83, 98, 126, 155, 176, 189, 216 },
{ 153, 141, 173, 195, 209, 215, 241, 166, 176, 184, 195,
204, 213, 231, 110, 116, 135, 157, 176, 188, 216 },
{ 180, 149, 172, 195, 209, 214, 241, 181, 191, 195, 201,
208, 214, 231, 126, 131, 143, 160, 176, 189, 216 } },
{ { 168, 138, 178, 200, 210, 221, 245, 140, 179, 213, 222,
234, 241, 246, 94, 116, 133, 133, 130, 159, 159 },
{ 193, 154, 172, 188, 199, 229, 244, 166, 189, 209, 224,
235, 234, 242, 128, 137, 130, 133, 156, 134, 124 },
{ 212, 182, 173, 187, 212, 220, 242, 178, 183, 204, 226,
230, 229, 241, 149, 155, 144, 170, 117, 145, 205 } } }
#endif
};
const aom_cdf_prob
default_coeff_lps_multi[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS][CDF_SIZE(
BR_CDF_SIZE)] = {
{ { { AOM_CDF4(21555, 28113, 30577) }, { AOM_CDF4(16428, 24339, 28256) },
{ AOM_CDF4(10989, 18433, 23378) }, { AOM_CDF4(7485, 13650, 18484) },
{ AOM_CDF4(5589, 10547, 14891) }, { AOM_CDF4(4426, 8481, 12276) },
{ AOM_CDF4(2881, 5588, 8293) }, { AOM_CDF4(23339, 29272, 31140) },
{ AOM_CDF4(21303, 28228, 30764) }, { AOM_CDF4(16293, 24470, 28491) },
{ AOM_CDF4(12020, 19809, 24797) }, { AOM_CDF4(9189, 16225, 21299) },
{ AOM_CDF4(7683, 13778, 18785) }, { AOM_CDF4(5400, 10345, 14678) },
{ AOM_CDF4(24663, 30358, 31858) }, { AOM_CDF4(22498, 29058, 31259) },
{ AOM_CDF4(18125, 26008, 29530) }, { AOM_CDF4(13536, 21780, 26564) },
{ AOM_CDF4(10546, 18291, 23483) }, { AOM_CDF4(9579, 16349, 21499) },
{ AOM_CDF4(6453, 12376, 17128) } },
{ { AOM_CDF4(23922, 29625, 31402) }, { AOM_CDF4(19040, 26414, 29555) },
{ AOM_CDF4(12348, 19869, 24430) }, { AOM_CDF4(7582, 13510, 18026) },
{ AOM_CDF4(5303, 10148, 14249) }, { AOM_CDF4(4280, 8377, 11826) },
{ AOM_CDF4(2811, 5803, 8084) }, { AOM_CDF4(26608, 31256, 32319) },
{ AOM_CDF4(23934, 29872, 31587) }, { AOM_CDF4(17759, 25602, 29184) },
{ AOM_CDF4(12659, 20319, 25333) }, { AOM_CDF4(9216, 16791, 21855) },
{ AOM_CDF4(8263, 14575, 19079) }, { AOM_CDF4(6672, 10694, 15173) },
{ AOM_CDF4(28210, 31715, 32422) }, { AOM_CDF4(25619, 30627, 32059) },
{ AOM_CDF4(19841, 27449, 30526) }, { AOM_CDF4(14932, 23483, 27854) },
{ AOM_CDF4(11773, 20308, 25116) }, { AOM_CDF4(9459, 14864, 22634) },
{ AOM_CDF4(12072, 17246, 21558) } } },
{ { { AOM_CDF4(19938, 26867, 29676) }, { AOM_CDF4(14274, 22090, 26345) },
{ AOM_CDF4(9225, 15930, 20748) }, { AOM_CDF4(6382, 11744, 16173) },
{ AOM_CDF4(4844, 9162, 13011) }, { AOM_CDF4(3948, 7515, 10887) },
{ AOM_CDF4(2433, 4739, 6987) }, { AOM_CDF4(18867, 25411, 28349) },
{ AOM_CDF4(18606, 26031, 29240) }, { AOM_CDF4(14638, 22572, 26871) },
{ AOM_CDF4(11037, 18517, 23465) }, { AOM_CDF4(8802, 15423, 20353) },
{ AOM_CDF4(7210, 13161, 17862) }, { AOM_CDF4(4904, 9219, 13019) },
{ AOM_CDF4(24908, 30238, 31794) }, { AOM_CDF4(22433, 29032, 31213) },
{ AOM_CDF4(18011, 25945, 29466) }, { AOM_CDF4(13806, 21960, 26577) },
{ AOM_CDF4(11113, 18660, 23757) }, { AOM_CDF4(9252, 16237, 21227) },
{ AOM_CDF4(6548, 11889, 16358) } },
{ { AOM_CDF4(20809, 27804, 30495) }, { AOM_CDF4(16892, 24731, 28500) },
{ AOM_CDF4(12028, 19699, 24487) }, { AOM_CDF4(8553, 15108, 19950) },
{ AOM_CDF4(6303, 11650, 16097) }, { AOM_CDF4(4734, 9245, 13066) },
{ AOM_CDF4(2722, 5357, 7956) }, { AOM_CDF4(23838, 29708, 31693) },
{ AOM_CDF4(22438, 28930, 31114) }, { AOM_CDF4(18024, 25840, 29262) },
{ AOM_CDF4(13356, 21260, 25900) }, { AOM_CDF4(10120, 17584, 22957) },
{ AOM_CDF4(7590, 13822, 19077) }, { AOM_CDF4(5285, 9975, 13926) },
{ AOM_CDF4(27522, 31714, 32477) }, { AOM_CDF4(25070, 30561, 32042) },
{ AOM_CDF4(20135, 27722, 30522) }, { AOM_CDF4(14730, 23098, 27428) },
{ AOM_CDF4(11631, 19031, 24480) }, { AOM_CDF4(9966, 16442, 21406) },
{ AOM_CDF4(6204, 12551, 16937) } } },
{ { { AOM_CDF4(19065, 25915, 28842) }, { AOM_CDF4(13266, 20843, 25186) },
{ AOM_CDF4(8422, 14687, 19287) }, { AOM_CDF4(5698, 10535, 14604) },
{ AOM_CDF4(4346, 8250, 11723) }, { AOM_CDF4(3441, 6587, 9580) },
{ AOM_CDF4(1791, 3507, 5199) }, { AOM_CDF4(15051, 20942, 24075) },
{ AOM_CDF4(14854, 21498, 24913) }, { AOM_CDF4(11799, 18880, 23182) },
{ AOM_CDF4(8918, 15413, 20055) }, { AOM_CDF4(7075, 12706, 17195) },
{ AOM_CDF4(5827, 10806, 14934) }, { AOM_CDF4(3506, 6703, 9625) },
{ AOM_CDF4(24001, 29683, 31469) }, { AOM_CDF4(21337, 28085, 30605) },
{ AOM_CDF4(17211, 24958, 28605) }, { AOM_CDF4(13206, 21021, 25589) },
{ AOM_CDF4(10431, 17673, 22573) }, { AOM_CDF4(8624, 15128, 19923) },
{ AOM_CDF4(5685, 10456, 14453) } },
{ { AOM_CDF4(17447, 24631, 28107) }, { AOM_CDF4(13167, 20490, 24864) },
{ AOM_CDF4(9022, 15643, 20459) }, { AOM_CDF4(6240, 11550, 16094) },
{ AOM_CDF4(5205, 9527, 13534) }, { AOM_CDF4(4201, 7869, 11579) },
{ AOM_CDF4(2148, 4384, 6624) }, { AOM_CDF4(15066, 21210, 24708) },
{ AOM_CDF4(16035, 22582, 25713) }, { AOM_CDF4(14568, 21860, 25486) },
{ AOM_CDF4(12783, 20164, 24803) }, { AOM_CDF4(10318, 17270, 21741) },
{ AOM_CDF4(7498, 13730, 18892) }, { AOM_CDF4(5526, 10062, 13732) },
{ AOM_CDF4(26569, 30769, 31984) }, { AOM_CDF4(24696, 30223, 31927) },
{ AOM_CDF4(20650, 28180, 30770) }, { AOM_CDF4(17087, 24956, 28669) },
{ AOM_CDF4(13081, 21097, 25803) }, { AOM_CDF4(10681, 17893, 23022) },
{ AOM_CDF4(8334, 14681, 19016) } } },
{ { { AOM_CDF4(17185, 23482, 26251) }, { AOM_CDF4(15444, 23256, 27230) },
{ AOM_CDF4(10405, 17619, 22597) }, { AOM_CDF4(7390, 13468, 18098) },
{ AOM_CDF4(6005, 10905, 14947) }, { AOM_CDF4(5101, 9498, 13296) },
{ AOM_CDF4(2014, 3874, 5611) }, { AOM_CDF4(14114, 20695, 24209) },
{ AOM_CDF4(12937, 19147, 22593) }, { AOM_CDF4(10446, 16701, 20502) },
{ AOM_CDF4(8306, 14118, 18095) }, { AOM_CDF4(6743, 12003, 15921) },
{ AOM_CDF4(5826, 10373, 14059) }, { AOM_CDF4(3224, 6138, 8717) },
{ AOM_CDF4(22096, 28196, 30519) }, { AOM_CDF4(20239, 27093, 29867) },
{ AOM_CDF4(16604, 24251, 28006) }, { AOM_CDF4(12875, 20562, 25136) },
{ AOM_CDF4(10257, 17333, 22145) }, { AOM_CDF4(8555, 14959, 19618) },
{ AOM_CDF4(5109, 9467, 13140) } },
{ { AOM_CDF4(11246, 16551, 19319) }, { AOM_CDF4(15159, 22199, 25265) },
{ AOM_CDF4(9912, 17414, 22390) }, { AOM_CDF4(7173, 13945, 18995) },
{ AOM_CDF4(5838, 11785, 15365) }, { AOM_CDF4(4476, 7403, 10904) },
{ AOM_CDF4(1429, 2903, 4502) }, { AOM_CDF4(14802, 21129, 24651) },
{ AOM_CDF4(9832, 15858, 20702) }, { AOM_CDF4(5522, 10567, 15086) },
{ AOM_CDF4(4341, 7835, 10773) }, { AOM_CDF4(2766, 5154, 7962) },
{ AOM_CDF4(1924, 4490, 7405) }, { AOM_CDF4(1231, 2873, 4641) },
{ AOM_CDF4(20719, 26743, 29241) }, { AOM_CDF4(17880, 24787, 27933) },
{ AOM_CDF4(15776, 24114, 27900) }, { AOM_CDF4(15725, 23942, 26884) },
{ AOM_CDF4(16163, 22583, 28118) }, { AOM_CDF4(12288, 22016, 26624) },
{ AOM_CDF4(12193, 22861, 24385) } } },
#if CONFIG_TX64X64
{ { { AOM_CDF4(17185, 23482, 26251) }, { AOM_CDF4(15444, 23256, 27230) },
{ AOM_CDF4(10405, 17619, 22597) }, { AOM_CDF4(7390, 13468, 18098) },
{ AOM_CDF4(6005, 10905, 14947) }, { AOM_CDF4(5101, 9498, 13296) },
{ AOM_CDF4(2014, 3874, 5611) }, { AOM_CDF4(14114, 20695, 24209) },
{ AOM_CDF4(12937, 19147, 22593) }, { AOM_CDF4(10446, 16701, 20502) },
{ AOM_CDF4(8306, 14118, 18095) }, { AOM_CDF4(6743, 12003, 15921) },
{ AOM_CDF4(5826, 10373, 14059) }, { AOM_CDF4(3224, 6138, 8717) },
{ AOM_CDF4(22096, 28196, 30519) }, { AOM_CDF4(20239, 27093, 29867) },
{ AOM_CDF4(16604, 24251, 28006) }, { AOM_CDF4(12875, 20562, 25136) },
{ AOM_CDF4(10257, 17333, 22145) }, { AOM_CDF4(8555, 14959, 19618) },
{ AOM_CDF4(5109, 9467, 13140) } },
{ { AOM_CDF4(11246, 16551, 19319) }, { AOM_CDF4(15159, 22199, 25265) },
{ AOM_CDF4(9912, 17414, 22390) }, { AOM_CDF4(7173, 13945, 18995) },
{ AOM_CDF4(5838, 11785, 15365) }, { AOM_CDF4(4476, 7403, 10904) },
{ AOM_CDF4(1429, 2903, 4502) }, { AOM_CDF4(14802, 21129, 24651) },
{ AOM_CDF4(9832, 15858, 20702) }, { AOM_CDF4(5522, 10567, 15086) },
{ AOM_CDF4(4341, 7835, 10773) }, { AOM_CDF4(2766, 5154, 7962) },
{ AOM_CDF4(1924, 4490, 7405) }, { AOM_CDF4(1231, 2873, 4641) },
{ AOM_CDF4(20719, 26743, 29241) }, { AOM_CDF4(17880, 24787, 27933) },
{ AOM_CDF4(15776, 24114, 27900) }, { AOM_CDF4(15725, 23942, 26884) },
{ AOM_CDF4(16163, 22583, 28118) }, { AOM_CDF4(12288, 22016, 26624) },
{ AOM_CDF4(12193, 22861, 24385) } } }
#endif
};
#else
const aom_prob default_coeff_lps[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS] = {
{ { 115, 128, 87, 119, 128, 128, 128, 128, 62, 94, 125, 128,
......@@ -2859,7 +2976,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->dc_sign, default_dc_sign);
av1_copy(fc->coeff_base, default_coeff_base);
av1_copy(fc->coeff_lps, default_coeff_lps);
#if !CONFIG_LV_MAP_MULTI
#if CONFIG_LV_MAP_MULTI
av1_copy(fc->coeff_br_cdf, default_coeff_lps_multi);
#else
av1_copy(fc->coeff_br, default_coeff_br);
#endif
......
......@@ -282,6 +282,8 @@ typedef struct FRAME_COUNTS {
#else
unsigned int coeff_lps[TX_SIZES][PLANE_TYPES][BR_CDF_SIZE - 1][LEVEL_CONTEXTS]
[2];
unsigned int coeff_lps_multi[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS]
[BR_CDF_SIZE];
#endif
#endif // CONFIG_LV_MAP
......
......@@ -320,6 +320,7 @@ void av1_init_txb_probs(FRAME_CONTEXT *fc) {
for (plane = 0; plane < PLANE_TYPES; ++plane) {
#if CONFIG_LV_MAP_MULTI
for (ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx) {
#if 0
int p = 32768 - fc->coeff_lps[tx_size][plane][0][ctx] * 128;
int sum = p;
fc->coeff_br_cdf[tx_size][plane][ctx][0] = AOM_ICDF(sum);
......@@ -335,6 +336,9 @@ void av1_init_txb_probs(FRAME_CONTEXT *fc) {
// fc->coeff_br_cdf[tx_size][plane][ctx][0] >> 7,
// fc->coeff_br_cdf[tx_size][plane][ctx][1] >> 7,
// fc->coeff_br_cdf[tx_size][plane][ctx][2] >> 7);
#else
(void)ctx; // coeff_br_cdf is initialized in init_mode_probs
#endif
}
#else
for (ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx) {
......
......@@ -303,17 +303,28 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
ctx = get_br_ctx(levels, pos, bwl, level_counts[pos]);
#endif
for (idx = 0; idx < COEFF_BASE_RANGE / (BR_CDF_SIZE - 1); ++idx) {
int k = av1_read_record_symbol(
counts, r,
int k = av1_read_record_symbol(counts, r,
#if 0
ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_16X16)][plane_type][ctx],
BR_CDF_SIZE, ACCT_STR);
#else
ec_ctx->coeff_br_cdf[AOMMIN(
txs_ctx, TX_32X32)][plane_type][ctx],
#endif
BR_CDF_SIZE, ACCT_STR);
*level += k;
if (counts) {
for (int lps = 0; lps < BR_CDF_SIZE - 1; lps++) {
#if 0
++counts->coeff_lps[AOMMIN(txs_ctx, TX_16X16)][plane_type][lps][ctx]
[lps == k];
#else
++counts->coeff_lps[AOMMIN(txs_ctx, TX_32X32)][plane_type][lps][ctx]
[lps == k];
#endif
if (lps == k) break;
}
++counts->coeff_lps_multi[AOMMIN(txs_ctx, TX_32X32)][plane_type][ctx]
[k];
}
if (k < BR_CDF_SIZE - 1) break;
}
......
......@@ -478,10 +478,14 @@ void av1_write_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#endif
for (idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
const int k = AOMMIN(base_range - idx, BR_CDF_SIZE - 1);
aom_write_symbol(
w, k,
aom_write_symbol(w, k,
#if 0
ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_16X16)][plane_type][ctx],
BR_CDF_SIZE);
#else
ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_32X32)]
[plane_type][ctx],
#endif
BR_CDF_SIZE);
if (k < BR_CDF_SIZE - 1) break;
}
if (base_range < COEFF_BASE_RANGE) continue;
......@@ -2258,13 +2262,24 @@ void av1_update_and_record_txb_context(int plane, int block, int blk_row,
for (idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
const int k = AOMMIN(base_range - idx, BR_CDF_SIZE - 1);
update_cdf(
#if 0
ec_ctx->coeff_br_cdf[AOMMIN(txsize_ctx, TX_16X16)][plane_type][ctx],
#else
ec_ctx->coeff_br_cdf[AOMMIN(txsize_ctx, TX_32X32)][plane_type][ctx],
#endif
k, BR_CDF_SIZE);
for (int lps = 0; lps < BR_CDF_SIZE - 1; lps++) {
#if 0
++td->counts->coeff_lps[AOMMIN(txsize_ctx, TX_16X16)][plane_type][lps]
[ctx][lps == k];
#else
++td->counts->coeff_lps[AOMMIN(txsize_ctx, TX_32X32)][plane_type][lps]
[ctx][lps == k];
#endif
if (lps == k) break;
}
++td->counts->coeff_lps_multi[AOMMIN(txsize_ctx, TX_32X32)][plane_type]
[ctx][k];
if (k < BR_CDF_SIZE - 1) break;
}
......
......@@ -695,6 +695,15 @@ int main(int argc, const char **argv) {
"static const aom_prob "
"default_coeff_lps[TX_SIZES][PLANE_TYPES][BR_CDF_SIZE-"
"1][LEVEL_CONTEXTS]");
cts_each_dim[0] = TX_SIZES;
cts_each_dim[1] = PLANE_TYPES;
cts_each_dim[2] = LEVEL_CONTEXTS;
cts_each_dim[3] = BR_CDF_SIZE;
optimize_cdf_table(&fc.coeff_lps_multi[0][0][0][0], probsfile, 4,
cts_each_dim,
"static const aom_cdf_prob "
"default_coeff_lps_multi[TX_SIZES][PLANE_TYPES][LEVEL_"
"CONTEXTS][CDF_SIZE(BR_CDF_SIZE)]");
#else
cts_each_dim[0] = TX_SIZES;
cts_each_dim[1] = PLANE_TYPES;
......
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