1 /* 2 * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 * 4 * This source code is subject to the terms of the BSD 2 Clause License and 5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 * was not distributed with this source code in the LICENSE file, you can 7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 * Media Patent License 1.0 was not distributed with this source code in the 9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 */ 11 12 #ifndef AOM_AV1_ENCODER_RDOPT_DATA_DEFS_H_ 13 #define AOM_AV1_ENCODER_RDOPT_DATA_DEFS_H_ 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 static const THR_MODES intra_to_mode_idx[INTRA_MODE_NUM] = { 20 THR_DC, // DC_PRED, 21 THR_V_PRED, // V_PRED, 22 THR_H_PRED, // H_PRED, 23 THR_D45_PRED, // D45_PRED, 24 THR_D135_PRED, // D135_PRED, 25 THR_D113_PRED, // D113_PRED, 26 THR_D157_PRED, // D157_PRED, 27 THR_D203_PRED, // D203_PRED, 28 THR_D67_PRED, // D67_PRED, 29 THR_SMOOTH, // SMOOTH_PRED, 30 THR_SMOOTH_V, // SMOOTH_V_PRED, 31 THR_SMOOTH_H, // SMOOTH_H_PRED, 32 THR_PAETH, // PAETH_PRED, 33 }; 34 35 /* clang-format off */ 36 static const THR_MODES single_inter_to_mode_idx[SINGLE_INTER_MODE_NUM] 37 [REF_FRAMES] = { 38 // NEARESTMV, 39 { THR_INVALID, THR_NEARESTMV, THR_NEARESTL2, THR_NEARESTL3, 40 THR_NEARESTG, THR_NEARESTB, THR_NEARESTA2, THR_NEARESTA, }, 41 // NEARMV, 42 { THR_INVALID, THR_NEARMV, THR_NEARL2, THR_NEARL3, 43 THR_NEARG, THR_NEARB, THR_NEARA2, THR_NEARA, }, 44 // GLOBALMV, 45 { THR_INVALID, THR_GLOBALMV, THR_GLOBALL2, THR_GLOBALL3, 46 THR_GLOBALG, THR_GLOBALB, THR_GLOBALA2, THR_GLOBALA, }, 47 // NEWMV, 48 { THR_INVALID, THR_NEWMV, THR_NEWL2, THR_NEWL3, 49 THR_NEWG, THR_NEWB, THR_NEWA2, THR_NEWA, }, 50 }; 51 /* clang-format on */ 52 53 /* clang-format off */ 54 static const THR_MODES comp_inter_to_mode_idx[COMP_INTER_MODE_NUM][REF_FRAMES] 55 [REF_FRAMES] = { 56 // NEAREST_NEARESTMV, 57 { 58 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 59 THR_INVALID, THR_INVALID, THR_INVALID, }, 60 { THR_INVALID, THR_INVALID, 61 THR_COMP_NEAREST_NEARESTLL2, THR_COMP_NEAREST_NEARESTLL3, 62 THR_COMP_NEAREST_NEARESTLG, THR_COMP_NEAREST_NEARESTLB, 63 THR_COMP_NEAREST_NEARESTLA2, THR_COMP_NEAREST_NEARESTLA, }, 64 { THR_INVALID, THR_INVALID, 65 THR_INVALID, THR_INVALID, 66 THR_INVALID, THR_COMP_NEAREST_NEARESTL2B, 67 THR_COMP_NEAREST_NEARESTL2A2, THR_COMP_NEAREST_NEARESTL2A, }, 68 { THR_INVALID, THR_INVALID, 69 THR_INVALID, THR_INVALID, 70 THR_INVALID, THR_COMP_NEAREST_NEARESTL3B, 71 THR_COMP_NEAREST_NEARESTL3A2, THR_COMP_NEAREST_NEARESTL3A, }, 72 { THR_INVALID, THR_INVALID, 73 THR_INVALID, THR_INVALID, 74 THR_INVALID, THR_COMP_NEAREST_NEARESTGB, 75 THR_COMP_NEAREST_NEARESTGA2, THR_COMP_NEAREST_NEARESTGA, }, 76 { THR_INVALID, THR_INVALID, 77 THR_INVALID, THR_INVALID, 78 THR_INVALID, THR_INVALID, 79 THR_INVALID, THR_COMP_NEAREST_NEARESTBA, }, 80 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 81 THR_INVALID, THR_INVALID, THR_INVALID, }, 82 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 83 THR_INVALID, THR_INVALID, THR_INVALID, }, 84 }, 85 // NEAR_NEARMV, 86 { 87 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 88 THR_INVALID, THR_INVALID, THR_INVALID, }, 89 { THR_INVALID, THR_INVALID, 90 THR_COMP_NEAR_NEARLL2, THR_COMP_NEAR_NEARLL3, 91 THR_COMP_NEAR_NEARLG, THR_COMP_NEAR_NEARLB, 92 THR_COMP_NEAR_NEARLA2, THR_COMP_NEAR_NEARLA, }, 93 { THR_INVALID, THR_INVALID, 94 THR_INVALID, THR_INVALID, 95 THR_INVALID, THR_COMP_NEAR_NEARL2B, 96 THR_COMP_NEAR_NEARL2A2, THR_COMP_NEAR_NEARL2A, }, 97 { THR_INVALID, THR_INVALID, 98 THR_INVALID, THR_INVALID, 99 THR_INVALID, THR_COMP_NEAR_NEARL3B, 100 THR_COMP_NEAR_NEARL3A2, THR_COMP_NEAR_NEARL3A, }, 101 { THR_INVALID, THR_INVALID, 102 THR_INVALID, THR_INVALID, 103 THR_INVALID, THR_COMP_NEAR_NEARGB, 104 THR_COMP_NEAR_NEARGA2, THR_COMP_NEAR_NEARGA, }, 105 { THR_INVALID, THR_INVALID, 106 THR_INVALID, THR_INVALID, 107 THR_INVALID, THR_INVALID, 108 THR_INVALID, THR_COMP_NEAR_NEARBA, }, 109 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 110 THR_INVALID, THR_INVALID, THR_INVALID, }, 111 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 112 THR_INVALID, THR_INVALID, THR_INVALID, }, 113 }, 114 // NEAREST_NEWMV, 115 { 116 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 117 THR_INVALID, THR_INVALID, THR_INVALID, }, 118 { THR_INVALID, THR_INVALID, 119 THR_COMP_NEAREST_NEWLL2, THR_COMP_NEAREST_NEWLL3, 120 THR_COMP_NEAREST_NEWLG, THR_COMP_NEAREST_NEWLB, 121 THR_COMP_NEAREST_NEWLA2, THR_COMP_NEAREST_NEWLA, }, 122 { THR_INVALID, THR_INVALID, 123 THR_INVALID, THR_INVALID, 124 THR_INVALID, THR_COMP_NEAREST_NEWL2B, 125 THR_COMP_NEAREST_NEWL2A2, THR_COMP_NEAREST_NEWL2A, }, 126 { THR_INVALID, THR_INVALID, 127 THR_INVALID, THR_INVALID, 128 THR_INVALID, THR_COMP_NEAREST_NEWL3B, 129 THR_COMP_NEAREST_NEWL3A2, THR_COMP_NEAREST_NEWL3A, }, 130 { THR_INVALID, THR_INVALID, 131 THR_INVALID, THR_INVALID, 132 THR_INVALID, THR_COMP_NEAREST_NEWGB, 133 THR_COMP_NEAREST_NEWGA2, THR_COMP_NEAREST_NEWGA, }, 134 { THR_INVALID, THR_INVALID, 135 THR_INVALID, THR_INVALID, 136 THR_INVALID, THR_INVALID, 137 THR_INVALID, THR_COMP_NEAREST_NEWBA, }, 138 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 139 THR_INVALID, THR_INVALID, THR_INVALID, }, 140 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 141 THR_INVALID, THR_INVALID, THR_INVALID, }, 142 }, 143 // NEW_NEARESTMV, 144 { 145 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 146 THR_INVALID, THR_INVALID, THR_INVALID, }, 147 { THR_INVALID, THR_INVALID, 148 THR_COMP_NEW_NEARESTLL2, THR_COMP_NEW_NEARESTLL3, 149 THR_COMP_NEW_NEARESTLG, THR_COMP_NEW_NEARESTLB, 150 THR_COMP_NEW_NEARESTLA2, THR_COMP_NEW_NEARESTLA, }, 151 { THR_INVALID, THR_INVALID, 152 THR_INVALID, THR_INVALID, 153 THR_INVALID, THR_COMP_NEW_NEARESTL2B, 154 THR_COMP_NEW_NEARESTL2A2, THR_COMP_NEW_NEARESTL2A, }, 155 { THR_INVALID, THR_INVALID, 156 THR_INVALID, THR_INVALID, 157 THR_INVALID, THR_COMP_NEW_NEARESTL3B, 158 THR_COMP_NEW_NEARESTL3A2, THR_COMP_NEW_NEARESTL3A, }, 159 { THR_INVALID, THR_INVALID, 160 THR_INVALID, THR_INVALID, 161 THR_INVALID, THR_COMP_NEW_NEARESTGB, 162 THR_COMP_NEW_NEARESTGA2, THR_COMP_NEW_NEARESTGA, }, 163 { THR_INVALID, THR_INVALID, 164 THR_INVALID, THR_INVALID, 165 THR_INVALID, THR_INVALID, 166 THR_INVALID, THR_COMP_NEW_NEARESTBA, }, 167 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 168 THR_INVALID, THR_INVALID, THR_INVALID, }, 169 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 170 THR_INVALID, THR_INVALID, THR_INVALID, }, 171 }, 172 // NEAR_NEWMV, 173 { 174 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 175 THR_INVALID, THR_INVALID, THR_INVALID, }, 176 { THR_INVALID, THR_INVALID, 177 THR_COMP_NEAR_NEWLL2, THR_COMP_NEAR_NEWLL3, 178 THR_COMP_NEAR_NEWLG, THR_COMP_NEAR_NEWLB, 179 THR_COMP_NEAR_NEWLA2, THR_COMP_NEAR_NEWLA, }, 180 { THR_INVALID, THR_INVALID, 181 THR_INVALID, THR_INVALID, 182 THR_INVALID, THR_COMP_NEAR_NEWL2B, 183 THR_COMP_NEAR_NEWL2A2, THR_COMP_NEAR_NEWL2A, }, 184 { THR_INVALID, THR_INVALID, 185 THR_INVALID, THR_INVALID, 186 THR_INVALID, THR_COMP_NEAR_NEWL3B, 187 THR_COMP_NEAR_NEWL3A2, THR_COMP_NEAR_NEWL3A, }, 188 { THR_INVALID, THR_INVALID, 189 THR_INVALID, THR_INVALID, 190 THR_INVALID, THR_COMP_NEAR_NEWGB, 191 THR_COMP_NEAR_NEWGA2, THR_COMP_NEAR_NEWGA, }, 192 { THR_INVALID, THR_INVALID, 193 THR_INVALID, THR_INVALID, 194 THR_INVALID, THR_INVALID, 195 THR_INVALID, THR_COMP_NEAR_NEWBA, }, 196 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 197 THR_INVALID, THR_INVALID, THR_INVALID, }, 198 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 199 THR_INVALID, THR_INVALID, THR_INVALID, }, 200 }, 201 // NEW_NEARMV, 202 { 203 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 204 THR_INVALID, THR_INVALID, THR_INVALID, }, 205 { THR_INVALID, THR_INVALID, 206 THR_COMP_NEW_NEARLL2, THR_COMP_NEW_NEARLL3, 207 THR_COMP_NEW_NEARLG, THR_COMP_NEW_NEARLB, 208 THR_COMP_NEW_NEARLA2, THR_COMP_NEW_NEARLA, }, 209 { THR_INVALID, THR_INVALID, 210 THR_INVALID, THR_INVALID, 211 THR_INVALID, THR_COMP_NEW_NEARL2B, 212 THR_COMP_NEW_NEARL2A2, THR_COMP_NEW_NEARL2A, }, 213 { THR_INVALID, THR_INVALID, 214 THR_INVALID, THR_INVALID, 215 THR_INVALID, THR_COMP_NEW_NEARL3B, 216 THR_COMP_NEW_NEARL3A2, THR_COMP_NEW_NEARL3A, }, 217 { THR_INVALID, THR_INVALID, 218 THR_INVALID, THR_INVALID, 219 THR_INVALID, THR_COMP_NEW_NEARGB, 220 THR_COMP_NEW_NEARGA2, THR_COMP_NEW_NEARGA, }, 221 { THR_INVALID, THR_INVALID, 222 THR_INVALID, THR_INVALID, 223 THR_INVALID, THR_INVALID, 224 THR_INVALID, THR_COMP_NEW_NEARBA, }, 225 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 226 THR_INVALID, THR_INVALID, THR_INVALID, }, 227 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 228 THR_INVALID, THR_INVALID, THR_INVALID, }, 229 }, 230 // GLOBAL_GLOBALMV, 231 { 232 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 233 THR_INVALID, THR_INVALID, THR_INVALID, }, 234 { THR_INVALID, THR_INVALID, 235 THR_COMP_GLOBAL_GLOBALLL2, THR_COMP_GLOBAL_GLOBALLL3, 236 THR_COMP_GLOBAL_GLOBALLG, THR_COMP_GLOBAL_GLOBALLB, 237 THR_COMP_GLOBAL_GLOBALLA2, THR_COMP_GLOBAL_GLOBALLA, }, 238 { THR_INVALID, THR_INVALID, 239 THR_INVALID, THR_INVALID, 240 THR_INVALID, THR_COMP_GLOBAL_GLOBALL2B, 241 THR_COMP_GLOBAL_GLOBALL2A2, THR_COMP_GLOBAL_GLOBALL2A, }, 242 { THR_INVALID, THR_INVALID, 243 THR_INVALID, THR_INVALID, 244 THR_INVALID, THR_COMP_GLOBAL_GLOBALL3B, 245 THR_COMP_GLOBAL_GLOBALL3A2, THR_COMP_GLOBAL_GLOBALL3A, }, 246 { THR_INVALID, THR_INVALID, 247 THR_INVALID, THR_INVALID, 248 THR_INVALID, THR_COMP_GLOBAL_GLOBALGB, 249 THR_COMP_GLOBAL_GLOBALGA2, THR_COMP_GLOBAL_GLOBALGA, }, 250 { THR_INVALID, THR_INVALID, 251 THR_INVALID, THR_INVALID, 252 THR_INVALID, THR_INVALID, 253 THR_INVALID, THR_COMP_GLOBAL_GLOBALBA, }, 254 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 255 THR_INVALID, THR_INVALID, THR_INVALID, }, 256 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 257 THR_INVALID, THR_INVALID, THR_INVALID, }, 258 }, 259 // NEW_NEWMV, 260 { 261 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 262 THR_INVALID, THR_INVALID, THR_INVALID, }, 263 { THR_INVALID, THR_INVALID, 264 THR_COMP_NEW_NEWLL2, THR_COMP_NEW_NEWLL3, 265 THR_COMP_NEW_NEWLG, THR_COMP_NEW_NEWLB, 266 THR_COMP_NEW_NEWLA2, THR_COMP_NEW_NEWLA, }, 267 { THR_INVALID, THR_INVALID, 268 THR_INVALID, THR_INVALID, 269 THR_INVALID, THR_COMP_NEW_NEWL2B, 270 THR_COMP_NEW_NEWL2A2, THR_COMP_NEW_NEWL2A, }, 271 { THR_INVALID, THR_INVALID, 272 THR_INVALID, THR_INVALID, 273 THR_INVALID, THR_COMP_NEW_NEWL3B, 274 THR_COMP_NEW_NEWL3A2, THR_COMP_NEW_NEWL3A, }, 275 { THR_INVALID, THR_INVALID, 276 THR_INVALID, THR_INVALID, 277 THR_INVALID, THR_COMP_NEW_NEWGB, 278 THR_COMP_NEW_NEWGA2, THR_COMP_NEW_NEWGA, }, 279 { THR_INVALID, THR_INVALID, 280 THR_INVALID, THR_INVALID, 281 THR_INVALID, THR_INVALID, 282 THR_INVALID, THR_COMP_NEW_NEWBA, }, 283 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 284 THR_INVALID, THR_INVALID, THR_INVALID, }, 285 { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, 286 THR_INVALID, THR_INVALID, THR_INVALID, }, 287 }, 288 }; 289 290 #ifdef __cplusplus 291 } // extern "C" 292 #endif 293 294 #endif // AOM_AV1_ENCODER_RDOPT_DATA_DEFS_H_ 295