TWI249290B - Lossless and near lossless image compression and coding methods - Google Patents

Lossless and near lossless image compression and coding methods Download PDF

Info

Publication number
TWI249290B
TWI249290B TW93139460A TW93139460A TWI249290B TW I249290 B TWI249290 B TW I249290B TW 93139460 A TW93139460 A TW 93139460A TW 93139460 A TW93139460 A TW 93139460A TW I249290 B TWI249290 B TW I249290B
Authority
TW
Taiwan
Prior art keywords
value
mode
edge mode
pixel
quantization step
Prior art date
Application number
TW93139460A
Other languages
Chinese (zh)
Other versions
TW200623654A (en
Inventor
Shen-Chuan Tai
Chia-Chi Liu
Original Assignee
Univ Nat Cheng Kung
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 Univ Nat Cheng Kung filed Critical Univ Nat Cheng Kung
Priority to TW93139460A priority Critical patent/TWI249290B/en
Application granted granted Critical
Publication of TWI249290B publication Critical patent/TWI249290B/en
Publication of TW200623654A publication Critical patent/TW200623654A/en

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A lossless and near lossless image compression and coding methods are described. The lossless compression is based on DPCM. The lossless compression is a part of the near-lossless compression. In the near lossless part, an adaptive quantization is used. The proposed lossless algorithm is designed in five modes which are the regular mode, the horizontal edge mode, the vertical edge mode, the diagonal edge mode and the non-edge mode. In quantization, many quantization step sizes are designed, so that the near lossless quantization provides better visual effect when the image is viewed by human.

Description

1249290 九、發明說明: 【發明所屬之技術領域】 本發明是有關於一種數位影像壓縮編碼方法,且特別是 包含了無失真和近無失真壓縮編碼方法。 【先前技術】 隨著電子以及資訊技術的進步,在電腦或各式各樣之電 子裝置上處理以及顯示影像的技術發展也越來越普遍。早期 之電子寅訊技術只能儲存或處理較低畫素之數位影像。然 而’人們對尚品質影像的需求越來越多,如何處理以及儲存 高品質影像也成為非常熱門的重點。高品質影像通常需要儲 存較高的畫素,對於計算機之運算速度以及儲存媒體之容量 也形成一大挑戰。所以,現行的技術利用壓縮以及編碼的技 術來利用最小的運算量以及最小的空間以達到相對高品質 的影像。 影像之壓縮可以分為無失真以及失真壓縮兩大類。在無 失真壓縮演算法中,JPEG-LS是利用預測和前文模式 (context modeling)來達到較好的壓縮比,可是前文模式的使 用,使得整體的運算量和記憶體需求上升。 除此之外,壓縮比相同或相近的影像,利用人類視覺來 直接判斷,影像品質給人的感覺經常會差很多。過去技術可 月色具有賴南的壓縮比,但是其影像品質相對而言不一定那麼 傑出。因此’如何設計一種壓縮編碼演算法,能夠兼顧低運 算複雜度以及高視覺品質,是工業界相當需要的。 1249290 【發明内容】 、因此^發明的目的就是在提供一種無失真壓縮編碼方 法,其計算複雜度和空間複雜度皆比JPEG-LS低。 本1月的另一目的是在提供一種近無失真壓縮編碼方 法,在視覺效果上比:PEG_LS的近無失真效果佳。 本^明❺X -目#是在提供一種近無&真壓縮編碼方 法’使用多個量化步階來維持良好視覺效果。 本發明的又一目的是在提供一種無失真壓縮編碼方法 以及一種近無失真壓縮編碼方法,可以提供高品質之醫學影 像。 〜 根據本發明之上述目的,提出一種無失真壓縮編碼方法 供壓縮一數位影像。此數位影像包括複數個像素,每個像素 以一數值表示。依照本發明一較佳實施例,以數位影像其中 一像素X而言,在無失真壓縮方面是針對影像中邊(以狀)的 特性分成5種模式來做預測,其中包含規律模式(regular mode)、水平邊緣模式(horizontal edge mode)、垂直邊緣模式 (horizontal edge mode)、對角邊緣模式(diagonal edge mode) 和無邊緣模式(non-edge mode)。依照上述5種方法分類之後 再進一步決定X以及X之預測值之間的差值ε。 在編碼方面,首先進行mean=(a + b + c + d)/4之運算。 其中a為一像素數值X左方之像素之數值、b為像素數值X 上方之像素之數值、c為像素數值X左上方之像素之數值且 d為像素數值X右上方之像素之數值。 12492901249290 IX. Description of the Invention: [Technical Field] The present invention relates to a digital image compression coding method, and particularly to a distortionless and near distortionless compression coding method. [Prior Art] With advances in electronics and information technology, technological developments in processing and displaying images on computers or various electronic devices are becoming more and more common. Early electronic video technology only stored or processed digital pixels with lower pixels. However, 'people are increasingly demanding quality images, and how to handle and store high-quality images has become a hot topic. High-quality images often require higher pixel counts, which also poses a challenge to the speed of the computer and the capacity of the storage medium. Therefore, current techniques utilize compression and coding techniques to achieve relatively high quality images with minimal computational effort and minimal space. Image compression can be divided into two categories: no distortion and distortion compression. In the distortion-free compression algorithm, JPEG-LS uses prediction and context modeling to achieve a better compression ratio, but the use of the previous mode makes the overall computational load and memory requirements increase. In addition, images with the same or similar compression are directly judged by human vision, and the image quality often feels a lot worse. In the past, the moonlight has a compression ratio of Lai Nan, but its image quality is not necessarily so outstanding. Therefore, how to design a compression coding algorithm that combines low computational complexity and high visual quality is quite needed in the industry. 1249290 [Invention] Therefore, the object of the invention is to provide a distortionless compression coding method, which has lower computational complexity and space complexity than JPEG-LS. Another purpose of this January is to provide a near-distortion-free compression coding method that is less visually effective than PEG_LS. This ^明❺X-目# is to provide a near-no & true compression coding method using multiple quantization steps to maintain good visual effects. It is still another object of the present invention to provide a distortionless compression coding method and a near distortionless compression coding method which can provide a high quality medical image. According to the above object of the present invention, a distortionless compression coding method is proposed for compressing a digital image. This digital image includes a plurality of pixels, each of which is represented by a numerical value. According to a preferred embodiment of the present invention, in the case of a pixel X of a digital image, in terms of distortion-free compression, the image is divided into five modes for the edge (in the shape of the image), and the regular mode is included. ), horizontal edge mode, horizontal edge mode, diagonal edge mode, and non-edge mode. After the classification according to the above five methods, the difference ε between the predicted values of X and X is further determined. In terms of coding, first perform the operation of mean=(a + b + c + d)/4. Where a is the value of the pixel to the left of a pixel value X, b is the value of the pixel above the pixel value X, c is the value of the pixel above the pixel value X, and d is the value of the pixel above the pixel value X. 1249290

/ 4 &quot; = (|mean'a,+,mean'b| + |mean'C| + dD 碼利用Golomb_Rice編碼方法對數位影像編 、中G〇l〇mb_Rice、編瑪方法選用的m值為 且k的選擇符合·· 太乃 (a&gt;Th!) k=M+l if (a&gt;Th2 ) k= =M if (a》ThM-1 ) k= =3 (GThM) k: :1 k= 1 if else else 其中Μ為正整數,Th!、Th, Th tu上 贸&amp; a μ 化…丁11…1、ThM為預定的臨 界值且 Th】&gt; Th2 &gt; ···&gt; Thw &gt; ThM。 e.根據本發明之目的,提出-種近無失真i縮編碼方法, 供麼縮-數位影像。此數位影像包括複數個像素,每個像素 以一數值表示。依照本發明—較佳實施例,此方法至少包括 下列步驟。首先選定該數位影像之—像素值χ。接著決定該 X是否屬於-規律模式非屬於規律模式,則決 定X是否屬於-水平邊緣模式。接著4χ非屬於水平邊緣 模式,則決^ X是否屬於-垂直邊緣模式。接著,若χ非屬 於垂直邊緣模式,則蚊X是否屬於—對㈣賴式。㈣, 若X非屬於對角邊緣模式,則將χ歸類為—無邊緣模式。 當X屬於規律模式、該水平邊緣模式或㈣直邊緣模式 其中之—時,利用—第—量化階(q職tization step size)進行 量化處理。當X屬於對角邊緣模式時,利用一第二量化階進 1249290 行量化處理。當x屬於無邊緣模式時,利用一第三量化階進 行量化處理。其中第三量化階的量化階值(stepsize)小於第一 量化階的量化階值,且第三量化階的量化階值小於第二量化 階的量化階值。 當X屬於對角邊緣模式、且第二量化階的量化階值大於 一預定臨界值時,可以利用Huffman編碼法對X進行編碼。 本發明至少具有下列優點,其中每一實施例可以具有一 個或多個優點。本發明之無失真壓縮編碼方法,其計算複雜 度和空間複雜度皆比JPEG-LS低。本發明之近無失真壓縮編 碼方法在視覺效果上比JPEG-LS的近無失真效果佳。本發明 之近無失真壓縮編碼方法使用多個量化步階來降低計算複 雜度並維持良好視覺效果。本發明之無失真壓縮編碼方法以 及近無失真壓縮編碼方法可以提供高品質之醫學影像。 【實施方式】 本發明所提出的演算法包含無失真壓縮和近無失真壓 縮,無失真壓縮部分是以DPCM為基礎,用預測方式得到誤 差影像’再將誤差影像做編碼。近無失真壓縮部分,是使用 適應性量化的方式來得到視覺效果較佳的重建影像。而近無 失真壓縮指的是,所有解碼後的灰階值與原灰階值都小於一 個預設值。 首先描述無失真壓縮。第1圖為本發明之無失真壓縮方 法的一範例流程圖。請參照第丨圖,本實施例所提出的無失 真壓縮是針對影像中邊(edge)的特性分成5種模式來做預 1249290 測’其中包含規律模式(regular mode)、水平邊緣模式 (h〇n刪al edge m°de)、垂直邊緣模式(h〇rizontal edge mode)、對角邊緣模式(diag〇nal edge m。㈣和無邊緣模式 (non-edge mode)。 在介紹模式之前,要先介紹像素方向的判斷方式。第2 圖綠示像素方向判斷之示意圖。請參照第2圖,假 在要判斷方向的像素,a,b,,和為v $ 4 / 4 不α马丫的4個相鄰的像素, 、、坐過第3圖的判斷即可得到像素乂的方向,且用d⑺來表示 y :方向。為了方便表示,在以下的文章中,χ用來表示現 正要預測的像素,以來表示χ_ χ周圍相鄰的丨1個像素,如第4圖所示。第二:::: 之像素相關位置圖。 (1) 規律模式 首b糾算“^和㈣方向㈣叫若滿足 ,)=D⑻=D⑷=D⑷,則χ即屬於規律模式(步驟1 〇4), 且 D(X) =D(a) = D(b) = d(c) = D(d),則 γ 认 π , 圖所示。 ⑷則X的預測方式如第5 換^說’在利用G—編碼方法壓縮數位影像 〈刖’決疋a、b、c、d以及古止你 及X的方向(步驟102)。當該a、b、 以及該x的方向均相同時’將X歸類為一規律棋式(牛 :1,請參照第5圖,當X的方向D(x)為右二= =為a;當X的方向D(X)為右下,則X之預測值為c;當 為ΙΓΓΧΧ)1下,則x之預測值為b; tx的方向D(X) 為左下,則X之預測值為d。接著,可以衫X以及x之預 1249290 測值之間的差值ε。X、X之預測值以及差值ε可以供之後 的編碼方法使用。 (2) 水平邊緣模式 若X不符合規律模式,則繼續測試是否滿足水平邊緣模 式(步驟106)。若X滿足(丨e-a丨$ Tnear ) π (丨b_c | ‘ Tnear) Π (|a-c| g Tfar) Π (|e-f| ^ Tfar),則 X 即被 歸類為水平邊緣模式(步驟1〇6),且其預測方式為i μ。換句 話說,若X值屬於水平邊緣模式,將χ之預測值設為a(步驟 108)。其中Tnear以及Tfar為預定之數值。接著,決定X以 及X之預測值之間的差值ε (步驟11〇)。 (3) 垂直邊緣模式 右入不符合以上模式 ,/it 一,〜ΰ挪疋茔直遭緣指 =驟叫若X滿足㈣$ Tnea〇n(丨f_ehT丽 直邊Γΐΐ Ha0 ^ (Μ ^ Tfar),則X即被歸類為連 邊式(步驟112)’且其預測方式為〜驟叫招 MX以及X之預測值之間的差值e(步驟㈣卜 ()對角邊緣模式 *右X不符合規律模式、水平邊緣模式和 二繼續測試是否滿足對角邊緣模式(步驟 ’ 或 |b_a|&gt;Th2,則 χ 二右 X 滿足 驟116)。 貝馮對角邊緣模式(步 3類,如第6圖 nH 3, 4。/ 4 &quot; = (|mean'a,+,mean'b| + |mean'C| + dD code uses the Golomb_Rice encoding method to encode the digital image, the G value of the G〇l〇mb_Rice, and the encoding method And the choice of k is in accordance with ·· too (a&gt;Th!) k=M+l if (a>Th2) k= =M if (a)ThM-1 ) k= =3 (GThM) k: :1 k = 1 if else else where Μ is a positive integer, Th!, Th, Th tu trade &amp; a μ... D11...1, ThM is a predetermined threshold and Th]&gt; Th2 &gt;···&gt; Thw &gt; ThM. e. According to the purpose of the present invention, a near-distortion-free encoding method is provided for a digital-digital image. The digital image includes a plurality of pixels, each pixel being represented by a numerical value. - In a preferred embodiment, the method comprises at least the following steps: first selecting the pixel value 该 of the digital image. Then determining whether the X belongs to the - regular mode is not a regular mode, then determining whether X belongs to the - horizontal edge mode. If it is not in the horizontal edge mode, then whether X is in the - vertical edge mode. Then, if it is not in the vertical edge mode, then whether the mosquito X belongs to - (4) Lai. (4) If X is not in the diagonal edge mode, then χ is classified as - no edge mode. When X belongs to the regular mode, the horizontal edge mode or the (four) straight edge mode, the -first quantization step (q job) Tization step size) performs quantization processing. When X belongs to the diagonal edge mode, a quantization process is performed by using a second quantization step 1249290. When x belongs to the edgeless mode, quantization processing is performed by using a third quantization step. The quantization step of the quantization step is smaller than the quantization step of the first quantization step, and the quantization step of the third quantization step is smaller than the quantization step of the second quantization step. When X belongs to the diagonal edge mode and the second quantization When the quantization step of the order is greater than a predetermined threshold, X can be encoded by Huffman coding. The present invention has at least the following advantages, wherein each embodiment may have one or more advantages. The distortion-free compression coding method of the present invention The computational complexity and spatial complexity are lower than JPEG-LS. The near-distortionless compression coding method of the present invention has better visual effect than JPEG-LS. The near distortionless compression coding method uses multiple quantization steps to reduce computational complexity and maintain good visual effects. The distortionless compression coding method and the near distortionless compression coding method of the present invention can provide high quality medical images. The proposed algorithm includes distortionless compression and near distortionless compression. The distortionless compression part is based on DPCM, and the error image is obtained by prediction mode, and then the error image is encoded. The near-distortion-free compression section uses an adaptive quantization method to obtain a reconstructed image with better visual effects. Near-distortionless compression means that all decoded grayscale values and original grayscale values are less than a preset value. First, the distortion-free compression will be described. Figure 1 is a flow chart showing an example of a distortionless compression method of the present invention. Referring to the figure, the distortion-free compression proposed in this embodiment is divided into five modes for the characteristics of the edge in the image to perform the pre-1249290 measurement, which includes the regular mode and the horizontal edge mode (h〇). n delete al edge m°de), vertical edge mode (h〇rizontal edge mode), diagonal edge mode (diag〇nal edge m. (4) and non-edge mode. Before introducing the mode, first This section describes the judgment of the pixel direction. Figure 2 shows the green pixel direction judgment. Please refer to Figure 2, if you want to judge the direction of the pixel, a, b,, and v $ 4 / 4 The adjacent pixels, and the judgment of Figure 3 can be used to obtain the direction of the pixel ,, and d(7) is used to represent the y: direction. For convenience of representation, in the following article, χ is used to indicate that it is now forecasting The pixel has been represented by 丨 1 pixel adjacent to χ _ ,, as shown in Fig. 4. The pixel-related position map of the second:::: (1) The regular pattern first b corrects the "^ and (four) directions (four) If it is satisfied,) = D (8) = D (4) = D (4), then χ belongs to the regular pattern (step 1 〇 4) , and D(X) = D(a) = D(b) = d(c) = D(d), then γ is recognized as π, as shown in the figure. (4) Then the prediction method of X is as follows: The G-encoding method is used to compress the digital image <刖' to determine a, b, c, d and the direction of you and X (step 102). When the directions of a, b, and x are the same, 'X Classified as a regular chess (Niu: 1, please refer to Figure 5, when the direction of X D (x) is right two = = a; when the direction of X D (X) is the lower right, then the prediction of X The value is c; when ΙΓΓΧΧ)1, the predicted value of x is b; the direction D(X) of tx is the lower left, then the predicted value of X is d. Then, the value of X and x 1249290 can be measured. The difference ε between X and X and the difference ε can be used for the subsequent encoding method. (2) Horizontal edge mode If X does not conform to the regular mode, it continues to test whether the horizontal edge mode is satisfied (step 106). If X satisfies (丨ea丨$ Tnear ) π (丨b_c | ' Tnear) Π (|ac| g Tfar) Π (|ef| ^ Tfar), then X is classified as horizontal edge mode (steps 1〇6) ), and its prediction mode is i μ. In other words, if the X value belongs to the horizontal edge mode, The predicted value of χ is set to a (step 108), where Tnear and Tfar are predetermined values. Next, the difference ε between the predicted values of X and X is determined (step 11 〇). (3) Vertical edge mode right input Does not meet the above pattern, /it one, ~ ΰ 疋茔 遭 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = It is a flank (step 112)' and its prediction mode is the difference e between the predicted values of MX and X. (Step (4) Bu () diagonal edge mode * Right X does not conform to the regular pattern, horizontal edge Mode and 2 continue to test whether the diagonal edge mode is satisfied (step ' or |b_a|&gt;Th2, then 右2 right X satisfies step 116). Bevon's diagonal edge mode (step 3, as shown in Figure 6 nH 3, 4.

在對角邊緣模式中,對角的方向被分為 不。X是屬於哪一種對角方向定義如下’’’’· Stepl:計算 〇1,〇2,03 和 〇4 · 1249290 弟7圖綠示〇 1,02,03和〇4之計算方式。 L ():水平方向誤差的和。 2· 02 (\) ·· -45°方向誤差的和。 3· 03 ():垂直方向誤差的和。 4· 〇4 (/) ·· β方向誤差的和。 steP2:藉由〇1,〇2,〇3和〇4來判斷χ是哪一種角方 向,其判斷方式如第8圖所示。第8圖繪示對角 邊緣模式之範例流程圖。 (5)無邊緣模式 若X都不符合以上模式’則用第9圖來得到乂的預測值。 第9圖繪示無邊緣模式之預測方式。 當X的方向非規律模式、非水平邊緣模式時、非垂直邊 緣模式時、也非對角邊緣模式時,則將χ歸類為無邊緣模式 (步驟118)。利用X之預測值二^:^決定該χ之預測值。 接著,利用G〇l〇mb-Rice編碼方法壓縮數位影像之前,決定 X以及該X之預測值之間的差值ε (步驟11〇)。 以下敘述無失真壓縮編碼。無失真壓縮編碼可以選擇利 用Golomb-Rice編碼方法壓縮該數位影像。其中 Golomb-Rice編碼方法選用的m值為2的k次方,且k的選 擇符合: ' if (a^Th!) 1 else if (a^Th2 ) k=M else if (a^ThM.i ) k=3 π 1249290 else (a^ThM ) k=2 else k=i 為預定的臨界值 其中M為正整數,1%、Th2 Th ^In the diagonal edge mode, the direction of the diagonal is divided into no. X is the diagonal direction defined as follows. 'Step': Step 〇1, 〇2,03 and 〇4 · 1249290 The calculation method of the green maps 1, 02, 03 and 〇4. L (): the sum of the horizontal direction errors. 2· 02 (\) ·· -45° direction error sum. 3· 03 (): The sum of the vertical direction errors. 4· 〇4 (/) ·· The sum of the β direction errors. steP2: 〇1, 〇2, 〇3, and 〇4 determine which angular direction the χ is, and the judgment is as shown in Fig. 8. Figure 8 is a flow chart showing an example of a diagonal edge mode. (5) No edge mode If X does not meet the above mode, then use Figure 9 to get the predicted value of 乂. Figure 9 shows the prediction of the edgeless mode. When the direction of the X is irregular, the non-horizontal edge mode, the non-vertical edge mode, and the non-diagonal edge mode, the χ is classified as the edgeless mode (step 118). The predicted value of X is determined by the predicted value of X^:^. Next, before compressing the digital image by the G〇l〇mb-Rice encoding method, the difference ε between X and the predicted value of the X is determined (step 11〇). The distortionless compression coding is described below. The distortion-free compression coding can optionally compress the digital image using the Golomb-Rice coding method. The Golomb-Rice encoding method uses the m value of 2 to the power of k, and the choice of k is consistent with: ' if (a^Th!) 1 else if (a^Th2 ) k=M else if (a^ThM.i k=3 π 1249290 else (a^ThM ) k=2 else k=i is a predetermined critical value where M is a positive integer, 1%, Th2 Th ^

2··· Um-i、ThM 且 Thi &gt; TI12 &gt; ···&gt; ThM-i〉ThM。 以下舉一例子說明如何實際進行k值得選擇 if (a^Th3 ) k==4 else if (a&gt;Th4 ) k=3 else if (a&gt;Th5 ) k==2 else k=l (Th3 &gt;2··· Um-i, ThM and Thi &gt; TI12 &gt;···&gt; ThM-i>ThM. The following example shows how to actually make k worth choosing if (a^Th3 ) k==4 else if (a&gt;Th4 ) k=3 else if (a&gt;Th5 ) k==2 else k=l (Th3 &gt;

Th4&gt;Th5) 其中Th3、 Th4和Th5是自訂的臨界值。位元串的格式 例如第10圖所示。 以下敘述近無失真壓縮方法。第u圖為本發明之近無失 真壓縮方法的範例流程圖。言青參照帛i i目,在近無失真部 分’篁化的方式是對影像使用乡個量化階(Quantizat— step size),不同區域的1化階都不同,而量化階的使用請參照第 12圖。第12圖繪示本發明之近無失真壓縮方法中量化階分 類方式之示意圖。 如第12圖所示。首先決定X是否屬於一規律模式(步驟 1202)。右X非屬於規律模式,則決定χ是否屬於—水平邊 緣_式(:㈣1204)。若X非屬於水平邊緣模式,則決定χ是 12 1249290 否屬於一垂直邊緣模式(步驟1206)。若X非屬於垂直邊緣模 式’則決定X是否屬於一對角邊緣模式(步驟12〇8)。若X非 屬於對角邊緣模式,則將X歸類為一無邊緣模式(步驟1210)。 畜X屬於規律模式、水平邊緣模式或垂直邊緣模式其中 之日$ ’利用一第一量化階(quantization step size)Ql進行量 化處理(步驟1212)。當X屬於對角邊緣模式時,利用一第二 量化階進行量化處理Q2(步驟1214)。當又屬於無邊緣模式 時,利用一第三量化階進行量化處理q3(步驟1216)。 其中第二罝化階的量化階值(step size)小於第一量化階 的篁化階值,且第三量化階的量化階值小於第二量化階的量 化階值。 第12圖之所以要使用3個量化階,是因為人眼對平滑 區域的失真較複雜區域的失真敏感,而影像令平滑的區域會 被所提出的演算法歸類在無邊緣模式中,複雜區域會歸類1 其他的邊緣模式中,尤其在對角邊緣模式中,所產生的誤差 通常比其他模式還要大。因此,用來量化無邊緣模式的卩3 就可以使用較小的量化階值,而用來量化對角邊緣模式的 就可以使用較大的量化階值,這樣的量化階設定,會使最後 的重建影像在視覺品質上有較好的結果。 以下敘述近無真壓縮編碼方法。近無真壓縮編碼部分使 用Golomb-Rice編碼法和Huffman編碼法這2種方式 13 1249290 (1) G-R編碼法 在位元串編碼部分是用’’Golomb-Rice編碼方法”,, 且所選用的m值為2的冪次方’在無失真壓縮中,k值的選 擇方式為: P(x) : Prediction of X. \P(x) - + \Ρ(χ) - 6| + \Ρ(χ) - c| + \Ρ(χ) ^ d\ &quot; 4 ' ^ 其中Golomb-Rice編碼方法選用 ^用的m值為2的k次方 且k的選擇符合: if (a^Th!) k= :N else if (a&gt;Th2 ) k= =N-1 else if (a2ThN-i ) k= =2 else (PThN) k -1 else 其中N為正整數 k= ,Tin、 =0 Th2-.Th 值且Thl&gt;Th2&gt; 、ThN為預定的臨界 子。 k==2 1 以下舉一個實際的運算例 if (α&gt; Τ6 ) else if (α^ T7 ) 1249290 k=0 (T6&gt;T7) 。位元串的格式如第13 else 其中Th6和Th7是自訂的臨界值 圖所示。 (2) Huffman 編碼法 當X屬於對角彡緣模式、且第二量化階的量化階值大於 預疋臨界值時,可以利用Huffman編碼法對χ進行編碼。 右S化對角邊緣模式的量化階Q2大於一個臨界值,則使用 Huffman編碼會得到較好的結果,所以若Q2&gt;Th8(臨界值), 則使用Huffman來編碼,如第14圖所示。第14圖繪示一位 元串格式之範例。 本發明至少具有下列優點,其中每—實施例可以具有一 個或多個優點。本發明之無失真壓縮編碼方法,其計算複雜 度和空間複雜度皆比JPEG_LS低。本發明之近無失真壓縮編 碼方法在視覺效果上比JPEG_LS的近無失真效果佳。本發明 之近無失真職編财法制乡個量化步階來降低計算複 雜度並維持請視覺效果。本㈣之無失__碼方法以 及近無失真壓縮編碼方法可以提供高品f之醫學影像。 雖然本發明已以-較佳實施例揭露如上,然其並非用以 限定本發明,任何熟習此技藝者,在不脫離本發明之精神和 範圍内’當可作各種之更動與潤飾,因此本發明之保護範圍 當視後附之申請專利範圍所界定者為準。 【圖式簡單說明】 15Th4&gt;Th5) where Th3, Th4 and Th5 are custom thresholds. The format of the bit string is shown in Figure 10. The near-distortionless compression method is described below. Figure u is an exemplary flow chart of the near-no distortion compression method of the present invention. In the near-distortion-free part, the method of using the Quantification is to use the Quantizat-step size for the image, and the different levels of the different regions are different. For the use of the quantization step, please refer to the 12th. Figure. Figure 12 is a diagram showing the quantization step classification method in the near distortionless compression method of the present invention. As shown in Figure 12. First, it is determined whether X belongs to a regular pattern (step 1202). If the right X is not in the regular pattern, it is determined whether the 属于 belongs to the horizontal edge _ ((4) 1204). If X is not in the horizontal edge mode, then it is determined that 12 1249290 belongs to a vertical edge mode (step 1206). If X is not in the vertical edge mode, then it is determined whether X belongs to the pair of corner edge modes (step 12〇8). If X is not in the diagonal edge mode, X is classified as a non-edge mode (step 1210). The animal X belongs to the regular pattern, the horizontal edge mode or the vertical edge mode, wherein the day $' is quantized by a first quantization step size Q1 (step 1212). When X belongs to the diagonal edge mode, quantization processing Q2 is performed using a second quantization step (step 1214). When it is again in the edgeless mode, the quantization process q3 is performed using a third quantization step (step 1216). The quantization step of the second quantization step is smaller than the quantization step of the first quantization step, and the quantization step of the third quantization step is smaller than the quantization step of the second quantization step. The reason why the 12th order is to use three quantization steps is because the human eye is sensitive to the distortion of the smooth region and the distortion of the complex region, and the smooth region of the image is classified by the proposed algorithm in the edgeless mode, which is complicated. Regions are classified 1 In other edge modes, especially in diagonal edge mode, the resulting error is usually larger than in other modes. Therefore, the 卩3 used to quantize the edgeless mode can use a smaller quantization step, and the quantized order can be used to quantize the diagonal edge mode. Such a quantization step setting will make the final Reconstructed images have better results in terms of visual quality. The near-true compression coding method will be described below. The near-true compression coding part uses the Golomb-Rice coding method and the Huffman coding method. 13 1249290 (1) The GR coding method uses the ''Golomb-Rice coding method' in the bit string coding part, and is selected. The m value is a power of 2'. In distortion-free compression, the value of k is chosen as: P(x) : Prediction of X. \P(x) - + \Ρ(χ) - 6| + \Ρ( χ) - c| + \Ρ(χ) ^ d\ &quot; 4 ' ^ where the Golomb-Rice encoding method uses ^ with a m value of 2 for the power of k and the choice of k matches: if (a^Th!) k= :N else if (a&gt;Th2 ) k= =N-1 else if (a2ThN-i ) k= =2 else (PThN) k -1 else where N is a positive integer k= , Tin, =0 Th2- .Th value and Thl>Th2&gt;, ThN is a predetermined critical value. k==2 1 The following is an actual operation example if (α> Τ6) else if (α^ T7 ) 1249290 k=0 (T6&gt;T7) The format of the bit string is as in the 13th Else where Th6 and Th7 are the custom threshold values. (2) Huffman coding method when X belongs to the diagonal edge mode, and the quantization step of the second quantization step is larger than the pre- When the threshold is 疋, the Huffman coding method can be used to encode χ. If the quantization step Q2 of the edge mode is greater than a critical value, the Huffman coding will get better results, so if Q2>Th8 (threshold value), use Huffman to encode, as shown in Figure 14. Figure 14 shows An example of a one-bit string format. The present invention has at least the following advantages, wherein each of the embodiments may have one or more advantages. The distortion-free compression coding method of the present invention has lower computational complexity and spatial complexity than JPEG_LS. The near-distortion-free compression coding method of the invention has better visual effect than the JPEG_LS, and has no distortion effect. The near-distortion-free code-making method of the invention has a quantization step to reduce the computational complexity and maintain the visual effect. (4) The __code method and the near-distortionless compression coding method can provide a medical image of a high quality product. Although the invention has been disclosed above in the preferred embodiment, it is not intended to limit the invention, and anyone skilled in the art The scope of the invention is defined by the scope of the appended claims, without departing from the spirit and scope of the invention. Subject to the rules. [Simplified illustration] 15

Claims (1)

1249290 十、申請專利範圍: 1.種無失真壓縮編碼方法,供壓縮編碼一數位影像, 該數位影像包含複數個像素,每個像相—數值表示’,該方 法至少包含: 進行mean=(a + b + c + d)/4之運算,其中a為一像素數 值X左方之像素之數U為該像素數值X上方之像素之數 值、c為㈣錄值X左上方之料之數值且d為該像素數 值X右上方之像素之數值; 進行 π (jmean-a卜丨mean_b卜丨mean c卜丨mean d丨)/ 4 之運算;以及 利用G〇1〇mb-RiCe編喝方法對該數位影像編碼’其中該 擇符合 • if (a^Th!) k-M+1 else if (a^Th2 ) k二 M else if (a^ThM.i ) k-3 else (a^ThM ) k二 2 else k=i 其中M為正整數,Th 、Th2...Th 且Th! &gt; ΊΠ12〉.··〉ThM_i &gt;ThM。 、ThM為預定的臨界值 2·如申請專利範圍第丨項新、&gt; 員所迷之無失真壓縮編碼方 法,更包含: 17 1249290 在利用G〇l〇mb-Rice編碼方法對該數位影 前,決定該a、b、c、d以及該χ的方 ,、爲石馬之 的判斷包含: 〃中該X的方向 當該a、b、c、d以及該χ的方向均相 X歸類為一規律模式; 析5亥 當該X的方向為右’則該χ之預測值為a; 當該X的方向為右下,則該χ之預測值為c; 當該X的方向為下,則該χ之預測值為b;以及 當該X的方向為左下,卩j _ r則4 x之預測值為d; 以及 在利用 Golomb-Rice 绝 士、i ,· Klce、編㉟方法對該數位影像編碼之 前,決疋該x以及該x之預測值之間的差值ε。 3·如申請專利範圍第2 ^^ ^ ^八 弟2項所述之無失真壓縮編碼方 法,更包含: 當該χ的方向非規律模式時,決定該χ是否符合 邊緣模式,其中該水平邊緣模式之判斷包含: 若X滿足(丨e-a丨c下”、 门,· 1 = Tnear )门(I b-C I s Tnear ) Π ( |a-c| ^ Tfar )门…。、 .^ T # (|e_fl - Tfar ),則將 X 歸類 為水平邊緣模式,t中 &quot; 為&amp;之左方之像素之數值、f 二上方之像素之數值、了咖以及衡為預定之數值; 右遠X值屬於該水平邊绥捃二、 以及 %緣模式,將該X之預測值設為a; 在利用Golomb-Rice绝M 、4喝方法對該數位影像編碼之 18 1249290 前,決定該X以及該X之預測值之間的差值ε 4·如申請專利範圍$ 3項所述之無失真壓縮編石馬方 法,更包含: 當該X的方向非規律模式、也非水平邊緣模式時,決定 該X是否符合一垂直邊緣模式,其中該垂直邊緣模式之判斷 包含: 若 X 滿足 X 滿足(| c-a I S f_e i s Tnear )门(|e-a| ^ Tfar )门(丨b_c| - Tfar ),則將 χ 歸類為垂直邊緣模式; 當該X屬於該垂直邊緣模式時,將該χ之預測值設為 b;以及 义在利用G〇1〇mb-Rice編碼方法對該數位影像編碼之 前,決定該X以及該X之預測值之間的差值£。 5.如申請專利範圍第4項所述之無失真壓縮編碼方 法,更包含: 田該X的方向非規律模式、非水平邊緣模式時、也非垂 =^模式時,決㈣符合—對角邊緣模式,其中該 對角邊緣模式之判斷包含: 斜Λχ滿足丨d-a|&gt;Thl或丨M&gt;Th2,則將χ歸類為 子角邊緣模式,其中TM、Th2為狀的數值; 依對角邊緣模式決定該X之預測值;以及 在利用G0l0mb-Rice、編碼方法對該數位影像編碼之 1249290 前,決定該x以及該x之預測值之間的差值ε 6·如申印專利目帛5工員所述之無&amp;真壓縮編碼方 法,更包含: 當該X的方向非規律模式、非水平邊緣模式時、非垂直 邊緣模式時、也Μ角邊緣模式時,縣㈣類為無邊緣模 式; 利用1249290 X. Patent application scope: 1. A distortion-free compression coding method for compression-encoding a digital image, the digital image comprising a plurality of pixels, each image phase-value representation ', the method at least comprising: performing mean=(a + b + c + d) / 4 operation, where a is a pixel value X The number of pixels on the left side U is the value of the pixel above the pixel value X, and c is the value of the material on the upper left of the (4) record value X and d is the value of the pixel at the upper right of the pixel value X; performing the operation of π (jmean-a 丨 丨 mean_b 丨 mean c c丨 mean d 丨) / 4; and using the G 〇 1 〇 mb-RiCe compiling method The digital image encoding 'where the choice is met • if (a^Th!) k-M+1 else if (a^Th2 ) k two M else if (a^ThM.i ) k-3 else (a^ThM ) k 2 2 else k=i where M is a positive integer, Th , Th2...Th and Th! &gt; ΊΠ12>.··〉ThM_i &gt;ThM. ThM is a predetermined threshold value. 2. For example, the patent application scope is new, and the distortion-free compression coding method is fascinated by the member, and further includes: 17 1249290 The digital image is processed by using the G〇l〇mb-Rice coding method. Before, the a, b, c, d and the side of the scorpion are determined, and the judgment of the stone horse includes: the direction of the X in the 当 when the directions of the a, b, c, d and the χ are X The class is a regular pattern; the analysis of 5 Hai when the direction of the X is right' then the predicted value of the χ is a; when the direction of the X is the lower right, the predicted value of the χ is c; when the direction of the X is Next, the predicted value of the χ is b; and when the direction of the X is the lower left, 卩j _ r is the predicted value of 4 x; and in the method of using Golomb-Rice, i, Klce, 35 Before encoding the digital image, the difference ε between the x and the predicted value of the x is determined. 3. The non-distortion compression coding method described in the 2nd application of the patent scope 2^^^^8, further includes: when the direction of the χ is irregular, determining whether the 符合 conforms to the edge mode, wherein the horizontal edge The judgment of the mode includes: If X satisfies (丨ea丨c下, gate, · 1 = Tnear) gate (I bC I s Tnear ) Π ( |ac| ^ Tfar ) gate...., .^ T # (|e_fl - Tfar ), X is classified as horizontal edge mode, t is the value of the pixel on the left of & the value of the pixel above the f, the value of the pixel above f, the value of the coffee and the balance is the predetermined value; It belongs to the horizontal edge 2 and the % edge mode, and the predicted value of X is set to a; the X and the X are determined before the encoding of the digital image by the Golomb-Rice absolute M and 4 drinking methods. The difference between the predicted values ε 4 · The non-distortion-compressed stone-horse method as described in claim 3, further includes: when the direction of the X is irregular and not horizontal, Whether X conforms to a vertical edge mode, wherein the determination of the vertical edge mode includes: X satisfies the X satisfies the (| ca IS f_e is Tnear ) gate (|ea| ^ Tfar ) gate (丨b_c| - Tfar ), and classifies χ as the vertical edge mode; when the X belongs to the vertical edge mode, The predicted value of the χ is set to b; and the difference between the predicted value of the X and the X is determined before the digital image is encoded by the G〇1〇 mb-Rice encoding method. The distortion-free compression coding method according to Item 4 of the scope further comprises: when the direction of the X is irregular, when the non-horizontal mode is not, and when the mode is not vertical, the (four) conforms to the diagonal edge mode, wherein the The judgment of the diagonal edge mode includes: If the skew satisfy 丨da|&gt;Thl or 丨M&gt;Th2, the χ is classified into a sub-edge edge mode, wherein TM and Th2 are values; the diagonal edge mode determines the The predicted value of X; and before the 1249290 encoding the digital image by the G0l0mb-Rice, the encoding method determines the difference between the predicted value of the x and the x ε 6 · as described in the patent application 5 The no-true compression encoding method, more includes: when the direction of the X In the irregular mode, the non-horizontal edge mode, the non-vertical edge mode, and the corner edge mode, the county (four) class is the edgeless mode; X之預測值 決定該X之預測值;以及 在利用Golomb_Rice編碼方法對 a 1〜&amp; *對S數位影像編碼戈 刖,決疋該X以及該X之預測值之間的差值£。 7. -種近無失真壓縮編碼方法,供壓縮編碼—數位影 像,該數位影像包含複數個像素,每個像素以—數值表示, 該方法至少包含:The predicted value of X determines the predicted value of X; and encodes the S digital image with a Golomb_Rice encoding method, and determines the difference between the predicted value of X and the X. 7. A near distortionless compression coding method for compression coding - digital image, the digital image comprising a plurality of pixels, each pixel being represented by a value, the method comprising at least: 選定該數位影像之一像素值χ; 決定該X是否屬於一規律模式 則決定該X是否屬於一水 若該X非屬於該規律模式 平邊緣模式; 則決定該X是否屬於 若該X非屬於該水平邊緣模式 一垂直邊緣模式; 20 1249290 則決定該χ是否屬於 若該χ非屬於該垂直邊緣模式 一對角邊緣模式; 若該X非屬於該對角邊緣模式,則將該乂歸類為1 邊緣模式; 該水平邊緣模式或該垂直邊緣 里化階(quantization step Size) 當該X屬於該規律模式、 模式其中之一時,利用一第一 進行量化處理’Selecting one of the digital image pixel values χ; determining whether the X belongs to a regular pattern determines whether the X belongs to a water if the X does not belong to the regular mode flat edge mode; determining whether the X belongs to the X if the X belongs to the Horizontal edge mode-vertical edge mode; 20 1249290 determines whether the 属于 belongs to a pair of angular edge modes if the 垂直 does not belong to the vertical edge mode; if the X does not belong to the diagonal edge mode, the 乂 is classified as 1 Edge mode; the horizontal edge mode or the quantization step size when the X belongs to the regular mode, one of the modes, using a first quantization process 當該X屬於該對角邊緣模式時,利用一第二量化階進行 量化處理;以及 當該X屬於該無邊緣模式時,利用一第三量化階進行量 化處理;When the X belongs to the diagonal edge mode, the quantization process is performed by using a second quantization step; and when the X belongs to the edgeless mode, the quantization process is performed by using a third quantization step; 其中δ亥第二篁化階的量化階值(step size)小於該第一量 化階的量化階值,且該第三量化階的量化階值小於該第二量 化階的量化階值。 8·如申請專利範圍第7項所述之近無失真壓縮編碼方 法,更包含: 進行 α== 二之運算,其中 3為 一像素數值χ左方之像素之數值、b為該像素數值χ上方之 21 1249290 像素之數值、C為該像素數值χ左上方之像素之數值且d為 該像素數值X右上方之像素之數值,ρ(χ)為X的預測值;以 及 利用Golomb-Rice編碼方法壓縮該數位影像,其中該 Golomb-Rice編碼方法選用的111值為2的]^次方,且k的選 擇符合: if (a^Th1 ) k=N else if (a&gt;Th2 ) k^N-1 else if (a&gt;ThN^ ) k=2 else (a^ThN ) k==l else k=〇 其中N為正整數,Th,、rp, 1 Th2&quot;,ThN-l、ThN為預定的臨界 值且 ΤΙιθΤΙ^···〉!^ ^%。 9’如申請專利_第7項所述之近無失真壓縮編碼方 法,更包含: 當該X屬於該對角邊緣模式、且該第二量化階的量化階 值大於一預定臨界值時,利 用Huffman編碼法對該χ進行編 碼0 22The quantization step of the second quantization step is smaller than the quantization step of the first quantization step, and the quantization step of the third quantization step is smaller than the quantization step of the second quantization step. 8. The near-distortionless compression coding method as described in claim 7 of the patent application scope, further comprising: performing an operation of α== two, wherein 3 is a pixel value 数值 a value of a pixel on the left side, and b is a value of the pixel χ The value of 21 1249290 pixels above, C is the value of the pixel at the top left of the pixel value and d is the value of the pixel at the top right of the pixel value X, ρ(χ) is the predicted value of X; and is encoded by Golomb-Rice The method compresses the digital image, wherein the Golomb-Rice encoding method uses a 111 value of 2^^^^^, and the choice of k is consistent with: if (a^Th1) k=N else if (a>Th2) k^N -1 else if (a&gt;ThN^ ) k=2 else (a^ThN ) k==l else k=〇 where N is a positive integer, Th, rp, 1 Th2&quot;, ThN-l, ThN are predetermined The critical value is ΤΙιθΤΙ^···〉! ^ ^%. 9: The near distortion-free compression coding method according to claim 7, further comprising: when the X belongs to the diagonal edge mode, and the quantization step of the second quantization step is greater than a predetermined threshold, Huffman coding encodes this 0 0 22
TW93139460A 2004-12-17 2004-12-17 Lossless and near lossless image compression and coding methods TWI249290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW93139460A TWI249290B (en) 2004-12-17 2004-12-17 Lossless and near lossless image compression and coding methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW93139460A TWI249290B (en) 2004-12-17 2004-12-17 Lossless and near lossless image compression and coding methods

Publications (2)

Publication Number Publication Date
TWI249290B true TWI249290B (en) 2006-02-11
TW200623654A TW200623654A (en) 2006-07-01

Family

ID=37429520

Family Applications (1)

Application Number Title Priority Date Filing Date
TW93139460A TWI249290B (en) 2004-12-17 2004-12-17 Lossless and near lossless image compression and coding methods

Country Status (1)

Country Link
TW (1) TWI249290B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8509553B2 (en) 2009-01-07 2013-08-13 Industrial Technology Research Institute DPCM-based encoder, decoder, encoding method and decoding method
TWI564837B (en) * 2015-11-04 2017-01-01 上海兆芯集成電路有限公司 Graphics data compression device and graphics data compression method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SG10201707023VA (en) 2012-04-15 2017-10-30 Samsung Electronics Co Ltd Parameter update method for entropy coding and decoding of conversion coefficient level, and entropy coding device and entropy decoding device of conversion coefficient level using same

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8509553B2 (en) 2009-01-07 2013-08-13 Industrial Technology Research Institute DPCM-based encoder, decoder, encoding method and decoding method
TWI564837B (en) * 2015-11-04 2017-01-01 上海兆芯集成電路有限公司 Graphics data compression device and graphics data compression method
US10304212B2 (en) 2015-11-04 2019-05-28 Via Alliance Semiconductor Co., Ltd. Graphic data compression device and graphic data compression method

Also Published As

Publication number Publication date
TW200623654A (en) 2006-07-01

Similar Documents

Publication Publication Date Title
KR101874102B1 (en) Method and apparatus for video intra prediction encoding, and computer readable medium
WO2010052833A1 (en) Image encoding device and image decoding device
CN107251557A (en) The coding/decoding of chrominance resolution details
CN107211150A (en) Dynamic updates quality to higher chroma samples rate
JP2017538381A (en) Inter-component prediction in video coding.
WO2007072895A1 (en) In-screen prediction mode decision method, image encoding method, and image encoding device
TWI718084B (en) Picture encoding apparatus, dynamic picture decoding apparatus, and dynamic picture encoding data
KR101261676B1 (en) Method of encoding an image and device implementing said method
RU2567988C2 (en) Encoder, method of encoding data, decoder, method of decoding data, system for transmitting data, method of transmitting data and programme product
KR20170026387A (en) Method and apparatus for predicting image samples for encoding or decoding
JP2003517796A (en) How to reduce the &#34;uneven picture&#34; effect
Kumar et al. Human visual system based enhanced AMBTC for color image compression using interpolation
TWI249290B (en) Lossless and near lossless image compression and coding methods
Wang et al. Adaptive multi-level block truncation coding for frame memory reduction in LCD overdrive
JP4833309B2 (en) Video compression encoding device
JP2003087572A (en) Method and device for compressing image, image compression program and image processor
JP2015019364A (en) Image compression apparatus and method
JP4510701B2 (en) Video encoding device
TW200838319A (en) Scalable encoding method and apparatus, scalable decoding method and apparatus, programs and storage media therefor
JP2001076166A (en) Encoding method of animation dynamic image
JP4147789B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP2009071472A (en) Image encoding method, image decoding method, image encoder, image decoder and semiconductor integrated circuit
CN109314787A (en) Enhancement layer masking for high dynamic range video coding
WO2016176849A1 (en) Self-adaptive motion estimation method and module
JP2004135254A (en) Image processing unit

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees