diff --git a/src/engine/cmdStreamOps.cpp b/src/engine/cmdStreamOps.cpp index c8795f142..426338122 100644 --- a/src/engine/cmdStreamOps.cpp +++ b/src/engine/cmdStreamOps.cpp @@ -570,6 +570,15 @@ void writeCommandValues(SafeWriter* w, const DivCommand& c) { using namespace DivCS; +int estimateBlockSize(unsigned char* buf, size_t len, unsigned char* speedDial) { + int ret=0; + for (size_t i=0; i& subBlocks) { +SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlocks, unsigned char* speedDial) { unsigned char* buf=stream->getFinalBuf(); size_t matchSize=48; std::vector matches; @@ -778,8 +787,43 @@ SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlock } } - // make sub-blocks + // check which sub-blocks are viable to make size_t lastOrig=SIZE_MAX; + size_t lastOrigOff=0; + int gains=0; + int blockSize=0; + for (size_t i=0; i<=workMatches.size(); i++) { + BlockMatch b(SIZE_MAX,SIZE_MAX,0); + if (i