MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / sendCode

Function sendCode

Source/ThirdParty/tinyexr.h:2785–2801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2783}
2784
2785inline void sendCode(long long sCode, int runCount, long long runCode,
2786 long long &c, int &lc, char *&out) {
2787 //
2788 // Output a run of runCount instances of the symbol sCount.
2789 // Output the symbols explicitly, or if that is shorter, output
2790 // the sCode symbol once followed by a runCode symbol and runCount
2791 // expressed as an 8-bit number.
2792 //
2793
2794 if (hufLength(sCode) + hufLength(runCode) + 8 < hufLength(sCode) * runCount) {
2795 outputCode(sCode, c, lc, out);
2796 outputCode(runCode, c, lc, out);
2797 outputBits(8, runCount, c, lc, out);
2798 } else {
2799 while (runCount-- >= 0) outputCode(sCode, c, lc, out);
2800 }
2801}
2802
2803//
2804// 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