Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
video_fec_budget.h File Reference

How much FEC a frame too large for the protocol's FEC blocks can keep. More...

#include <algorithm>
#include <cstddef>
Include dependency graph for video_fec_budget.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

constexpr int stream::large_frame_fec_percentage (std::size_t data_packets, int configured, int min_parity)

Variables

constexpr std::size_t stream::max_fec_blocks = 4
 The video packet header has 2 bits for the FEC block count.
constexpr std::size_t stream::max_fec_block_shards = 255
 Reed-Solomon over GF(2^8): data and parity shards of one FEC block together.

Detailed Description

How much FEC a frame too large for the protocol's FEC blocks can keep.

Definition in file video_fec_budget.h.

Function Documentation

◆ large_frame_fec_percentage()

int stream::large_frame_fec_percentage ( std::size_t data_packets,
int configured,
int min_parity )
constexpr

The FEC percentage for a frame that needs more than max_fec_blocks blocks at the configured percentage.

Such a frame is split into max_fec_blocks blocks anyway. Sending it with no parity at all means a single lost packet drops the frame, and these frames are mostly key frames, which the frames after them need. Instead keep the largest percentage whose shards still fit every block. The client reads the percentage from each packet's FEC info, so it needs nothing new.

Parameters
data_packetsThe frame's data packets.
configuredThe configured FEC percentage, the most this returns.
min_parityThe client's minimum parity packets per block; the encoder raises a block's parity to it, so it has to fit too.
Returns
The percentage, or 0 when no parity fits.

Definition at line 35 of file video_fec_budget.h.

Variable Documentation

◆ max_fec_block_shards

std::size_t stream::max_fec_block_shards = 255
constexpr

Reed-Solomon over GF(2^8): data and parity shards of one FEC block together.

Definition at line 16 of file video_fec_budget.h.

◆ max_fec_blocks

std::size_t stream::max_fec_blocks = 4
constexpr

The video packet header has 2 bits for the FEC block count.

Definition at line 13 of file video_fec_budget.h.