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_bursty.h" 12 13 namespace { 14 // clang-format off 15 #define kMaskBursty1_1 \ 16 0x80, 0x00 17 18 #define kMaskBursty2_1 \ 19 0xc0, 0x00 20 21 #define kMaskBursty2_2 \ 22 0x80, 0x00, \ 23 0xc0, 0x00 24 25 #define kMaskBursty3_1 \ 26 0xe0, 0x00 27 28 #define kMaskBursty3_2 \ 29 0xc0, 0x00, \ 30 0xa0, 0x00 31 32 #define kMaskBursty3_3 \ 33 0x80, 0x00, \ 34 0xc0, 0x00, \ 35 0x60, 0x00 36 37 #define kMaskBursty4_1 \ 38 0xf0, 0x00 39 40 #define kMaskBursty4_2 \ 41 0xa0, 0x00, \ 42 0xd0, 0x00 43 44 #define kMaskBursty4_3 \ 45 0xc0, 0x00, \ 46 0x60, 0x00, \ 47 0x90, 0x00 48 49 #define kMaskBursty4_4 \ 50 0x80, 0x00, \ 51 0xc0, 0x00, \ 52 0x60, 0x00, \ 53 0x30, 0x00 54 55 #define kMaskBursty5_1 \ 56 0xf8, 0x00 57 58 #define kMaskBursty5_2 \ 59 0xd0, 0x00, \ 60 0xa8, 0x00 61 62 #define kMaskBursty5_3 \ 63 0x70, 0x00, \ 64 0x90, 0x00, \ 65 0xc8, 0x00 66 67 #define kMaskBursty5_4 \ 68 0xc0, 0x00, \ 69 0x60, 0x00, \ 70 0x30, 0x00, \ 71 0x88, 0x00 72 73 #define kMaskBursty5_5 \ 74 0x80, 0x00, \ 75 0xc0, 0x00, \ 76 0x60, 0x00, \ 77 0x30, 0x00, \ 78 0x18, 0x00 79 80 #define kMaskBursty6_1 \ 81 0xfc, 0x00 82 83 #define kMaskBursty6_2 \ 84 0xa8, 0x00, \ 85 0xd4, 0x00 86 87 #define kMaskBursty6_3 \ 88 0x94, 0x00, \ 89 0xc8, 0x00, \ 90 0x64, 0x00 91 92 #define kMaskBursty6_4 \ 93 0x60, 0x00, \ 94 0x38, 0x00, \ 95 0x88, 0x00, \ 96 0xc4, 0x00 97 98 #define kMaskBursty6_5 \ 99 0xc0, 0x00, \ 100 0x60, 0x00, \ 101 0x30, 0x00, \ 102 0x18, 0x00, \ 103 0x84, 0x00 104 105 #define kMaskBursty6_6 \ 106 0x80, 0x00, \ 107 0xc0, 0x00, \ 108 0x60, 0x00, \ 109 0x30, 0x00, \ 110 0x18, 0x00, \ 111 0x0c, 0x00 112 113 #define kMaskBursty7_1 \ 114 0xfe, 0x00 115 116 #define kMaskBursty7_2 \ 117 0xd4, 0x00, \ 118 0xaa, 0x00 119 120 #define kMaskBursty7_3 \ 121 0xc8, 0x00, \ 122 0x74, 0x00, \ 123 0x92, 0x00 124 125 #define kMaskBursty7_4 \ 126 0x38, 0x00, \ 127 0x8a, 0x00, \ 128 0xc4, 0x00, \ 129 0x62, 0x00 130 131 #define kMaskBursty7_5 \ 132 0x60, 0x00, \ 133 0x30, 0x00, \ 134 0x1c, 0x00, \ 135 0x84, 0x00, \ 136 0xc2, 0x00 137 138 #define kMaskBursty7_6 \ 139 0xc0, 0x00, \ 140 0x60, 0x00, \ 141 0x30, 0x00, \ 142 0x18, 0x00, \ 143 0x0c, 0x00, \ 144 0x82, 0x00 145 146 #define kMaskBursty7_7 \ 147 0x80, 0x00, \ 148 0xc0, 0x00, \ 149 0x60, 0x00, \ 150 0x30, 0x00, \ 151 0x18, 0x00, \ 152 0x0c, 0x00, \ 153 0x06, 0x00 154 155 #define kMaskBursty8_1 \ 156 0xff, 0x00 157 158 #define kMaskBursty8_2 \ 159 0xaa, 0x00, \ 160 0xd5, 0x00 161 162 #define kMaskBursty8_3 \ 163 0x74, 0x00, \ 164 0x92, 0x00, \ 165 0xc9, 0x00 166 167 #define kMaskBursty8_4 \ 168 0x8a, 0x00, \ 169 0xc5, 0x00, \ 170 0x62, 0x00, \ 171 0x31, 0x00 172 173 #define kMaskBursty8_5 \ 174 0x30, 0x00, \ 175 0x1c, 0x00, \ 176 0x85, 0x00, \ 177 0xc2, 0x00, \ 178 0x61, 0x00 179 180 #define kMaskBursty8_6 \ 181 0x60, 0x00, \ 182 0x30, 0x00, \ 183 0x18, 0x00, \ 184 0x0e, 0x00, \ 185 0x82, 0x00, \ 186 0xc1, 0x00 187 188 #define kMaskBursty8_7 \ 189 0xc0, 0x00, \ 190 0x60, 0x00, \ 191 0x30, 0x00, \ 192 0x18, 0x00, \ 193 0x0c, 0x00, \ 194 0x06, 0x00, \ 195 0x81, 0x00 196 197 #define kMaskBursty8_8 \ 198 0x80, 0x00, \ 199 0xc0, 0x00, \ 200 0x60, 0x00, \ 201 0x30, 0x00, \ 202 0x18, 0x00, \ 203 0x0c, 0x00, \ 204 0x06, 0x00, \ 205 0x03, 0x00 206 207 #define kMaskBursty9_1 \ 208 0xff, 0x80 209 210 #define kMaskBursty9_2 \ 211 0xd5, 0x00, \ 212 0xaa, 0x80 213 214 #define kMaskBursty9_3 \ 215 0x92, 0x00, \ 216 0xc9, 0x00, \ 217 0x74, 0x80 218 219 #define kMaskBursty9_4 \ 220 0xc5, 0x00, \ 221 0x62, 0x00, \ 222 0x39, 0x00, \ 223 0x8a, 0x80 224 225 #define kMaskBursty9_5 \ 226 0x1c, 0x00, \ 227 0x85, 0x00, \ 228 0xc2, 0x80, \ 229 0x61, 0x00, \ 230 0x30, 0x80 231 232 #define kMaskBursty9_6 \ 233 0x30, 0x00, \ 234 0x18, 0x00, \ 235 0x0e, 0x00, \ 236 0x82, 0x80, \ 237 0xc1, 0x00, \ 238 0x60, 0x80 239 240 #define kMaskBursty9_7 \ 241 0x60, 0x00, \ 242 0x30, 0x00, \ 243 0x18, 0x00, \ 244 0x0c, 0x00, \ 245 0x07, 0x00, \ 246 0x81, 0x00, \ 247 0xc0, 0x80 248 249 #define kMaskBursty9_8 \ 250 0xc0, 0x00, \ 251 0x60, 0x00, \ 252 0x30, 0x00, \ 253 0x18, 0x00, \ 254 0x0c, 0x00, \ 255 0x06, 0x00, \ 256 0x03, 0x00, \ 257 0x80, 0x80 258 259 #define kMaskBursty9_9 \ 260 0x80, 0x00, \ 261 0xc0, 0x00, \ 262 0x60, 0x00, \ 263 0x30, 0x00, \ 264 0x18, 0x00, \ 265 0x0c, 0x00, \ 266 0x06, 0x00, \ 267 0x03, 0x00, \ 268 0x01, 0x80 269 270 #define kMaskBursty10_1 \ 271 0xff, 0xc0 272 273 #define kMaskBursty10_2 \ 274 0xaa, 0x80, \ 275 0xd5, 0x40 276 277 #define kMaskBursty10_3 \ 278 0xc9, 0x00, \ 279 0x74, 0x80, \ 280 0x92, 0x40 281 282 #define kMaskBursty10_4 \ 283 0x62, 0x00, \ 284 0x39, 0x00, \ 285 0x8a, 0x80, \ 286 0xc5, 0x40 287 288 #define kMaskBursty10_5 \ 289 0x85, 0x00, \ 290 0xc2, 0x80, \ 291 0x61, 0x40, \ 292 0x30, 0x80, \ 293 0x18, 0x40 294 295 #define kMaskBursty10_6 \ 296 0x18, 0x00, \ 297 0x0e, 0x00, \ 298 0x82, 0x80, \ 299 0xc1, 0x40, \ 300 0x60, 0x80, \ 301 0x30, 0x40 302 303 #define kMaskBursty10_7 \ 304 0x30, 0x00, \ 305 0x18, 0x00, \ 306 0x0c, 0x00, \ 307 0x07, 0x00, \ 308 0x81, 0x40, \ 309 0xc0, 0x80, \ 310 0x60, 0x40 311 312 #define kMaskBursty10_8 \ 313 0x60, 0x00, \ 314 0x30, 0x00, \ 315 0x18, 0x00, \ 316 0x0c, 0x00, \ 317 0x06, 0x00, \ 318 0x03, 0x00, \ 319 0x80, 0x80, \ 320 0xc0, 0x40 321 322 #define kMaskBursty10_9 \ 323 0xc0, 0x00, \ 324 0x60, 0x00, \ 325 0x30, 0x00, \ 326 0x18, 0x00, \ 327 0x0c, 0x00, \ 328 0x06, 0x00, \ 329 0x03, 0x00, \ 330 0x01, 0x80, \ 331 0x80, 0x40 332 333 #define kMaskBursty10_10 \ 334 0x80, 0x00, \ 335 0xc0, 0x00, \ 336 0x60, 0x00, \ 337 0x30, 0x00, \ 338 0x18, 0x00, \ 339 0x0c, 0x00, \ 340 0x06, 0x00, \ 341 0x03, 0x00, \ 342 0x01, 0x80, \ 343 0x00, 0xc0 344 345 #define kMaskBursty11_1 \ 346 0xff, 0xe0 347 348 #define kMaskBursty11_2 \ 349 0xd5, 0x40, \ 350 0xaa, 0xa0 351 352 #define kMaskBursty11_3 \ 353 0x74, 0x80, \ 354 0x92, 0x40, \ 355 0xc9, 0x20 356 357 #define kMaskBursty11_4 \ 358 0x39, 0x00, \ 359 0x8a, 0x80, \ 360 0xc5, 0x40, \ 361 0x62, 0x20 362 363 #define kMaskBursty11_5 \ 364 0xc2, 0xc0, \ 365 0x61, 0x00, \ 366 0x30, 0xa0, \ 367 0x1c, 0x40, \ 368 0x85, 0x20 369 370 #define kMaskBursty11_6 \ 371 0x0e, 0x00, \ 372 0x82, 0x80, \ 373 0xc1, 0x40, \ 374 0x60, 0xa0, \ 375 0x30, 0x40, \ 376 0x18, 0x20 377 378 #define kMaskBursty11_7 \ 379 0x18, 0x00, \ 380 0x0c, 0x00, \ 381 0x07, 0x00, \ 382 0x81, 0x40, \ 383 0xc0, 0xa0, \ 384 0x60, 0x40, \ 385 0x30, 0x20 386 387 #define kMaskBursty11_8 \ 388 0x30, 0x00, \ 389 0x18, 0x00, \ 390 0x0c, 0x00, \ 391 0x06, 0x00, \ 392 0x03, 0x40, \ 393 0x80, 0xa0, \ 394 0xc0, 0x40, \ 395 0x60, 0x20 396 397 #define kMaskBursty11_9 \ 398 0x60, 0x00, \ 399 0x30, 0x00, \ 400 0x18, 0x00, \ 401 0x0c, 0x00, \ 402 0x06, 0x00, \ 403 0x03, 0x00, \ 404 0x01, 0x80, \ 405 0x80, 0x40, \ 406 0xc0, 0x20 407 408 #define kMaskBursty11_10 \ 409 0xc0, 0x00, \ 410 0x60, 0x00, \ 411 0x30, 0x00, \ 412 0x18, 0x00, \ 413 0x0c, 0x00, \ 414 0x06, 0x00, \ 415 0x03, 0x00, \ 416 0x01, 0x80, \ 417 0x00, 0xc0, \ 418 0x80, 0x20 419 420 #define kMaskBursty11_11 \ 421 0x80, 0x00, \ 422 0xc0, 0x00, \ 423 0x60, 0x00, \ 424 0x30, 0x00, \ 425 0x18, 0x00, \ 426 0x0c, 0x00, \ 427 0x06, 0x00, \ 428 0x03, 0x00, \ 429 0x01, 0x80, \ 430 0x00, 0xc0, \ 431 0x00, 0x60 432 433 #define kMaskBursty12_1 \ 434 0xff, 0xf0 435 436 #define kMaskBursty12_2 \ 437 0xaa, 0xa0, \ 438 0xd5, 0x50 439 440 #define kMaskBursty12_3 \ 441 0x92, 0x40, \ 442 0xc9, 0x20, \ 443 0x74, 0x90 444 445 #define kMaskBursty12_4 \ 446 0x8a, 0x80, \ 447 0xc5, 0x40, \ 448 0x62, 0x20, \ 449 0x39, 0x10 450 451 #define kMaskBursty12_5 \ 452 0x61, 0x00, \ 453 0x30, 0xa0, \ 454 0x1c, 0x50, \ 455 0x85, 0x20, \ 456 0xc2, 0x90 457 458 #define kMaskBursty12_6 \ 459 0x82, 0x90, \ 460 0xc1, 0x40, \ 461 0x60, 0xa0, \ 462 0x30, 0x50, \ 463 0x18, 0x20, \ 464 0x0c, 0x10 465 466 #define kMaskBursty12_7 \ 467 0x0c, 0x00, \ 468 0x07, 0x00, \ 469 0x81, 0x40, \ 470 0xc0, 0xa0, \ 471 0x60, 0x50, \ 472 0x30, 0x20, \ 473 0x18, 0x10 474 475 #define kMaskBursty12_8 \ 476 0x18, 0x00, \ 477 0x0c, 0x00, \ 478 0x06, 0x00, \ 479 0x03, 0x00, \ 480 0x80, 0xa0, \ 481 0xc0, 0x50, \ 482 0x60, 0x20, \ 483 0x30, 0x10 484 485 #define kMaskBursty12_9 \ 486 0x30, 0x00, \ 487 0x18, 0x00, \ 488 0x0c, 0x00, \ 489 0x06, 0x00, \ 490 0x03, 0x00, \ 491 0x01, 0x80, \ 492 0x80, 0x50, \ 493 0xc0, 0x20, \ 494 0x60, 0x10 495 496 #define kMaskBursty12_10 \ 497 0x60, 0x00, \ 498 0x30, 0x00, \ 499 0x18, 0x00, \ 500 0x0c, 0x00, \ 501 0x06, 0x00, \ 502 0x03, 0x00, \ 503 0x01, 0x80, \ 504 0x00, 0xc0, \ 505 0x80, 0x20, \ 506 0xc0, 0x10 507 508 #define kMaskBursty12_11 \ 509 0xc0, 0x00, \ 510 0x60, 0x00, \ 511 0x30, 0x00, \ 512 0x18, 0x00, \ 513 0x0c, 0x00, \ 514 0x06, 0x00, \ 515 0x03, 0x00, \ 516 0x01, 0x80, \ 517 0x00, 0xc0, \ 518 0x00, 0x60, \ 519 0x80, 0x10 520 521 #define kMaskBursty12_12 \ 522 0x80, 0x00, \ 523 0xc0, 0x00, \ 524 0x60, 0x00, \ 525 0x30, 0x00, \ 526 0x18, 0x00, \ 527 0x0c, 0x00, \ 528 0x06, 0x00, \ 529 0x03, 0x00, \ 530 0x01, 0x80, \ 531 0x00, 0xc0, \ 532 0x00, 0x60, \ 533 0x00, 0x30 534 535 #define kPacketMaskBursty1 1, \ 536 kMaskBursty1_1 537 538 #define kPacketMaskBursty2 2, \ 539 kMaskBursty2_1, \ 540 kMaskBursty2_2 541 542 #define kPacketMaskBursty3 3, \ 543 kMaskBursty3_1, \ 544 kMaskBursty3_2, \ 545 kMaskBursty3_3 546 547 #define kPacketMaskBursty4 4, \ 548 kMaskBursty4_1, \ 549 kMaskBursty4_2, \ 550 kMaskBursty4_3, \ 551 kMaskBursty4_4 552 553 #define kPacketMaskBursty5 5, \ 554 kMaskBursty5_1, \ 555 kMaskBursty5_2, \ 556 kMaskBursty5_3, \ 557 kMaskBursty5_4, \ 558 kMaskBursty5_5 559 560 #define kPacketMaskBursty6 6, \ 561 kMaskBursty6_1, \ 562 kMaskBursty6_2, \ 563 kMaskBursty6_3, \ 564 kMaskBursty6_4, \ 565 kMaskBursty6_5, \ 566 kMaskBursty6_6 567 568 #define kPacketMaskBursty7 7, \ 569 kMaskBursty7_1, \ 570 kMaskBursty7_2, \ 571 kMaskBursty7_3, \ 572 kMaskBursty7_4, \ 573 kMaskBursty7_5, \ 574 kMaskBursty7_6, \ 575 kMaskBursty7_7 576 577 #define kPacketMaskBursty8 8, \ 578 kMaskBursty8_1, \ 579 kMaskBursty8_2, \ 580 kMaskBursty8_3, \ 581 kMaskBursty8_4, \ 582 kMaskBursty8_5, \ 583 kMaskBursty8_6, \ 584 kMaskBursty8_7, \ 585 kMaskBursty8_8 586 587 #define kPacketMaskBursty9 9, \ 588 kMaskBursty9_1, \ 589 kMaskBursty9_2, \ 590 kMaskBursty9_3, \ 591 kMaskBursty9_4, \ 592 kMaskBursty9_5, \ 593 kMaskBursty9_6, \ 594 kMaskBursty9_7, \ 595 kMaskBursty9_8, \ 596 kMaskBursty9_9 597 598 #define kPacketMaskBursty10 10, \ 599 kMaskBursty10_1, \ 600 kMaskBursty10_2, \ 601 kMaskBursty10_3, \ 602 kMaskBursty10_4, \ 603 kMaskBursty10_5, \ 604 kMaskBursty10_6, \ 605 kMaskBursty10_7, \ 606 kMaskBursty10_8, \ 607 kMaskBursty10_9, \ 608 kMaskBursty10_10 609 610 #define kPacketMaskBursty11 11, \ 611 kMaskBursty11_1, \ 612 kMaskBursty11_2, \ 613 kMaskBursty11_3, \ 614 kMaskBursty11_4, \ 615 kMaskBursty11_5, \ 616 kMaskBursty11_6, \ 617 kMaskBursty11_7, \ 618 kMaskBursty11_8, \ 619 kMaskBursty11_9, \ 620 kMaskBursty11_10, \ 621 kMaskBursty11_11 622 623 #define kPacketMaskBursty12 12, \ 624 kMaskBursty12_1, \ 625 kMaskBursty12_2, \ 626 kMaskBursty12_3, \ 627 kMaskBursty12_4, \ 628 kMaskBursty12_5, \ 629 kMaskBursty12_6, \ 630 kMaskBursty12_7, \ 631 kMaskBursty12_8, \ 632 kMaskBursty12_9, \ 633 kMaskBursty12_10, \ 634 kMaskBursty12_11, \ 635 kMaskBursty12_12 636 637 // clang-format on 638 } // namespace 639 640 namespace webrtc { 641 namespace fec_private_tables { 642 643 const uint8_t kPacketMaskBurstyTbl[] = { 644 12, 645 kPacketMaskBursty1, 646 kPacketMaskBursty2, 647 kPacketMaskBursty3, 648 kPacketMaskBursty4, 649 kPacketMaskBursty5, 650 kPacketMaskBursty6, 651 kPacketMaskBursty7, 652 kPacketMaskBursty8, 653 kPacketMaskBursty9, 654 kPacketMaskBursty10, 655 kPacketMaskBursty11, 656 kPacketMaskBursty12, 657 }; 658 659 } // namespace fec_private_tables 660 } // namespace webrtc 661