99
So you think you can FEC? Mikhail “Misha” Fludkov (fludkov) – Pexip R&D Erlend “Earl” Graff (egraff) – Pexip R&D 8 th GStreamer Conference 21 October 2017 Prague, Czech Republic

So you think you can FEC? - GStreamer...RTP video or audio packets (VP8, H264, OPUS, etc) FEC packets with redundant data. ... GStreamer element for packet recovery #6 #5 #4 #3 #2

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

  • So you think you can FEC?

    Mikhail “Misha” Fludkov (fludkov) – Pexip R&D

    Erlend “Earl” Graff (egraff) – Pexip R&D

    8th GStreamer Conference21 October 2017

    Prague, Czech Republic

  • Outline

    • Introduction to FEC

    • Designing a FEC decoder element

    • FEC algorithms

    • XOR-based FEC

    • Reed-Solomon FEC

    • DEMO!

  • Bird’s eye view on FEC

    #6 #5 #4 #3 #2 #1 #0#9 #8 #7#10#12 #11#13#18 #16 #15 #14#17

    RTP video or audio packets (VP8, H264, OPUS, etc)

    FEC packets with redundant data

  • Bird’s eye view on FEC

    #6 #5 #4 #3 #2 #1 #0#9 #8 #7#10#12 #11#13#18 #16 #15 #14#17

  • FEC standards zoo

    • RED - Redundant Audio Data (RFC 2198)

    • ULPFEC based standards:

    • ULPFEC – Generic Forward Error Correction (RFC 5109)

    • ULPFEC (WebRTC)

    • X-ULPFECUC (Skype)

    • FLEX FEC - Flexible Forward Error Correction

  • GStreamer element for packet recovery

    #6 #5 #4 #3 #2 #1 #0 FECDec #4 #3 #2 #1 #0

  • GstRtpBin FECDecFECDec

    Where to hook it up? Before or after jitterbuffer?

    here ? or here ?

  • Where to hook it up?

    #6 #5 #4 #3 #2 #1 #0

    Lost event with seq-num #4

    GstRtpBin FECDec#4

    #4

  • “What if…” it works and recovers packets! Yaaay!

    #6 #5 #3 #2 #1 #0

    #4

    lost packet was recoveredand pushed here

    send_rtcp_src

    GstRtpBinFECDec

  • Where to hook it up to? Flex FEC case

    #1 #0

    #1 #0#1 #0#1 #0#1 #0

    #1 #0

    recv_rtp_src_100

    recv_rtp_src_200

    audio packet with ssrc 100

    video packet with ssrc 200

    Flex FEC packet with ssrc 300

    GstRtpBin

    recv_rtp_src_300

  • Doing it the right way

    #6 #5 #3 #2 #0

    recv_rtp_src_100

    recv_rtp_src_200

    recv_rtp_src_300

    get_packets_for_recovery(ssrc=300, seq_num=4)

    GstRtpBin

    #4

    RtpStorage

    PexFecDec

    PexFecDec

    PexFecDec

  • Yet another “what if…”

    #6 #5 #4 #3 #2 #1 #0#9 #8 #7#10#12 #11#13#18 #16 #15 #14#17

  • FEC Algorithms

    XOR-based FEC

    Reed-Solomon FEC

  • XOR-based FEC

  • XOR-based FEC

    D1

    D2

    D3

    D4

    R1

    R2

  • XOR-based FEC

    D1

    D2

    D3

    D4

    R1

    R2

    =

    =

    ⊕ ⊕⊕

    D1

    D1

    D2

    D2 D3 D4

  • D3

    D2

    D2

    XOR-based FEC

    =

    =

    D1

    D2

    D3

    D4

    R1

    R2 ⊕ ⊕ ⊕

    D1

    D1 D4

  • 𝑥

    XOR-based FEC

    =

    =

    𝑥

    𝑥 ⊕ ⊕

    D1

    D4

    R1

    R2

    D1

    D1 D4

  • 𝑦

    𝑥

    XOR-based FEC

    =

    =

    𝑥

    𝑥 ⊕ ⊕𝑦

    D1

    D4

    R1

    R2

    D1

    D1 D4

  • XOR-based FEC

    =

    =

    𝑥

    𝑦

    𝑥

    𝑥 ⊕ ⊕𝑦

    D1

    D4

    R1

    R2

    D1

    D1 D4

    R1

    D4

    D1

    D1⇔

    𝑥 = ⊕

    𝑦 = ⊕ ⊕𝑥 ⊕

    R1

    R2

  • XOR-based FEC

    ⇔𝑦 = ⊕ ⊕

    =

    =

    𝑥

    𝑦

    𝑥

    𝑥 ⊕ ⊕𝑦

    D1

    D4

    R1

    R2

    D1

    D1 D4

    D1𝑥 = ⊕ R1

    R1 D4 R2

  • XOR-based FEC

    D1

    D2

    D3

    D4

    R1

    R2

    =

    =

    ⊕ ⊕⊕

    D1

    D1

    D2

    D2 D3 D4

  • XOR-based FEC

    D1

    D2

    D3

    D4

    R1

    R2

    =

    =

    ⊕ ⊕⊕

    D1

    D1

    D2

    D2 D3 D4

  • XOR-based FEC

    D1

    D2

    R1

    R2

    =

    =

    ⊕ ⊕⊕

    D1

    D1

    D2

    D2

    𝑥

    𝑥

  • XOR-based FEC

    D1

    D2

    R1

    R2

    =

    =

    ⊕ ⊕⊕

    D1

    D1

    D2

    D2

    𝑥

    𝑦

    𝑥 𝑦

  • Reed-Solomon codes

    Irving S. Reed and Gustave Solomon

    • Either

    • Detect up to 𝑡 errors

    • Detect and correct up to Τ𝑡 2 errors

    • Correct up to 𝑡 erasures

    𝑘 data symbols 𝑡 parity symbols

    R-Sencoder

    𝑘 symbols(data and/or parity)

    𝑘 original data symbols

    R-Serasuredecoder

  • Data packets

    Redundancy packets

    Reed-Solomon codes

  • Reed-Solomon codes

    55 47 56 34 61 58 41 67 61 58 4d 67 59 58 64 6c 63 32 39 74 5a 53 45 68 49 51 3d 3d …

    ee c9 95 a1 9d 21 a3 b3 87 53 75 a5 aa 16 4f 4b 70 7f 4b 95 70 c6 bd e8 cb 02 bf 8c …

    5d 4a d7 8b 73 0f 61 54 bf bc d7 cd aa 22 d9 44 4a f6 48 8a 14 c4 0a c3 ca f4 d5 ff …

    90 09 d6 a5 f3 e3 5d d3 24 3f 24 a8 1b 96 72 09 1f c8 cb d7 41 94 23 42 6e 85 2d d6 …

    85 9a b2 76 8f 41 c2 37 29 ee d3 5b fd e0 b0 d1 49 58 91 2a 45 52 47 d1 82 b2 dd 0c …

    Data packets

    Redundancy packets

  • Reed-Solomon codes

    55

    ee

    5d

    90

    85

    Data packets

    Redundancy packets

  • Reed-Solomon codes

    47

    c9

    4a

    09

    9a

    Data packets

    Redundancy packets

  • Reed-Solomon codes

    56

    95

    d7

    d6

    b2

    Data packets

    Redundancy packets

  • 55 47 56 34 61 58 41 67 61 58 4d 67 59 58 64 6c 63 32 39 74 5a 53 45 68 49 51 3d 3d …

    ee c9 95 a1 9d 21 a3 b3 87 53 75 a5 aa 16 4f 4b 70 7f 4b 95 70 c6 bd e8 cb 02 bf 8c …

    5d 4a d7 8b 73 0f 61 54 bf bc d7 cd aa 22 d9 44 4a f6 48 8a 14 c4 0a c3 ca f4 d5 ff …

    Reed-Solomon codes

    90 09 d6 a5 f3 e3 5d d3 24 3f 24 a8 1b 96 72 09 1f c8 cb d7 41 94 23 42 6e 85 2d d6 …

    85 9a b2 76 8f 41 c2 37 29 ee d3 5b fd e0 b0 d1 49 58 91 2a 45 52 47 d1 82 b2 dd 0c …

    Data packets

    Redundancy packets

  • Reed-Solomon codes

  • Reed-Solomon codes – encoding

    10

    50

    100D1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficientsD1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2

    D1:

    D2:

    D3:

    R1:

    R2:

  • 100

    1050100

    Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +

    50 10

    D1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    1005 × 502 × 103×+

    + +

    +

    1004 × 5 × 50 2 × 10

    D1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    502 × 103×+

    + +

    +

    1004 × 5 × 50 2 × 10

    500

    D1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    103×+

    + +

    +

    1004 × 5 × 50 2 × 10

    500 100

    D1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    + +

    +

    1004 × 5 × 50 2 × 10

    500 100 30

    D1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    + +

    +

    1004 × 5 × 50 2 × 10

    500 100 30630

    D1:

    D2:

    D3:

    R1:

    R2:

  • 400 250 20

    Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    + +

    +500 100 30630

    D1:

    D2:

    D3:

    R1:

    R2:

  • 400 250 20

    Reed-Solomon codes – encoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    + +

    +500 100 30630

    670

    D1:

    D2:

    D3:

    R1:

    R2:

  • 100

    1050100

    Reed-Solomon codes – decoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +

    50 10

    630

    670

    D1:

    D2:

    D3:

    R1:

    R2:

  • 100

    1050100

    Reed-Solomon codes – decoding

    10

    50

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +

    50 10

    630

    670

    D1:

    D2:

    D3:

    R1:

    R2:

  • 100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    670

    𝑥

    𝑥

    𝑥

    D1:

    D2:

    D3:

    R1:

    R2:

  • 100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    670

    𝑥

    𝑥

    𝑥

    𝑦

    𝑦

    𝑦

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    𝑥 𝑦

    𝑦

    670⇔

    500 + 2𝑥 + 3𝑦 = 630

    400 + 5𝑥 + 2𝑦 = 670

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    𝑥 𝑦

    𝑦

    670⇔

    500 + 2𝑥 + 3𝑦 = 630

    400 + 5𝑥 + 2𝑦 = 670

    500 + 2𝑥 + 3𝑦 = 630 − 500

    400 + 5𝑥 + 2𝑦 = 670 − 400

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    𝑥 𝑦

    𝑦

    670⇔

    2𝑥 + 3𝑦 = 630 − 500

    5𝑥 + 2𝑦 = 670 − 400

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    𝑥 𝑦

    𝑦

    670⇔

    2𝑥 + 3𝑦 = 130

    5𝑥 + 2𝑦 = 270

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    𝑥 𝑦

    𝑦

    670⇔

    −3𝑥 + 𝑦 = −140

    2𝑥 + 3𝑦 = 130

    5𝑥 + 2𝑦 = 270

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    𝑥 𝑦

    𝑦

    670⇔

    𝑦 = 3𝑥 − 140

    2𝑥 + 3𝑦 = 130

    5𝑥 + 2𝑦 = 270

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    100

    100

    Reed-Solomon codes – decoding

    100

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +630

    𝑥 𝑦

    𝑦

    670⇔

    𝑦 = 3𝑥 − 140

    2𝑥 + 3𝑦 = 130

    5𝑥 + 2𝑦 = 270⇔

    2𝑥 + 3 3𝑥 − 140 = 130

    2𝑥 + 9𝑥 − 420 = 130

    11𝑥 = 550

    𝑥 = 50

    D1:

    D2:

    D3:

    R1:

    R2:

  • Reed-Solomon codes – summary

    • Encoding• Linear combination (matrix multiplication)

    • Decoding• Solving linear equation system (matrix inversion and multiplication)

  • But… 10

    50

    100

    630

    670

  • Linear combinations in ℝ

    5 × 100 + 2 × 50 + 3 × 10

    ∈ ℝ ∈ ℝ ∈ ℝ

  • ∈ 0,255 ∈ 0,255 ∈ 0,255

    Linear combinations… not in ℝ?

    5 × 100 + 2 × 50 + 3 × 10

  • ∈ 0,255 ∈ 0,255 ∈ 0,255

    Linear combinations… not in ℝ?

    5 × 100 + 2 × 50 + 3 × 10

    ∈ 0,255

  • Fields

    • Set of elements

    • + and ⋅

    • Given 𝑎 ∈ Ϝ and 𝑏 ∈ Ϝ, then…

    • 𝑎 + 𝑏 ∈ Ϝ

    • 𝑎 ⋅ 𝑏 ∈ Ϝ

    • ℝ and ℚ – infinite fields

    • Finite fields

  • Fields

    ൗℤ 7ℤ

    0,1,2,3,4,5,6

    + is addition modulo 7

    ⋅ is multiplication modulo 7

  • Fields

    Multiplication table for Τℤ 7ℤ

    1 2 3 4 5 6

    1 1 2 3 4 5 6

    2 4 6 1 3 5

    3 2 5 1 4

    4 2 6 3

    5 4 2

    6 1

  • Fields

    Multiplication table for Τℤ 7ℤ

    1 2 3 4 5 6

    1 1 2 3 4 5 6

    2 4 6 1 3 5

    3 2 5 1 4

    4 2 6 3

    5 4 2

    6 1

    2 ⋅ 4 ≡ 8 ≡ 1 mod 7

  • Fields

    Multiplication table for Τℤ 7ℤ

    1 2 3 4 5 6

    1 1 2 3 4 5 6

    2 4 6 1 3 5

    3 2 5 1 4

    4 2 6 3

    5 4 2

    6 1

    4 ⋅ 5 ≡ 20 ≡ 6 mod 7

  • Fields

    • Finite fields – 𝑝𝑞 elements

    • Solving linear equation systems works!

    • Reed-Solomon: typically 2𝑞 elements

    • 𝐺𝐹 28 – 0,255

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1D1:

    D2:

    D3:

    R1:

    R2:

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficientsD1:

    D2:

    D3:

    R1:

    R2:

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2

    D1:

    D2:

    D3:

    R1:

    R2:

  • 1

    321

    Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +

    2 3

    D1:

    D2:

    D3:

    R1:

    R2:

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    = 14 ×

    15 × 22 × 33×+

    +

    +

    +5 × 2 2 × 3

    D1:

    D2:

    D3:

    R1:

    R2:

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    = 14 ×

    22 × 33×+

    +

    +

    +5 × 2 2 × 3

    D1:

    D2:

    D3:

    R1:

    R2:

    5

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    = 14 ×

    33×+

    +

    +

    +5 × 2 2 × 3

    D1:

    D2:

    D3:

    R1:

    R2:

    5 4

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    = 14 ×

    +

    +

    +

    +5 × 2 2 × 3

    D1:

    D2:

    D3:

    R1:

    R2:

    5 4 2

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    = 14 ×

    +

    +

    +

    +5 × 2 2 × 3

    D1:

    D2:

    D3:

    R1:

    R2:

    5 4 24

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    +

    +

    +5 × 2 2 × 3

    D1:

    D2:

    D3:

    R1:

    R2:

    5 4 24

    4

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    +

    +

    + 2 × 3

    D1:

    D2:

    D3:

    R1:

    R2:

    5 4 24

    4 3

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    +

    +

    +

    D1:

    D2:

    D3:

    R1:

    R2:

    5 4 24

    4 3 6

  • Linear MDS codes over Τℤ 7ℤ – encoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    +

    +

    +

    +

    D1:

    D2:

    D3:

    R1:

    R2:

    5 4 24

    4 3 66

  • 1

    321

    Linear MDS codes over Τℤ 7ℤ – decoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +

    2 3

    4

    6

    D1:

    D2:

    D3:

    R1:

    R2:

  • 1

    321

    Linear MDS codes over Τℤ 7ℤ – decoding

    3

    2

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +

    2 3

    4

    6

    D1:

    D2:

    D3:

    R1:

    R2:

  • 1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    6

    𝑥

    𝑥

    𝑥

    D1:

    D2:

    D3:

    R1:

    R2:

  • 1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    6

    𝑥

    𝑥

    𝑥

    𝑦

    𝑦

    𝑦

    D1:

    D2:

    D3:

    R1:

    R2:

  • 𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    5 + 2𝑥 + 3𝑦 = 4

    4 + 5𝑥 + 2𝑦 = 6

    D1:

    D2:

    D3:

    R1:

    R2:

  • 3 + 4 + 5𝑥 + 2𝑦 = 6 + 3

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    5 + 2𝑥 + 3𝑦 = 4

    4 + 5𝑥 + 2𝑦 = 6

    D1:

    D2:

    D3:

    R1:

    R2:

    2 + 5 + 2𝑥 + 3𝑦 = 4 + 2

  • 3 + 4 + 5𝑥 + 2𝑦 = 6 + 3

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    5 + 2𝑥 + 3𝑦 = 4

    4 + 5𝑥 + 2𝑦 = 6

    D1:

    D2:

    D3:

    R1:

    R2:

    2 + 5 + 2𝑥 + 3𝑦 = 4 + 2

  • 2𝑥 + 3𝑦 = 4 + 2

    5𝑥 + 2𝑦 = 6 + 3

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

  • 2𝑥 + 3𝑦 = 6

    5𝑥 + 2𝑦 = 2

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

  • 2𝑥 + 3𝑦 = 6

    5𝑥 + 2𝑦 = 2

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

    0𝑥 + 5𝑦 = 1

  • 2𝑥 + 3𝑦 = 6

    5𝑥 + 2𝑦 = 2

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

    5𝑦 = 1

  • 2𝑥 + 3𝑦 = 6

    5𝑥 + 2𝑦 = 2

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

    Multiplication table for Τℤ 7ℤ

    1 2 3 4 5 6

    1 1 2 3 4 5 6

    2 4 6 1 3 5

    3 2 5 1 4

    4 2 6 3

    5 4 2

    6 1

    5𝑦 = 1

  • 2𝑥 + 3𝑦 = 6

    5𝑥 + 2𝑦 = 2

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

    5𝑦 = 1

    Multiplication table for Τℤ 7ℤ

    1 2 3 4 5 6

    1 1 2 3 4 5 6

    2 4 6 1 3 5

    3 2 5 1 4

    4 2 6 3

    5 4 2

    6 1

  • 2𝑥 + 3𝑦 = 6

    5𝑥 + 2𝑦 = 2

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

    3 ⋅ 5𝑦 = 1 ⋅ 3

    Multiplication table for Τℤ 7ℤ

    1 2 3 4 5 6

    1 1 2 3 4 5 6

    2 4 6 1 3 5

    3 2 5 1 4

    4 2 6 3

    5 4 2

    6 1

  • 2𝑥 + 3𝑦 = 6

    5𝑥 + 2𝑦 = 2

    𝑦

    𝑥

    𝑥

    1

    1

    Linear MDS codes over Τℤ 7ℤ – decoding

    1

    5

    4

    2 3

    5 2

    Encoding coefficients

    =

    =

    5 2 3

    4 5 2×

    × ×

    × ×

    ×+

    + +

    +4

    𝑥 𝑦

    𝑦

    6⇔

    D1:

    D2:

    D3:

    R1:

    R2:

    𝑦 = 3

    Multiplication table for Τℤ 7ℤ

    1 2 3 4 5 6

    1 1 2 3 4 5 6

    2 4 6 1 3 5

    3 2 5 1 4

    4 2 6 3

    5 4 2

    6 1

  • FEC it up!

    • GStreamer elements

    • RED encoder and decoder

    • ULPFEC decoder (XOR and Reed-Solomon)

    • RTPStorage element

    • Reed-Solomon encoder and decoder

    • Only 𝐺𝐹 28

    • Matrix operations

    • Cauchy-RS – fast matrix inversion

    • SIMD optimizations1

    1 Anvin, H. P. The mathematics of RAID-6. 2009.

  • DEMO THYME

  • Benchmarks – Reed-Solomon encoding

  • Benchmarks – Reed-Solomon decoding

  • Questions?(Do you think we can FEC?)