We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b22be16 commit c6b70f7Copy full SHA for c6b70f7
Block.cpp
@@ -179,8 +179,13 @@ void dc::Block<size>::createRLESequence(void) {
179
*/
180
template<size_t size>
181
size_t dc::Block<size>::streamSize(void) const {
182
- return 4u // 4 bits for bit length
183
- + (size * size * 8u); // Upper estimate for needed bits
+ if (this->rle_Data == nullptr) {
+ return 4u // 4 bits for bit length
184
+ + (size * size * 16u); // Upper estimate for needed bits
185
+ } else {
186
+ // Exact prediction if RLE sequence is known
187
+ return 4u + (size * size * this->rle_Data->front()->data_bits);
188
+ }
189
}
190
191
/**
0 commit comments