JPEG2000的Kakadu源代码浅析之二:码流参数

  JPEG2000的很多参数都与图像的预处理和分割有关。一般的彩色图像都具有三个分量,例如RGB,或者YUV等。在进行主要的图像分割之前,现要将原始图像信号去直流(所谓DC层进)并进行分量变换(主要是将RGB变换为YCbCr)。这里仅对彩色图像的一个分量或者黑白图像进行讨论。

  第一个重要概念是参考网格(reference grid)。这相当于JPEG2000图像的基本坐标系。而图像区域相当于该坐标系下的某个偏移处(一般记作(XOsiz, YOsiz))开始,并以某个偏移(一般记作(Xsiz-1,Ysiz-1))为末尾的的矩形区域。对于不同的分量可能采用不同的二次采样,例如对于YCbCr的亮度分量采样一般比色差分量采样高。记X和Y方向上的采样间隔分别为:XRsiz(c)和YRsiz(c)。图像区域将被填充块分割的矩形网格划分成多个块。填充块分割网格起始点记作(XTOsiz, YTOsiz),网格的大小为(XTsiz, YTsiz)。很自然地,必须满足:0<=XTOsiz<=XOsiz,0<=YTOsiz<=YOsiz,XTOsiz+XTsiz>XOsiz, YTOsiz+YTsiz>YOsiz,以使最左上角的网格就包含第一个图像分割块。填充块的索引按照光栅顺序。填充块分割类似于JPEG中的以8×8为单位的编码分割,而后者是固定的。

  对于不同二次采样频率的分量而言,虽然填充块分割在参考网格中的绝对大小是一样的,但是相同填充块内采样点的序号和个数都是不同的。具体的换算并不复杂,在此省略。

  JPEG2000的核心工作子带分裂虽然是在每个填充块中进行的,但却对填充快内的采样点的坐标(并非参考网格上的绝对坐标,而是X和Y方向上的采样索引)却是敏感的,这个坐标要作为小波变换的参数。子带一般记作nBxBy,其中n是0或正整数,表示子带的分解层次(decomposition level),Bx和By取L或H,分别表示低通和高通。每个nLL子带具有一定的分辨率层次(resolution level),用r表示,r=NL-n,NL为最高分解层次。每个子带都有一块内存区间,保存整个图像在该子带上的信息。从而对填充块的子带分解,是在每个子带的存储区间上相应位置上填上信息,随着填充块操作的进行而顺次进行,直至完成整个图像。而合成是一个相反的过程。

  对每个子带的信息进行子区分割,子区长宽大小限制为2的幂次。

  (未完待续)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Changes from version 2.2.2 to version 2.2.3 ------------------------------------------- * Extremely minor changes to avoid mixed use of formatted and unformatted calls to "ostream" objects. These appear to excite a bug in GCC version 3.0. The only file affected is "params.cpp" in "coresys/parameters". Changes from version 2.2.1 to version 2.2.2 ------------------------------------------- Note: none of these have any impact whatsoever on executable code or DLL's. * Renamed the "core" directory as "coresys". A trivial change and my appologies for those whom this might adversely affect. However, the use of the name "core" was causing some people difficulties, since it is identical to the name of a Unix core dump file. * Made the Linux MMX-optimized functions "extern C" instead of "extern", so as to avoid problems caused by different name mangling conventions between various versions of gcc. * Eliminated multi-line comments from assembler files so as to avoid problems created by earlier versions of the gnu assembler. Changes from version 2.2 to version 2.2.1 ----------------------------------------- * Replaced the C++ I/O routines used for image and compressed data transfers with ANSI C I/O functions. This was motivated by the fact that the new-style ANSI C++ I/O package is unbelievably slow, at least as implemented in Microsoft's Visual C++ compiler. The change has no impact whatsoever on the Kakadu core system; it affects only the implementation of a few application level objects -- the core system abstracts all such I/O considerations through interface classes which are implemented by applications. Everything now runs a little faster than it did in version 2.1 and quite a bit faster than it did in the first release of version 2.2. * Made provision for compiling under versions of GCC prior to version 3.0. To use this, you should define GCC_VERSION_LESS_THAN_3. Changes from version 2.1 to version 2.2 --------------------------------------- * Extensive support for ROI (Region of Interest) specification at encode time (see "kakadu.pdf" for more on this). * Migrated from the old-style C++ iostream package to the new standard iostream package -- minimal use of "using namespace std" and never used in common header files, so this should enhance namespace protection and portability. * Added AT&T style versions of the small amount of Pentium assembly code to enable compilation of a high speed version under GCC as well as MSVC. * Some minor bug fixes. Changes from version 2.0.2 to version 2.1 ----------------------------------------- * Extensive support for working with the JP2 file format. The "kdu_show" application demonstrates the capabilities required of a conformant JP2 reader: palette mapping; interpolation of components to a common resolution; application of registration offsets in the CRG marker segment; and colour conversion to an appropriate rendering space (sRGB here). The "kdu_region_decompressor" object provides extensive support for general purpose interactive rendering applications, performing all of the above tasks in a platform independent manner. * It is now possible to directly control rate-distortion slope thresholds used in the construction of quality layers. This capability may also be used to significantly increase compression speed, if a suitable threshold is known, since the encoder then incrementally predicts the point at which there is no point in coding further coding passes. * A number of improvements to the "kdu_show" application, including the ability to arbitrarily zoom into images. * A number of minor bug fixes, including one important bug reported by Aaron Deever of Kodak, and a bug which occasionally manifested itself in the incremental rate prediction heuristic (reported by Jim Andrew of CISRA). * Improved documentation. Changes from version 2.0.1 to version 2.02 ------------------------------------------ * A PDF document (documentation.pdf) has been prepared to guide the new user into some of the more important aspects of the Kakadu system. The first draft is included here. * A very simple compression example and a very simple decompression example have been added to assist developers in familiarizing themselves with the Kakadu system -- the existing demo apps provide perhaps too much functionality to be quickly understood. * A full BIBO (Bounded Input Bounded Output) numerical analysis of the DWT and other processing steps is used to establish the best utilization of limited precision sample data representations. The new version should not be able to fall prey to numerical overflow or underflow difficulties under any circumstances (this could just have been possible with the last version). It also provides slightly higher accuracy. * The automatic heuristic for generating quality layer rate targets has been substantially improved. * A number of minor bugs/limitations were corrected, although these had not manifested themselves in any real examples. Changes from version 2.0 to version 2.01 ---------------------------------------- * One line change in each of "kdu_expand.cpp" and "kdu_compress.cpp" to correct a minor rare bug in these demo applications. * Minor changes in "kdu_show.cpp" to correct a rare bug and improve the user interface in regard to image rotation. * Four lines added to each of "encoder.cpp" and "decoder.cpp" to fix a minor memory leak.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值