jj2000.j2k.roi.encoder
Class ArbROIMaskGenerator

java.lang.Object
  |
  +--jj2000.j2k.roi.encoder.ROIMaskGenerator
        |
        +--jj2000.j2k.roi.encoder.ArbROIMaskGenerator

public class ArbROIMaskGenerator
extends ROIMaskGenerator

This class generates the ROI bit-mask when, at least, one ROI is not rectangular. In this case, the fast ROI bit-mask algorithm generation can not be used.

The values are calculated from the scaling factors of the ROIs. The values with which to scale are equal to u-umin where umin is the lowest scaling factor within the block. The umin value is sent to the entropy coder to be used for scaling the distortion values.

See Also:
ROIMaskGenerator, ArbROIMaskGenerator

Field Summary
private  int[] maskLineHigh
          The High frequency part of a mask line
private  int[] maskLineLow
          The low frequency part of a mask line
private  int[] paddedMaskLine
          A line or column of the mask with padding
private  boolean roiInTile
          Flag indicating if any ROI was found to be in this tile
private  int[][] roiMask
          The ROI mask for the current tile for all components
private  Quantizer src
          The source of quantized wavelet transform coefficients
 
Fields inherited from class jj2000.j2k.roi.encoder.ROIMaskGenerator
nrc, rois, tileMaskMade
 
Constructor Summary
ArbROIMaskGenerator(ROI[] rois, int nrc, Quantizer src)
          The constructor of the arbitrary mask generator
 
Method Summary
private  void decomp(Subband sb, int tilew, int tileh, int c)
          This function decomposes the mask for a node in the subband tree.
 boolean getROIMask(DataBlkInt db, Subband sb, int magbits, int c)
          This functions gets a DataBlk the size of the current code-block an fills this block with the ROI mask.
 void makeMask(Subband sb, int magbits, int c)
          This function generates the ROI mask for one tile-component.
 java.lang.String toString()
          This function returns the relevant data of the mask generator
 
Methods inherited from class jj2000.j2k.roi.encoder.ROIMaskGenerator
getROIs, tileChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

src

private Quantizer src
The source of quantized wavelet transform coefficients


roiMask

private int[][] roiMask
The ROI mask for the current tile for all components


maskLineLow

private int[] maskLineLow
The low frequency part of a mask line


maskLineHigh

private int[] maskLineHigh
The High frequency part of a mask line


paddedMaskLine

private int[] paddedMaskLine
A line or column of the mask with padding


roiInTile

private boolean roiInTile
Flag indicating if any ROI was found to be in this tile

Constructor Detail

ArbROIMaskGenerator

public ArbROIMaskGenerator(ROI[] rois,
                           int nrc,
                           Quantizer src)
The constructor of the arbitrary mask generator

Parameters:
rois - The ROI info.
nrc - The number of components
src - The quantizer module
Method Detail

getROIMask

public boolean getROIMask(DataBlkInt db,
                          Subband sb,
                          int magbits,
                          int c)
This functions gets a DataBlk the size of the current code-block an fills this block with the ROI mask.

In order to get the mask for a particular Subband, the subband tree is traversed and at each decomposition, the ROI masks are computed.

The widths of the synthesis filters corresponding to the wavelet filters used in the wavelet transform are used to expand the ROI masks in the decompositions.

Specified by:
getROIMask in class ROIMaskGenerator
Parameters:
db - The data block that is to be filled with the mask
sb - The root of the subband tree to which db belongs
magbits - The max number of magnitude bits in any code-block
c - The number of the component
Returns:
Whether or not a mask was needed for this tile

toString

public java.lang.String toString()
This function returns the relevant data of the mask generator

Overrides:
toString in class java.lang.Object

makeMask

public void makeMask(Subband sb,
                     int magbits,
                     int c)
This function generates the ROI mask for one tile-component.

Once the mask is generated in the pixel domain. it is decomposed following the same decomposition scheme as the wavelet transform.

Specified by:
makeMask in class ROIMaskGenerator
Parameters:
sb - The root of the subband tree used in the decomposition
magbits - The max number of magnitude bits in any code-block
c - component number

decomp

private void decomp(Subband sb,
                    int tilew,
                    int tileh,
                    int c)
This function decomposes the mask for a node in the subband tree. after the mask is decomposed for a node, this function is called for the children of the subband. The decomposition is done line by line and column by column

Parameters:
sb - The subband that is to be used for the decomposition
tilew - The width of the current tile
tileh - The height of the current tile
c - component number