Skip to content

Commit 4d904d2

Browse files
committed
Added support for BROADCAST and IMF profiles
1 parent 539d90d commit 4d904d2

File tree

9 files changed

+573
-23
lines changed

9 files changed

+573
-23
lines changed

src/apps/apps.xcodeproj/xcshareddata/xcschemes/ojph_compress.xcscheme

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
isEnabled = "NO">
6767
</CommandLineArgument>
6868
<CommandLineArgument
69-
argument = "-i ARRI_AlexaDrums_3840x2160p_24_8b_P3_444_00000.ppm -o test.j2c -num_decomps 5 -block_size \{64,64\} -precincts \{128,128\},\{256,256\}"
70-
isEnabled = "YES">
69+
argument = "-i ARRI_AlexaDrums_3840x2160p_24_8b_P3_444_00000.ppm -o test.j2c -block_size \{64,64\} -precincts \{128,128\},\{256,256\}"
70+
isEnabled = "NO">
7171
</CommandLineArgument>
7272
<CommandLineArgument
7373
argument = "-i 15512894668_2e5581297c_o.ppm -o test.j2c -num_decomps 5 -block_size \{64,64\} -precincts \{128,128\},\{256,256\} -prog_order CPRL"
@@ -182,8 +182,8 @@
182182
isEnabled = "NO">
183183
</CommandLineArgument>
184184
<CommandLineArgument
185-
argument = "-num_decomps 5"
186-
isEnabled = "NO">
185+
argument = "-num_decomps 4"
186+
isEnabled = "YES">
187187
</CommandLineArgument>
188188
<CommandLineArgument
189189
argument = "-num_decomps 2"
@@ -215,7 +215,7 @@
215215
</CommandLineArgument>
216216
<CommandLineArgument
217217
argument = "-prog_order CPRL"
218-
isEnabled = "NO">
218+
isEnabled = "YES">
219219
</CommandLineArgument>
220220
<CommandLineArgument
221221
argument = "-block_size \{4,1024\}"
@@ -263,7 +263,7 @@
263263
</CommandLineArgument>
264264
<CommandLineArgument
265265
argument = "-reversible true"
266-
isEnabled = "NO">
266+
isEnabled = "YES">
267267
</CommandLineArgument>
268268
<CommandLineArgument
269269
argument = "-colour_trans false"
@@ -273,6 +273,22 @@
273273
argument = "-qstep 0.04"
274274
isEnabled = "NO">
275275
</CommandLineArgument>
276+
<CommandLineArgument
277+
argument = "-profile IMF"
278+
isEnabled = "YES">
279+
</CommandLineArgument>
280+
<CommandLineArgument
281+
argument = "-profile BROADCAST"
282+
isEnabled = "NO">
283+
</CommandLineArgument>
284+
<CommandLineArgument
285+
argument = "-tile_size \{1024,1024\}"
286+
isEnabled = "YES">
287+
</CommandLineArgument>
288+
<CommandLineArgument
289+
argument = "-i ARRI_AlexaDrums_3840x2160p_24_8b_P3_444_00000.ppm -o test.j2c -block_size \{32,32\} -precincts \{128,128\},\{256,256\}"
290+
isEnabled = "YES">
291+
</CommandLineArgument>
276292
</CommandLineArguments>
277293
</LaunchAction>
278294
<ProfileAction

src/apps/ojph_compress/ojph_compress.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ struct si32_to_bool_list_interpreter
321321

322322
//////////////////////////////////////////////////////////////////////////////
323323
bool get_arguments(int argc, char *argv[], char *&input_filename,
324-
char *&output_filename,
325-
char *&progression_order, int &num_decompositions,
324+
char *&output_filename, char *&progression_order,
325+
char *&profile_string, int &num_decompositions,
326326
float &quantization_step, bool &reversible,
327327
int &employ_color_transform,
328328
const int max_num_precincts, int &num_precincts,
@@ -340,6 +340,7 @@ bool get_arguments(int argc, char *argv[], char *&input_filename,
340340
interpreter.reinterpret("-i", input_filename);
341341
interpreter.reinterpret("-o", output_filename);
342342
interpreter.reinterpret("-prog_order", progression_order);
343+
interpreter.reinterpret("-profile", profile_string);
343344
interpreter.reinterpret("-num_decomps", num_decompositions);
344345
interpreter.reinterpret("-qstep", quantization_step);
345346
interpreter.reinterpret("-reversible", reversible);
@@ -422,6 +423,8 @@ int main(int argc, char * argv[]) {
422423
char *output_filename = NULL;
423424
char prog_order_store[] = "RPCL";
424425
char *prog_order = prog_order_store;
426+
char profile_string_store[] = "";
427+
char *profile_string = profile_string_store;
425428
int num_decompositions = 5;
426429
float quantization_step = -1.0;
427430
bool reversible = false;
@@ -477,6 +480,9 @@ int main(int argc, char * argv[]) {
477480
" -tile_offset {x,y} tile offset. \n"
478481
" -tile_size {x,y} tile width and height. \n"
479482
" -image_offset {x,y} image offset from origin. \n"
483+
" -profile (None) is the profile, the code will check if the \n"
484+
" selected options meet the profile. Currently only \n"
485+
" BROADCAST and IMF are supported\n"
480486
"\n"
481487

482488
"When the input file is a YUV file, these arguments need to be \n"
@@ -491,7 +497,7 @@ int main(int argc, char * argv[]) {
491497
return -1;
492498
}
493499
if (!get_arguments(argc, argv, input_filename, output_filename,
494-
prog_order, num_decompositions,
500+
prog_order, profile_string, num_decompositions,
495501
quantization_step, reversible, employ_color_transform,
496502
max_precinct_sizes, num_precints, precinct_size,
497503
block_size, dims, image_offset, tile_size, tile_offset,
@@ -547,6 +553,8 @@ int main(int argc, char * argv[]) {
547553
cod.set_reversible(reversible);
548554
if (!reversible && quantization_step != -1)
549555
codestream.access_qcd().set_irrev_quant(quantization_step);
556+
if (profile_string[0] != '\0')
557+
codestream.set_profile(profile_string);
550558

551559
if (employ_color_transform != -1)
552560
OJPH_WARN(0x01000001,
@@ -599,6 +607,8 @@ int main(int argc, char * argv[]) {
599607
if (!reversible && quantization_step != -1)
600608
codestream.access_qcd().set_irrev_quant(quantization_step);
601609
codestream.set_planar(false);
610+
if (profile_string[0] != '\0')
611+
codestream.set_profile(profile_string);
602612

603613
if (dims.w != -1 || dims.h != -1)
604614
OJPH_WARN(0x01000011,
@@ -680,6 +690,8 @@ int main(int argc, char * argv[]) {
680690
if (!reversible && quantization_step != -1)
681691
codestream.access_qcd().set_irrev_quant(quantization_step);
682692
codestream.set_planar(true);
693+
if (profile_string[0] != '\0')
694+
codestream.set_profile(profile_string);
683695

684696
yuv.open(input_filename);
685697
base = &yuv;

0 commit comments

Comments
 (0)