mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-10 17:56:06 +00:00
Use nanors for optimized Reed-Solomon FEC decoding (#125)
This commit is contained in:
@@ -55,8 +55,7 @@ void RtpaInitializeQueue(PRTP_AUDIO_QUEUE queue) {
|
||||
// works correctly. This is possible because the data and FEC shard count is
|
||||
// constant and known in advance.
|
||||
const unsigned char parity[] = { 0x77, 0x40, 0x38, 0x0e, 0xc7, 0xa7, 0x0d, 0x6c };
|
||||
memcpy(&queue->rs->m[16], parity, sizeof(parity));
|
||||
memcpy(queue->rs->parity, parity, sizeof(parity));
|
||||
memcpy(queue->rs->p, parity, sizeof(parity));
|
||||
}
|
||||
|
||||
static void validateFecBlockState(PRTP_AUDIO_QUEUE queue) {
|
||||
@@ -444,7 +443,7 @@ static bool completeFecBlock(PRTP_AUDIO_QUEUE queue, PRTPA_FEC_BLOCK block) {
|
||||
memset(block->dataPackets[dropIndex], 0, sizeof(RTP_PACKET) + block->blockSize);
|
||||
#endif
|
||||
|
||||
int res = reed_solomon_reconstruct(queue->rs, shards, block->marks, RTPA_TOTAL_SHARDS, block->blockSize);
|
||||
int res = reed_solomon_decode(queue->rs, shards, block->marks, RTPA_TOTAL_SHARDS, block->blockSize);
|
||||
if (res != 0) {
|
||||
// We should always have enough data to recover the entire block since we checked above.
|
||||
LC_ASSERT(res == 0);
|
||||
|
||||
Reference in New Issue
Block a user