MCPcopy Create free account
hub / github.com/RenderKit/embree / sendCode

Function sendCode

tutorials/common/image/tinyexr.h:2715–2731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2713}
2714
2715inline void sendCode(long long sCode, int runCount, long long runCode,
2716 long long &c, int &lc, char *&out) {
2717 //
2718 // Output a run of runCount instances of the symbol sCount.
2719 // Output the symbols explicitly, or if that is shorter, output
2720 // the sCode symbol once followed by a runCode symbol and runCount
2721 // expressed as an 8-bit number.
2722 //
2723
2724 if (hufLength(sCode) + hufLength(runCode) + 8 < hufLength(sCode) * runCount) {
2725 outputCode(sCode, c, lc, out);
2726 outputCode(runCode, c, lc, out);
2727 outputBits(8, runCount, c, lc, out);
2728 } else {
2729 while (runCount-- >= 0) outputCode(sCode, c, lc, out);
2730 }
2731}
2732
2733//
2734// 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