1 /* 2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "modules/rtp_rtcp/source/fec_private_tables_random.h" 12 13 namespace { 14 // clang-format off 15 #define kMaskRandom1_1 \ 16 0x80, 0x00 17 18 #define kMaskRandom2_1 \ 19 0xc0, 0x00 20 21 #define kMaskRandom2_2 \ 22 0xc0, 0x00, \ 23 0x80, 0x00 24 25 #define kMaskRandom3_1 \ 26 0xe0, 0x00 27 28 #define kMaskRandom3_2 \ 29 0xc0, 0x00, \ 30 0xa0, 0x00 31 32 #define kMaskRandom3_3 \ 33 0xc0, 0x00, \ 34 0xa0, 0x00, \ 35 0x60, 0x00 36 37 #define kMaskRandom4_1 \ 38 0xf0, 0x00 39 40 #define kMaskRandom4_2 \ 41 0xc0, 0x00, \ 42 0xb0, 0x00 43 44 #define kMaskRandom4_3 \ 45 0xc0, 0x00, \ 46 0xb0, 0x00, \ 47 0x60, 0x00 48 49 #define kMaskRandom4_4 \ 50 0xc0, 0x00, \ 51 0xa0, 0x00, \ 52 0x30, 0x00, \ 53 0x50, 0x00 54 55 #define kMaskRandom5_1 \ 56 0xf8, 0x00 57 58 #define kMaskRandom5_2 \ 59 0xa8, 0x00, \ 60 0xd0, 0x00 61 62 #define kMaskRandom5_3 \ 63 0xb0, 0x00, \ 64 0xc8, 0x00, \ 65 0x50, 0x00 66 67 #define kMaskRandom5_4 \ 68 0xc8, 0x00, \ 69 0xb0, 0x00, \ 70 0x50, 0x00, \ 71 0x28, 0x00 72 73 #define kMaskRandom5_5 \ 74 0xc0, 0x00, \ 75 0x30, 0x00, \ 76 0x18, 0x00, \ 77 0xa0, 0x00, \ 78 0x48, 0x00 79 80 #define kMaskRandom6_1 \ 81 0xfc, 0x00 82 83 #define kMaskRandom6_2 \ 84 0xa8, 0x00, \ 85 0xd4, 0x00 86 87 #define kMaskRandom6_3 \ 88 0xd0, 0x00, \ 89 0x68, 0x00, \ 90 0xa4, 0x00 91 92 #define kMaskRandom6_4 \ 93 0xa8, 0x00, \ 94 0x58, 0x00, \ 95 0x64, 0x00, \ 96 0x94, 0x00 97 98 #define kMaskRandom6_5 \ 99 0xa8, 0x00, \ 100 0x84, 0x00, \ 101 0x64, 0x00, \ 102 0x90, 0x00, \ 103 0x58, 0x00 104 105 #define kMaskRandom6_6 \ 106 0x98, 0x00, \ 107 0x64, 0x00, \ 108 0x50, 0x00, \ 109 0x14, 0x00, \ 110 0xa8, 0x00, \ 111 0xe0, 0x00 112 113 #define kMaskRandom7_1 \ 114 0xfe, 0x00 115 116 #define kMaskRandom7_2 \ 117 0xd4, 0x00, \ 118 0xaa, 0x00 119 120 #define kMaskRandom7_3 \ 121 0xd0, 0x00, \ 122 0xaa, 0x00, \ 123 0x64, 0x00 124 125 #define kMaskRandom7_4 \ 126 0xd0, 0x00, \ 127 0xaa, 0x00, \ 128 0x64, 0x00, \ 129 0x1c, 0x00 130 131 #define kMaskRandom7_5 \ 132 0x0c, 0x00, \ 133 0xb0, 0x00, \ 134 0x1a, 0x00, \ 135 0xc4, 0x00, \ 136 0x62, 0x00 137 138 #define kMaskRandom7_6 \ 139 0x8c, 0x00, \ 140 0x4a, 0x00, \ 141 0x64, 0x00, \ 142 0xd0, 0x00, \ 143 0xa0, 0x00, \ 144 0x32, 0x00 145 146 #define kMaskRandom7_7 \ 147 0x4a, 0x00, \ 148 0x94, 0x00, \ 149 0x1a, 0x00, \ 150 0xc4, 0x00, \ 151 0x28, 0x00, \ 152 0xc2, 0x00, \ 153 0x34, 0x00 154 155 #define kMaskRandom8_1 \ 156 0xff, 0x00 157 158 #define kMaskRandom8_2 \ 159 0xaa, 0x00, \ 160 0xd5, 0x00 161 162 #define kMaskRandom8_3 \ 163 0xc5, 0x00, \ 164 0x92, 0x00, \ 165 0x6a, 0x00 166 167 #define kMaskRandom8_4 \ 168 0x45, 0x00, \ 169 0xb4, 0x00, \ 170 0x6a, 0x00, \ 171 0x89, 0x00 172 173 #define kMaskRandom8_5 \ 174 0x8c, 0x00, \ 175 0x92, 0x00, \ 176 0x2b, 0x00, \ 177 0x51, 0x00, \ 178 0x64, 0x00 179 180 #define kMaskRandom8_6 \ 181 0xa1, 0x00, \ 182 0x52, 0x00, \ 183 0x91, 0x00, \ 184 0x2a, 0x00, \ 185 0xc4, 0x00, \ 186 0x4c, 0x00 187 188 #define kMaskRandom8_7 \ 189 0x15, 0x00, \ 190 0xc2, 0x00, \ 191 0x25, 0x00, \ 192 0x62, 0x00, \ 193 0x58, 0x00, \ 194 0x8c, 0x00, \ 195 0xa3, 0x00 196 197 #define kMaskRandom8_8 \ 198 0x25, 0x00, \ 199 0x8a, 0x00, \ 200 0x91, 0x00, \ 201 0x68, 0x00, \ 202 0x32, 0x00, \ 203 0x43, 0x00, \ 204 0xc4, 0x00, \ 205 0x1c, 0x00 206 207 #define kMaskRandom9_1 \ 208 0xff, 0x80 209 210 #define kMaskRandom9_2 \ 211 0xaa, 0x80, \ 212 0xd5, 0x00 213 214 #define kMaskRandom9_3 \ 215 0xa5, 0x00, \ 216 0xc8, 0x00, \ 217 0x52, 0x80 218 219 #define kMaskRandom9_4 \ 220 0xa2, 0x00, \ 221 0xc9, 0x00, \ 222 0x52, 0x80, \ 223 0x24, 0x80 224 225 #define kMaskRandom9_5 \ 226 0x8c, 0x00, \ 227 0x25, 0x00, \ 228 0x92, 0x80, \ 229 0x41, 0x80, \ 230 0x58, 0x00 231 232 #define kMaskRandom9_6 \ 233 0x84, 0x80, \ 234 0x27, 0x00, \ 235 0x51, 0x80, \ 236 0x1a, 0x00, \ 237 0x68, 0x00, \ 238 0x89, 0x00 239 240 #define kMaskRandom9_7 \ 241 0x8c, 0x00, \ 242 0x47, 0x00, \ 243 0x81, 0x80, \ 244 0x12, 0x80, \ 245 0x58, 0x00, \ 246 0x28, 0x80, \ 247 0xb4, 0x00 248 249 #define kMaskRandom9_8 \ 250 0x2c, 0x00, \ 251 0x91, 0x00, \ 252 0x40, 0x80, \ 253 0x06, 0x80, \ 254 0xc8, 0x00, \ 255 0x45, 0x00, \ 256 0x30, 0x80, \ 257 0xa2, 0x00 258 259 #define kMaskRandom9_9 \ 260 0x4c, 0x00, \ 261 0x62, 0x00, \ 262 0x91, 0x00, \ 263 0x42, 0x80, \ 264 0xa4, 0x00, \ 265 0x13, 0x00, \ 266 0x30, 0x80, \ 267 0x88, 0x80, \ 268 0x09, 0x00 269 270 #define kMaskRandom10_1 \ 271 0xff, 0xc0 272 273 #define kMaskRandom10_10 \ 274 0x4c, 0x00, \ 275 0x51, 0x00, \ 276 0xa0, 0x40, \ 277 0x04, 0xc0, \ 278 0x03, 0x80, \ 279 0x86, 0x00, \ 280 0x29, 0x00, \ 281 0x42, 0x40, \ 282 0x98, 0x00, \ 283 0x30, 0x80 284 285 #define kMaskRandom10_2 \ 286 0xaa, 0x80, \ 287 0xd5, 0x40 288 289 #define kMaskRandom10_3 \ 290 0xa4, 0x40, \ 291 0xc9, 0x00, \ 292 0x52, 0x80 293 294 #define kMaskRandom10_4 \ 295 0xca, 0x00, \ 296 0x32, 0x80, \ 297 0xa1, 0x40, \ 298 0x55, 0x00 299 300 #define kMaskRandom10_5 \ 301 0xca, 0x00, \ 302 0x32, 0x80, \ 303 0xa1, 0x40, \ 304 0x55, 0x00, \ 305 0x08, 0xc0 306 307 #define kMaskRandom10_6 \ 308 0x0e, 0x00, \ 309 0x33, 0x00, \ 310 0x10, 0xc0, \ 311 0x45, 0x40, \ 312 0x88, 0x80, \ 313 0xe0, 0x00 314 315 #define kMaskRandom10_7 \ 316 0x46, 0x00, \ 317 0x33, 0x00, \ 318 0x80, 0xc0, \ 319 0x0c, 0x40, \ 320 0x28, 0x80, \ 321 0x94, 0x00, \ 322 0xc1, 0x00 323 324 #define kMaskRandom10_8 \ 325 0x2c, 0x00, \ 326 0x81, 0x80, \ 327 0xa0, 0x40, \ 328 0x05, 0x40, \ 329 0x18, 0x80, \ 330 0xc2, 0x00, \ 331 0x22, 0x80, \ 332 0x50, 0x40 333 334 #define kMaskRandom10_9 \ 335 0x4c, 0x00, \ 336 0x23, 0x00, \ 337 0x88, 0xc0, \ 338 0x21, 0x40, \ 339 0x52, 0x80, \ 340 0x94, 0x00, \ 341 0x26, 0x00, \ 342 0x48, 0x40, \ 343 0x91, 0x80 344 345 #define kMaskRandom11_1 \ 346 0xff, 0xe0 347 348 #define kMaskRandom11_10 \ 349 0x64, 0x40, \ 350 0x51, 0x40, \ 351 0xa9, 0x00, \ 352 0x04, 0xc0, \ 353 0xd0, 0x00, \ 354 0x82, 0x40, \ 355 0x21, 0x20, \ 356 0x0c, 0x20, \ 357 0x4a, 0x00, \ 358 0x12, 0xa0 359 360 #define kMaskRandom11_11 \ 361 0x46, 0x40, \ 362 0x33, 0x20, \ 363 0x99, 0x00, \ 364 0x05, 0x80, \ 365 0x80, 0xa0, \ 366 0x84, 0x40, \ 367 0x40, 0x60, \ 368 0x0a, 0x80, \ 369 0x68, 0x00, \ 370 0x10, 0x20, \ 371 0x30, 0x40 372 373 #define kMaskRandom11_2 \ 374 0xec, 0xc0, \ 375 0x9b, 0xa0 376 377 #define kMaskRandom11_3 \ 378 0xca, 0xc0, \ 379 0xf1, 0x40, \ 380 0xb6, 0x20 381 382 #define kMaskRandom11_4 \ 383 0xc4, 0xc0, \ 384 0x31, 0x60, \ 385 0x4b, 0x20, \ 386 0x2c, 0xa0 387 388 #define kMaskRandom11_5 \ 389 0x86, 0x80, \ 390 0x23, 0x20, \ 391 0x16, 0x20, \ 392 0x4c, 0x20, \ 393 0x41, 0xc0 394 395 #define kMaskRandom11_6 \ 396 0x64, 0x40, \ 397 0x51, 0x40, \ 398 0x0c, 0xa0, \ 399 0xa1, 0x20, \ 400 0x12, 0xa0, \ 401 0x8a, 0x40 402 403 #define kMaskRandom11_7 \ 404 0x46, 0x40, \ 405 0x33, 0x20, \ 406 0x91, 0x80, \ 407 0xa4, 0x20, \ 408 0x50, 0xa0, \ 409 0x84, 0xc0, \ 410 0x09, 0x60 411 412 #define kMaskRandom11_8 \ 413 0x0c, 0x80, \ 414 0x80, 0x60, \ 415 0xa0, 0x80, \ 416 0x05, 0x40, \ 417 0x43, 0x00, \ 418 0x1a, 0x00, \ 419 0x60, 0x20, \ 420 0x14, 0x20 421 422 #define kMaskRandom11_9 \ 423 0x46, 0x40, \ 424 0x62, 0x60, \ 425 0x8c, 0x00, \ 426 0x01, 0x60, \ 427 0x07, 0x80, \ 428 0xa0, 0x80, \ 429 0x18, 0xa0, \ 430 0x91, 0x00, \ 431 0x78, 0x00 432 433 #define kMaskRandom12_1 \ 434 0xff, 0xf0 435 436 #define kMaskRandom12_10 \ 437 0x51, 0x40, \ 438 0x45, 0x10, \ 439 0x80, 0xd0, \ 440 0x24, 0x20, \ 441 0x0a, 0x20, \ 442 0x00, 0xe0, \ 443 0xb8, 0x00, \ 444 0x09, 0x10, \ 445 0x56, 0x00, \ 446 0xa2, 0x80 447 448 #define kMaskRandom12_11 \ 449 0x53, 0x60, \ 450 0x21, 0x30, \ 451 0x10, 0x90, \ 452 0x00, 0x70, \ 453 0x0c, 0x10, \ 454 0x40, 0xc0, \ 455 0x6a, 0x00, \ 456 0x86, 0x00, \ 457 0x24, 0x80, \ 458 0x89, 0x00, \ 459 0xc0, 0x20 460 461 #define kMaskRandom12_12 \ 462 0x10, 0x60, \ 463 0x02, 0x30, \ 464 0x40, 0x50, \ 465 0x21, 0x80, \ 466 0x81, 0x10, \ 467 0x14, 0x80, \ 468 0x98, 0x00, \ 469 0x08, 0x90, \ 470 0x62, 0x00, \ 471 0x24, 0x20, \ 472 0x8a, 0x00, \ 473 0x84, 0x40 474 475 #define kMaskRandom12_2 \ 476 0xec, 0xc0, \ 477 0x93, 0xb0 478 479 #define kMaskRandom12_3 \ 480 0x9b, 0x80, \ 481 0x4f, 0x10, \ 482 0x3c, 0x60 483 484 #define kMaskRandom12_4 \ 485 0x8b, 0x20, \ 486 0x14, 0xb0, \ 487 0x22, 0xd0, \ 488 0x45, 0x50 489 490 #define kMaskRandom12_5 \ 491 0x53, 0x60, \ 492 0x64, 0x20, \ 493 0x0c, 0xc0, \ 494 0x82, 0xa0, \ 495 0x09, 0x30 496 497 #define kMaskRandom12_6 \ 498 0x51, 0x40, \ 499 0xc5, 0x10, \ 500 0x21, 0x80, \ 501 0x12, 0x30, \ 502 0x08, 0xe0, \ 503 0x2e, 0x00 504 505 #define kMaskRandom12_7 \ 506 0x53, 0x60, \ 507 0x21, 0x30, \ 508 0x90, 0x90, \ 509 0x02, 0x50, \ 510 0x06, 0xa0, \ 511 0x2c, 0x00, \ 512 0x88, 0x60 513 514 #define kMaskRandom12_8 \ 515 0x20, 0x60, \ 516 0x80, 0x30, \ 517 0x42, 0x40, \ 518 0x01, 0x90, \ 519 0x14, 0x10, \ 520 0x0a, 0x80, \ 521 0x38, 0x00, \ 522 0xc5, 0x00 523 524 #define kMaskRandom12_9 \ 525 0x53, 0x60, \ 526 0xe4, 0x20, \ 527 0x24, 0x40, \ 528 0xa1, 0x10, \ 529 0x18, 0x30, \ 530 0x03, 0x90, \ 531 0x8a, 0x10, \ 532 0x04, 0x90, \ 533 0x00, 0xe0 534 535 #define kPacketMaskRandom1 1, \ 536 kMaskRandom1_1 537 538 #define kPacketMaskRandom2 2, \ 539 kMaskRandom2_1, \ 540 kMaskRandom2_2 541 542 #define kPacketMaskRandom3 3, \ 543 kMaskRandom3_1, \ 544 kMaskRandom3_2, \ 545 kMaskRandom3_3 546 547 #define kPacketMaskRandom4 4, \ 548 kMaskRandom4_1, \ 549 kMaskRandom4_2, \ 550 kMaskRandom4_3, \ 551 kMaskRandom4_4 552 553 #define kPacketMaskRandom5 5, \ 554 kMaskRandom5_1, \ 555 kMaskRandom5_2, \ 556 kMaskRandom5_3, \ 557 kMaskRandom5_4, \ 558 kMaskRandom5_5 559 560 #define kPacketMaskRandom6 6, \ 561 kMaskRandom6_1, \ 562 kMaskRandom6_2, \ 563 kMaskRandom6_3, \ 564 kMaskRandom6_4, \ 565 kMaskRandom6_5, \ 566 kMaskRandom6_6 567 568 #define kPacketMaskRandom7 7, \ 569 kMaskRandom7_1, \ 570 kMaskRandom7_2, \ 571 kMaskRandom7_3, \ 572 kMaskRandom7_4, \ 573 kMaskRandom7_5, \ 574 kMaskRandom7_6, \ 575 kMaskRandom7_7 576 577 #define kPacketMaskRandom8 8, \ 578 kMaskRandom8_1, \ 579 kMaskRandom8_2, \ 580 kMaskRandom8_3, \ 581 kMaskRandom8_4, \ 582 kMaskRandom8_5, \ 583 kMaskRandom8_6, \ 584 kMaskRandom8_7, \ 585 kMaskRandom8_8 586 587 #define kPacketMaskRandom9 9, \ 588 kMaskRandom9_1, \ 589 kMaskRandom9_2, \ 590 kMaskRandom9_3, \ 591 kMaskRandom9_4, \ 592 kMaskRandom9_5, \ 593 kMaskRandom9_6, \ 594 kMaskRandom9_7, \ 595 kMaskRandom9_8, \ 596 kMaskRandom9_9 597 598 #define kPacketMaskRandom10 10, \ 599 kMaskRandom10_1, \ 600 kMaskRandom10_2, \ 601 kMaskRandom10_3, \ 602 kMaskRandom10_4, \ 603 kMaskRandom10_5, \ 604 kMaskRandom10_6, \ 605 kMaskRandom10_7, \ 606 kMaskRandom10_8, \ 607 kMaskRandom10_9, \ 608 kMaskRandom10_10 609 610 #define kPacketMaskRandom11 11, \ 611 kMaskRandom11_1, \ 612 kMaskRandom11_2, \ 613 kMaskRandom11_3, \ 614 kMaskRandom11_4, \ 615 kMaskRandom11_5, \ 616 kMaskRandom11_6, \ 617 kMaskRandom11_7, \ 618 kMaskRandom11_8, \ 619 kMaskRandom11_9, \ 620 kMaskRandom11_10, \ 621 kMaskRandom11_11 622 623 #define kPacketMaskRandom12 12, \ 624 kMaskRandom12_1, \ 625 kMaskRandom12_2, \ 626 kMaskRandom12_3, \ 627 kMaskRandom12_4, \ 628 kMaskRandom12_5, \ 629 kMaskRandom12_6, \ 630 kMaskRandom12_7, \ 631 kMaskRandom12_8, \ 632 kMaskRandom12_9, \ 633 kMaskRandom12_10, \ 634 kMaskRandom12_11, \ 635 kMaskRandom12_12 636 637 // clang-format on 638 } // namespace 639 640 namespace webrtc { 641 namespace fec_private_tables { 642 643 const uint8_t kPacketMaskRandomTbl[] = { 644 12, 645 kPacketMaskRandom1, // 2 byte entries. 646 kPacketMaskRandom2, 647 kPacketMaskRandom3, 648 kPacketMaskRandom4, 649 kPacketMaskRandom5, 650 kPacketMaskRandom6, 651 kPacketMaskRandom7, 652 kPacketMaskRandom8, 653 kPacketMaskRandom9, 654 kPacketMaskRandom10, 655 kPacketMaskRandom11, 656 kPacketMaskRandom12, 657 }; 658 659 } // namespace fec_private_tables 660 } // namespace webrtc 661