MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / MakeDecoderMatrix

Method MakeDecoderMatrix

Libraries/unrar/rs16.cpp:127–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126
127void RSCoder16::MakeDecoderMatrix()
128{
129 // Create Cauchy decoder matrix. Skip trivial rows matching valid data
130 // units and containing "1" on main diagonal. Such rows would just copy
131 // source data to destination and they have no real value for us.
132 // Include rows only for broken data units and replace them by first
133 // available valid recovery code rows.
134 for (uint Flag=0, R=ND, Dest=0; Flag < ND; Flag++)
135 if (!ValidFlags[Flag]) // For every broken data unit.
136 {
137 while (!ValidFlags[R]) // Find a valid recovery unit.
138 R++;
139 for (uint J = 0; J < ND; J++) // And place its row to matrix.
140 MX[Dest*ND + J] = gfInv( gfAdd(R,J) );
141 Dest++;
142 R++;
143 }
144}
145
146
147// Apply Gauss�Jordan elimination to find inverse of decoder matrix.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected