📄 syntax.txt
字号:
This file documents the elements of each marker which
are communicted to the stream object in the current
implementation. It is the task of the stream object
to pack these into the actual marker segments, which
may involve some rearrangement or even more sophisticated
processing. For example, the actual markers COD and
COC have overlapping responsibilities and there are
multiple ways to use these markers to convey the same
information. However, information conveyed to the
stream object has no such overlap since all quantities
which can change from component to component are sent
to the COC marker, while the remaining quantities are
sent to the COD marker. It is the stream object's
responsibility to collect the COC markers for each
component and determine how best to construct a
complete COD marker which will minimize the number of
COC markers.
PART-I syntax elements are fixed; other elements
are viewed as potential candidates for PART-2 which
has not yet been standardized. The latter are identified
as PART-2 regardless of whether or not they are likely
to form part of PART-2 of the standard.
The reader may find it helpful to refer to the marker
file, "markers.h", for further comments on these
marker conventions and notation.
Note: the "Source Object" column below remains blank until
the marker element has been implemented. Do not enter
anything in anticipation of implementation!
===============================================================================
SIZ Marker
===============================================================================
Name Bits Size Source Object Description
----- ---- ---- ------------- -----------
SIZ_X 32 1 "forward_info" Width of reference grid
SIZ_Y 32 1 "forward_info" Height of reference grid
SIZ_XO 32 1 "forward_info" Horizontal offset of image
SIZ_YO 32 1 "forward_info" Vertical offset of image
SIZ_XT 32 1 "forward_info" Width of one reference tile
SIZ_YT 32 1 "forward_info" Height of one reference tile
SIZ_XTO 32 1 "forward_info" Horizontal tiling offset
SIZ_YTO 32 1 "forward_info" Vertical tiling offset
SIZ_C 16 1 "invocation" Number of image components (C)
SIZ_S 8 C "forward_info" Precision of component samples
SIZ_XR 8 C "forward_info" Horizontal sub-sampling factor
SIZ_YR 8 C "forward_info" Vertical sub-sampling factors
Comments: C denotes the number of image components.
===============================================================================
COD Marker
===============================================================================
Name Bits Size Source Object Description
---- ---- ---- ------------- -----------
COD_LAYERS 16 1 "encoder" Number of quality layers
COD_PROG 8 1 "encoder" Progression style (default)
COD_SOP 8 1 "stream_out" SOP markers used?
COD_EPH 8 1 "stream_out" EPH markers used?
COD_CXFORM 8 1 "component_mix" Multiple component transform
* Most entries in the COD marker should be derived automatically
from the COC markers, which will be written for each component.
===============================================================================
COC Marker
===============================================================================
Name Bits Size Source Object Description
---- ---- ---- ------------- -----------
COC_LEVELS 8 1 "forward_info" Number of decomposition levels (N)
COC_DECOMP 2 <=N "forward_info" Decomposition structure (PART-2)
COC_REV 1 1 "forward_info" Reversible/Non-reversible kernel
COC_KERNEL 8 <=N "forward_info" PART-2 kernel options
COC_SUPP 8 * "forward_info" PART-2 user-defined kernel support
COC_TAPS 16 * "forward_info" PART-2 user-defined lifting step taps
COC_XCB 4 1 "encoder" XCB (Code-block width <= 2^{XCB+2})
COC_YCB 4 1 "encoder" YCB (Code-block height <= 2^{YCB+2})
COC_PPX 4 1 "encoder" PPX (Packet partition width = 2^PPX)
COC_PPY 4 1 "encoder" PPY (Packet partition height = 2^PPY)
COC_XCL 4 1 "forward_info" XCL (Cell width = 2^XCL)
COC_YCL 4 1 "forward_info" YCL (Cell height = 2^YCL)
COC_XAP 1 1 "forward_info" XAP (Horizontal partition anchor point)
COC_YAP 1 1 "forward_info" YAP (Vertical partition anchor point)
COC_CCB 1 1 "encoder" Code-blocks respect cell boundaries?
COC_SSOX 4 1 "forward_info" Num lowest levels using hor SSO-DWT
COC_SSOY 4 1 "forward_info" Num lowest levels using vert SSO-DWT
COC_MOD 6 1 "encoder" Entropy coder mode flags
COC_OVLP 4 1 "forward_info" Tile boundary overlap flags
COC_SSOEXT 1 1 "analysis" Use SSO-DWT style extension
* N denotes the number of resolution levels.
* COC_DECOMP is a PART-2 element; it will not always be present.
In the real marker, its presence should probably be signalled by a
flag in the COD/COC marker's STYLE byte. When present, the length
of the element is important, since it cannot be deduced from any
other quantity. The element consists of a sequence of `hp_descent'
values, corresponding to the highest resolution level and then
consecutively lower resolution levels; once the sequence has expired,
any further levels use the last supplied `hp_descent' value.
* COC_KERNEL is a PART-2 element; it will not always be present. When
present, this element consists of a sequence of 8-bit quantities with
at most one such quantity for each of the N decomposition levels. The
format of each 8-bit quantity is (C|B|A), where A is the 3 LSB's, B is
the next 3 bits and C is bit 6 (i.e. next to MSB) of the byte. The
interpretation of these quantities is as follows. A defines the
horizontal kernel: 0 -> repeat kernel used last in the same direction;
1 -> repeat kernel used last in the opposite direction; 2 -> W5X3;
3 -> W9X7 kernel; 4 -> New user-defined kernel. B has the same
interpretation as A but applies to the vertical kernel. The flag, C,
holds 0 if these kernel definitions are to be applied to all subsequent
decomposition levels, while the value of 1 means that the kernel definitions
apply only to the next decomposition level. The first byte in the sequence
describes the first decomposition level (highest frequency subbands);
subsequent bytes appear as needed to describe different kernels for lower
resolution levels.
* COC_SUPP is a PART-2 element; there is one byte for each lifting step
of each new user-defined kernel (there is one new user-defined kernel for
each part (A or B) of each byte in the COC_KERNEL element which has the
value 2, as defined above). Each byte consists of three fields (C|B|A)
where C, the MSB holds 0 except on the last lifting step of a new kernel
where it holds 1. B is a 4 bit field identifying the amount of downshift
which should be applied to the integer tap values (the interpretation is
the same, regardless of whether reversible or non-reversible lifting
kernels are being defined). C is the 3 LSB's of the byte; it holds the
number of taps in the lifting step so that no more than 7 taps are available
for any lifting step.
* COC_TAPS is a PART-2 element. Each user-defined lifting step contributes
exactly one entry for each tap, where the entries correspond to the integer
tap values prior to the application of the downshifts specified in the
COC_SUPP element.
* COC_XCL, COC_XAP and COC_SSOX are PART-2 elements; they
will not always be present, but if any is present, all will be.
In the real marker, their presence should probably be signalled by a
flag in the COD/COC marker's STYLE byte.
* COC_YCL, COC_YAP and COC_SSOY are PART-2 elements; they
will not always be present, but if any is present, all will be.
In the real marker, their presence should probably be signalled by a
flag in the COD/COC marker's STYLE byte. Separate flags should be
used for these vertical variants from the flag used for the horizontal
variants, COC_XCL, COC_XAP and COC_SSOX.
* COC_CCB is a PART-2 element; it will be present if and only if one (and
hence all) of the COC_XCL, COC_YCL, COC_XAP and COC_YAP elements is present.
* COC_OVLP is a PART-2 element; the 4 bits in its single parameter identify
whether the top (bit 0=LSB), bottom (bit 1), left (bit 2) and
right (bit 3=MSB) boundaries of the relevant tile-component have an extra
overlap sample.
* COC_SSOEXT is a PART-2 element; the single bit flag indicates whether or
not SSO-DWT style extension should be used at tile boundaries whenever
the boundary sample is the one which is updated by the update lifting
steps. The element will usually be missing.
===============================================================================
QCD Marker
===============================================================================
Name Bits Size Source Object Description
---- ---- ---- ------------- -----------
QCD_WHICH 2 1 "quantizer" Which quantizer (DZQ,MASK, ...)
QCD_PWLN 6 1 "mask quantizer" Points in PWL mask quantizer curve (P)
QCD_PWLOFF 3 1 "mask quantizer" Offset in masking
QCD_PWLRM 4 1 "mask quantizer" Range max in masking
QCD_PWLLEV 4 1 "mask quantizer" Max level in masking
QCD_PWLOO 2 1 "mask quantizer" Orienoff in masking
QCD_PWLDAT 16 2P "mask quantizer" (x,y) pairs for each point
* QCD_PWLN through QCD_PWLDAT are PART-2 features; they are used by the
mask quantizer.
===============================================================================
QCC Marker
===============================================================================
Name Bits Size Source Object Description
---- ---- ---- ------------- -----------
QCC_GUARD 3 1 "forward_info" Number of guard bits
QCC_REV 5 B "forward_info" Reversible dynamic range params (mu)
QCC_STEP 16 1,B "forward_info" Quant step/range params (mu,epsilon)
QCC_CSFW 8 B "mask quantizer" CSF weights
* B is the number of subbands in the relevant image component.
* If the QCC_STEP element has only 1 element, then the implicit scalar
quantization mode is being used and the quantity refers only to the LL
subband from which all other quantities are derived.
* QCC_REV and QCC_STEP are mutually exclusive; moreover, QCC_REV is used
if any only if the decomposition is reversible (see the COC_REV element).
* QCC_CSFW is a PART-2 feature; it is used to signal CSF weights for
non-uniform quantizers.
===============================================================================
RGN Marker
===============================================================================
Name Bits Size Source Object Description
---- ---- ---- ------------- -----------
ERS_BOOSTS 8 * "forward_roi" Region boost values (rect rgns first)
ERS_RECTS 32 4R "forward_roi" Rect region coords (4 at a time)
ERS_CIRCS 32 3C "forward_roi" Circular region coords (3 at a time)
* If ERS_RECTS and ERS_CIRCS elements are missing (i.e. for PART-1 of the
standard), the ERS_BOOSTS element contains exactly 1 entry and the
MAX-SHIFT method is implied. Otherwise, ERS_BOOSTS contains R+C entries,
where ERS_RECTS contains 4R entries and ERS_CIRCS contains 3C entries.
* ERS_RECTS and ERS_CIRCS are PART-2 elements. The parameters for ERS_RECTS
elements appear 4 at a time, corresponding to the absolute vertical
and horizontal coordinates of the upper left hand sample in the region and
the height and width of the region, respectively, expressed in the
domain of the image component (not the reference grid) relative to the
canvas origin. The parameters for ERS_CIRCS elements appear 3 at a
time, corresponding tot he absolute vertical and horizontal coordinates of
the centre of the circle and the radius, respectively, expressed in the
domain of the image component (not the reference grid) relative to the
canvas origin.
===============================================================================
POC Marker
===============================================================================
Name Bits Size Source Object Description
---- ---- ---- ------------- -----------
POC_CHANGES 16 6C "encoder" Progression order changes
* The POC_CHANGES element contains 6C entries where C is the
number of changes. The 6 entries for each change are (in order)
Rstart, Cstart, Lend, Rend, Cend, and Prog. The bounding box for
the previous progression order is 0 <= L < Lend, Rstart <= R < Rend
and Cstart <= C < Cend. The progression is identified by Prog.
Note that the first five parameters may take on any non-negative
values whatsoever. There is no requirement that the lower bounds
be no larger than the upper bounds so that boxes may be empty.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -