@@ -321,8 +321,8 @@ struct si32_to_bool_list_interpreter
321
321
322
322
// ////////////////////////////////////////////////////////////////////////////
323
323
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,
326
326
float &quantization_step, bool &reversible,
327
327
int &employ_color_transform,
328
328
const int max_num_precincts, int &num_precincts,
@@ -340,6 +340,7 @@ bool get_arguments(int argc, char *argv[], char *&input_filename,
340
340
interpreter.reinterpret (" -i" , input_filename);
341
341
interpreter.reinterpret (" -o" , output_filename);
342
342
interpreter.reinterpret (" -prog_order" , progression_order);
343
+ interpreter.reinterpret (" -profile" , profile_string);
343
344
interpreter.reinterpret (" -num_decomps" , num_decompositions);
344
345
interpreter.reinterpret (" -qstep" , quantization_step);
345
346
interpreter.reinterpret (" -reversible" , reversible);
@@ -422,6 +423,8 @@ int main(int argc, char * argv[]) {
422
423
char *output_filename = NULL ;
423
424
char prog_order_store[] = " RPCL" ;
424
425
char *prog_order = prog_order_store;
426
+ char profile_string_store[] = " " ;
427
+ char *profile_string = profile_string_store;
425
428
int num_decompositions = 5 ;
426
429
float quantization_step = -1.0 ;
427
430
bool reversible = false ;
@@ -477,6 +480,9 @@ int main(int argc, char * argv[]) {
477
480
" -tile_offset {x,y} tile offset. \n "
478
481
" -tile_size {x,y} tile width and height. \n "
479
482
" -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 "
480
486
" \n "
481
487
482
488
" When the input file is a YUV file, these arguments need to be \n "
@@ -491,7 +497,7 @@ int main(int argc, char * argv[]) {
491
497
return -1 ;
492
498
}
493
499
if (!get_arguments (argc, argv, input_filename, output_filename,
494
- prog_order, num_decompositions,
500
+ prog_order, profile_string, num_decompositions,
495
501
quantization_step, reversible, employ_color_transform,
496
502
max_precinct_sizes, num_precints, precinct_size,
497
503
block_size, dims, image_offset, tile_size, tile_offset,
@@ -547,6 +553,8 @@ int main(int argc, char * argv[]) {
547
553
cod.set_reversible (reversible);
548
554
if (!reversible && quantization_step != -1 )
549
555
codestream.access_qcd ().set_irrev_quant (quantization_step);
556
+ if (profile_string[0 ] != ' \0 ' )
557
+ codestream.set_profile (profile_string);
550
558
551
559
if (employ_color_transform != -1 )
552
560
OJPH_WARN (0x01000001 ,
@@ -599,6 +607,8 @@ int main(int argc, char * argv[]) {
599
607
if (!reversible && quantization_step != -1 )
600
608
codestream.access_qcd ().set_irrev_quant (quantization_step);
601
609
codestream.set_planar (false );
610
+ if (profile_string[0 ] != ' \0 ' )
611
+ codestream.set_profile (profile_string);
602
612
603
613
if (dims.w != -1 || dims.h != -1 )
604
614
OJPH_WARN (0x01000011 ,
@@ -680,6 +690,8 @@ int main(int argc, char * argv[]) {
680
690
if (!reversible && quantization_step != -1 )
681
691
codestream.access_qcd ().set_irrev_quant (quantization_step);
682
692
codestream.set_planar (true );
693
+ if (profile_string[0 ] != ' \0 ' )
694
+ codestream.set_profile (profile_string);
683
695
684
696
yuv.open (input_filename);
685
697
base = &yuv;
0 commit comments