• R/O
  • SSH
  • HTTPS

jyeipegyuu: Commit


Commit MetaInfo

Revision12 (tree)
Time2009-09-06 23:37:47
Authorberupon

Log Message

Paeth予測を切り替えられるようにした。

Change Summary

Incremental Difference

--- main.cpp (revision 11)
+++ main.cpp (revision 12)
@@ -92,7 +92,11 @@
9292 reorderByFrequency(hBlockCount, vBlockCount, pWork, pWork2);
9393
9494 // TODO: to add option to disable paeth prediction
95- paethPredictEncode(hBlockCount, vBlockCount, pWork2, pWork);
95+ unsigned char enablePaethPrediction = 1;
96+ *dest++ = enablePaethPrediction;
97+ if (enablePaethPrediction) {
98+ paethPredictEncode(hBlockCount, vBlockCount, pWork2, pWork);
99+ }
96100
97101 std::vector<unsigned char> signFlags(totalBlockCount*64);
98102 unsigned char* pSignFlags = &signFlags[0];
@@ -147,6 +151,8 @@
147151 int* pWork2 = &work2[0];
148152 size_t destLen = work2.size();
149153
154+ unsigned char enablePaethPrediction = *src++;
155+
150156 // zero one flags
151157 unsigned char zeroOneLimit = *src++;
152158 std::vector<unsigned char> zeroOneFlags(totalBlockCount);
@@ -186,7 +192,9 @@
186192 }
187193 }
188194
189- paethPredictDecode(hBlockCount, vBlockCount, pWork2, pWork);
195+ if (enablePaethPrediction) {
196+ paethPredictDecode(hBlockCount, vBlockCount, pWork2, pWork);
197+ }
190198
191199 reorderByPosition(hBlockCount, vBlockCount, pWork2, pWork);
192200
Show on old repository browser