WO2006072206A1 - Method of performing fast compression and decompression for image - Google Patents

Method of performing fast compression and decompression for image Download PDF

Info

Publication number
WO2006072206A1
WO2006072206A1 PCT/CN2005/002292 CN2005002292W WO2006072206A1 WO 2006072206 A1 WO2006072206 A1 WO 2006072206A1 CN 2005002292 W CN2005002292 W CN 2005002292W WO 2006072206 A1 WO2006072206 A1 WO 2006072206A1
Authority
WO
WIPO (PCT)
Prior art keywords
image data
data block
component
image
cosine transform
Prior art date
Application number
PCT/CN2005/002292
Other languages
English (en)
French (fr)
Inventor
Jian Wang
Original Assignee
Peking University Founder Group Co., Ltd
Beijing Founder Electronics Co., Ltd.
Peking University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University Founder Group Co., Ltd, Beijing Founder Electronics Co., Ltd., Peking University filed Critical Peking University Founder Group Co., Ltd
Priority to JP2007549786A priority Critical patent/JP4831547B2/ja
Priority to US11/813,388 priority patent/US8548266B2/en
Priority to EP05850055A priority patent/EP1840836B1/en
Priority to AT05850055T priority patent/ATE543338T1/de
Publication of WO2006072206A1 publication Critical patent/WO2006072206A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding

Definitions

  • the invention belongs to the field of computer image processing and data compression, and particularly relates to a method for rapidly compressing and decompressing images. Background technique
  • JPEG Joint Photographic Experts Group
  • ISO International Standard Organization
  • DCT Discrete Cosine Transform
  • IDCT Inverse Discrete Cosine Transform
  • the input of this process is arbitrary image data.
  • the main purpose of this process is to preprocess the input data to meet the requirements of subsequent processing, or to achieve the best compression. These include: Dividing the original image data into 8 x 8 blocks, normalizing the pixel values of the image, color space conversion, and so on.
  • (x, y) represents the coordinates of a point before the discrete cosine transform in the block, where (0, 0) is the coordinates of the pixel in the upper left corner of the image data block; f (x, y) represents the coordinate before the discrete cosine transform (x, y) the value of the pixel; (u, v) represents the coordinates of an element in the block after the discrete cosine transform, where (0, 0) represents the pixel coordinate of the upper left corner of the image data block; F (u, V) represents the discrete The value of the element at the coordinates ( u, V ) after cosine transformation.
  • F (x,y) [ F (x,y) / Q (x,y) + 0.5 ]
  • the last predicted DC component for the next image block becomes:
  • Post-processing is the reverse process of pre-processing.
  • the flow of JPEG compression/decompression based on discrete cosine transform and inverse discrete cosine transform is shown in Figure 1.
  • JPEG Joint Photographic Experts Group
  • FIG. 1 For all details on JPEG, please refer to the document CCITT Rec. T.81 (1992 E) published by CCITT (The International Brass and Telephone Consultative Committee), entitled Information Technology-Digital Compress ion and Coding of Cont inuous-Tone St ill Images-Requi rement and Guide l ine ⁇ .
  • the JPEG compression algorithm based on discrete chord transformation can achieve a good compression ratio, and the error of the human being after image restoration is almost imperceptible, but its processing speed is not satisfactory.
  • the object of the present invention is to improve JPEG compression/decompression based on discrete cosine transform and inverse discrete cosine transform without changing the effect of JPEG algorithm based on discrete cosine transform and inverse discrete cosine transform.
  • Processing speed while not affecting the compression/decompression results of JPEG, does not affect the quality of image compression and decompression.
  • the technical solution adopted by the present invention is: A method for rapidly compressing and decompressing an image. Among them, a method for rapidly compressing an image includes the following steps:
  • pre-processing the input image including dividing the original image data into image data blocks, normalizing the pixel values of the image, and converting the color space;
  • step (3) determining whether the given image data block satisfies the accelerated compression processing condition, and if yes, performing step (3), otherwise performing step (4), wherein the accelerated compression processing condition refers to all pixels in one image block. Whether the values are equal;
  • Entropy coding of the AC component in the image data block that is, AC entropy coding
  • the compression process ends.
  • the judgment of the accelerated compression processing condition in the step (2) can be changed to a fast judgment method, that is, a plurality of image data are synthesized into one large "unit" data.
  • the discrete cosine transform and the quantization process can be combined into one step, namely, cylindrical discrete cosine-quantization processing, DC component entropy coding, and in the case where the conditions of the accelerated compression processing are satisfied.
  • the quantity entropy coding can be combined into one step to simplify entropy coding.
  • the preferred accelerated compression process is as follows:
  • step (2) judging whether the accelerated image processing block satisfies the condition of the accelerated compression processing, if it is satisfied, then performing step (8), otherwise performing step (3), wherein the accelerated compression processing condition refers to all of the image blocks. Whether the values of the pixels are equal;
  • a method of quickly decompressing an image includes the following steps:
  • step (6) determining whether the given image data block satisfies the accelerated decompression processing condition one, if it is satisfied, then performing step (6), otherwise performing step (7), the accelerated decompression processing condition one refers to the given Whether the AC components in the image data block are all 0;
  • the starting point of the acceleration processing is advanced, and the AC component entropy decoding, the binarization inverse quantization process, and the inverse discrete cosine are omitted in the case where the accelerated decompression processing condition is satisfied.
  • the transformation process, the preferred accelerated decompression process is:
  • the accelerated decompression processing condition 2 refers to the first Whether the AC component coding is a block end flag, that is, End Of Block, or EOB for short;
  • the effect of the present invention is that: by using the method of the present invention, in most cases, the speed of JPEG compression/decompression processing based on discrete cosine transform and inverse discrete cosine transform is accelerated, and the discrete cosine transform based is not affected at all. JPEG compression/decompression effect; Even in the most unfavorable case, the processing time of JPEG compression/decompression based on discrete cosine transform and inverse discrete cosine transform is hardly increased.
  • Figure 1 is a flow chart of a classical JPEG compression/decompression process based on discrete cosine transform and inverse discrete cosine transform;
  • Figure 2 is a serpentine arrangement diagram of the AC component
  • FIG. 3 is a flow chart of an entropy-running encoding process of an AC component
  • Figure 4 is a flow chart of the accelerated JPEG compression and decompression method processing
  • Figure 5 is a flow chart of a preferred accelerated JPEG compression and decompression method process. detailed description
  • Preprocessing the input image including dividing the original image data into image data blocks, normalizing the pixel values of the image, and converting the color space. Pre-processing steps with the background art;
  • step (3) Determine whether the accelerated image processing conditions are satisfied for a given image block. If satisfied then Perform step (3), otherwise perform step (4)
  • the input to this process is an 8 ⁇ 8 image data block, and the value of each pixel has been standardized.
  • the accelerated compression processing condition refers to whether the values of all the pixels in one image block are equal.
  • the pixel depth that JPEG can handle is 8 bits and 12 bits. The following are pseudo code representations for the depth of the two pixels.
  • variable f represents a data stream. In the worst case of the above operation, 64 bit stream operations and 63 comparison operations are required. A return value of true indicates that the accelerated compression processing condition is satisfied; a return value of false indicates that the accelerated compression processing condition is not satisfied.
  • step (2) of the embodiment adopts the following method: synthesize a plurality of data into a large "unit" of data for comparison, instead of comparing only one number at a time.
  • step (2) accelerated compression processing condition
  • the pseudo code for the quick judgment is as follows:
  • Unsigned int temp circle— lef t_shif t (p [0], 8); II
  • the left shift is 8 bits.
  • the effect of the right shift of the 8-bit is the same.
  • the algorithm is equivalent to the algorithm described in step 2 of the basic accelerated compression process.
  • the algorithm cost is only 1/4 of the algorithm described in step 2.
  • the cost of this algorithm is only 1/8 or 1/16 of the algorithm described in step 2.
  • the steps that can be optimized are not only discrete cosine transforms, but also quantization and entropy encoding steps.
  • the preferred accelerated compression process is as follows:
  • step (8) Determine whether the given image block satisfies the accelerated compression processing condition. If it is satisfied, then execute step (8), otherwise perform step (3);
  • the accelerated processing conditions are the same as those in step 2 of the accelerated compression processing flow.
  • the method of judging the condition may be in step 2, or may be the fast judging method mentioned above.
  • DC-Code F(0, 0) ) ; ⁇ Entropy coding the predicted DC component AC_Code (EOB); II Run-length coding terminator
  • step (6) Determine whether the given image block satisfies the accelerated decompression processing condition one. If it is satisfied, perform step (6), otherwise perform step (7);
  • the input to this process is a data block of length 64 including a DC component and an AC component.
  • the so-called accelerated decompression processing condition 1 refers to whether all the AC components in the input data block are 0, and the following is a pseudo code representation of the accelerated decompression processing condition, assuming that the input data block is F, then:
  • step (5) of the present embodiment adopts the following method: Combine a plurality of data into one large "unit" of data for comparison, instead of comparing only one data at a time.
  • the pseudo code for the quick judgment is as follows:
  • Unsigned int* p (unsigned int*)(&F(0,0));
  • the algorithm is equivalent to the algorithm described in step 5.
  • its algorithm cost is only 1/2 of the algorithm described in step 5.
  • the cost of this algorithm is only 1/4 or 1/8 of the algorithm described in step 5.
  • the inverse discrete cosine transform is the most time consuming step in the decompression process based on the inverse discrete cosine transform, it is also a key optimization step of the present invention, but in the case of satisfying the condition 2 of the accelerated decompression processing, other steps can also be obtained. accelerate.
  • the preferred accelerated decompression process is as follows:
  • step (3) Determine whether the decompression acceleration processing condition 2 is satisfied for a given image block. If yes, perform step (7), otherwise perform step (3);
  • the accelerated decompression processing condition 2 refers to whether the first AC component entropy coding is a block end flag, and the code is as follows:

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

一种对图像进行快速压缩和解压缩的方法
技术领域
本发明属于计算机图像处理和数据压缩领域, 具体涉及一种对图像进行 快速压缩和解压缩的方法。 背景技术
JPEG ( Joint Photographic Experts Group, 联合图象专家组) 是国际 标准组织 ( International Standard Organization, 简称 ISO) 下属一个讨 论组制订的静态图像压缩格式国际标准。 目前广泛地用于图像存储、 数码相 机等领域。 JPEG中有若干基于离散余弦变换(Discrete Cosine Transform, 简称 DCT)及逆离散余弦变换 ( Inverse Discrete Cosine Transform, 简称 IDCT) 的压缩和解压缩的方法。
基于离散余弦变换的压缩方法的具体步驟如下:
(1)预处理, 本处理过程的输入为任意的图像数据。 本处理过程的主要 目的是预处理输入数据, 使之符合后续处理过程的要求, 或者是为了获得最 好的压缩效果。 其中包括: 把原始图像数据切分成 8 X 8的块、把图像的像素 值标准化、 颜色空间转换等等。
(2) 离散余弦变换, 本过程的输入为 8x8的图像数据块, 每个像素的 取值已经经过了标'准化。 离散余弦变换的计算公式如下:
Figure imgf000003_0001
其中: u, v, x, y = 0, 1, 2, ...7。
(x,y)表示块内离散余弦变换前某个点的坐标, 其中(0,0)是图像数据 块左上角的像素的坐标; f (x,y)表示离散余弦变换前坐标(x,y)处像素的取 值; (u,v)表示离散余弦变换后块内某个元素的坐标, 其中(0,0)表示图像 数据块左上角的像素坐标; F (u, V)表示离散余弦变换后坐标( u, V )处元素的 取值。
当 u, v = 0, C (u) , C (v) =l/sqrt(2), 其中 sqrt表示开平方运算。 ( 3)量化,本过程的输入为经过离散余弦变换后的数据块和一个指定的 量化矩阵。量化矩阵内所有元素都是非 0的正整数。假定量化矩阵为 Q(x,y ), :那么量化处理的计算公式为:
F (x,y) = [ F (x,y) / Q (x,y) + 0.5 ] 其中 x,y = 0, 1,2,〜7, []表示取整运算。 加 0.5是为了四舍五入操作。
(4) 一维直流分量 (Direct Current, 简称 DC)预测。 F ( 0, 0 )被称 为直流分量, 其它元素被称为交流分量 (Alternating Current, 简称 AC) , 本过程主要指的是对直流分量的处理。假定上一个图像块的直流分量为 P,也 就是当前直流分量预测值, 那么预测的计算公式为:
F (0, 0) = F (0, 0) - P; II预测后的直流分量取值
最后用于下一个图像块的直流分量预测值变为:
P = P + F ( 0, 0) ; II 生成下一个图像块直流分量的预测值
(5) 直流分量熵编码 (Entropy Coding) , 本过程的输入为步骤 (4) 中的输出矩阵中的直流分量。 在图 2中的左上角黑色元素表示直流分量。
(6) 交流分量熵编码 (Entropy Coding) , 本过程的输入为步驟 (4) 中的输出矩阵中的交流分量。其中对交流分量的处理是熵 -游程(Run Length) 编码, 矩阵内各个元素的处理顺序是蛇行排列 (Zigzag) , 详见图 2。 在图 1 中除左上角黑色元素外的其它元素为交流分量。 折线表示对交流分量进行编 码时使用的蛇行排列。 图 3表示的是交流分量熵 -游程编码的程序流程图。 基于逆离散余弦的解压缩方法描述如下, 基本上是压缩方法的逆过程: (1) 直流分量熵解码。
( 2 ) 交流分量熵解码
( 3) —维直流分量反预测。 计算公式如下:
P = F (0, 0) = F (0, 0) + P
( 4 )反量化。 计算公式如下:
F (x, y) = F (x,y) χ Q (x,y)
(5)逆离散余弦变换。 计算公式如下:
lif^ +i tt ' ' (2γ+1)ν y) = ∑∑ C(uC(v) F( v)聽 16 -cm -. I6 ~
(6)后处理, 是预处理的逆过程。 基于离散余弦变换和逆离散余弦变换的 JPEG压缩 /解压缩处理流程详见 图 1。有关 JPEG的所有细节请参见 CCITT( The International Telegraph and Telephone Consultative Committee)发布的编号为 CCITT Rec. T.81 (1992 E)的文件, 名为 《 Information Technology-Digital Compress ion and Coding of Cont inuous-Tone St i l l Images-Requi rement and Guide l ine》 。 目前,基于离散佘弦变换的 JPEG压缩算法能够取得很好的压缩倍率, 而 且图像还原后所产生的误差人的视觉几乎无法察觉, 但是它的处理速度却不 能令人满意。 从离散余弦变换和逆离散余弦变换的计算公式可以看出, 仅离 散余弦变换或者逆离散余弦变换的计算量就相当大。 尽管离散余弦变换和逆 离散余弦变换都有快速算法, 相对于直接实现公式而言大大降低了计算量, 但是当处理高分辨率和大尺寸图像数据时,处理速度始终是应用 JPEG的一个 障碍。 发明内容
针对现有技术中存在的缺陷, 本发明的目的是在不改变基于离散余弦变 换和逆离散余弦变换的 JPEG算法的效果的前提下提高基于离散余弦变换和 逆离散余弦变换的 JPEG压缩 /解压缩处理速度, 同时并不影响 JPEG的压缩 / 解压缩结果, 即不影响图像压缩和解压缩的质量。 为达到以上目的, 本发明采用的技术方案是: 一种对图像进行快速压缩 和解压缩的方法。 其中, 一种对图像进行快速压缩的方法包括以下步驟:
( 1 )对输入的图像进行预处理,包括把原始图像数据切分成图像数据块、 把图像的像素值标准化及颜色空间转换;
( 2 )判断给定的图像数据块是否满足加速压缩处理条件,如果满足那么 执行步骤(3 ) , 否则执行步骤(4 ) , 所述的加速压缩处理条件指的是 一个图像块中的所有像素取值是否相等;
( 3 )对图像数据块进行简化离散余弦变换, 结束后跳转到步骤(5 ) ; ( 4 )对图像数据块进行离散余弦变换;
( 5 )对变换后的图像数据块进行量化处理;
( 6 )对图像数据块中的一维直流分量进行预测;
( 7 )对图像数据块中的直流分量熵编码, 即 DC熵编码;
( 8 )对图像数据块中的交流分量熵编码, 即 AC熵编码, 压缩处理结束。 进一步来说, 为了使上述快速压缩方法有更好的效果, 可以把步骤(2 ) 中对加速压缩处理条件的判断改为快速判断方法, 即将多个图像数据合成一 个较大 "单位" 的数据进行比较, 而不是一次仅比较一个图像数据; 更进一步, 在满足加速压缩处理条件的情况下, 离散余弦变换和量化处 理可以合并成一个步骤即筒化离散余弦-量化处理,直流分量熵编码和交流分 量熵编码可以合并成一个步骤即简化熵编码,优选的加速压缩处理流程如下:
( 1 ) 对输入的图像进行预处理;
(2) 对给定的图像数据块判断是否满足加速压缩处理条件, 如果满 足那么执行步骤 (8) , 否则执行步骤 ( 3) , 所述的加速压缩处理条件指的 是一个图像块中的所有像素的取值是否相等;
( 3 ) 对图像数据块进行离散余弦变换;
( 4 ) 对变换后的图像数据块进行量化处理;
( 5 ) 对图像数据块中的一维直流分量进行预测;
( 6 ) 对图 4象数据块中的直流分量熵编码;
(7) 对图像数据块中的交流分量熵编码, 处理结束;
( 8 ) 进行筒化离散余弦变换-量化处理;
( 9 ) 对图像数据块中的一维直流分量进行预测;
(10) 进行筒化熵编码, 处理结束。
一种对图像进行快速解压缩的方法包括以下步骤:
( 1 )输入经过压缩的图像数据块, 对图像数据块中的直流分量熵解码, 即 DC熵解码;
( 2 )对图像数据块中的交流分量熵解码, 即 AC熵解码;
(3)对图像数据块中的一维直流分量进行反预测;
( 4 )对量化的图像数据块进行反量化;
( 5 )判断给定的图像数据块是否满足加速解压缩处理条件一,如果满足 那么执行步驟 (6) , 否则执行步骤 (7) , 所述的加速解压缩处理条件 一指的是给定的图像数据块中的交流分量是否全部为 0;
(6) 进行简化逆离散余弦变换, 结束后跳转到步驟 (8) ;
(7) 进行逆离散余弦变换;
(8)对图像数据进行后处理, 输出经过解压缩后的原始图像数据。 进一步来说, 为使上述快速解压缩方法具有更好的效果: 上述快速解压 方法中的步骤 5中对加速解压缩处理条件一的判断采用快速判断方法, 即将 多个数据合成一个较大 "单位" 的数据进行比较, 而不是一次仅比较一个数
再进一步, 对图像进行解压缩时将加速处理的起点前移, 在满足加速解 压缩处理条件的情况下省略交流分量熵解码, 筒化反量化过程和逆离散余弦 变换过程, 优选的加速解压缩处理流程为:
( 1) 对图像数据块中的直流分量熵解码;
(2) 判断给定的图像数据块是否满足加速解压缩处理条件二, 如果 满足那么执行步驟 (7) , 否则执行步骤 (3 ) , 所述的加速解压缩处理条件 二指的是第一个交流分量编码是否为块结束标志,即 End Of Block,简称 EOB;
(3) 对图像数据块中的交流分量熵解码;
(4) 对图像数据块中的一维直流分量进行反预测;
( 5 ) 对量化的图像数据块进行反量化;
(6) 进行逆离散余弦变换, 结束后跳转到步骤 (9) ;
(7) 对图像数据块中的一维直流分量进行反预测;
( 8) 进行简化逆离散余弦变换-反量化处理;
(9) 对图像数据进行后处理, 输出经过解压缩后的原始图像数据。 本发明的效果在于: 采用本发明所述的方法, 在绝大多数情况下, 加快 了基于离散余弦变换和逆离散余弦变换的 JPEG压缩 /解压缩处理速度, 同时 完全不影响基于离散余弦变换的 JPEG压缩 /解压缩效果; 即使在最不利的情 况下, 也几乎不会增加基于离散余弦变换和逆离散余弦变换的 JPEG压缩 /解 压缩的处理时间。 附图说明
图 1是基于离散余弦变换和逆离散余弦变换的经典 JPEG压缩 /解压缩处 理流程图;
图 2是交流分量的蛇行排列图;
图 3是交流分量的熵-游程编码处理流程图;
图 4是加速的 JPEG压缩和解压缩方法处理流程图;
图 5是优选的加速 JPEG压缩和解压缩方法处理流程图。 具体实施方式
下面结合附图和实施例对本发明作进一步的描述:
如图 4、 图 5所示, 对于基于离散余弦变换的: TPEG压缩过程, 基本加速 压缩处理流程如下:
( 1 ) 对输入的图像进行预处理, 包括把原始图像数据切分成图像数据 块、 把图像的像素值标准化及颜色空间转换。 同背景技术的预处 理步骤;
( 2) 对给定的图像块判断是否满足加速压缩处理条件。 如果满足那么 执行步骤(3) , 否则执行步驟(4)
本过程的输入为 8 X 8的图像数据块, 每个像素的取值已经 经过了标准化。 所述的加速压缩处理条件指的是一个图像块中的 所有像素的取值是否相等。 JPEG可以处理的像素深度有 8位和 12位两种, 下面是分别针对两种像素深度的伪代码表示。
对于像素深度为 8位的情况:
for ( int n = 1; n < 64; n ++ )
if ( f[0] != f[n] ) return false;
return true;
上述操作最不利情况下需要进行 63次比较操作。 对于像素深度为 12位的情况:
int tmp = read_bit(f,12); II 从数据流中读取 12位
for ( int n = 1; n < 64; n ++ )
if (read(f,12) != tmp) return false;
return true;
其中变量 f表示一个数据流。 上述操作最不利情况下需要进 行 64次位流操作和 63次比较操作。 返回值 true表示满足加速 压缩处理条件; 返回值为 false表示不满足加速压缩处理条件。
( 3) 筒化离散余弦变换变换, 结束后跳转到 5;
筒化离散余弦变换变换计算公式如下, 假定 f (x,y) 为离散 余弦前的矩阵, F(x,y)为离散余弦变换后的矩阵, 其中 x,y = 0, 1, 2, ...7, 那么:
对于 X, y = 0, F(x, y) = f (0, 0) χ 8;
对于 x != 0或者 y != 0, F (x, y) = 0.
(4) 离散佘弦变换变换, 同背景技术的同名步驟;
( 5) 量化, 同背景技术的同名步驟;
( 6) 一维直流分量预测, 同背景技术的同名步骤;
( 7) 直流分量熵编码, 同背景技术的同名步骤;
(8) 交流分量熵编码, 同背景技术的同名步驟。
上述处理流程请参见图 4中的压缩部分。 为了使本发明拥有更好的效果, 本实施例步骤(2 )采用了如下方法: 将 多个数据合成一个较大 "单位" 的数据进行比较, 而不是一次仅比较一个数 针对本实施例中加速压缩处理中的步驟( 2 ) (加速压缩处理条件)而言, 快速判断的伪代码如下:
unsigned int * p = (unsigned int *) f ;
unsigned int temp = circle— lef t_shif t (p [0], 8); II 循环左移 8位。 当然循环右移 8位效果也是相同的。
for ( int n = 0 ; n < 64/ s izeof (int) ; n ++ )
if ( temp != [n] ) return false
return true ;
可以证明, 该算法和基本加速压缩处理流程中的步骤 2中描述的算法是 等价的。 对于目前绝大部分的 32位 CPU, 在最不利的情况下仅需要一次循环 移位操作和 16次比较操作。 在最不利的情况下, 它的算法代价只是步驟 2 中描述算法的 1/4。对于拥有 64、 128位寄存器的 CPU (例如: Intel公司 CPU 上的丽 X寄存器) 而言, 该算法的代价更是只有步骤 2中描述算法的 1/8或 者 1/16。 在满足快速压缩条件的情况下, 可优化的步骤不仅仅是离散余弦变换, 还有量化和熵编码步驟。 优选的加速压缩处理流程如下:
(1) 预处理, 同背景技术的 "预处理" 部分;
(2) 判断给定的图像块是否满足加速压缩处理条件。 如果满足那么执 行步骤 (8) , 否则执行步骤(3) ;
所述的加速处理条件和加速压缩处理流程中步驟 2中的条件 相同。 判断条件的方法可以是步驟 2中的, 也可以是前面提到快 速判断方法。
( 3) 离散余弦变换, 同背景技术的 "离散余弦变换" 部分;
(4) 量化处理, 同背景技术的同名步骤;
(5) 一维直流分量预测, 同背景技术的同名步骤;
(6) 直流分量熵编码, 同背景技术的同名步骤;
(7) 交流分量熵编码, 同背景技术的同名步驟, 处理结束;
( 8 ) 筒化离散余弦变换-量化处理;
假定 F表示处理前的矩阵, f表示变换后的矩阵, Q表示量 化矩阵, 那么:
F(0, 0) = f (0, 0) * ( 8/Q(0, 0) );
由于 8/Q(0, 0)事实上是一个常数,因此本步骤实际上仅执行 了 " 〉欠 、法 ( 9) 一维直流分量预测, 同背景技术的 "一维直流分量预测" 部分;
( 10) 简化熵编码, 处理结束;
此时熵编码过程变成只需要进行两次编码, 如下:
DC-Code (F(0, 0) ) ; 〃 对预测后的直流分量进行熵编码 AC_Code (EOB); II 游程编码结束符
处理流程图详见图 5中的压缩部分。 注意在图 5中有几条虛线, 表示在 加速压缩处理过程进行中, 可以在适当的时机重新回到 "背景技术" 部分描 述的处理过程。 它们认为是本发明中描述的加速压缩处理过程的变种。 对于基于逆离散余弦变换的 JPEG解压缩过程,基本加速解压缩处理流程 如下:
( 1 ) 直流分量熵解码, 同背景技术的同名步驟;
( 2) 交流分量熵解码, 同背景技术的同名步骤;
( 3) 一维直流分量反预测, 同背景技术的同名步骤;
( 4) 反量化, 同背景技术的同名步驟;
( 5 ) 判断给定的图像块是否满足加速解压缩处理条件一。 如果满足那 么执行步骤 (6) , 否则执行步骤 (7) ;
本过程的输入为包括直流分量和交流分量的长度为 64的数 据块。 在这里, 所谓的加速解压缩处理条件一指的是输入数据块 中所有的交流分量是否为 0, 下面是加速解压缩处理条件的伪代 码表示, 假定输入的数据块为 F,那么:
for ( int n = 1; n < 64; n ++ )
if(F[0] !=0)
return false; II 不满足加速解压缩处理条件
return true; // 满足加速处理条件
上述操作最不利情况下需要进行 63次比较操作。
( 6 ) 简化逆离散余弦变换, 结束后跳转到步驟( 8 ) ;
简化逆离散余弦变换变换计算公式如下。假定 F (x, y)为逆离 散余弦变换前的矩阵, f (x,y)为逆离散余弦变换后的矩阵, 其中 X, y = 0, 1, 2, ...7, 那么:
对于 X, y = 0, 1, 2, -7, f (x, y) = F(0, 0) I 8;
( 7) 逆离散余弦变换, 同背景技术的同名步骤;
( 8) 后处理, 同背景技术的同名步骤;
处理流程图详见图 4中的解压缩部分。 为了使本发明拥有更好的效果, 本实施例步驟(5 )采用了如下方法: 将 多个数据合成一个较大 "单位" 的数据进行比较, 而不是一次仅比较一个数 据。 针对本实施例中加速压缩处理中的步骤 (5 ) (加速解压缩处理条件一) 而言, 快速判断的伪代码如下:
unsigned int temp = F[0]; II把直流分量先保存起来
F[0] = 0;〃把直流分量清 0
unsigned int* p = (unsigned int*)(&F(0,0));
for ( int n = 0 ; n < 64*sizeof(short)/sizeof(int); n ++ )
if ( p[n] != 0 )
{
F[0] = temp;
return false; // 不满足加速解压缩处理条件
}
F[0] = temp;
return true; II 满足加速解压缩处理条件
可以证明, 该算法和步骤 5中描述的算法是等价的。 对于目前绝大部分 的 32位 CPU,在最不利的情况下,它的算法代价只是步骤 5中描述算法的 1/2。 对于拥有 64、 128位寄存器的 CPU (例如: Intel公司 CPU上的丽 X寄存器) 而言, 该算法的代价更是只有步驟 5中描述算法的 1/4或者 1/8。 虽然在基于逆离散余弦变换的解压缩过程中, 逆离散余弦变换是最耗时 的步驟, 也是本发明重点优化的步骤, 但是在满足加速解压缩处理条件二的 情况下, 其它步骤也可以得到加速。
优选的加速解压缩处理流程如下:
( 1 ) 直流分量熵解码, 同背景技术的 "直流分量熵解码" 部分;
( 2 ) 对给定的图像块判断是否满足解压缩加速处理条件二。 如果满足 那么执行步驟 (7 ) , 否则执行步骤 (3 ) ;
所述的加速解压缩处理条件二指的是第一个交流分量熵编 码是否为块结束标志, 示意代码如下:
R = DECODE () ; II 解出第一个交流分量编码
if ( R == E0B ) II 判断是否为块结束标志
return true ; II 满足条件 return false ; II 不满足条件
注意: 在满足快速解压缩处理条件二情况下, "交流分量熵 解码" 将被省略。
( 3) 交流分量熵解码, 同背景技术的 "交流分量熵解码" 部分;
( 4) 一维直流分量反预测, 同背景技术的 "一维直流分量反预测" 部 分;
( 5) 反量化, 同背景技术的 "反量化" 部分;
( 6) 逆离散余弦变换, 结束后跳转到步骤(9) 。 同背景技术同名步 骤;
( 7) 一维直流分量反预测, 同背景技术同名步骤;
( 8 ) 筒化逆离散余弦变换-反量化处理;
假定 F表示处理前的矩阵, f表示变换后的矩阵, Q表示量 化矩阵, 那么:
f (x, y) = F(0, 0) * (Q(0,0)/8 ), 对于 x,y = 0,1,2, -70 注意 Q(0, 0)是一个常数。
( 9) 后处理, 同背景技术同名步骤。 具体流程图请参见图 5中的解压缩部分。 注意在图 5中有几条虚线, 表 示在加速解压缩处理过程进行中, 可以在适当的时机重新回到 "背景技术" 部分描述的处理过程。 它们是本发明中描述的加速解压缩处理过程的变种。

Claims

权 利 要 求 书
1. 一种对图像进行快速压缩的方法, 包括以下步驟:
( 1 ) 对输入的图像进行预处理, 包括把原始图像数据切分成图像数 据块、 把图像的像素值标准化及颜色空间转换;
( 2) 判断给定的图像数据块是否满足加速压缩处理条件, 如果满足 那么执行步驟(3) , 否则执行步驟(4) , 所述的加速压缩处 理条件指的是一个图像块中的所有像素取值是否相等;
( 3) 对图像数据块进行简化离散余弦变换,结束后跳转到步骤( 5); ( 4 ) 对图像数据块进行离散余弦变换;
( 5 ) 对变换后的图像数据块进行量化处理;
( 6 ) 对图像数据块中的一维直流分量进行预测;
( 7) 对图像数据块中的直流分量熵编码, 即 DC熵编码;
( 8) 对图像数据块中的交流分量熵编码, 即 AC熵编码, 压缩处理 结束。
2.如权利要求 1所述的一种对图像进行快速压缩的方法,其特征在于: 步骤(2)中对加速压缩处理条件的判断采用快速判断方法, 即将多个图像 数据合成一个较大 "单位" 的数据进行比较, 而不是一次仅比较一个图像 数据。
3. 如权利要求 1或 2所述的一种对图像进行快速压缩的方法,其特征 在于: 在满足加速压缩处理条件的情况下, 离散余弦变换和量化处理可以 合并成一个步驟即简化的离散余弦变换 -量化处理,直流分量熵编码和交流 分量熵编码可以合并成一个步骤即简化熵编码, 优选的加速压缩处理流程 如下:
( 1 ) 对输入的图像进行预处理;
(2) 判断给定的图像数据块是否满足加速压缩处理条件, 如果满足 那么执行步骤(8) , 否则执行步骤(3) , 所述的加速压缩处 理条件指的是一个图像块中的所有像素的取值是否相等;
( 3 ) 对图像数据块进行离散余弦变换;
( 4 ) 对变换后的图像数据块进行量化处理;
( 5 ) 对图像数据块中的一维直流分量进行预测;
(6) 对图像数据块中的直流分量熵编码;
(7) 对图像数据块中的交流分量熵编码, 处理结束;
( 8) 进行筒化离散余弦变换-量化处理;
(9) 对图像数据块中的一维直流分量进行预测; ( 10) 进行简化熵编码, 处理结束。
4. 一种对图像进行快速解压缩的方法, 包括以下步驟:
( 1 ) 输入经过压缩的图像数据块, 对图像数据块中的直流分量熵解 码, 即 DC熵解码;
( 2 ) 对图像数据块中的交流分量熵解码, 即 AC熵解码;
( 3 ) 对图像数据块中的一维直流分量进行反预测;
(4) 对图像数据块进行反量化;
(5) 判断给定的图像数据块是否满足加速解压缩处理条件一, 如果 满足那么执行步骤(6) , 否则执行步驟(7) , 所述的加速解 压缩处理条件一指的是给定的图像数据块中的交流分量是否 全部为 0;
(6) 进行简化逆离散余弦变换, 结束后跳转到步驟(8) ;
(7) 进行逆离散余弦变换;
(8) 对图像数据进行后处理, 输出经过解压缩后的原始图像数据。
5. 如权利要求 4所述的一种对图像进行快速解压缩的方法, 其特征在 于: 步驟(5) 中对加速解压缩处理条件一的判断采用快速判断方法, 即将 多个图像数据合成一个较大 "单位" 的数据进行比较, 而不是一次仅比较 一个图像数据。
6. 如权利要求 4所述的一种对图像进行快速解压缩的方法,其特征在 于: 对图像进行解压缩时, 将快速处理的起点前移, 在满足加速解压缩处 理条件二的情况下省略交流分量熵解码, 简化反量化过程和逆离散余弦变 换过程, 优选的加速解压缩处理流程如下:
( 1 ) 对图像数据块中的直流分量熵解码;
(2) 判断给定的图像数据块是否满足加速解压缩处理条件二, 如果 满足那么执行步骤(7) , 否则执行步驟(3) , 所述的加速解 压缩处理条件二指的是第一个交流分量编码是否为块结束标 志, 即 End Of Block, 简称 EOB;
(3) 对图像数据块中的交流分量熵解码;
(4) 对图像数据块中的一维直流分量进行反预测;
(5) 对图像数据块进行反量化;
(6) 进行逆离散余弦变换, 结束后跳转到步骤 (9) ;
(7) 对图像数据块中的一维直流分量进行反预测;
(8) 进行简化逆离散余弦变换-反量化处理;
(9) 对图像数据进行后处理, 输出经过解压缩后的原始图像数据。
PCT/CN2005/002292 2005-01-07 2005-12-23 Method of performing fast compression and decompression for image WO2006072206A1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2007549786A JP4831547B2 (ja) 2005-01-07 2005-12-23 画像圧縮および伸張加速化のための方法
US11/813,388 US8548266B2 (en) 2005-01-07 2005-12-23 Method of performing fast compression and decompression for image with accelerated steps
EP05850055A EP1840836B1 (en) 2005-01-07 2005-12-23 Method of performing fast compression for an image
AT05850055T ATE543338T1 (de) 2005-01-07 2005-12-23 Verfahren zur durchführung einer schnellen komprimierung für ein bild

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200510000589.6 2005-01-07
CNB2005100005896A CN1282107C (zh) 2005-01-07 2005-01-07 一种对图像进行快速压缩和解压缩的方法

Publications (1)

Publication Number Publication Date
WO2006072206A1 true WO2006072206A1 (en) 2006-07-13

Family

ID=34777986

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2005/002292 WO2006072206A1 (en) 2005-01-07 2005-12-23 Method of performing fast compression and decompression for image

Country Status (6)

Country Link
US (1) US8548266B2 (zh)
EP (1) EP1840836B1 (zh)
JP (1) JP4831547B2 (zh)
CN (1) CN1282107C (zh)
AT (1) ATE543338T1 (zh)
WO (1) WO2006072206A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5590390B2 (ja) * 2010-07-15 2014-09-17 ソニー株式会社 画像処理装置および方法
JP5732765B2 (ja) * 2010-07-22 2015-06-10 富士ゼロックス株式会社 画像データ復号装置
CN103413287B (zh) * 2013-08-27 2016-09-14 浙江宇视科技有限公司 一种jpeg图片合成方法及装置
US11611359B2 (en) 2015-05-29 2023-03-21 SK Hynix Inc. Data storage device
KR102347418B1 (ko) * 2015-09-25 2022-01-06 에스케이하이닉스 주식회사 데이터 처리 장치 및 그것의 동작 방법
US11177835B2 (en) 2015-09-25 2021-11-16 SK Hynix Inc. Data storage device
KR102285940B1 (ko) 2015-05-29 2021-08-05 에스케이하이닉스 주식회사 데이터 처리 회로, 데이터 처리 회로를 포함하는 데이터 저장 장치 및 그것의 동작 방법
US11515897B2 (en) 2015-05-29 2022-11-29 SK Hynix Inc. Data storage device
US10396827B2 (en) 2015-09-25 2019-08-27 SK Hynix Inc. Data storage device
JP2020004033A (ja) * 2018-06-27 2020-01-09 株式会社Screenホールディングス 画像処理方法、コンピュータプログラムおよび記録媒体

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003179924A (ja) * 1996-09-21 2003-06-27 Samsung Electronics Co Ltd 離散コサイン変換係数の予測方法
JP2003324739A (ja) * 2002-05-01 2003-11-14 Sony Corp 2次元離散コサイン変換回路およびその方法、ならびに画像データ圧縮装置およびその方法
WO2003101121A1 (en) * 2002-05-24 2003-12-04 Koninklijke Philips Electronics N.V. A method and system for estimating objective quality of compressed video data
KR20040066397A (ko) * 2003-01-17 2004-07-27 아스텔 주식회사 디지털 영상압축 시스템 및 그 방법
KR20040073790A (ko) * 2003-02-14 2004-08-21 (주) 멀티비아 이동통신 단말기용 동영상 부호화 시스템 및 방법

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5371611A (en) 1992-08-26 1994-12-06 Kokusai Denshin Denwa Kabushiki Kaisha Method for and system of decoding compressed continuous-tone digital image data
JPH07162861A (ja) 1993-12-10 1995-06-23 Fujitsu General Ltd 静止画再生装置
US5719961A (en) * 1994-07-22 1998-02-17 Apple Computer, Inc. Adaptive technique for encoder and decoder signal transformation
US6160918A (en) * 1997-10-02 2000-12-12 At&T Corp. Method and apparatus for fast image compression
JP2000013612A (ja) * 1998-06-18 2000-01-14 Minolta Co Ltd 画像処理装置および方法ならびに画像処理プログラムを記録した記録媒体
JP2000013596A (ja) * 1998-06-18 2000-01-14 Minolta Co Ltd 画像処理装置および方法ならびに画像処理プログラムを記録した記録媒体
EP0990992A3 (de) * 1998-09-28 2002-02-13 Siemens Aktiengesellschaft Diskreter/invers-diskreter Cosinus-Transformationsvorrichtung und Anordnung
JP2001145107A (ja) 1999-11-12 2001-05-25 Seiko Epson Corp Dctを用いた信号処理装置及画像圧縮装置
JP3538352B2 (ja) 1999-12-15 2004-06-14 シャープ株式会社 画像符号化方法および画像復号化方法ならびカラーファクシミリ装置
US6778707B1 (en) * 1999-12-17 2004-08-17 Xerox Corporation Method for decompressing JPEG files using a variable block size inverse discrete cosine transform
US6882685B2 (en) * 2001-09-18 2005-04-19 Microsoft Corporation Block transform and quantization for image and video coding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003179924A (ja) * 1996-09-21 2003-06-27 Samsung Electronics Co Ltd 離散コサイン変換係数の予測方法
JP2003324739A (ja) * 2002-05-01 2003-11-14 Sony Corp 2次元離散コサイン変換回路およびその方法、ならびに画像データ圧縮装置およびその方法
WO2003101121A1 (en) * 2002-05-24 2003-12-04 Koninklijke Philips Electronics N.V. A method and system for estimating objective quality of compressed video data
KR20040066397A (ko) * 2003-01-17 2004-07-27 아스텔 주식회사 디지털 영상압축 시스템 및 그 방법
KR20040073790A (ko) * 2003-02-14 2004-08-21 (주) 멀티비아 이동통신 단말기용 동영상 부호화 시스템 및 방법

Also Published As

Publication number Publication date
CN1282107C (zh) 2006-10-25
EP1840836A4 (en) 2009-03-04
JP2008527809A (ja) 2008-07-24
EP1840836A1 (en) 2007-10-03
JP4831547B2 (ja) 2011-12-07
US8548266B2 (en) 2013-10-01
ATE543338T1 (de) 2012-02-15
US20090016629A1 (en) 2009-01-15
CN1622137A (zh) 2005-06-01
EP1840836B1 (en) 2012-01-25

Similar Documents

Publication Publication Date Title
WO2006072206A1 (en) Method of performing fast compression and decompression for image
RU2486691C1 (ru) Способ декодирования потока битов
TWI221390B (en) Animation encoding method, animation encoding device
He et al. Reversible data hiding in JPEG images based on negative influence models
JPH10112796A (ja) Jpeg圧縮を使用して少ないメモリで画像を回転するための装置
JP4019790B2 (ja) 画像処理装置および画像処理プログラム
US20040141655A1 (en) Method and apparatus for image processing
Liu et al. Learnt mutual feature compression for machine vision
CN112449201B (zh) 解码方法、编码方法、相应的装置、电子设备及存储介质
US20020027558A1 (en) Data transfer apparatus and method
CN100396101C (zh) 产生并使用辅助图像的图像压缩设备及其方法
CN113949868B (zh) 一种熵编码方法及装置
TWI384862B (zh) 影像解碼裝置及方法
JP2006005478A (ja) 画像符号化装置及び画像復号装置
US12022078B2 (en) Picture processing method and apparatus
CN111787320B (zh) 一种变换编码系统和方法
JP3781012B2 (ja) 画像データ圧縮方法、画像データ伸長方法、および画像データ伸長回路
JP3954032B2 (ja) 画像符号化装置、画像符号化方法、画像符号化プログラムおよび画像符号化プログラムを記録したコンピュータ読取可能な記録媒体
JPH05298063A (ja) 符号化装置
JPH10116267A (ja) 演算装置及び情報処理装置
JP2004172657A (ja) 画像伸長縮小装置、方法及びプログラム
CN118175340A (zh) 一种图像传输方法与装置
JP2005235029A (ja) 画像縮小方法および装置ならびにプログラム
JP3796235B2 (ja) イメージ圧縮及び復元方法
CN115412727A (zh) 编码方法、解码方法及其装置

Legal Events

Date Code Title Description
DPE2 Request for preliminary examination filed before expiration of 19th month from priority date (pct application filed from 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2007549786

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2005850055

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 2005850055

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 11813388

Country of ref document: US