how to add ROI coding module into openjpeg

Skip to first unread message


Mar 2, 2008, 10:23:03 AM3/2/08
to OpenJPEG
I have downloaded the latest version of openjpeg v1.3, as I am not so
familiar with the source code, could anyone please give me any
sugestions on how to begin with if I want to add ROI coding module
into the source code, such as the relevant functions to be

And is there any code available on ROI coding algorithm, such as
maxshift ?

Thanks for any help.

Antonin Descampe

Jun 12, 2008, 9:54:39 AM6/12/08

Hi James,

Currently, openjpeg v1.3 has a very limited implementation of ROI. The
only thing that can be done is upshift a whole component (as there is
no spatial zone selection, i wonder if we can even call this ROI ...).
However, this gives a basis to go one step further and implement a
true ROI option.

The JPEG 2000 ROI feature is described in annex H of the standard.
There are basically two things to implement :

* The mask generation : based on coordinates provided by the user, a
binary mask has to be generated for each subband (or even for each
code-block if we want to get the finest granularity when specifying
the ROI). I would say that this should be done when doing the DWT
(=>dwt_encode(_real) in dwt.c) but I should maybe investigate this a
bit more.

* The scaling operation : based on the mask, some coefficients have to
be up-scaled in order to be encoded first during entropy coding
(Maxshift method). This should surely be done in t1.c
(t1_encode_cblk), before applying the three coding passes. Depending
on the granularity required by the ROI implementation, the whole code-
block will be up-shifted or only some of its coefficients (the one
selected by the binary mask).

Well, writing this, i realize that it's not so easy to do... Let us
know if you investigate this a bit further or feel free to ask for
more details (not sure i will be able to answer though).



Le 02-mars-08 à 16:23, James a écrit :


Sep 19, 2019, 10:21:34 AM9/19/19
to OpenJPEG
Hi James,
I am also working on region of interest encoding and i am also trying to implement max shift algorithm. Can you help me please if you have done it.



Tejasvee Bisen

Sep 19, 2019, 10:45:05 AM9/19/19
No, i am also trying. Actually OpenJPEG has something component of interest thing not as region of interest. So i am also not getting how to implement it. 
If you get or know how to do it in OpenJPEG please let me know. 


You are subscribed to the mailing-list of the OpenJPEG project (
To post: email to
To unsubscribe: email to
For more options: visit
OpenJPEG is mainly supported by :
* UCL Image and Signal Processing Group (
* IntoPIX (
You received this message because you are subscribed to the Google Groups "OpenJPEG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages