MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / sendCode

Function sendCode

third-party/tinyexr/tinyexr.h:2641–2657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2639}
2640
2641inline void sendCode(long long sCode, int runCount, long long runCode,
2642 long long &c, int &lc, char *&out) {
2643 //
2644 // Output a run of runCount instances of the symbol sCount.
2645 // Output the symbols explicitly, or if that is shorter, output
2646 // the sCode symbol once followed by a runCode symbol and runCount
2647 // expressed as an 8-bit number.
2648 //
2649
2650 if (hufLength(sCode) + hufLength(runCode) + 8 < hufLength(sCode) * runCount) {
2651 outputCode(sCode, c, lc, out);
2652 outputCode(runCode, c, lc, out);
2653 outputBits(8, runCount, c, lc, out);
2654 } else {
2655 while (runCount-- >= 0) outputCode(sCode, c, lc, out);
2656 }
2657}
2658
2659//
2660// Encode (compress) ni values based on the Huffman encoding table hcode:

Callers 1

hufEncodeFunction · 0.85

Calls 3

hufLengthFunction · 0.85
outputCodeFunction · 0.85
outputBitsFunction · 0.85

Tested by

no test coverage detected