OPJ_JP3D_COMPRESS(1)

πŸ“¦ version 2.4.0, in ubuntu jammy

πŸ’– NAME πŸ’–

okay so bestie, meet opj_jp3d_compress β€” she is a User Command and her entire job, her whole personality, is compressing a source file into a jp3d file. that's it. that's the gig. and she eats every single time πŸ’…βœ¨


✨ SYNOPSIS ✨

opj_jp3d_compress [optional arguments] -i source.{bin, pgx} -m
characteristics.img -o destination.{jp3d}

like, you hand her a source, a characteristics file, and a destination, and she understands the assignment. no cap 🫢


πŸŽ€ OPTIONS πŸŽ€

🌸 Required Parameters (except with -h) 🌸

these ones? not optional. she needs them. periodt.

  • -i β€” the source file, bestie. it's either -i source.bin or source*.pgx πŸ¦‹
  • -m β€” the source characteristics file, aka -m imgfile.img πŸ’œ
  • -o β€” where it all goes, aka the destination file: -o dest.jp3d πŸŽ€

🌈 Optional Parameters 🌈

the fun little extras. mix and match, she's flexible πŸ’–

  • -h β€” shows you the help information. the girl literally explaining herself πŸ™ˆ
  • -n β€” number of resolutions (-n 3,3,3) ⭐
  • -I β€” uses the irreversible transforms: ICT + DWT 9-7 (-I) β€” irreversible, so yeah, that's a whole commitment πŸ’€
  • -C β€” the coding algorithm (-C 2EB) β€” options are [2EB, 3EB] πŸ‘‘
  • -r β€” different compression ratios for successive layers (-r 20,10,5)

so the rate you specify for each quality level is the compression factor you want, and rate 1 means lossless compression. also, huge, crucial, do not skip: options -r and -q cannot be used together 🚫

  • -q β€” different psnr for successive layers (-q 30,40,50)

and same energy: options -r and -q cannot be used together 😭

  • -b β€” size of code block (-b 32,32,32) 🧚
  • -c β€” size of precinct (-c 128,128,128) 🌸
  • -t β€” size of tile (-t 512,512,512) πŸŽ€
  • -p β€” progression order (-p LRCP) β€” the lineup is [LRCP, RLCP, RPCL, PCRL, CPRL] πŸ’…
  • -s β€” subsampling factor (-s 2,2,2), format [-s X,Y,Z]
heads up bestie: subsampling bigger than 2 can produce error. she said what she said 🫣
  • -SOP β€” writes an SOP marker before each packet ⭐
  • -EPH β€” writes an EPH marker after each header packet ⭐
  • -M β€” code-block style (-M 0)

the menu is:

[1=BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL) 8=VSC 16=PTERM
32=SEGSYM 64=3DCTXT]

and the way you indicate multiple modes is by adding their values together, like literally doing math in your head, for example: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38 ✨ (yes SEGMARK, that's what the original says, iykyk)

  • -D β€” define DC offset (-D 12) πŸ”₯
  • -x β€” create an index file *.Idx (-x index_name.Idx) πŸ’œ
  • -ROI β€” c=%d,U=%d

so the quantization indices get upshifted for component c=%d where [%d = 0,1,2], with a value of U=%d where [0 <= %d <= 37]. example, since i know you want one: -ROI:c=0,U=25 πŸ‘‘

  • -d β€” offset of the origin of the volume (-d 150,300,100) πŸ¦‹
  • -l β€” offset of the origin of the tiles (-l 100,75,25) πŸ¦‹

🌟 Default coding 🌟

if you just… don't say anything? here's what she defaults to. no notes:

  • Lossless πŸ’š
  • 1 tile
  • Size of precinct: 2^15 x 2^15 x 2^15 (which means 1 precinct)
  • Size of code-block: 64 x 64 x 64
  • Number of resolutions in x, y and z axis: 3
  • No SOP marker in the codestream
  • No EPH marker in the codestream
  • No sub-sampling in x, y or z direction
  • No mode switch activated
  • Progression order: LRCP
  • No index file
  • No ROI upshifted
  • No offset of the origin of the volume
  • No offset of the origin of the tiles
  • Reversible DWT 5-3 on each 2D slice
  • Coding algorithm: 2D-EBCOT

πŸ’« Remarks πŸ’«

the tea, the lore, the fine print πŸ“

The markers written to the main_header are: SOC SIZ COD QCD COM.

COD and QCD markers will never appear in the tile_header. never ever. she's not doing that πŸ™…

bestie you need enough disk space memory (twice the original) to encode the volume, i.e. for a 1.5 GB volume you need a minimum of 3GB of disk memory. plan accordingly πŸ˜­πŸ’€

When loading .pgx files, a relative path to directory is needed for the input argument, followed by the common prefix of the slices and a '' character representing sequential numeration:

-i relativepath/slices*.pgx

The index file has the structure below:

Image_height Image_width Image_depth

Progression order: 0 (LRCP)

Tiles_size_X Tiles_size_Y Tiles_size_Z

Components_nb

Layers_nb

Decomposition_levels

[Precincts_size_X_res_Nr Precincts_size_Y_res_Nr
Precincts_size_Z_res_Nr]

...

[Precincts_size_X_res_0 Precincts_size_Y_res_0
Precincts_size_Z_res_0]

Main_header_end_position

Codestream_size

Tile_0 [start_pos end_header end_pos TotalDisto NumPix MaxMSE]
...

Tile_Nt [  ''         ''        ''        ''       ''    ''  ]

Tpacket_0 [Tile layer res. comp. prec. start_pos end_pos disto]
...

Tpacket_Np [''   ''    ''   ''    ''       ''       ''     '' ]

MaxDisto

TotalDisto

πŸ‘‘ AUTHOR πŸ‘‘

This manual page was written by Mathieu Malaterre <malat@debian.org> and Hugo Lefeuvre <hle@debian.org> for the Debian GNU/Linux system, but may be used by others. icons, honestly, we love them for this πŸ«ΆπŸ’–


and that's the whole page bestie!! opj_jp3d_compress version 2.3.1, from way back in October 2019, filed under OPJ_JP3D_COMPRESS(1). slay, go compress something πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from