diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-11-29 22:53:05 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-12-04 21:12:45 +0000 |
| commit | 9d2e56c2d2adb03d67af2d96dfbda88848e00caf (patch) | |
| tree | 38cc10a2fdf8a8e9417f6d5bc25e93650356f87c | |
| parent | b7439a387e431dad378466a912b4f38500811531 (diff) | |
Dump the round-tripped JPEG2000 file for checking.
| -rw-r--r-- | test/bench.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/bench.cc b/test/bench.cc index 57283645..3c375037 100644 --- a/test/bench.cc +++ b/test/bench.cc @@ -78,12 +78,13 @@ main (int argc, char* argv[]) Timer decompress; Timer compress; + dcp::Data recomp; for (int i = 0; i < count; ++i) { decompress.start (); shared_ptr<dcp::OpenJPEGImage> xyz = dcp::decompress_j2k (j2k, 0); decompress.stop (); compress.start (); - dcp::compress_j2k (xyz, j2k_bandwidth, 24, false, false); + recomp = dcp::compress_j2k (xyz, j2k_bandwidth, 24, false, false); compress.stop (); cout << (i + 1) << " "; cout.flush (); @@ -92,4 +93,8 @@ main (int argc, char* argv[]) cout << "Decompress: " << count / decompress.get() << " fps.\n"; cout << "Compress: " << count / compress.get() << " fps.\n"; + + FILE* f = fopen ("check.j2c", "wb"); + fwrite (recomp.data.get(), 1, recomp.size, f); + fclose (f); } |
