OpenJPH
Open-source implementation of JPEG2000 Part-15
Loading...
Searching...
No Matches
test_executables.cpp
Go to the documentation of this file.
1//***************************************************************************/
2// This software is released under the 2-Clause BSD license, included
3// below.
4//
5// Copyright (c) 2019, Aous Naman
6// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
7// Copyright (c) 2019, The University of New South Wales, Australia
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12//
13// 1. Redistributions of source code must retain the above copyright
14// notice, this list of conditions and the following disclaimer.
15//
16// 2. Redistributions in binary form must reproduce the above copyright
17// notice, this list of conditions and the following disclaimer in the
18// documentation and/or other materials provided with the distribution.
19//
20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31//***************************************************************************/
32// This file is part of the OpenJPH software implementation.
33// File: test_executables.cpp
34// Author: Aous Naman
35// Date: 30 December 2022
36//***************************************************************************/
37
38#include <array>
39#include <string>
40#include "ojph_arch.h"
41#include "gtest/gtest.h"
42
44// STATIC ojph_popen
46static inline
47FILE* ojph_popen(const char* command, const char* modes)
48{
49#ifdef OJPH_COMPILER_MSVC
50 return _popen(command, modes);
51#else
52 return popen(command, modes);
53#endif
54}
55
57// STATIC ojph_pclose
59static inline
60int ojph_pclose(FILE* stream)
61{
62#ifdef OJPH_COMPILER_MSVC
63 return _pclose(stream);
64#else
65 return pclose(stream);
66#endif
67}
68
70// STATIC execute
72static
73int execute(const std::string& cmd, std::string& result)
74{
75 std::array<char, 128> buffer;
76 result.clear();
77
78 FILE* pipe = ojph_popen(cmd.c_str(), "r");
79 if (!pipe)
80 throw std::runtime_error("ojph_popen() failed!");
81
82 while (!feof(pipe))
83 if (fgets(buffer.data(), 128, pipe) != nullptr)
84 result += buffer.data();
85
86 int rc = ojph_pclose(pipe);
87 if (rc != EXIT_SUCCESS)
88 return 1;
89 return 0;
90}
91
93// MACROS
95
96#ifdef OJPH_OS_WINDOWS
97#define SRC_FILE_DIR ".\\jp2k_test_codestreams\\openjph\\"
98#define OUT_FILE_DIR ".\\"
99#define REF_FILE_DIR ".\\jp2k_test_codestreams\\openjph\\references\\"
100#define MSE_PAE_PATH ".\\mse_pae"
101#define COMPARE_FILES_PATH ".\\compare_files"
102#define EXPAND_EXECUTABLE ".\\ojph_expand.exe"
103#define COMPRESS_EXECUTABLE ".\\ojph_compress.exe"
104#else
105#define SRC_FILE_DIR "./jp2k_test_codestreams/openjph/"
106#define OUT_FILE_DIR "./"
107#define REF_FILE_DIR "./jp2k_test_codestreams/openjph/references/"
108#define MSE_PAE_PATH "./mse_pae"
109#define COMPARE_FILES_PATH "./compare_files"
110
111// This is a comment to me, to help with emscripten testing.
112// This is written after the completion of the tests.
113// 1. Compile for the target platform (Linux), selecting from the following
114// code the version that suits you; in particular it should be the one
115// the uses node. Ideally create two versions of test_executables, one
116// for WASM SIMD, and for WASM without SIMD -- use linux cp command to
117// create test_executables_simd and test_executables_no_simd
118// 2. Compile again, without deleting what compiled; this time compile using
119// emscripten, targeting WASM. The compilation is very finicky, do
120// 'make clean && make' after every change in code.
121// 3. cd to tests, and run test_executables_simd or test_executables_no_simd.
122
123#define EXPAND_EXECUTABLE "./ojph_expand"
124#define COMPRESS_EXECUTABLE "./ojph_compress"
125//#define EXPAND_EXECUTABLE "20.18.0_64bit/bin/node ./ojph_expand.js"
126//#define COMPRESS_EXECUTABLE "20.18.0_64bit/bin/node ./ojph_compress.js"
127//#define EXPAND_EXECUTABLE "node-v18.7.0-linux-x64/bin/node ./ojph_expand_simd.js"
128//#define COMPRESS_EXECUTABLE "node-v18.7.0-linux-x64/bin/node ./ojph_compress_simd.js"
129//#define EXPAND_EXECUTABLE "./../../../sde/sde64 -skx -- ./ojph_expand"
130//#define COMPRESS_EXECUTABLE "./../../../sde/sde64 -skx -- ./ojph_compress"
131#endif
132#define TOL_DOUBLE 0.01
133#define TOL_INTEGER 1
134
136// run_ojph_compress
138void run_ojph_compress(const std::string& ref_filename,
139 const std::string& base_filename,
140 const std::string& extended_base_fname,
141 const std::string& out_ext,
142 const std::string& extra_options)
143{
144 try {
145 std::string result, command;
146 command = std::string(COMPRESS_EXECUTABLE)
147 + " -i " + REF_FILE_DIR + ref_filename
148 + " -o " + OUT_FILE_DIR + base_filename + extended_base_fname +
149 "." + out_ext + " " + extra_options;
150 EXPECT_EQ(execute(command, result), 0);
151 }
152 catch (const std::runtime_error& error) {
153 FAIL() << error.what();
154 }
155}
156
158// run_ojph_expand
160void run_ojph_expand(const std::string& base_filename,
161 const std::string& src_ext,
162 const std::string& out_ext)
163{
164 try {
165 std::string result, command;
166 command = std::string(EXPAND_EXECUTABLE)
167 + " -i " + SRC_FILE_DIR + base_filename + "." + src_ext
168 + " -o " + OUT_FILE_DIR + base_filename + "." + out_ext;
169 EXPECT_EQ(execute(command, result), 0);
170 }
171 catch (const std::runtime_error& error) {
172 FAIL() << error.what();
173 }
174}
175
177// run_ojph_compress
179void run_ojph_compress_expand(const std::string& base_filename,
180 const std::string& out_ext,
181 const std::string& decode_ext)
182{
183 try {
184 std::string result, command;
185 command = std::string(EXPAND_EXECUTABLE)
186 + " -i " + OUT_FILE_DIR + base_filename + "." + out_ext
187 + " -o " + OUT_FILE_DIR + base_filename + "." + decode_ext;
188 EXPECT_EQ(execute(command, result), 0);
189 }
190 catch (const std::runtime_error& error) {
191 FAIL() << error.what();
192 }
193}
194
196// run_mse_pae
198void run_mse_pae(const std::string& base_filename,
199 const std::string& out_ext,
200 const std::string& ref_filename,
201 const std::string& yuv_specs,
202 int num_components, double* mse, int* pae)
203{
204 try {
205 std::string result, command;
206 command = std::string(MSE_PAE_PATH)
207 + " " + OUT_FILE_DIR + base_filename + "." + out_ext + yuv_specs
208 + " " + REF_FILE_DIR + ref_filename + yuv_specs;
209 EXPECT_EQ(execute(command, result), 0);
210
211 size_t pos = 0;
212 for (int c = 0; c < num_components; ++c) {
213 if (pos < result.length()) {
214 double valf = atof(result.c_str() + pos);
215 EXPECT_NEAR((valf - mse[c]) / (valf + TOL_DOUBLE), 0.0, TOL_DOUBLE);
216 }
217 else {
218 FAIL() << "mse_pae result string does not have enough entries.";
219 }
220 pos = result.find(" ", pos);
221 if (pos != std::string::npos)
222 ++pos;
223 if (pos < result.length()) {
224 int vali = atoi(result.c_str() + pos);
225 EXPECT_NEAR(vali, pae[c], TOL_INTEGER);
226 }
227 else {
228 FAIL() << "mse_pae result string does not have enough entries.";
229 }
230 pos = result.find("\n", pos);
231 if (pos != std::string::npos)
232 ++pos;
233 }
234 }
235 catch (const std::runtime_error& error) {
236 FAIL() << error.what();
237 }
238}
239
241// compare_files
243void compare_files(const std::string& base_filename,
244 const std::string& extended_base_fname,
245 const std::string& ext)
246{
247 try {
248 std::string result, command;
249 command = std::string(COMPARE_FILES_PATH)
250 + " " + OUT_FILE_DIR + base_filename + extended_base_fname + "." + ext
251 + " " + SRC_FILE_DIR + base_filename + "." + ext;
252 EXPECT_EQ(execute(command, result), 0);
253 }
254 catch (const std::runtime_error& error) {
255 FAIL() << error.what();
256 }
257}
258
260// tests
262
264// Test ojph_compress on its own
265TEST(TestExecutables, OpenJPHCompressNoArguments) {
266 try {
267 std::string result;
268 EXPECT_EQ(execute(COMPRESS_EXECUTABLE, result), 1);
269 }
270 catch (const std::runtime_error& error) {
271 FAIL() << error.what();
272 }
273}
274
276// Test ojph_expand on its own
277TEST(TestExecutables, OpenJPHExpandNoArguments) {
278 try {
279 std::string result;
280 EXPECT_EQ(execute(EXPAND_EXECUTABLE, result), 1);
281 }
282 catch (const std::runtime_error& error) {
283 FAIL() << error.what();
284 }
285}
286
288// other tests
290
292// Test ojph_expand with codeblocks when the irv97 wavelet is used.
293// Command-line options used to obtain this file is:
294// -o simple_dec_irv97_64x64.jph -precise -quiet -rate 0.5 -full
295TEST(TestExecutables, SimpleDecIrv9764x64) {
296 double mse[3] = { 39.2812, 36.3819, 47.642};
297 int pae[3] = { 74, 77, 73};
298 run_ojph_expand("simple_dec_irv97_64x64", "jph", "ppm");
299 run_mse_pae("simple_dec_irv97_64x64", "ppm", "Malamute.ppm",
300 "", 3, mse, pae);
301}
302
304// Test ojph_expand with codeblocks when the irv97 wavelet is used.
305// Command-line options used to obtain this file is:
306// -o simple_dec_irv97_32x32.jph -precise -quiet -rate 1 Cblk={32,32} -full
307TEST(TestExecutables, SimpleDecIrv9732x32) {
308 double mse[3] = { 18.6979, 17.1208, 22.7539};
309 int pae[3] = { 51, 48, 46};
310 run_ojph_expand("simple_dec_irv97_32x32", "jph", "ppm");
311 run_mse_pae("simple_dec_irv97_32x32", "ppm", "Malamute.ppm",
312 "", 3, mse, pae);
313}
314
316// Test ojph_expand with codeblocks when the irv97 wavelet is used.
317// Command-line options used to obtain this file is:
318// -o simple_dec_irv97_16x16.jph -precise -quiet -rate 1 Cblk={16,16} -full
319TEST(TestExecutables, SimpleDecIrv9716x16) {
320 double mse[3] = { 20.1706, 18.5427, 24.6146};
321 int pae[3] = { 53, 51, 47};
322 run_ojph_expand("simple_dec_irv97_16x16", "jph", "ppm");
323 run_mse_pae("simple_dec_irv97_16x16", "ppm", "Malamute.ppm",
324 "", 3, mse, pae);
325}
326
328// Test ojph_expand with codeblocks when the irv97 wavelet is used.
329// Command-line options used to obtain this file is:
330// -o simple_dec_irv97_4x4.jph -precise -quiet -rate 1 Cblk={4,4} -full
331TEST(TestExecutables, SimpleDecIrv974x4) {
332 double mse[3] = { 40.8623, 37.9308, 49.7276};
333 int pae[3] = { 75, 77, 80};
334 run_ojph_expand("simple_dec_irv97_4x4", "jph", "ppm");
335 run_mse_pae("simple_dec_irv97_4x4", "ppm", "Malamute.ppm",
336 "", 3, mse, pae);
337}
338
340// Test ojph_expand with codeblocks when the irv97 wavelet is used.
341// Command-line options used to obtain this file is:
342// -o simple_dec_irv97_1024x4.jph -precise -quiet -rate 1 Cblk={1024,4} -full
343TEST(TestExecutables, SimpleDecIrv971024x4) {
344 double mse[3] = { 19.8275, 18.2511, 24.2832};
345 int pae[3] = { 53, 52, 50};
346 run_ojph_expand("simple_dec_irv97_1024x4", "jph", "ppm");
347 run_mse_pae("simple_dec_irv97_1024x4", "ppm", "Malamute.ppm",
348 "", 3, mse, pae);
349}
350
352// Test ojph_expand with codeblocks when the irv97 wavelet is used.
353// Command-line options used to obtain this file is:
354// -o simple_dec_irv97_4x1024.jph -precise -quiet -rate 1 Cblk={4,1024} -full
355TEST(TestExecutables, SimpleDecIrv974x1024) {
356 double mse[3] = { 19.9635, 18.4063, 24.1719};
357 int pae[3] = { 51, 48, 51};
358 run_ojph_expand("simple_dec_irv97_4x1024", "jph", "ppm");
359 run_mse_pae("simple_dec_irv97_4x1024", "ppm", "Malamute.ppm",
360 "", 3, mse, pae);
361}
362
364// Test ojph_expand with codeblocks when the irv97 wavelet is used.
365// Command-line options used to obtain this file is:
366// -o simple_dec_irv97_512x8.jph -precise -quiet -rate 1 Cblk={512,8} -full
367TEST(TestExecutables, SimpleDecIrv97512x8) {
368 double mse[3] = { 18.7929, 17.2026, 22.9922};
369 int pae[3] = { 53, 52, 50};
370 run_ojph_expand("simple_dec_irv97_512x8", "jph", "ppm");
371 run_mse_pae("simple_dec_irv97_512x8", "ppm", "Malamute.ppm",
372 "", 3, mse, pae);
373}
374
376// Test ojph_expand with codeblocks when the irv97 wavelet is used.
377// Command-line options used to obtain this file is:
378// -o simple_dec_irv97_8x512.jph -precise -quiet -rate 1 Cblk={8,512} -full
379TEST(TestExecutables, SimpleDecIrv978x512) {
380 double mse[3] = { 19.3661, 17.8067, 23.4574};
381 int pae[3] = { 51, 48, 52};
382 run_ojph_expand("simple_dec_irv97_8x512", "jph", "ppm");
383 run_mse_pae("simple_dec_irv97_8x512", "ppm", "Malamute.ppm",
384 "", 3, mse, pae);
385}
386
388// Test ojph_expand with codeblocks when the irv97 wavelet is used.
389// Command-line options used to obtain this file is:
390// -o simple_dec_irv97_256x16.jph -precise -quiet -rate 1 Cblk={256,16} -full
391TEST(TestExecutables, SimpleDecIrv97256x16) {
392 double mse[3] = { 18.6355, 17.0963, 22.6076};
393 int pae[3] = { 54, 51, 48};
394 run_ojph_expand("simple_dec_irv97_256x16", "jph", "ppm");
395 run_mse_pae("simple_dec_irv97_256x16", "ppm", "Malamute.ppm",
396 "", 3, mse, pae);
397}
398
400// Test ojph_expand with codeblocks when the irv97 wavelet is used.
401// Command-line options used to obtain this file is:
402// -o simple_dec_irv97_16x256.jph -precise -quiet -rate 1 Cblk={16,256} -full
403TEST(TestExecutables, SimpleDecIrv9716x256) {
404 double mse[3] = { 18.5933, 17.0208, 22.5709};
405 int pae[3] = { 51, 48, 47};
406 run_ojph_expand("simple_dec_irv97_16x256", "jph", "ppm");
407 run_mse_pae("simple_dec_irv97_16x256", "ppm", "Malamute.ppm",
408 "", 3, mse, pae);
409}
410
412// Test ojph_expand with codeblocks when the irv97 wavelet is used.
413// Command-line options used to obtain this file is:
414// -o simple_dec_irv97_128x32.jph -precise -quiet -rate 1 Cblk={128,32} -full
415TEST(TestExecutables, SimpleDecIrv97128x32) {
416 double mse[3] = { 18.4443, 16.9133, 22.4193};
417 int pae[3] = { 52, 50, 46};
418 run_ojph_expand("simple_dec_irv97_128x32", "jph", "ppm");
419 run_mse_pae("simple_dec_irv97_128x32", "ppm", "Malamute.ppm",
420 "", 3, mse, pae);
421}
422
424// Test ojph_expand with codeblocks when the irv97 wavelet is used.
425// Command-line options used to obtain this file is:
426// -o simple_dec_irv97_32x128.jph -precise -quiet -rate 1 Cblk={32,128} -full
427TEST(TestExecutables, SimpleDecIrv9732x128) {
428 double mse[3] = { 18.4874, 16.9379, 22.4855};
429 int pae[3] = { 51, 48, 45};
430 run_ojph_expand("simple_dec_irv97_32x128", "jph", "ppm");
431 run_mse_pae("simple_dec_irv97_32x128", "ppm", "Malamute.ppm",
432 "", 3, mse, pae);
433}
434
436// Test ojph_expand with codeblocks when the rev53 wavelet is used.
437// Command-line options used to obtain this file is:
438// -o simple_dec_rev53_64x64.jph -precise -quiet Creversible=yes -full
439TEST(TestExecutables, SimpleDecRev5364x64) {
440 double mse[3] = { 0, 0, 0};
441 int pae[3] = { 0, 0, 0};
442 run_ojph_expand("simple_dec_rev53_64x64", "jph", "ppm");
443 run_mse_pae("simple_dec_rev53_64x64", "ppm", "Malamute.ppm",
444 "", 3, mse, pae);
445}
446
448// Test ojph_expand with codeblocks when the rev53 wavelet is used.
449// Command-line options used to obtain this file is:
450// -o simple_dec_rev53_32x32.jph -precise -quiet Creversible=yes Cblk={32,32}
451// -full
452TEST(TestExecutables, SimpleDecRev5332x32) {
453 double mse[3] = { 0, 0, 0};
454 int pae[3] = { 0, 0, 0};
455 run_ojph_expand("simple_dec_rev53_32x32", "jph", "ppm");
456 run_mse_pae("simple_dec_rev53_32x32", "ppm", "Malamute.ppm",
457 "", 3, mse, pae);
458}
459
461// Test ojph_expand with codeblocks when the rev53 wavelet is used.
462// Command-line options used to obtain this file is:
463// -o simple_dec_rev53_4x4.jph -precise -quiet Creversible=yes Cblk={4,4}
464// -full
465TEST(TestExecutables, SimpleDecRev534x4) {
466 double mse[3] = { 0, 0, 0};
467 int pae[3] = { 0, 0, 0};
468 run_ojph_expand("simple_dec_rev53_4x4", "jph", "ppm");
469 run_mse_pae("simple_dec_rev53_4x4", "ppm", "Malamute.ppm",
470 "", 3, mse, pae);
471}
472
474// Test ojph_expand with codeblocks when the rev53 wavelet is used.
475// Command-line options used to obtain this file is:
476// -o simple_dec_rev53_1024x4.jph -precise -quiet Creversible=yes
477// Cblk={1024,4} -full
478TEST(TestExecutables, SimpleDecRev531024x4) {
479 double mse[3] = { 0, 0, 0};
480 int pae[3] = { 0, 0, 0};
481 run_ojph_expand("simple_dec_rev53_1024x4", "jph", "ppm");
482 run_mse_pae("simple_dec_rev53_1024x4", "ppm", "Malamute.ppm",
483 "", 3, mse, pae);
484}
485
487// Test ojph_expand with codeblocks when the rev53 wavelet is used.
488// Command-line options used to obtain this file is:
489// -o simple_dec_rev53_4x1024.jph -precise -quiet Creversible=yes
490// Cblk={4,1024} -full
491TEST(TestExecutables, SimpleDecRev534x1024) {
492 double mse[3] = { 0, 0, 0};
493 int pae[3] = { 0, 0, 0};
494 run_ojph_expand("simple_dec_rev53_4x1024", "jph", "ppm");
495 run_mse_pae("simple_dec_rev53_4x1024", "ppm", "Malamute.ppm",
496 "", 3, mse, pae);
497}
498
500// Test ojph_expand with codeblocks when the irv97 wavelet is used.
501// and the color components are subsampled.
502// Command-line options used to obtain this file is:
503// -o simple_dec_irv97_64x64_yuv.jph -precise -quiet -rate 0.5
504// Sdims={288,352},{144,176},{144,176} Ssampling={1,1},{2,2},{2,2}
505// Nprecision={8} Nsigned={no} -full
506TEST(TestExecutables, SimpleDecIrv9764x64Yuv) {
507 double mse[3] = { 20.2778, 6.27912, 4.15937};
508 int pae[3] = { 52, 22, 31};
509 run_ojph_expand("simple_dec_irv97_64x64_yuv", "jph", "yuv");
510 run_mse_pae("simple_dec_irv97_64x64_yuv", "yuv", "foreman_420.yuv",
511 ":352x288x8x420", 3, mse, pae);
512}
513
515// Test ojph_expand with codeblocks when the rev53 wavelet is used.
516// and the color components are subsampled.
517// Command-line options used to obtain this file is:
518// -o simple_dec_rev53_64x64_yuv.jph -precise -quiet Creversible=yes
519// Sdims={288,352},{144,176},{144,176} Ssampling={1,1},{2,2},{2,2}
520// Nprecision={8} Nsigned={no} -full
521TEST(TestExecutables, SimpleDecRev5364x64Yuv) {
522 double mse[3] = { 0, 0, 0};
523 int pae[3] = { 0, 0, 0};
524 run_ojph_expand("simple_dec_rev53_64x64_yuv", "jph", "yuv");
525 run_mse_pae("simple_dec_rev53_64x64_yuv", "yuv", "foreman_420.yuv",
526 ":352x288x8x420", 3, mse, pae);
527}
528
530// Test ojph_expand with codeblocks when the irv97 wavelet is used.
531// and the color components are subsampled.
532// Command-line options used to obtain this file is:
533// -o simple_dec_irv97_64x64_tiles_yuv.jph -precise -quiet -rate 0.5
534// Sdims={288,352},{144,176},{144,176} Ssampling={1,1},{2,2},{2,2}
535// Nprecision={8} Nsigned={no} Stiles={33,257} -full
536TEST(TestExecutables, SimpleDecIrv9764x64TilesYuv) {
537 double mse[3] = { 34.4972, 10.1112, 7.96331};
538 int pae[3] = { 67, 30, 39};
539 run_ojph_expand("simple_dec_irv97_64x64_tiles_yuv", "jph", "yuv");
540 run_mse_pae("simple_dec_irv97_64x64_tiles_yuv", "yuv", "foreman_420.yuv",
541 ":352x288x8x420", 3, mse, pae);
542}
543
545// Test ojph_expand with codeblocks when the rev53 wavelet is used.
546// and the color components are subsampled.
547// Command-line options used to obtain this file is:
548// -o simple_dec_rev53_64x64_tiles_yuv.jph -precise -quiet Creversible=yes
549// Sdims={288,352},{144,176},{144,176} Ssampling={1,1},{2,2},{2,2}
550// Nprecision={8} Nsigned={no} Stiles={33,257} -full
551TEST(TestExecutables, SimpleDecRev5364x64TilesYuv) {
552 double mse[3] = { 0, 0, 0};
553 int pae[3] = { 0, 0, 0};
554 run_ojph_expand("simple_dec_rev53_64x64_tiles_yuv", "jph", "yuv");
555 run_mse_pae("simple_dec_rev53_64x64_tiles_yuv", "yuv", "foreman_420.yuv",
556 ":352x288x8x420", 3, mse, pae);
557}
558
560// Test ojph_expand with codeblocks when the irv97 wavelet is used.
561// Command-line options used to obtain this file is:
562// -o simple_dec_irv97_64x64_tiles_LRCP.jph -precise -quiet -rate 0.5
563// Clevels=5 Corder=LRCP Cprecincts={2,256} Sorigin={374,1717}
564// Stile_origin={374,1717} -full
565TEST(TestExecutables, SimpleDecIrv9764x64TilesLRCP) {
566 double mse[3] = { 71.8149, 68.7115, 89.4001};
567 int pae[3] = { 78, 78, 83};
568 run_ojph_expand("simple_dec_irv97_64x64_tiles_LRCP", "jph", "ppm");
569 run_mse_pae("simple_dec_irv97_64x64_tiles_LRCP", "ppm", "Malamute.ppm",
570 "", 3, mse, pae);
571}
572
574// Test ojph_expand with codeblocks when the irv97 wavelet is used.
575// Command-line options used to obtain this file is:
576// -o simple_dec_irv97_64x64_tiles_RLCP.jph -precise -quiet -rate 0.5
577// Clevels=5 Corder=RLCP Cprecincts={2,256} Sorigin={374,1717}
578// Stile_origin={374,1717} -full
579TEST(TestExecutables, SimpleDecIrv9764x64TilesRLCP) {
580 double mse[3] = { 71.8149, 68.7115, 89.4001};
581 int pae[3] = { 78, 78, 83};
582 run_ojph_expand("simple_dec_irv97_64x64_tiles_RLCP", "jph", "ppm");
583 run_mse_pae("simple_dec_irv97_64x64_tiles_RLCP", "ppm", "Malamute.ppm",
584 "", 3, mse, pae);
585}
586
588// Test ojph_expand with codeblocks when the irv97 wavelet is used.
589// Command-line options used to obtain this file is:
590// -o simple_dec_irv97_64x64_tiles_RPCL.jph -precise -quiet -rate 0.5
591// Clevels=5 Corder=RPCL Cprecincts={2,256} Sorigin={374,1717}
592// Stile_origin={374,1717} -full
593TEST(TestExecutables, SimpleDecIrv9764x64TilesRPCL) {
594 double mse[3] = { 71.8149, 68.7115, 89.4001};
595 int pae[3] = { 78, 78, 83};
596 run_ojph_expand("simple_dec_irv97_64x64_tiles_RPCL", "jph", "ppm");
597 run_mse_pae("simple_dec_irv97_64x64_tiles_RPCL", "ppm", "Malamute.ppm",
598 "", 3, mse, pae);
599}
600
602// Test ojph_expand with codeblocks when the irv97 wavelet is used.
603// Command-line options used to obtain this file is:
604// -o simple_dec_irv97_64x64_tiles_PCRL.jph -precise -quiet -rate 0.5
605// Clevels=5 Corder=PCRL Cprecincts={2,256} Sorigin={374,1717}
606// Stile_origin={374,1717} -full
607TEST(TestExecutables, SimpleDecIrv9764x64TilesPCRL) {
608 double mse[3] = { 71.8149, 68.7115, 89.4001};
609 int pae[3] = { 78, 78, 83};
610 run_ojph_expand("simple_dec_irv97_64x64_tiles_PCRL", "jph", "ppm");
611 run_mse_pae("simple_dec_irv97_64x64_tiles_PCRL", "ppm", "Malamute.ppm",
612 "", 3, mse, pae);
613}
614
616// Test ojph_expand with codeblocks when the irv97 wavelet is used.
617// Command-line options used to obtain this file is:
618// -o simple_dec_irv97_64x64_tiles_CPRL.jph -precise -quiet -rate 0.5
619// Clevels=5 Corder=CPRL Cprecincts={2,256} Sorigin={374,1717}
620// Stile_origin={374,1717} -full
621TEST(TestExecutables, SimpleDecIrv9764x64TilesCPRL) {
622 double mse[3] = { 71.8149, 68.7115, 89.4001};
623 int pae[3] = { 78, 78, 83};
624 run_ojph_expand("simple_dec_irv97_64x64_tiles_CPRL", "jph", "ppm");
625 run_mse_pae("simple_dec_irv97_64x64_tiles_CPRL", "ppm", "Malamute.ppm",
626 "", 3, mse, pae);
627}
628
630// Test ojph_expand with codeblocks when the irv97 wavelet is used.
631// Command-line options used to obtain this file is:
632// -o simple_dec_irv97_64x64_tiles_LRCP33.jph -precise -quiet -rate 0.5
633// Clevels=5 Corder=LRCP Sorigin={5,33} Stile_origin={5,10} Stiles={33,257}
634// -full
635TEST(TestExecutables, SimpleDecIrv9764x64TilesLRCP33) {
636 double mse[3] = { 56.2139, 51.4121, 69.0107};
637 int pae[3] = { 80, 81, 98};
638 run_ojph_expand("simple_dec_irv97_64x64_tiles_LRCP33", "jph", "ppm");
639 run_mse_pae("simple_dec_irv97_64x64_tiles_LRCP33", "ppm", "Malamute.ppm",
640 "", 3, mse, pae);
641}
642
644// Test ojph_expand with codeblocks when the irv97 wavelet is used.
645// Command-line options used to obtain this file is:
646// -o simple_dec_irv97_64x64_tiles_RLCP33.jph -precise -quiet -rate 0.5
647// Clevels=5 Corder=RLCP Sorigin={5,33} Stile_origin={5,10} Stiles={33,257}
648// -full
649TEST(TestExecutables, SimpleDecIrv9764x64TilesRLCP33) {
650 double mse[3] = { 56.2139, 51.4121, 69.0107};
651 int pae[3] = { 80, 81, 98};
652 run_ojph_expand("simple_dec_irv97_64x64_tiles_RLCP33", "jph", "ppm");
653 run_mse_pae("simple_dec_irv97_64x64_tiles_RLCP33", "ppm", "Malamute.ppm",
654 "", 3, mse, pae);
655}
656
658// Test ojph_expand with codeblocks when the irv97 wavelet is used.
659// Command-line options used to obtain this file is:
660// -o simple_dec_irv97_64x64_tiles_RPCL33.jph -precise -quiet -rate 0.5
661// Clevels=5 Corder=RPCL Sorigin={5,33} Stile_origin={5,10} Stiles={33,257}
662// -full
663TEST(TestExecutables, SimpleDecIrv9764x64TilesRPCL33) {
664 double mse[3] = { 56.2139, 51.4121, 69.0107};
665 int pae[3] = { 80, 81, 98};
666 run_ojph_expand("simple_dec_irv97_64x64_tiles_RPCL33", "jph", "ppm");
667 run_mse_pae("simple_dec_irv97_64x64_tiles_RPCL33", "ppm", "Malamute.ppm",
668 "", 3, mse, pae);
669}
670
672// Test ojph_expand with codeblocks when the irv97 wavelet is used.
673// Command-line options used to obtain this file is:
674// -o simple_dec_irv97_64x64_tiles_PCRL33.jph -precise -quiet -rate 0.5
675// Clevels=5 Corder=PCRL Sorigin={5,33} Stile_origin={5,10} Stiles={33,257}
676// -full
677TEST(TestExecutables, SimpleDecIrv9764x64TilesPCRL33) {
678 double mse[3] = { 56.2139, 51.4121, 69.0107};
679 int pae[3] = { 80, 81, 98};
680 run_ojph_expand("simple_dec_irv97_64x64_tiles_PCRL33", "jph", "ppm");
681 run_mse_pae("simple_dec_irv97_64x64_tiles_PCRL33", "ppm", "Malamute.ppm",
682 "", 3, mse, pae);
683}
684
686// Test ojph_expand with codeblocks when the irv97 wavelet is used.
687// Command-line options used to obtain this file is:
688// -o simple_dec_irv97_64x64_tiles_CPRL33.jph -precise -quiet -rate 0.5
689// Clevels=5 Corder=CPRL Sorigin={5,33} Stile_origin={5,10} Stiles={33,257}
690// -full
691TEST(TestExecutables, SimpleDecIrv9764x64TilesCPRL33) {
692 double mse[3] = { 56.2139, 51.4121, 69.0107};
693 int pae[3] = { 80, 81, 98};
694 run_ojph_expand("simple_dec_irv97_64x64_tiles_CPRL33", "jph", "ppm");
695 run_mse_pae("simple_dec_irv97_64x64_tiles_CPRL33", "ppm", "Malamute.ppm",
696 "", 3, mse, pae);
697}
698
700// Test ojph_expand with codeblocks when the irv97 wavelet is used.
701// Command-line options used to obtain this file is:
702// -o simple_dec_irv97_64x64_tiles_LRCP33x33.jph -precise -quiet -rate 0.5
703// Clevels=5 Corder=LRCP Sorigin={5,33} Stile_origin={5,10} Stiles={33,33}
704// -full
705TEST(TestExecutables, SimpleDecIrv9764x64TilesLRCP33x33) {
706 double mse[3] = { 210.283, 210.214, 257.276};
707 int pae[3] = { 165, 161, 166};
708 run_ojph_expand("simple_dec_irv97_64x64_tiles_LRCP33x33", "jph", "ppm");
709 run_mse_pae("simple_dec_irv97_64x64_tiles_LRCP33x33", "ppm", "Malamute.ppm",
710 "", 3, mse, pae);
711}
712
714// Test ojph_expand with codeblocks when the irv97 wavelet is used.
715// Command-line options used to obtain this file is:
716// -o simple_dec_irv97_64x64_tiles_RLCP33x33.jph -precise -quiet -rate 0.5
717// Clevels=5 Corder=RLCP Sorigin={5,33} Stile_origin={5,10} Stiles={33,33}
718// -full
719TEST(TestExecutables, SimpleDecIrv9764x64TilesRLCP33x33) {
720 double mse[3] = { 210.283, 210.214, 257.276};
721 int pae[3] = { 165, 161, 166};
722 run_ojph_expand("simple_dec_irv97_64x64_tiles_RLCP33x33", "jph", "ppm");
723 run_mse_pae("simple_dec_irv97_64x64_tiles_RLCP33x33", "ppm", "Malamute.ppm",
724 "", 3, mse, pae);
725}
726
728// Test ojph_expand with codeblocks when the irv97 wavelet is used.
729// Command-line options used to obtain this file is:
730// -o simple_dec_irv97_64x64_tiles_RPCL33x33.jph -precise -quiet -rate 0.5
731// Clevels=5 Corder=RPCL Sorigin={5,33} Stile_origin={5,10} Stiles={33,33}
732// -full
733TEST(TestExecutables, SimpleDecIrv9764x64TilesRPCL33x33) {
734 double mse[3] = { 210.283, 210.214, 257.276};
735 int pae[3] = { 165, 161, 166};
736 run_ojph_expand("simple_dec_irv97_64x64_tiles_RPCL33x33", "jph", "ppm");
737 run_mse_pae("simple_dec_irv97_64x64_tiles_RPCL33x33", "ppm", "Malamute.ppm",
738 "", 3, mse, pae);
739}
740
742// Test ojph_expand with codeblocks when the irv97 wavelet is used.
743// Command-line options used to obtain this file is:
744// -o simple_dec_irv97_64x64_tiles_PCRL33x33.jph -precise -quiet -rate 0.5
745// Clevels=5 Corder=PCRL Sorigin={5,33} Stile_origin={5,10} Stiles={33,33}
746// -full
747TEST(TestExecutables, SimpleDecIrv9764x64TilesPCRL33x33) {
748 double mse[3] = { 210.283, 210.214, 257.276};
749 int pae[3] = { 165, 161, 166};
750 run_ojph_expand("simple_dec_irv97_64x64_tiles_PCRL33x33", "jph", "ppm");
751 run_mse_pae("simple_dec_irv97_64x64_tiles_PCRL33x33", "ppm", "Malamute.ppm",
752 "", 3, mse, pae);
753}
754
756// Test ojph_expand with codeblocks when the irv97 wavelet is used.
757// Command-line options used to obtain this file is:
758// -o simple_dec_irv97_64x64_tiles_CPRL33x33.jph -precise -quiet -rate 0.5
759// Clevels=5 Corder=CPRL Sorigin={5,33} Stile_origin={5,10} Stiles={33,33}
760// -full
761TEST(TestExecutables, SimpleDecIrv9764x64TilesCPRL33x33) {
762 double mse[3] = { 210.283, 210.214, 257.276};
763 int pae[3] = { 165, 161, 166};
764 run_ojph_expand("simple_dec_irv97_64x64_tiles_CPRL33x33", "jph", "ppm");
765 run_mse_pae("simple_dec_irv97_64x64_tiles_CPRL33x33", "ppm", "Malamute.ppm",
766 "", 3, mse, pae);
767}
768
770// Test ojph_expand with codeblocks when the rev53 wavelet is used.
771// Command-line options used to obtain this file is:
772// -o simple_dec_rev53_64x64_gray_tiles.jph -precise -quiet Creversible=yes
773// Clevels=5 Stiles={33,257} -full
774TEST(TestExecutables, SimpleDecRev5364x64GrayTiles) {
775 double mse[1] = { 0};
776 int pae[1] = { 0};
777 run_ojph_expand("simple_dec_rev53_64x64_gray_tiles", "jph", "pgm");
778 run_mse_pae("simple_dec_rev53_64x64_gray_tiles", "pgm", "monarch.pgm",
779 "", 1, mse, pae);
780}
781
783// Test ojph_expand with codeblocks when the irv97 wavelet is used.
784// Command-line options used to obtain this file is:
785// -o simple_dec_irv97_64x64_gray_tiles.jph -precise -quiet -rate 0.5
786// Clevels=5 Stiles={33,257} -full
787TEST(TestExecutables, SimpleDecIrv9764x64GrayTiles) {
788 double mse[1] = { 18.9601};
789 int pae[1] = { 56};
790 run_ojph_expand("simple_dec_irv97_64x64_gray_tiles", "jph", "pgm");
791 run_mse_pae("simple_dec_irv97_64x64_gray_tiles", "pgm", "monarch.pgm",
792 "", 1, mse, pae);
793}
794
796// Test ojph_expand with codeblocks when the irv97 wavelet is used.
797// Command-line options used to obtain this file is:
798// -o simple_dec_irv97_64x64_16bit.jph -precise -quiet -rate 0.5 -full
799TEST(TestExecutables, SimpleDecIrv9764x6416bit) {
800 double mse[3] = { 60507.2, 36672.5, 64809.8};
801 int pae[3] = { 2547, 1974, 1922};
802 run_ojph_expand("simple_dec_irv97_64x64_16bit", "jph", "ppm");
803 run_mse_pae("simple_dec_irv97_64x64_16bit", "ppm", "mm.ppm",
804 "", 3, mse, pae);
805}
806
808// Test ojph_expand with codeblocks when the irv97 wavelet is used.
809// Command-line options used to obtain this file is:
810// -o simple_dec_irv97_64x64_16bit_gray.jph -precise -quiet -rate 0.5 -full
811TEST(TestExecutables, SimpleDecIrv9764x6416bitGray) {
812 double mse[1] = { 19382.9};
813 int pae[1] = { 1618};
814 run_ojph_expand("simple_dec_irv97_64x64_16bit_gray", "jph", "pgm");
815 run_mse_pae("simple_dec_irv97_64x64_16bit_gray", "pgm", "mm.pgm",
816 "", 1, mse, pae);
817}
818
820// Test ojph_expand with codeblocks when the rev53 wavelet is used.
821// Command-line options used to obtain this file is:
822// -o simple_dec_rev53_64x64_16bit.jph -precise -quiet Creversible=yes -full
823TEST(TestExecutables, SimpleDecRev5364x6416bit) {
824 double mse[3] = { 0, 0, 0};
825 int pae[3] = { 0, 0, 0};
826 run_ojph_expand("simple_dec_rev53_64x64_16bit", "jph", "ppm");
827 run_mse_pae("simple_dec_rev53_64x64_16bit", "ppm", "mm.ppm",
828 "", 3, mse, pae);
829}
830
832// Test ojph_expand with codeblocks when the rev53 wavelet is used.
833// Command-line options used to obtain this file is:
834// -o simple_dec_rev53_64x64_16bit_gray.jph -precise -quiet Creversible=yes
835// -full
836TEST(TestExecutables, SimpleDecRev5364x6416bitGray) {
837 double mse[1] = { 0};
838 int pae[1] = { 0};
839 run_ojph_expand("simple_dec_rev53_64x64_16bit_gray", "jph", "pgm");
840 run_mse_pae("simple_dec_rev53_64x64_16bit_gray", "pgm", "mm.pgm",
841 "", 1, mse, pae);
842}
843
845// Test ojph_expand with codeblocks when the rev53 wavelet is used.
846// Command-line options used to obtain this file is:
847// -o simple_dec_irv53_bhvhb_low_latency.jph -quiet Corder=PCRL Clevels=5
848// Cmodes=HT|CAUSAL -rate 2 Catk=2 Kkernels:I2=I5X3
849// Cprecincts={16,8192},{8,8192},{4,8192} Cblk={8,256}
850// Cdecomp=B(-:-:-),H(-),V(-),H(-),B(-:-:-) Qstep=0.0001 -precise -no_weights
851// -tolerance 0
852TEST(TestExecutables, SimpleDecIrv53BhvhbLowLatency) {
853 double mse[3] = { 5.52392, 4.01405, 6.8166};
854 int pae[3] = { 16, 17, 23};
855 run_ojph_expand("simple_dec_irv53_bhvhb_low_latency", "jph", "ppm");
856 run_mse_pae("simple_dec_irv53_bhvhb_low_latency", "ppm", "Malamute.ppm",
857 "", 3, mse, pae);
858}
859
861// Test ojph_compress with codeblocks when the irv97 wavelet is used.
862// We test by comparing MSE and PAE of decoded images.
863// The compressed file is obtained using these command-line options:
864// -o simple_enc_irv97_64x64.j2c -qstep 0.1
865TEST(TestExecutables, SimpleEncIrv9764x64) {
866 double mse[3] = { 46.2004, 43.622, 56.7452};
867 int pae[3] = { 48, 46, 52};
868 run_ojph_compress("Malamute.ppm",
869 "simple_enc_irv97_64x64", "", "j2c",
870 "-qstep 0.1");
871 run_ojph_compress_expand("simple_enc_irv97_64x64", "j2c", "ppm");
872 run_mse_pae("simple_enc_irv97_64x64", "ppm",
873 "Malamute.ppm", "", 3, mse, pae);
874}
875
877// Test ojph_compress with codeblocks when the irv97 wavelet is used.
878// We test by comparing MSE and PAE of decoded images.
879// The compressed file is obtained using these command-line options:
880// -o simple_enc_irv97_32x32.j2c -qstep 0.01 -block_size {32,32}
881TEST(TestExecutables, SimpleEncIrv9732x32) {
882 double mse[3] = { 1.78779, 1.26001, 2.38395};
883 int pae[3] = { 7, 6, 9};
884 run_ojph_compress("Malamute.ppm",
885 "simple_enc_irv97_32x32", "", "j2c",
886 "-qstep 0.01 -block_size \"{32,32}\"");
887 run_ojph_compress_expand("simple_enc_irv97_32x32", "j2c", "ppm");
888 run_mse_pae("simple_enc_irv97_32x32", "ppm",
889 "Malamute.ppm", "", 3, mse, pae);
890}
891
893// Test ojph_compress with codeblocks when the irv97 wavelet is used.
894// We test by comparing MSE and PAE of decoded images.
895// The compressed file is obtained using these command-line options:
896// -o simple_enc_irv97_16x16.j2c -qstep 0.01 -block_size {16,16}
897TEST(TestExecutables, SimpleEncIrv9716x16) {
898 double mse[3] = { 1.78779, 1.26001, 2.38395};
899 int pae[3] = { 7, 6, 9};
900 run_ojph_compress("Malamute.ppm",
901 "simple_enc_irv97_16x16", "", "j2c",
902 "-qstep 0.01 -block_size \"{16,16}\"");
903 run_ojph_compress_expand("simple_enc_irv97_16x16", "j2c", "ppm");
904 run_mse_pae("simple_enc_irv97_16x16", "ppm",
905 "Malamute.ppm", "", 3, mse, pae);
906}
907
909// Test ojph_compress with codeblocks when the irv97 wavelet is used.
910// We test by comparing MSE and PAE of decoded images.
911// The compressed file is obtained using these command-line options:
912// -o simple_enc_irv97_4x4.j2c -qstep 0.01 -block_size {4,4}
913TEST(TestExecutables, SimpleEncIrv974x4) {
914 double mse[3] = { 1.78779, 1.26001, 2.38395};
915 int pae[3] = { 7, 6, 9};
916 run_ojph_compress("Malamute.ppm",
917 "simple_enc_irv97_4x4", "", "j2c",
918 "-qstep 0.01 -block_size \"{4,4}\"");
919 run_ojph_compress_expand("simple_enc_irv97_4x4", "j2c", "ppm");
920 run_mse_pae("simple_enc_irv97_4x4", "ppm",
921 "Malamute.ppm", "", 3, mse, pae);
922}
923
925// Test ojph_compress with codeblocks when the irv97 wavelet is used.
926// We test by comparing MSE and PAE of decoded images.
927// The compressed file is obtained using these command-line options:
928// -o simple_enc_irv97_1024x4.j2c -qstep 0.01 -block_size {4,1024}
929TEST(TestExecutables, SimpleEncIrv971024x4) {
930 double mse[3] = { 1.78779, 1.26001, 2.38395};
931 int pae[3] = { 7, 6, 9};
932 run_ojph_compress("Malamute.ppm",
933 "simple_enc_irv97_1024x4", "", "j2c",
934 "-qstep 0.01 -block_size \"{4,1024}\"");
935 run_ojph_compress_expand("simple_enc_irv97_1024x4", "j2c", "ppm");
936 run_mse_pae("simple_enc_irv97_1024x4", "ppm",
937 "Malamute.ppm", "", 3, mse, pae);
938}
939
941// Test ojph_compress with codeblocks when the irv97 wavelet is used.
942// We test by comparing MSE and PAE of decoded images.
943// The compressed file is obtained using these command-line options:
944// -o simple_enc_irv97_4x1024.j2c -qstep 0.01 -block_size {1024,4}
945TEST(TestExecutables, SimpleEncIrv974x1024) {
946 double mse[3] = { 1.78779, 1.26001, 2.38395};
947 int pae[3] = { 7, 6, 9};
948 run_ojph_compress("Malamute.ppm",
949 "simple_enc_irv97_4x1024", "", "j2c",
950 "-qstep 0.01 -block_size \"{1024,4}\"");
951 run_ojph_compress_expand("simple_enc_irv97_4x1024", "j2c", "ppm");
952 run_mse_pae("simple_enc_irv97_4x1024", "ppm",
953 "Malamute.ppm", "", 3, mse, pae);
954}
955
957// Test ojph_compress with codeblocks when the irv97 wavelet is used.
958// We test by comparing MSE and PAE of decoded images.
959// The compressed file is obtained using these command-line options:
960// -o simple_enc_irv97_512x8.j2c -qstep 0.01 -block_size {8,512}
961TEST(TestExecutables, SimpleEncIrv97512x8) {
962 double mse[3] = { 1.78779, 1.26001, 2.38395};
963 int pae[3] = { 7, 6, 9};
964 run_ojph_compress("Malamute.ppm",
965 "simple_enc_irv97_512x8", "", "j2c",
966 "-qstep 0.01 -block_size \"{8,512}\"");
967 run_ojph_compress_expand("simple_enc_irv97_512x8", "j2c", "ppm");
968 run_mse_pae("simple_enc_irv97_512x8", "ppm",
969 "Malamute.ppm", "", 3, mse, pae);
970}
971
973// Test ojph_compress with codeblocks when the irv97 wavelet is used.
974// We test by comparing MSE and PAE of decoded images.
975// The compressed file is obtained using these command-line options:
976// -o simple_enc_irv97_8x512.j2c -qstep 0.01 -block_size {512,8}
977TEST(TestExecutables, SimpleEncIrv978x512) {
978 double mse[3] = { 1.78779, 1.26001, 2.38395};
979 int pae[3] = { 7, 6, 9};
980 run_ojph_compress("Malamute.ppm",
981 "simple_enc_irv97_8x512", "", "j2c",
982 "-qstep 0.01 -block_size \"{512,8}\"");
983 run_ojph_compress_expand("simple_enc_irv97_8x512", "j2c", "ppm");
984 run_mse_pae("simple_enc_irv97_8x512", "ppm",
985 "Malamute.ppm", "", 3, mse, pae);
986}
987
989// Test ojph_compress with codeblocks when the irv97 wavelet is used.
990// We test by comparing MSE and PAE of decoded images.
991// The compressed file is obtained using these command-line options:
992// -o simple_enc_irv97_256x16.j2c -qstep 0.01 -block_size {16,256}
993TEST(TestExecutables, SimpleEncIrv97256x16) {
994 double mse[3] = { 1.78779, 1.26001, 2.38395};
995 int pae[3] = { 7, 6, 9};
996 run_ojph_compress("Malamute.ppm",
997 "simple_enc_irv97_256x16", "", "j2c",
998 "-qstep 0.01 -block_size \"{16,256}\"");
999 run_ojph_compress_expand("simple_enc_irv97_256x16", "j2c", "ppm");
1000 run_mse_pae("simple_enc_irv97_256x16", "ppm",
1001 "Malamute.ppm", "", 3, mse, pae);
1002}
1003
1005// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1006// We test by comparing MSE and PAE of decoded images.
1007// The compressed file is obtained using these command-line options:
1008// -o simple_enc_irv97_16x256.j2c -qstep 0.01 -block_size {256,16}
1009TEST(TestExecutables, SimpleEncIrv9716x256) {
1010 double mse[3] = { 1.78779, 1.26001, 2.38395};
1011 int pae[3] = { 7, 6, 9};
1012 run_ojph_compress("Malamute.ppm",
1013 "simple_enc_irv97_16x256", "", "j2c",
1014 "-qstep 0.01 -block_size \"{256,16}\"");
1015 run_ojph_compress_expand("simple_enc_irv97_16x256", "j2c", "ppm");
1016 run_mse_pae("simple_enc_irv97_16x256", "ppm",
1017 "Malamute.ppm", "", 3, mse, pae);
1018}
1019
1021// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1022// We test by comparing MSE and PAE of decoded images.
1023// The compressed file is obtained using these command-line options:
1024// -o simple_enc_irv97_128x32.j2c -qstep 0.01 -block_size {32,128}
1025TEST(TestExecutables, SimpleEncIrv97128x32) {
1026 double mse[3] = { 1.78779, 1.26001, 2.38395};
1027 int pae[3] = { 7, 6, 9};
1028 run_ojph_compress("Malamute.ppm",
1029 "simple_enc_irv97_128x32", "", "j2c",
1030 "-qstep 0.01 -block_size \"{32,128}\"");
1031 run_ojph_compress_expand("simple_enc_irv97_128x32", "j2c", "ppm");
1032 run_mse_pae("simple_enc_irv97_128x32", "ppm",
1033 "Malamute.ppm", "", 3, mse, pae);
1034}
1035
1037// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1038// We test by comparing MSE and PAE of decoded images.
1039// The compressed file is obtained using these command-line options:
1040// -o simple_enc_irv97_32x128.j2c -qstep 0.01 -block_size {128,32}
1041TEST(TestExecutables, SimpleEncIrv9732x128) {
1042 double mse[3] = { 1.78779, 1.26001, 2.38395};
1043 int pae[3] = { 7, 6, 9};
1044 run_ojph_compress("Malamute.ppm",
1045 "simple_enc_irv97_32x128", "", "j2c",
1046 "-qstep 0.01 -block_size \"{128,32}\"");
1047 run_ojph_compress_expand("simple_enc_irv97_32x128", "j2c", "ppm");
1048 run_mse_pae("simple_enc_irv97_32x128", "ppm",
1049 "Malamute.ppm", "", 3, mse, pae);
1050}
1051
1053// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1054// We test by comparing MSE and PAE of decoded images.
1055// The compressed file is obtained using these command-line options:
1056// -o simple_enc_irv97_64x64_tiles_33x33_d5.j2c -qstep 0.01 -tile_size {33,33}
1057// -num_decomps 5
1058TEST(TestExecutables, SimpleEncIrv9764x64Tiles33x33D5) {
1059 double mse[3] = { 1.88906, 1.30757, 2.5347};
1060 int pae[3] = { 9, 6, 10};
1061 run_ojph_compress("Malamute.ppm",
1062 "simple_enc_irv97_64x64_tiles_33x33_d5", "", "j2c",
1063 "-qstep 0.01 -tile_size \"{33,33}\" -num_decomps 5");
1064 run_ojph_compress_expand("simple_enc_irv97_64x64_tiles_33x33_d5", "j2c", "ppm");
1065 run_mse_pae("simple_enc_irv97_64x64_tiles_33x33_d5", "ppm",
1066 "Malamute.ppm", "", 3, mse, pae);
1067}
1068
1070// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1071// We test by comparing MSE and PAE of decoded images.
1072// The compressed file is obtained using these command-line options:
1073// -o simple_enc_irv97_64x64_tiles_33x33_d6.j2c -qstep 0.01 -tile_size {33,33}
1074// -num_decomps 6
1075TEST(TestExecutables, SimpleEncIrv9764x64Tiles33x33D6) {
1076 double mse[3] = { 1.88751, 1.30673, 2.53378};
1077 int pae[3] = { 8, 6, 10};
1078 run_ojph_compress("Malamute.ppm",
1079 "simple_enc_irv97_64x64_tiles_33x33_d6", "", "j2c",
1080 "-qstep 0.01 -tile_size \"{33,33}\" -num_decomps 6");
1081 run_ojph_compress_expand("simple_enc_irv97_64x64_tiles_33x33_d6", "j2c", "ppm");
1082 run_mse_pae("simple_enc_irv97_64x64_tiles_33x33_d6", "ppm",
1083 "Malamute.ppm", "", 3, mse, pae);
1084}
1085
1087// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1088// We test by comparing MSE and PAE of decoded images.
1089// The compressed file is obtained using these command-line options:
1090// -o simple_enc_irv97_64x64_16bit.j2c -qstep 0.01
1091TEST(TestExecutables, SimpleEncIrv9764x6416bit) {
1092 double mse[3] = { 51727.3, 32596.4, 45897.8};
1093 int pae[3] = { 1512, 1481, 1778};
1094 run_ojph_compress("mm.ppm",
1095 "simple_enc_irv97_64x64_16bit", "", "j2c",
1096 "-qstep 0.01");
1097 run_ojph_compress_expand("simple_enc_irv97_64x64_16bit", "j2c", "ppm");
1098 run_mse_pae("simple_enc_irv97_64x64_16bit", "ppm",
1099 "mm.ppm", "", 3, mse, pae);
1100}
1101
1103// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1104// We test by comparing MSE and PAE of decoded images.
1105// The compressed file is obtained using these command-line options:
1106// -o simple_enc_irv97_64x64_16bit_gray.j2c -qstep 0.01
1107TEST(TestExecutables, SimpleEncIrv9764x6416bitGray) {
1108 double mse[1] = { 25150.6};
1109 int pae[1] = { 1081};
1110 run_ojph_compress("mm.pgm",
1111 "simple_enc_irv97_64x64_16bit_gray", "", "j2c",
1112 "-qstep 0.01");
1113 run_ojph_compress_expand("simple_enc_irv97_64x64_16bit_gray", "j2c", "pgm");
1114 run_mse_pae("simple_enc_irv97_64x64_16bit_gray", "pgm",
1115 "mm.pgm", "", 1, mse, pae);
1116}
1117
1119// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1120// We test by comparing MSE and PAE of decoded images.
1121// The compressed file is obtained using these command-line options:
1122// -o simple_enc_rev53_64x64_16bit.j2c -reversible true
1123TEST(TestExecutables, SimpleEncRev5364x6416bit) {
1124 double mse[3] = { 0, 0, 0};
1125 int pae[3] = { 0, 0, 0};
1126 run_ojph_compress("mm.ppm",
1127 "simple_enc_rev53_64x64_16bit", "", "j2c",
1128 "-reversible true");
1129 run_ojph_compress_expand("simple_enc_rev53_64x64_16bit", "j2c", "ppm");
1130 run_mse_pae("simple_enc_rev53_64x64_16bit", "ppm",
1131 "mm.ppm", "", 3, mse, pae);
1132}
1133
1135// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1136// We test by comparing MSE and PAE of decoded images.
1137// The compressed file is obtained using these command-line options:
1138// -o simple_enc_rev53_64x64_16bit_gray.j2c -reversible true
1139TEST(TestExecutables, SimpleEncRev5364x6416bitGray) {
1140 double mse[1] = { 0};
1141 int pae[1] = { 0};
1142 run_ojph_compress("mm.pgm",
1143 "simple_enc_rev53_64x64_16bit_gray", "", "j2c",
1144 "-reversible true");
1145 run_ojph_compress_expand("simple_enc_rev53_64x64_16bit_gray", "j2c", "pgm");
1146 run_mse_pae("simple_enc_rev53_64x64_16bit_gray", "pgm",
1147 "mm.pgm", "", 1, mse, pae);
1148}
1149
1151// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1152// We test by comparing MSE and PAE of decoded images.
1153// The compressed file is obtained using these command-line options:
1154// -o simple_enc_rev53_64x64_16bit.j2c -reversible true
1155TEST(TestExecutables, SimpleEncRev5364x64) {
1156 double mse[3] = { 0, 0, 0};
1157 int pae[3] = { 0, 0, 0};
1158 run_ojph_compress("Malamute.ppm",
1159 "simple_enc_rev53_64x64", "", "j2c",
1160 "-reversible true");
1161 run_ojph_compress_expand("simple_enc_rev53_64x64", "j2c", "ppm");
1162 run_mse_pae("simple_enc_rev53_64x64", "ppm",
1163 "Malamute.ppm", "", 3, mse, pae);
1164}
1165
1167// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1168// We test by comparing MSE and PAE of decoded images.
1169// The compressed file is obtained using these command-line options:
1170// -o simple_enc_rev53_32x32.j2c -reversible true -block_size {32,32}
1171TEST(TestExecutables, SimpleEncRev5332x32) {
1172 double mse[3] = { 0, 0, 0};
1173 int pae[3] = { 0, 0, 0};
1174 run_ojph_compress("Malamute.ppm",
1175 "simple_enc_rev53_32x32", "", "j2c",
1176 "-reversible true -block_size \"{32,32}\"");
1177 run_ojph_compress_expand("simple_enc_rev53_32x32", "j2c", "ppm");
1178 run_mse_pae("simple_enc_rev53_32x32", "ppm",
1179 "Malamute.ppm", "", 3, mse, pae);
1180}
1181
1183// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1184// We test by comparing MSE and PAE of decoded images.
1185// The compressed file is obtained using these command-line options:
1186// -o simple_enc_rev53_4x4.j2c -reversible true -block_size {4,4}
1187TEST(TestExecutables, SimpleEncRev534x4) {
1188 double mse[3] = { 0, 0, 0};
1189 int pae[3] = { 0, 0, 0};
1190 run_ojph_compress("Malamute.ppm",
1191 "simple_enc_rev53_4x4", "", "j2c",
1192 "-reversible true -block_size \"{4,4}\"");
1193 run_ojph_compress_expand("simple_enc_rev53_4x4", "j2c", "ppm");
1194 run_mse_pae("simple_enc_rev53_4x4", "ppm",
1195 "Malamute.ppm", "", 3, mse, pae);
1196}
1197
1199// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1200// We test by comparing MSE and PAE of decoded images.
1201// The compressed file is obtained using these command-line options:
1202// -o simple_enc_rev53_1024x4.j2c -reversible true -block_size {4,1024}
1203TEST(TestExecutables, SimpleEncRev531024x4) {
1204 double mse[3] = { 0, 0, 0};
1205 int pae[3] = { 0, 0, 0};
1206 run_ojph_compress("Malamute.ppm",
1207 "simple_enc_rev53_1024x4", "", "j2c",
1208 "-reversible true -block_size \"{4,1024}\"");
1209 run_ojph_compress_expand("simple_enc_rev53_1024x4", "j2c", "ppm");
1210 run_mse_pae("simple_enc_rev53_1024x4", "ppm",
1211 "Malamute.ppm", "", 3, mse, pae);
1212}
1213
1215// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1216// We test by comparing MSE and PAE of decoded images.
1217// The compressed file is obtained using these command-line options:
1218// -o simple_enc_rev53_4x1024.j2c -reversible true -block_size {1024,4}
1219TEST(TestExecutables, SimpleEncRev534x1024) {
1220 double mse[3] = { 0, 0, 0};
1221 int pae[3] = { 0, 0, 0};
1222 run_ojph_compress("Malamute.ppm",
1223 "simple_enc_rev53_4x1024", "", "j2c",
1224 "-reversible true -block_size \"{1024,4}\"");
1225 run_ojph_compress_expand("simple_enc_rev53_4x1024", "j2c", "ppm");
1226 run_mse_pae("simple_enc_rev53_4x1024", "ppm",
1227 "Malamute.ppm", "", 3, mse, pae);
1228}
1229
1231// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1232// We test by comparing MSE and PAE of decoded images.
1233// The compressed file is obtained using these command-line options:
1234// -o simple_enc_rev53_64x64_tiles_33x33_d5.j2c -reversible true -tile_size
1235// {32,32} -num_decomps 5
1236TEST(TestExecutables, SimpleEncRev5364x64Tiles33x33D5) {
1237 double mse[3] = { 0, 0, 0};
1238 int pae[3] = { 0, 0, 0};
1239 run_ojph_compress("Malamute.ppm",
1240 "simple_enc_rev53_64x64_tiles_33x33_d5", "", "j2c",
1241 "-reversible true -tile_size \"{32,32}\" -num_decomps 5");
1242 run_ojph_compress_expand("simple_enc_rev53_64x64_tiles_33x33_d5", "j2c", "ppm");
1243 run_mse_pae("simple_enc_rev53_64x64_tiles_33x33_d5", "ppm",
1244 "Malamute.ppm", "", 3, mse, pae);
1245}
1246
1248// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1249// We test by comparing MSE and PAE of decoded images.
1250// The compressed file is obtained using these command-line options:
1251// -o simple_enc_rev53_64x64_tiles_33x33_d6.j2c -reversible true -tile_size
1252// {32,32} -num_decomps 6
1253TEST(TestExecutables, SimpleEncRev5364x64Tiles33x33D6) {
1254 double mse[3] = { 0, 0, 0};
1255 int pae[3] = { 0, 0, 0};
1256 run_ojph_compress("Malamute.ppm",
1257 "simple_enc_rev53_64x64_tiles_33x33_d6", "", "j2c",
1258 "-reversible true -tile_size \"{32,32}\" -num_decomps 6");
1259 run_ojph_compress_expand("simple_enc_rev53_64x64_tiles_33x33_d6", "j2c", "ppm");
1260 run_mse_pae("simple_enc_rev53_64x64_tiles_33x33_d6", "ppm",
1261 "Malamute.ppm", "", 3, mse, pae);
1262}
1263
1265// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1266// We test by comparing MSE and PAE of decoded images.
1267// The compressed file is obtained using these command-line options:
1268// -o simple_enc_irv97_64x64_yuv.j2c -qstep 0.1 -dims {352,288} -num_comps 3
1269// -downsamp {1,1},{2,2},{2,2} -bit_depth 8,8,8 -signed false,false,false
1270TEST(TestExecutables, SimpleEncIrv9764x64Yuv) {
1271 double mse[3] = { 30.3548, 7.69602, 5.22246};
1272 int pae[3] = { 49, 27, 26};
1273 run_ojph_compress("foreman_420.yuv",
1274 "simple_enc_irv97_64x64_yuv", "", "j2c",
1275 "-qstep 0.1 -dims \"{352,288}\" -num_comps 3 -downsamp"
1276 " \"{1,1}\",\"{2,2}\",\"{2,2}\" -bit_depth 8,8,8"
1277 " -signed false,false,false");
1278 run_ojph_compress_expand("simple_enc_irv97_64x64_yuv", "j2c", "yuv");
1279 run_mse_pae("simple_enc_irv97_64x64_yuv", "yuv",
1280 "foreman_420.yuv", ":352x288x8x420", 3, mse, pae);
1281}
1282
1284// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1285// We test by comparing MSE and PAE of decoded images.
1286// The compressed file is obtained using these command-line options:
1287// -o simple_enc_rev53_64x64_yuv.j2c -reversible true -qstep 0.1 -dims
1288// {352,288} -num_comps 3 -downsamp {1,1},{2,2},{2,2} -bit_depth 8,8,8 -signed
1289// false,false,false
1290TEST(TestExecutables, SimpleEncRev5364x64Yuv) {
1291 double mse[3] = { 0, 0, 0};
1292 int pae[3] = { 0, 0, 0};
1293 run_ojph_compress("foreman_420.yuv",
1294 "simple_enc_rev53_64x64_yuv", "", "j2c",
1295 "-reversible true -qstep 0.1 -dims \"{352,288}\""
1296 " -num_comps 3 -downsamp \"{1,1}\",\"{2,2}\",\"{2,2}\""
1297 " -bit_depth 8,8,8 -signed false,false,false");
1298 run_ojph_compress_expand("simple_enc_rev53_64x64_yuv", "j2c", "yuv");
1299 run_mse_pae("simple_enc_rev53_64x64_yuv", "yuv",
1300 "foreman_420.yuv", ":352x288x8x420", 3, mse, pae);
1301}
1302
1304// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1305// We test by comparing MSE and PAE of decoded images.
1306// The compressed file is obtained using these command-line options:
1307// -o simple_enc_irv97_tall_narrow.j2c -qstep 0.1
1308TEST(TestExecutables, SimpleEncIrv97TallNarrow) {
1309 double mse[3] = { 112.097, 79.2214, 71.1367};
1310 int pae[3] = { 56, 41, 32};
1311 run_ojph_compress("tall_narrow.ppm",
1312 "simple_enc_irv97_tall_narrow", "", "j2c",
1313 "-qstep 0.1");
1314 run_ojph_compress_expand("simple_enc_irv97_tall_narrow", "j2c", "ppm");
1315 run_mse_pae("simple_enc_irv97_tall_narrow", "ppm",
1316 "tall_narrow.ppm", "", 3, mse, pae);
1317}
1318
1320// Test ojph_compress with codeblocks when the irv97 wavelet is used.
1321// We test by comparing MSE and PAE of decoded images.
1322// The compressed file is obtained using these command-line options:
1323// -o simple_enc_irv97_tall_narrow1.j2c -image_offset {1,0} -qstep 0.1
1324TEST(TestExecutables, SimpleEncIrv97TallNarrow1) {
1325 double mse[3] = { 100.906, 76.113, 72.8347};
1326 int pae[3] = { 39, 35, 34};
1327 run_ojph_compress("tall_narrow.ppm",
1328 "simple_enc_irv97_tall_narrow1", "", "j2c",
1329 "-image_offset \"{1,0}\" -qstep 0.1");
1330 run_ojph_compress_expand("simple_enc_irv97_tall_narrow1", "j2c", "ppm");
1331 run_mse_pae("simple_enc_irv97_tall_narrow1", "ppm",
1332 "tall_narrow.ppm", "", 3, mse, pae);
1333}
1334
1336// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1337// We test by comparing MSE and PAE of decoded images.
1338// The compressed file is obtained using these command-line options:
1339// -o simple_enc_rev53_tall_narrow.j2c -reversible true
1340TEST(TestExecutables, SimpleEncRev53TallNarrow) {
1341 double mse[3] = { 0, 0, 0};
1342 int pae[3] = { 0, 0, 0};
1343 run_ojph_compress("tall_narrow.ppm",
1344 "simple_enc_rev53_tall_narrow", "", "j2c",
1345 "-reversible true");
1346 run_ojph_compress_expand("simple_enc_rev53_tall_narrow", "j2c", "ppm");
1347 run_mse_pae("simple_enc_rev53_tall_narrow", "ppm",
1348 "tall_narrow.ppm", "", 3, mse, pae);
1349}
1350
1352// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1353// We test by comparing MSE and PAE of decoded images.
1354// The compressed file is obtained using these command-line options:
1355// -o simple_enc_rev53_tall_narrow1.j2c -image_offset {1,0} -reversible true
1356TEST(TestExecutables, SimpleEncRev53TallNarrow1) {
1357 double mse[3] = { 0, 0, 0};
1358 int pae[3] = { 0, 0, 0};
1359 run_ojph_compress("tall_narrow.ppm",
1360 "simple_enc_rev53_tall_narrow1", "", "j2c",
1361 "-image_offset \"{1,0}\" -reversible true");
1362 run_ojph_compress_expand("simple_enc_rev53_tall_narrow1", "j2c", "ppm");
1363 run_mse_pae("simple_enc_rev53_tall_narrow1", "ppm",
1364 "tall_narrow.ppm", "", 3, mse, pae);
1365}
1366
1368// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1369// We test by comparing MSE and PAE of decoded images.
1370// The compressed file is obtained using these command-line options:
1371// -o dpx_enc_1280x720_10bit_le_nuke11.j2c -reversible true
1372TEST(TestExecutables, DpxEnc1280x72010bitLeNuke11) {
1373 double mse[3] = { 0, 0, 0};
1374 int pae[3] = { 0, 0, 0};
1375 run_ojph_compress("dpx_1280x720_10bit.ppm",
1376 "dpx_enc_1280x720_10bit_le_nuke11", "", "j2c",
1377 "-reversible true");
1378 run_ojph_compress_expand("dpx_enc_1280x720_10bit_le_nuke11", "j2c", "ppm");
1379 run_mse_pae("dpx_enc_1280x720_10bit_le_nuke11", "ppm",
1380 "dpx_1280x720_10bit.ppm", "", 3, mse, pae);
1381}
1382
1384// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1385// We test by comparing MSE and PAE of decoded images.
1386// The compressed file is obtained using these command-line options:
1387// -o dpx_enc_1280x720_10bit_be_nuke11.j2c -reversible true
1388TEST(TestExecutables, DpxEnc1280x72010bitBeNuke11) {
1389 double mse[3] = { 0, 0, 0};
1390 int pae[3] = { 0, 0, 0};
1391 run_ojph_compress("dpx_1280x720_10bit.ppm",
1392 "dpx_enc_1280x720_10bit_be_nuke11", "", "j2c",
1393 "-reversible true");
1394 run_ojph_compress_expand("dpx_enc_1280x720_10bit_be_nuke11", "j2c", "ppm");
1395 run_mse_pae("dpx_enc_1280x720_10bit_be_nuke11", "ppm",
1396 "dpx_1280x720_10bit.ppm", "", 3, mse, pae);
1397}
1398
1400// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1401// We test by comparing MSE and PAE of decoded images.
1402// The compressed file is obtained using these command-line options:
1403// -o dpx_enc_1280x720_16bit_le_nuke11.j2c -reversible true
1404TEST(TestExecutables, DpxEnc1280x72016bitLeNuke11) {
1405 double mse[3] = { 0, 0, 0};
1406 int pae[3] = { 0, 0, 0};
1407 run_ojph_compress("dpx_1280x720_16bit.ppm",
1408 "dpx_enc_1280x720_16bit_le_nuke11", "", "j2c",
1409 "-reversible true");
1410 run_ojph_compress_expand("dpx_enc_1280x720_16bit_le_nuke11", "j2c", "ppm");
1411 run_mse_pae("dpx_enc_1280x720_16bit_le_nuke11", "ppm",
1412 "dpx_1280x720_16bit.ppm", "", 3, mse, pae);
1413}
1414
1416// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1417// We test by comparing MSE and PAE of decoded images.
1418// The compressed file is obtained using these command-line options:
1419// -o dpx_enc_1280x720_16bit_be_nuke11.j2c -reversible true
1420TEST(TestExecutables, DpxEnc1280x72016bitBeNuke11) {
1421 double mse[3] = { 0, 0, 0};
1422 int pae[3] = { 0, 0, 0};
1423 run_ojph_compress("dpx_1280x720_16bit.ppm",
1424 "dpx_enc_1280x720_16bit_be_nuke11", "", "j2c",
1425 "-reversible true");
1426 run_ojph_compress_expand("dpx_enc_1280x720_16bit_be_nuke11", "j2c", "ppm");
1427 run_mse_pae("dpx_enc_1280x720_16bit_be_nuke11", "ppm",
1428 "dpx_1280x720_16bit.ppm", "", 3, mse, pae);
1429}
1430
1432// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1433// We test by comparing MSE and PAE of decoded images.
1434// The compressed file is obtained using these command-line options:
1435// -o dpx_enc_1280x720_10bit_resolve18.j2c -reversible true
1436TEST(TestExecutables, DpxEnc1280x72010bitResolve18) {
1437 double mse[3] = { 0, 0, 0};
1438 int pae[3] = { 0, 0, 0};
1439 run_ojph_compress("dpx_1280x720_10bit.ppm",
1440 "dpx_enc_1280x720_10bit_resolve18", "", "j2c",
1441 "-reversible true");
1442 run_ojph_compress_expand("dpx_enc_1280x720_10bit_resolve18", "j2c", "ppm");
1443 run_mse_pae("dpx_enc_1280x720_10bit_resolve18", "ppm",
1444 "dpx_1280x720_10bit.ppm", "", 3, mse, pae);
1445}
1446
1448// Test ojph_compress with codeblocks when the rev53 wavelet is used.
1449// We test by comparing MSE and PAE of decoded images.
1450// The compressed file is obtained using these command-line options:
1451// -o dpx_enc_1280x720_16bit_resolve18.j2c -reversible true
1452TEST(TestExecutables, DpxEnc1280x72016bitResolve18) {
1453 double mse[3] = { 0, 0, 0};
1454 int pae[3] = { 0, 0, 0};
1455 run_ojph_compress("dpx_1280x720_16bit.ppm",
1456 "dpx_enc_1280x720_16bit_resolve18", "", "j2c",
1457 "-reversible true");
1458 run_ojph_compress_expand("dpx_enc_1280x720_16bit_resolve18", "j2c", "ppm");
1459 run_mse_pae("dpx_enc_1280x720_16bit_resolve18", "ppm",
1460 "dpx_1280x720_16bit.ppm", "", 3, mse, pae);
1461}
1462
1464// main
1466int main(int argc, char** argv) {
1467 ::testing::InitGoogleTest(&argc, argv);
1468 return RUN_ALL_TESTS();
1469}
#define REF_FILE_DIR
static int ojph_pclose(FILE *stream)
#define TOL_DOUBLE
#define COMPRESS_EXECUTABLE
void run_ojph_compress_expand(const std::string &base_filename, const std::string &out_ext, const std::string &decode_ext)
#define COMPARE_FILES_PATH
#define OUT_FILE_DIR
int main(int argc, char **argv)
void run_ojph_expand(const std::string &base_filename, const std::string &src_ext, const std::string &out_ext)
static int execute(const std::string &cmd, std::string &result)
#define EXPAND_EXECUTABLE
static FILE * ojph_popen(const char *command, const char *modes)
#define TOL_INTEGER
void run_mse_pae(const std::string &base_filename, const std::string &out_ext, const std::string &ref_filename, const std::string &yuv_specs, int num_components, double *mse, int *pae)
#define SRC_FILE_DIR
void compare_files(const std::string &base_filename, const std::string &extended_base_fname, const std::string &ext)
#define MSE_PAE_PATH
TEST(TestExecutables, OpenJPHCompressNoArguments)
void run_ojph_compress(const std::string &ref_filename, const std::string &base_filename, const std::string &extended_base_fname, const std::string &out_ext, const std::string &extra_options)