Skip to content

Commit ad7d1df

Browse files
author
Grok Compression
committed
compress: only increment processed packets when packet is actually written
1 parent ebb4f46 commit ad7d1df

File tree

2 files changed

+35
-12
lines changed

2 files changed

+35
-12
lines changed

.vscode/launch.json

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,45 @@
2323
]
2424
},
2525
{
26-
"name": "codec compress",
26+
"name": "compress corrupt sop",
2727
"type": "cppdbg",
2828
"request": "launch",
29-
"program": "${workspaceFolder}/build/bin/codec_compress",
30-
"args": [],
31-
"stopAtEntry": true,
29+
"program": "${workspaceFolder}/build/bin/grk_compress",
30+
"args": [
31+
"-i",
32+
"$HOME/temp/florence.png",
33+
"-o",
34+
"$HOME/temp/florence.jp2",
35+
"-S",
36+
"-u",
37+
"R"
38+
39+
],
3240
"cwd": "${workspaceFolder}",
33-
"environment": [],
41+
"environment": [
42+
{ "name": "GRK_DEBUG", "value": "4" }
43+
],
3444
"MIMode": "gdb",
35-
"setupCommands": [
45+
"miDebuggerPath": "/usr/bin/gdb"
46+
},
3647
{
37-
"description": "Enable pretty-printing for gdb",
38-
"text": "-enable-pretty-printing",
39-
"ignoreFailures": true
40-
}
41-
]
48+
"name": "decompress corrupt sop",
49+
"type": "cppdbg",
50+
"request": "launch",
51+
"program": "${workspaceFolder}/build/bin/grk_decompress",
52+
"args": [
53+
"-i",
54+
"$HOME/temp/florence.jp2",
55+
"-o",
56+
"$HOME/temp/florence.jp2.tif",
57+
58+
],
59+
"cwd": "${workspaceFolder}",
60+
"environment": [
61+
{ "name": "GRK_DEBUG", "value": "4" }
62+
],
63+
"MIMode": "gdb",
64+
"miDebuggerPath": "/usr/bin/gdb"
4265
},
4366
{
4467
"name": "test",

src/lib/core/t2/T2Compress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ bool T2Compress::compressPackets(uint16_t tile_no, uint16_t max_layers, Buffered
196196
if(!compressPacket(tcp, current_pi, stream, &numBytes))
197197
return false;
198198
*tileBytesWritten += numBytes;
199-
tileProcessor->incNumProcessedPackets(1);
200199
}
201200
}
202201

@@ -420,6 +419,7 @@ bool T2Compress::compressPacket(TileCodingParams* tcp, PacketIter* pi, BufferedS
420419
}
421420
}
422421
*packet_bytes_written += (uint32_t)(stream->tell() - stream_start);
422+
tileProcessor->incNumProcessedPackets(1);
423423

424424
return true;
425425
}

0 commit comments

Comments
 (0)