[go: up one dir, main page]

TW202046727A - Lossless image compression method achieving a high throughput of 6.4G (pixel/sec) and meeting the real-time compression requirements for 4K images - Google Patents

Lossless image compression method achieving a high throughput of 6.4G (pixel/sec) and meeting the real-time compression requirements for 4K images Download PDF

Info

Publication number
TW202046727A
TW202046727A TW108120791A TW108120791A TW202046727A TW 202046727 A TW202046727 A TW 202046727A TW 108120791 A TW108120791 A TW 108120791A TW 108120791 A TW108120791 A TW 108120791A TW 202046727 A TW202046727 A TW 202046727A
Authority
TW
Taiwan
Prior art keywords
pixel
pixels
residual value
pixel group
leaf
Prior art date
Application number
TW108120791A
Other languages
Chinese (zh)
Other versions
TWI709326B (en
Inventor
李宇軒
桂承鴻
高悅展
范姜士松
Original Assignee
元智大學
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 元智大學 filed Critical 元智大學
Priority to TW108120791A priority Critical patent/TWI709326B/en
Application granted granted Critical
Publication of TWI709326B publication Critical patent/TWI709326B/en
Publication of TW202046727A publication Critical patent/TW202046727A/en

Links

Images

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention is a lossless image compression method, including capturing a 16x8 image block and dividing it into root pixels, multiple trunk pixels, multiple branch pixels, multiple left-leaf pixels, multiple right-leaf pixels, and calculating the residual value of the trunk pixels, calculating the residual value of the branch pixels, calculating the residual value of the left-leaf pixels, calculating the residual value of the right-leaf pixels, dividing the 16x8 image block into the original pixels, the first pixel group, the second pixel group, the third pixel group, the fourth pixel group, the fifth pixel group, the sixth pixel group, and the seventh pixel group, setting the encoding header of each pixel group, connecting the root pixels, multiple encoding headers and multiple residual values to generate a compressed data string. Therefore, the lossless image compression method of the present invention can achieve a high throughput of 6.4G (pixel/sec) and can meet the real-time compression requirements for 4K images.

Description

無損影像壓縮方法Lossless image compression method

本發明係有關於一種無損影像壓縮方法,尤其是關於影像無損壓縮以及硬體設計,利用達4K解析度吞吐量且具低複雜度的演算法以滿足4K解析度的吞吐量需求。The present invention relates to a lossless image compression method, in particular to lossless image compression and hardware design, which utilizes 4K resolution throughput and low complexity algorithms to meet 4K resolution throughput requirements.

隨著科技的進步,高清(HD)圖像/視頻已成為一項重要功能現代顯示技術,近來,HD已從1,920×1,080(1080p)提升到3,840×2,160(2160p或4K)。這種趨勢推動了視頻壓縮標準能夠處理高清視頻內容,使得H.264 / AVC被採用為1080p的藍光光盤的視頻壓縮標準。With the advancement of technology, high-definition (HD) images/videos have become an important feature of modern display technology. Recently, HD has been upgraded from 1,920×1,080 (1080p) to 3,840×2,160 (2160p or 4K). This trend has pushed video compression standards to handle high-definition video content, making H.264/AVC adopted as the video compression standard for 1080p Blu-ray Discs.

然而,這種發展趨勢給視頻編碼系統帶來了兩個設計挑戰:大吞吐量和巨大的內存帶寬。雖然通過先進的CMOS工藝和適當的平行處理或pipeline技術可以解決吞吐量巨大的問題,但是上述方法卻無法解決巨大的內存帶寬。理由是,這種設計上的挑戰在於一些內存密集型的視頻編碼過程,例如運動估計,幀內預測和濾波。目前,這個瓶頸可以通過嵌入式壓縮來解決,而其嵌入式壓縮可以分為兩種類型:有損嵌入式壓縮和無損嵌入式壓縮,其中有損嵌入式壓縮產生之誤差會降低視覺效果質量,而無損嵌入式壓縮不僅可以提供可接受的壓縮率,且還能保持視覺質量。However, this development trend brings two design challenges to video coding systems: large throughput and huge memory bandwidth. Although advanced CMOS technology and appropriate parallel processing or pipeline technology can solve the huge throughput problem, the above-mentioned methods cannot solve the huge memory bandwidth. The reason is that the challenge of this design lies in some memory-intensive video coding processes, such as motion estimation, intra prediction and filtering. At present, this bottleneck can be solved by embedded compression, and its embedded compression can be divided into two types: lossy embedded compression and lossless embedded compression. The error generated by lossy embedded compression will reduce the quality of visual effects. The lossless embedded compression can not only provide acceptable compression rates, but also maintain visual quality.

進一步而言,可藉由嵌入式壓縮以減少視頻編碼系統和幀存儲器之間的存儲器帶寬,然而其演算法的吞吐量必須達到能夠支援顯示裝置所能提供的解析度大小。Furthermore, embedded compression can be used to reduce the memory bandwidth between the video encoding system and the frame memory. However, the throughput of the algorithm must be able to support the resolution provided by the display device.

更加具體而言,在影像壓縮中,預測編碼是常用的技術,而且歷史已相當之久,最早可以追溯到40年代提出的Delta編碼(Delta modulation),乃至於到今日我們都還可以常常看到線性預測編碼的技術不斷的改進、革新、強化。簡而言之,預測編碼是屬於時間領域的編碼法。他的基本理念是利用前面已經出現了的符號來預測目前的符號,然後將實際上的符號與預測符號得到預測誤差,將此誤差編碼並送出。More specifically, predictive coding is a commonly used technology in image compression, and it has a long history. It can be traced back to the Delta coding (Delta modulation) proposed in the 1940s, and we can still see it often today. The technology of linear predictive coding is continuously improved, innovated and strengthened. In short, predictive coding is a coding method that belongs to the time domain. His basic idea is to use the symbols that have appeared before to predict the current symbol, and then obtain the prediction error from the actual symbol and the predicted symbol, encode and send the error.

上述預測誤差的編碼法可以採用無失真資料壓縮法或失真資料壓縮法。若採用前者,則整個系統仍然是無失真資料壓所法;反之,若採用後者,則整個系統就成了失真資料壓縮法。因此,預測編碼既是屬於無失真資料壓縮法,也是屬於失真資料壓縮法。使用預測編碼的動機是誤差訊號的變化要比原訊號的變化小許多,因此我們可以使用比較少的位元來為每一個誤差訊號的取樣做編碼以達到資料壓縮的目的。The above-mentioned coding method for the prediction error can be a lossless data compression method or a distortion data compression method. If the former is adopted, the entire system is still a distortion-free data compression method; on the contrary, if the latter is adopted, the entire system becomes a distortion-free data compression method. Therefore, predictive coding is not only a lossless data compression method, but also a distortion data compression method. The motivation for using predictive coding is that the change of the error signal is much smaller than that of the original signal, so we can use fewer bits to encode each error signal sample to achieve the purpose of data compression.

隨著4K解析度的影像漸漸成為主流規格,為滿足吞吐量的需求,習用技術的演算法會導致硬體面積過大,且功率消耗過多,進而造成系統過熱,有當機失效的風險。As 4K resolution images gradually become the mainstream specifications, in order to meet throughput requirements, the algorithms of conventional technologies will cause excessive hardware area and excessive power consumption, which in turn will cause the system to overheat and risk crashes.

再者,現有之影像無損壓縮技術大多無法滿足4K影像的即時壓縮需求,而雖然有少部分演算法技術可滿足即時壓縮,但是壓縮率不足,對內存傳輸頻寬有較大的負擔,常發生資料漏失的問題。Moreover, most of the existing image lossless compression technologies cannot meet the real-time compression requirements of 4K images. Although there are a small number of algorithm technologies that can meet the real-time compression, the compression rate is insufficient, which places a greater burden on the memory transmission bandwidth, which often occurs The problem of missing data.

因此,非常需要一種創新的無損影像壓縮方法,利用複雜度低的演算法,達到高畫質、高吞吐量、無損壓縮、低硬體面積、低功率消耗的具體功效,藉以解決上述習用技術的所有問題。Therefore, there is a great need for an innovative lossless image compression method that uses a low-complexity algorithm to achieve the specific effects of high image quality, high throughput, lossless compression, low hardware area, and low power consumption, so as to solve the above-mentioned conventional technology. All questions.

本發明之主要目的在於提供一種無損影像壓縮方法,利用預測處理及編碼處理以實現無損影像壓縮的功能。具體而言,本發明的無損影像壓縮方法包括擷取輸入影像資料中的16x8影像區塊,當作處理區塊,且處理區塊包含矩陣排列的16x8像素,並接著將處理區塊的所有像素分割成根像素、多個幹像素、多個分枝像素、多個左葉像素及多個右葉像素。The main purpose of the present invention is to provide a lossless image compression method that utilizes prediction processing and encoding processing to realize the function of lossless image compression. Specifically, the lossless image compression method of the present invention includes capturing a 16x8 image block in the input image data as a processing block, and the processing block includes 16x8 pixels arranged in a matrix, and then all pixels of the processing block Divide into root pixels, multiple stem pixels, multiple branch pixels, multiple left leaf pixels, and multiple right leaf pixels.

進一步而言,根像素為該16x8像素中的像素(1,1),是位於處理區塊的左上角,該等幹像素是像素(1,2)至(1,16),該等分枝像素是像素(6,2)至(8,12)的對角線上之像素,該等左葉像素是位於該等分枝像素之左側及該根像素、該等幹像素之間的像素,該等右葉像素是位於該等分枝像素之右側及該等幹像素之間的像素。Furthermore, the root pixel is the pixel (1, 1) in the 16x8 pixel, which is located in the upper left corner of the processing block, and the dry pixels are pixels (1, 2) to (1, 16). The branches Pixels are pixels on the diagonal of pixels (6, 2) to (8, 12). The left-leaf pixels are pixels located to the left of the branch pixels and between the root pixel and the stem pixels. The equal right leaf pixels are pixels located to the right of the branch pixels and between the stem pixels.

然後,對處理區塊中的每個幹像素進行殘值計算以獲得每個幹像素的殘值,且殘值為r ,並表示成r=PC-PL,其中PC為幹像素,而PL為幹像素左側的像素。Then, the residual value of each dry pixel in the processing block is calculated to obtain the residual value of each dry pixel, and the residual value is r, and expressed as r=PC-PL, where PC is the dry pixel and PL is The pixel to the left of the dry pixel.

類似的,對處理區塊中的每個分枝像素進行殘值計算以獲得每個分枝像素的殘值,且殘值為r ,並表示成r=C-PT,其中PC為分枝像素,而PT為分枝像素上方的幹像素。Similarly, calculate the residual value of each branch pixel in the processing block to obtain the residual value of each branch pixel, and the residual value is r, and expressed as r=C-PT, where PC is the branch pixel , And PT is the dry pixel above the branch pixel.

之後,對處理區塊中的每個左葉像素進行殘值計算以獲得每個左葉像素的殘值,且殘值為r,並表示成r=PC-HL1、PC-HL2、PC-HL3的其中之一,其中HL1為(PRT+PT)/2,HL2為(PR+PT)/2,HL3為(PRT+PR)/2,PM為HL1、HL2、HL3中的最小值,而如果PM為HL1,則r為PC-HL1,如果PM為HL2,則r為PC-HL2,如果PM為HL3,則r為PC-HL3。After that, the residual value of each left-leaf pixel in the processing block is calculated to obtain the residual value of each left-leaf pixel, and the residual value is r, which is expressed as r=PC-HL1, PC-HL2, PC-HL3 HL1 is (PRT+PT)/2, HL2 is (PR+PT)/2, HL3 is (PRT+PR)/2, PM is the minimum of HL1, HL2, and HL3, and if PM is HL1, then r is PC-HL1, if PM is HL2, then r is PC-HL2, if PM is HL3, then r is PC-HL3.

對處理區塊中的每個右葉像素進行殘值計算,以獲得每個右葉像素的殘值,且殘值為r,並表示成r=PC-HR1、PC-HR2、PC-HR3的其中之一,其中HR1為(PLT+PT)/2,HR2為(PL+PT)/2,HR3為(PLT+PL)/2,PM為HR1、HR2、HR3中的最小值,而如果PM為HR1,則r為PC-HR1,如果PM為HR2,則r為PC-HR2,如果PM為HR3,則r為PC-HR3。The residual value of each right-leaf pixel in the processing block is calculated to obtain the residual value of each right-leaf pixel, and the residual value is r, which is expressed as r=PC-HR1, PC-HR2, PC-HR3 One of them, where HR1 is (PLT+PT)/2, HR2 is (PL+PT)/2, HR3 is (PLT+PL)/2, PM is the minimum of HR1, HR2, and HR3, and if PM If it is HR1, then r is PC-HR1, if PM is HR2, then r is PC-HR2, if PM is HR3, then r is PC-HR3.

將16x8影像區塊的像素分割成原始像素、第一像素群組、第二像素群組、第三像素群組、第四像素群組、第五像素群組、第六像素群組以及第七像素群組,其中原始像素為根像素,第一像素群組包含所有的幹像素,第二像素群組包含除像素(8,12)以外的所有的分枝像素,第三像素群組包含所有左葉像素中像素(2,1)至像素(8,4)的區塊內之所有像素,第四像素群組包含所有左葉像素中除去第三像素群組以及像素(8,5)至像素(8,11)的橫向排列之所有像素以外的其餘像素,第五像素群組包含所有右葉像素中除去位於像素(5,10)至像素(5,16)下方之所有像素的其餘像素,第六像素群組包含所有右葉像素除去第五像素群組以及像素(8,13)至像素(8,16)的橫向排列像素以外的其餘像素,第七像素群組包含像素(8,1)至像素(8,16)的所有橫向排列的像素。Divide the pixels of the 16x8 image block into original pixels, first pixel group, second pixel group, third pixel group, fourth pixel group, fifth pixel group, sixth pixel group, and seventh pixel group Pixel group, where the original pixel is the root pixel, the first pixel group contains all the dry pixels, the second pixel group contains all the branch pixels except the pixel (8, 12), and the third pixel group contains all All pixels in the block from pixel (2,1) to pixel (8,4) in the left-leaf pixel, the fourth pixel group includes all the left-leaf pixels except the third pixel group and pixels (8,5) to Pixels (8, 11) are arranged horizontally except for all the remaining pixels. The fifth pixel group includes all the right-leaf pixels except for the remaining pixels below the pixel (5, 10) to the pixel (5, 16) , The sixth pixel group includes all right-leaf pixels except the fifth pixel group and the pixels (8, 13) to pixels (8, 16) arranged horizontally except for the remaining pixels. The seventh pixel group includes the pixel (8, 1) All horizontally arranged pixels from pixel (8, 16).

針對每個像素群組,依據每個像素所對應的殘值的絕對值的範圍,設定編碼表頭(header),並以三位元表示該編碼表頭。For each pixel group, a coding header is set according to the absolute value range of the residual value corresponding to each pixel, and the coding header is represented by three bits.

最後,依據預設的排列次序,將根像素、編碼表頭及殘值藉串接而產生16x8影像區塊所對應的壓縮資料串,或稱作位元串。Finally, according to the preset arrangement sequence, the root pixel, the code header and the residual value are concatenated to generate the compressed data string corresponding to the 16x8 image block, or called the bit string.

更加具體而言,上述的排列次序是指由先而後包含根像素、第一像素群組的編碼表頭至第七像素群組的編碼表頭、第一像素群組中每個像素的殘值至第七像素群組中每個像素的殘值。More specifically, the aforementioned arrangement order refers to the first pixel group including the root pixel, the encoding header of the first pixel group to the encoding header of the seventh pixel group, and the residual value of each pixel in the first pixel group. To the residual value of each pixel in the seventh pixel group.

本發明的無損影像壓縮方法可降低內存頻寬,且達成6.4G(pixel/sec)高吞吐量,能滿足4K影像的即時壓縮需求,非常適合應用於需要快速、即時影像壓縮的領域。The lossless image compression method of the present invention can reduce the memory bandwidth, and achieve a high throughput of 6.4G (pixel/sec), can meet the real-time compression requirements of 4K images, and is very suitable for applications that require fast and real-time image compression.

以下配合圖示及元件符號對本發明之實施方式做更詳細的說明,俾使熟習該項技藝者在研讀本說明書後能據以實施。The following is a more detailed description of the implementation of the present invention in conjunction with the drawings and component symbols, so that those who are familiar with the art can implement it after studying this manual.

請參考第一圖,本發明實施例無損影像壓縮方法的操作流程圖。如第一圖所示,本發明的無損影像壓縮方法包括步驟S10、S20、S30、S40、S50、S60、S70、S80,用以對輸入的影像資料進行預測處理及編碼處理而實現無損影像壓縮的功能,可大幅降低所需的內存頻寬,並保持高品質的影像。Please refer to the first figure, which is an operation flowchart of a lossless image compression method according to an embodiment of the present invention. As shown in the first figure, the lossless image compression method of the present invention includes steps S10, S20, S30, S40, S50, S60, S70, S80, which are used to perform prediction processing and encoding processing on the input image data to achieve lossless image compression The function can greatly reduce the required memory bandwidth and maintain high-quality images.

首先,本發明的無損影像壓縮方法是從的步驟S10開始,主要是擷取輸入影像資料中的16x8影像區塊,當作處理區塊,亦即處理區塊包含矩陣排列的16x8像素,並將這些像素分割成不同群組。如第二圖所示,像素(1,1)是位於處理區塊的左上角,稱為根像素RT,像素(1,2)至(1,16)是從相鄰於根像素的像素開始往右到右側邊緣的像素,稱為幹像素T,在像素(6,2)至(8,12)的對角線上之像素是分枝像素B,位於分枝像素左側及根像素、幹像素之間的像素為左葉像素LL,位於分枝像素右側及幹像素之間的像素為右葉像素RL。First of all, the lossless image compression method of the present invention starts from step S10, which mainly captures 16x8 image blocks in the input image data as processing blocks, that is, the processing blocks include 16x8 pixels arranged in a matrix, and These pixels are divided into different groups. As shown in the second figure, the pixel (1, 1) is located in the upper left corner of the processing block, called the root pixel RT, and the pixels (1, 2) to (1, 16) start from the pixels adjacent to the root pixel The pixel on the right to the right edge is called the dry pixel T. The pixel on the diagonal of pixels (6, 2) to (8, 12) is the branch pixel B, which is located on the left side of the branch pixel and the root pixel and the dry pixel The pixel in between is the left leaf pixel LL, and the pixel located to the right of the branch pixel and between the stem pixels is the right leaf pixel RL.

為方便以下說明,如第三圖所示,將像素PC當作目標像素,並將像素PC上方、左側、右側、左上方、右上方的像素分別當作上方像素PT、左側像素PL、右側像素PR、左上方像素PLT、右上方像素PRT。For the convenience of the following description, as shown in the third figure, the pixel PC is regarded as the target pixel, and the pixels above, left, right, upper left, and upper right of the pixel PC are respectively regarded as the upper pixel PT, the left pixel PL, and the right pixel. PR, upper left pixel PLT, upper right pixel PRT.

接著,進入步驟S20,對處理區塊中的每個幹像素T進行殘值計算,以獲得幹像素T的殘值r,且殘值r為PC-PL,其中PC為幹像素,而PL為幹像素左側的像素。Then, go to step S20, perform residual value calculation on each dry pixel T in the processing block to obtain the residual value r of the dry pixel T, and the residual value r is PC-PL, where PC is the dry pixel and PL is The pixel to the left of the dry pixel.

在步驟S30中,對處理區塊中的每個分枝像素B進行殘值計算,以獲得分枝像素B的殘值r,且殘值r為PC-PT,其中PC為分枝像素,而PT為分枝像素上方的幹像素。In step S30, the residual value calculation is performed on each branch pixel B in the processing block to obtain the residual value r of the branch pixel B, and the residual value r is PC-PT, where PC is the branch pixel, and PT is the dry pixel above the branch pixel.

在步驟S40中,對處理區塊中的每個左葉像素LL進行殘值計算,以獲得左葉像素LL的殘值r,且殘值r為PC-HL1、PC-HL2、PC-HL3的其中之一,其中HL1為(PRT+PT)/2,HL2為(PR+PT)/2,HL3為(PRT+PR)/2,此外,PM為HL1、HL2、HL3中的最小值,而如果PM為HL1,則殘值r為PC-HL1,如果PM為HL2,則殘值r為PC-HL2,如果PM為HL3,則殘值r為PC-HL3。In step S40, the residual value of each left-leaf pixel LL in the processing block is calculated to obtain the residual value r of the left-leaf pixel LL, and the residual value r is the value of PC-HL1, PC-HL2, PC-HL3 One of them, where HL1 is (PRT+PT)/2, HL2 is (PR+PT)/2, HL3 is (PRT+PR)/2, and PM is the minimum of HL1, HL2, and HL3, and If PM is HL1, then the residual value r is PC-HL1, if PM is HL2, then the residual value r is PC-HL2, if PM is HL3, then the residual value r is PC-HL3.

在步驟S50中,對處理區塊中的每個右葉像素RL進行殘值計算,以獲得右葉像素RL的殘值r,且殘值r為PC-HR1、PC-HR2、PC-HR3的其中之一,其中HR1為(PLT+PT)/2,HR2為(PL+PT)/2,HR3為(PLT+PL)/2,此外,PM為HR1、HR2、HR3中的最小值,而如果PM為HR1,則殘值r為PC-HR1,如果PM為HR2,則殘值r為PC-HR2,如果PM為HR3,則殘值r為PC-HR3。In step S50, the residual value of each right-leaf pixel RL in the processing block is calculated to obtain the residual value r of the right-leaf pixel RL, and the residual value r is the value of PC-HR1, PC-HR2, PC-HR3 One of them, where HR1 is (PLT+PT)/2, HR2 is (PL+PT)/2, HR3 is (PLT+PL)/2, and PM is the minimum of HR1, HR2, and HR3, and If PM is HR1, then the residual value r is PC-HR1, if PM is HR2, then the residual value r is PC-HR2, if PM is HR3, then the residual value r is PC-HR3.

具體而言,上述的步驟S20、S30、S40、S50屬於預測處理,可獲得每個像素的殘值r。Specifically, the aforementioned steps S20, S30, S40, and S50 belong to the prediction process, and the residual value r of each pixel can be obtained.

之後,進行編碼處理的過程,包含步驟S60、S70、S80。After that, the process of encoding processing includes steps S60, S70, and S80.

首先進入步驟S60,依據第四圖,將16x8影像區塊分割成原始像素R、第一像素群組G1、第二像素群組G2、第三像素群組G3、第四像素群組G4、第五像素群組G5、第六像素群組G6以及第七像素群組G7。具體而言,原始像素R為上述的根像素,第一像素群組G1包含所有的幹像素,第二像素群組G2包含除像素(8,12)以外的所有的分枝像素,第三像素群組G3包含所有左葉像素中像素(2,1)至像素(8,4)的區塊內像素,合計6x4,共24像素,第四像素群組G4包含所有左葉像素中除去第三像素群組G3以及像素(8,5)至像素(8,11)的橫向排列像素以外的其餘像素,第五像素群組G5包含所有右葉像素中除去位於像素(5,10)至像素(5,16)下方之像素的其餘像素,第六像素群組G6包含所有右葉像素除去第五像素群組G5以及像素(8,13)至像素(8,16)的橫向排列像素以外的其餘像素,第七像素群組G7包含像素(8,1)至像素(8,16)的所有橫向排列的像素。First, go to step S60. According to the fourth figure, divide the 16x8 image block into the original pixel R, the first pixel group G1, the second pixel group G2, the third pixel group G3, the fourth pixel group G4, and the fourth pixel group G2. The five pixel group G5, the sixth pixel group G6, and the seventh pixel group G7. Specifically, the original pixel R is the above-mentioned root pixel, the first pixel group G1 includes all dry pixels, the second pixel group G2 includes all branch pixels except the pixel (8, 12), and the third pixel Group G3 includes all the pixels in the block from pixel (2,1) to pixel (8,4) in all the left-leaf pixels, totaling 6x4, a total of 24 pixels, the fourth pixel group G4 includes all the left-leaf pixels except the third Pixel group G3 and pixels (8, 5) to pixels (8, 11) are arranged horizontally except for the remaining pixels. The fifth pixel group G5 includes all the pixels located in the right leaf except for pixels (5, 10) to pixels ( 5, 16) The remaining pixels of the pixels below, the sixth pixel group G6 includes all right-leaf pixels except for the fifth pixel group G5 and the pixels (8, 13) to (8, 16) horizontally arranged. Pixels, the seventh pixel group G7 includes all the pixels arranged horizontally from the pixel (8, 1) to the pixel (8, 16).

在步驟S70中,針對每個像素群組,依據每個像素所對應的殘值的絕對值的範圍,設定編碼表頭(header),並以三位元表示。具體而言,在所有像素的殘值皆為0時,編碼表頭為000;在殘值的絕對值之範圍為0~1時,編碼表頭為001;在殘值的絕對值之範圍為0~3時,編碼表頭為010;在殘值的絕對值之範圍為0~7時,編碼表頭為011;在殘值的絕對值之範圍為0~15時,編碼表頭為100;在殘值的絕對值之範圍為0~31時,編碼表頭為101;在殘值的絕對值之範圍為0~63時,編碼表頭為110;在殘值的絕對值之範圍超出0~63時,編碼表頭為111。In step S70, for each pixel group, according to the absolute value range of the residual value corresponding to each pixel, a coding header is set and represented by three bits. Specifically, when the residual value of all pixels is 0, the coding header is 000; when the absolute value of the residual value is in the range of 0 to 1, the coding header is 001; when the absolute value of the residual value is in the range 0~3, the coding header is 010; when the absolute value of the residual value is in the range of 0-7, the coding header is 011; when the absolute value of the residual value is in the range of 0-15, the coding header is 100 ; When the absolute value of the residual value ranges from 0 to 31, the coding header is 101; when the absolute value of the residual value ranges from 0 to 63, the coding header is 110; when the absolute value of the residual value exceeds the range 0~63, the code header is 111.

在步驟S80中,依據預設的排列次序,將根像素、多個編碼表頭及多個殘值串接而產生16x8影像區塊所對應的壓縮資料串,或稱作位元串(bitstearm),其中預設的排列次序是指由先而後包含根像素、第一像素群組的編碼表頭至第七像素群組的編碼表頭、第一像素群組中每個像素的殘值至第七像素群組中每個像素的殘值。In step S80, the root pixel, multiple encoding headers, and multiple residual values are concatenated according to a preset arrangement order to generate a compressed data string corresponding to a 16x8 image block, or called a bit string (bitstearm) , Wherein the preset arrangement order refers to the first pixel group including the root pixel, the encoding header of the first pixel group to the encoding header of the seventh pixel group, and the residual value of each pixel in the first pixel group to the first pixel group. The residual value of each pixel in the seven-pixel group.

在上述的壓縮資料串中,因每個像素群組的編碼表頭具3位元,因此,第一至第七像素群組的編碼表頭合計為21位元(7x3),而編碼表頭的數值大小是表示像素群組中每個像素的殘值所使用的位元數。簡言之,當編碼表頭的數值較小時,表示像素群組中每個像素的殘值所佔據的位元數也較小。In the above-mentioned compressed data string, since the encoding header of each pixel group has 3 bits, the total encoding headers of the first to seventh pixel groups are 21 bits (7x3), and the encoding header The value of is the number of bits used to represent the residual value of each pixel in the pixel group. In short, when the value of the encoding header is small, it means that the number of bits occupied by the residual value of each pixel in the pixel group is also small.

綜上所述,本發明的特點在於利用影像區快分割、預測處理、編碼處理以具體實現無損(lossless )內埋式壓縮(embedded compression,(EC)的影像壓縮演算法,壓縮率(Compression Ratio,CR)可高達2.24,不僅可節省內存頻寬約55.4%,並能同時保持高品質的影像。舉例而言,如果以CMOS 0.18 um的半導體技術將本發明的方法製作成晶片而運作,則最大吞吐量可達6.4G(pixel/sec),且3,840x2,160@60fps,足可滿足4K影像的即時壓縮需求。In summary, the feature of the present invention lies in the use of image area fast segmentation, prediction processing, and encoding processing to specifically realize lossless (lossless) embedded compression (EC) image compression algorithm, compression ratio (Compression Ratio) , CR) can be as high as 2.24, which not only saves about 55.4% of the memory bandwidth, but also maintains high-quality images. For example, if the method of the present invention is made into a chip using CMOS 0.18 um semiconductor technology, then The maximum throughput can reach 6.4G (pixel/sec) and 3,840x2,160@60fps, which can meet the real-time compression requirements of 4K images.

以上所述者僅為用以解釋本發明之較佳實施例,並非企圖據以對本發明做任何形式上之限制,是以,凡有在相同之發明精神下所作有關本發明之任何修飾或變更,皆仍應包括在本發明意圖保護之範疇。The above descriptions are only used to explain the preferred embodiments of the present invention, and are not intended to limit the present invention in any form. Therefore, any modifications or changes related to the present invention made under the same spirit of the invention , Should still be included in the scope of the invention's intention to protect.

S10、S20、S30、S40:步驟 S50、S60、S70、S80:步驟 R:原始像素 G1:第一像素群組 G2:第二像素群組 G3:第三像素群組 G4:第四像素群組 G5:第五像素群組 G6:第六像素群組 G7:第七像素群組 PC:目標像素, PT:上方像素 PL:左側像素 PR:右側像素 PLT:左上方像素 PRT:右上方像素 RT:根像素 T:幹像素 B:分枝像素 LL:左葉像素 RL:右葉像素S10, S20, S30, S40: steps S50, S60, S70, S80: steps R: raw pixels G1: The first pixel group G2: The second pixel group G3: The third pixel group G4: The fourth pixel group G5: The fifth pixel group G6: The sixth pixel group G7: seventh pixel group PC: target pixel, PT: upper pixel PL: left pixel PR: Right pixel PLT: upper left pixel PRT: upper right pixel RT: Root pixel T: dry pixel B: branch pixel LL: left leaf pixel RL: Right leaf pixel

第一圖顯示依據本發明實施例無損影像壓縮方法的操作流程圖。 第二圖顯示依據本發明實施例無損影像壓縮方法中16x8影像區塊的示意圖。 第三圖顯示依據本發明實施例本發明實施例無損影像壓縮方法中目標像素之相鄰像素的示意圖。 第四圖顯示依據本發明實施例無損影像壓縮方法中分割16x8影像區塊成第一至第七像素群組的示意圖。The first figure shows the operation flowchart of the lossless image compression method according to the embodiment of the invention. The second figure shows a schematic diagram of a 16x8 image block in a lossless image compression method according to an embodiment of the invention. The third figure shows a schematic diagram of adjacent pixels of the target pixel in the lossless image compression method according to the embodiment of the present invention. The fourth figure shows a schematic diagram of dividing a 16x8 image block into first to seventh pixel groups in a lossless image compression method according to an embodiment of the present invention.

S10、S20、S30、S40:步驟 S10, S20, S30, S40: steps

S50、S60、S70、S80:步驟 S50, S60, S70, S80: steps

Claims (2)

一種無損影像壓縮方法,包括: 擷取一輸入影像資料中的16x8影像區塊,當作一處理區塊,該處理區塊包含矩陣排列的16x8像素,並將該處理區塊的所有像素分割成一根像素、多個幹像素、多個分枝像素、多個左葉像素及多個右葉像素,該根像素為該16x8像素中的像素(1,1),是位於該處理區塊的左上角,該等幹像素是像素(1,2)至(1,16),該等分枝像素是像素(6,2)至(8,12)的一對角線上之像素,該等左葉像素是位於該等分枝像素之左側及該根像素、該等幹像素之間的像素,該等右葉像素是位於該等分枝像素之右側及該等幹像素之間的像素; 對該處理區塊中的每個該幹像素進行殘值計算以獲得每個該幹像素的殘值,且該殘值為r ,並表示成r=PC-PL,其中PC為幹像素,而PL為幹像素左側的像素; 對該處理區塊中的每個該分枝像素進行殘值計算以獲得每個該分枝像素的殘值,且該殘值為r ,並表示成r=C-PT,其中PC為分枝像素,而PT為分枝像素上方的幹像素; 對該處理區塊中的每個該左葉像素進行殘值計算以獲得每個該左葉像素的殘值,且該殘值為r,並表示成r=PC-HL1、PC-HL2、PC-HL3的其中之一,其中HL1為(PRT+PT)/2,HL2為(PR+PT)/2,HL3為(PRT+PR)/2,PM為HL1、HL2、HL3中的最小值,而如果PM為HL1,則r為PC-HL1,如果PM為HL2,則r為PC-HL2,如果PM為HL3,則r為PC-HL3; 對該處理區塊中的每個該右葉像素進行殘值計算,以獲得每個該右葉像素的殘值,且該殘值為r,並表示成r=PC-HR1、PC-HR2、PC-HR3的其中之一,其中HR1為(PLT+PT)/2,HR2為(PL+PT)/2,HR3為(PLT+PL)/2,PM為HR1、HR2、HR3中的最小值,而如果PM為HR1,則r為PC-HR1,如果PM為HR2,則r為PC-HR2,如果PM為HR3,則r為PC-HR3; 將該16x8影像區塊的該等像素分割成一原始像素、一第一像素群組、一第二像素群組、一第三像素群組、一第四像素群組、一第五像素群組、一第六像素群組以及一第七像素群組,該原始像素為該根像素,該第一像素群組包含所有的該等幹像素,該第二像素群組包含除像素(8,12)以外的所有的該等分枝像素,該第三像素群組包含所有該等左葉像素中像素(2,1)至像素(8,4)的區塊內之所有像素,該第四像素群組包含所有該等左葉像素中除去該第三像素群組以及像素(8,5)至像素(8,11)的橫向排列之所有像素以外的其餘像素,該第五像素群組包含所有該等右葉像素中除去位於像素(5,10)至像素(5,16)下方之所有像素的其餘像素,該第六像素群組包含所有該等右葉像素除去該第五像素群組以及像素(8,13)至像素(8,16)的橫向排列像素以外的其餘像素,該第七像素群組包含像素(8,1)至像素(8,16)的所有橫向排列的像素; 針對每個該像素群組,依據每個該像素所對應的殘值的一絕對值的範圍,設定一編碼表頭(header),並以三位元表示該編碼表頭;以及 依據預設的一排列次序,將該根像素、該等編碼表頭及該等殘值藉串接而產生該16x8影像區塊所對應的一壓縮資料串,或稱作一位元串(bitstearm), 其中該排列次序是指由先而後包含該根像素、該第一像素群組的編碼表頭至該第七像素群組的編碼表頭、該第一像素群組中每個像素的殘值至該第七像素群組中每個像素的殘值。A lossless image compression method, including: Capture a 16x8 image block in the input image data as a processing block. The processing block contains 16x8 pixels arranged in a matrix, and divides all the pixels in the processing block into one pixel, multiple dry pixels, Multiple branch pixels, multiple left-leaf pixels, and multiple right-leaf pixels, the root pixel is the pixel (1, 1) in the 16x8 pixel, which is located at the upper left corner of the processing block, and the dry pixels are pixels (1, 2) to (1, 16), the branch pixels are pixels on the diagonal of pixels (6, 2) to (8, 12), and the left leaf pixels are located in the branch pixels And the pixels between the root pixel and the stem pixels, and the right leaf pixels are the pixels located on the right side of the branch pixels and between the stem pixels; The residual value of each dry pixel in the processing block is calculated to obtain the residual value of each dry pixel, and the residual value is r, which is expressed as r=PC-PL, where PC is the dry pixel, and PL is the pixel to the left of the dry pixel; Calculate the residual value of each branch pixel in the processing block to obtain the residual value of each branch pixel, and the residual value is r, expressed as r=C-PT, where PC is the branch Pixel, and PT is the dry pixel above the branch pixel; Calculate the residual value of each left-leaf pixel in the processing block to obtain the residual value of each left-leaf pixel, and the residual value is r, which is expressed as r=PC-HL1, PC-HL2, PC -One of HL3, where HL1 is (PRT+PT)/2, HL2 is (PR+PT)/2, HL3 is (PRT+PR)/2, PM is the minimum of HL1, HL2, and HL3, If PM is HL1, then r is PC-HL1, if PM is HL2, then r is PC-HL2, if PM is HL3, then r is PC-HL3; Perform residual value calculation on each right-leaf pixel in the processing block to obtain the residual value of each right-leaf pixel, and the residual value is r, which is expressed as r=PC-HR1, PC-HR2 One of PC-HR3, where HR1 is (PLT+PT)/2, HR2 is (PL+PT)/2, HR3 is (PLT+PL)/2, PM is the minimum of HR1, HR2, and HR3 , And if PM is HR1, then r is PC-HR1, if PM is HR2, then r is PC-HR2, if PM is HR3, then r is PC-HR3; The pixels of the 16x8 image block are divided into an original pixel, a first pixel group, a second pixel group, a third pixel group, a fourth pixel group, and a fifth pixel group, A sixth pixel group and a seventh pixel group, the original pixel is the root pixel, the first pixel group includes all the dry pixels, and the second pixel group includes the sub-pixels (8, 12) All the branch pixels other than the other, the third pixel group includes all the pixels in the block from pixel (2, 1) to pixel (8, 4) in all the left-leaf pixels, the fourth pixel group The group includes all the left-leaf pixels except for the third pixel group and all pixels in the horizontal arrangement of pixels (8, 5) to (8, 11). The fifth pixel group includes all the pixels The remaining pixels of the right-leaf pixels except all the pixels below the pixels (5, 10) to (5, 16), the sixth pixel group includes all the right-leaf pixels, except the fifth pixel group and pixels (8, 13) to pixel (8, 16) other than pixels arranged in the horizontal direction, the seventh pixel group includes all pixels arranged in the horizontal direction from pixel (8, 1) to pixel (8, 16); For each pixel group, according to an absolute value range of the residual value corresponding to each pixel, a coding header is set, and the coding header is represented by three bits; and According to a preset arrangement sequence, the root pixel, the encoding headers, and the residual values are concatenated to generate a compressed data string corresponding to the 16x8 image block, or called a bit string (bitstearm ), The arrangement sequence refers to the order from the root pixel, the encoding header of the first pixel group to the encoding header of the seventh pixel group, the residual value of each pixel in the first pixel group to The residual value of each pixel in the seventh pixel group. 依據申請專利範圍第1項所述之無損影像壓縮方法,其中在設定每個該像素群組的編碼表頭時,如果所有該等像素的殘值皆為0,則該編碼表頭為000;在該殘值的絕對值之範圍為0~1時,該編碼表頭為001;在該殘值的絕對值之範圍為0~3時,該編碼表頭為010;在該殘值的絕對值之範圍為0~7時,該編碼表頭為011;在該殘值的絕對值之範圍為0~15時,該編碼表頭為100;在該殘值的絕對值之範圍為0~31時,該編碼表頭為101;在該殘值的絕對值之範圍為0~63時,該編碼表頭為110;在殘值的絕對值之範圍超出0~63時,該編碼表頭為111。According to the lossless image compression method described in item 1 of the scope of patent application, when the encoding header of each pixel group is set, if the residual value of all the pixels is 0, the encoding header is 000; When the absolute value of the residual value ranges from 0 to 1, the code header is 001; when the absolute value of the residual value ranges from 0 to 3, the code header is 010; in the absolute value of the residual value When the value range is 0~7, the coding header is 011; when the absolute value of the residual value is in the range of 0-15, the coding header is 100; when the absolute value of the residual value is in the range of 0~ At 31 o'clock, the code header is 101; when the absolute value of the residual value is in the range of 0 to 63, the code header is 110; when the absolute value of the residual value exceeds the range of 0 to 63, the code header is Is 111.
TW108120791A 2019-06-14 2019-06-14 Lossless image compression method TWI709326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108120791A TWI709326B (en) 2019-06-14 2019-06-14 Lossless image compression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108120791A TWI709326B (en) 2019-06-14 2019-06-14 Lossless image compression method

Publications (2)

Publication Number Publication Date
TWI709326B TWI709326B (en) 2020-11-01
TW202046727A true TW202046727A (en) 2020-12-16

Family

ID=74202608

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108120791A TWI709326B (en) 2019-06-14 2019-06-14 Lossless image compression method

Country Status (1)

Country Link
TW (1) TWI709326B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5680129A (en) * 1995-07-18 1997-10-21 Hewlett-Packard Company System and method for lossless image compression
US6865298B2 (en) * 2001-03-30 2005-03-08 Sharp Laboratories Of America, Inc. Compound document compression based upon neighboring pixels
AU2007249106B2 (en) * 2007-12-18 2010-11-25 Canon Kabushiki Kaisha A lossless compressor for image data values
JP5051087B2 (en) * 2008-09-30 2012-10-17 ヤマハ株式会社 Lossless compression coding apparatus and lossless decoding apparatus
CN102271251B (en) * 2010-06-02 2013-01-16 华晶科技股份有限公司 Lossless Image Compression Method

Also Published As

Publication number Publication date
TWI709326B (en) 2020-11-01

Similar Documents

Publication Publication Date Title
US10182244B2 (en) Fast encoding loss metric
CN104219525B (en) Perception method for video coding based on conspicuousness and minimum discernable distortion
US10051272B2 (en) Coding structure
US20180309991A1 (en) Video encoding with adaptive rate distortion control by skipping blocks of a lower quality video into a higher quality video
US10616498B2 (en) High dynamic range video capture control for video transmission
TWI634780B (en) Method and apparatus for image compression using block prediction mode
CN104683819A (en) A method and device for adaptive loop filtering
CN103313055B (en) A kind of chroma intra prediction method based on segmentation and video code and decode method
TWI505717B (en) Joint scalar embedded graphics coding for color images
US20200077102A1 (en) FLC-based Image Compression Method and Device
TWI709326B (en) Lossless image compression method
CN106954074B (en) Video data processing method and device
JP6194334B2 (en) Video encoding apparatus, video encoding method, and video encoding program
CN107404650B (en) Pixel-level three-way intra-frame prediction method based on self-adaptive mode selection
CN116320446A (en) Video coding method and device, electronic equipment and computer medium
CN109618155B (en) Compression encoding method
US11871003B2 (en) Systems and methods of rate control for multiple pass video encoding
US12015799B2 (en) Systems and methods for data partitioning in video encoding
US12015801B2 (en) Systems and methods for streaming extensions for video encoding
CN107277508B (en) Pixel-level bidirectional intra-frame prediction method adopting self-adaptive mode selection
CN105763826A (en) Video data input method, video data output method, video data input device, and video data output device
Wu et al. Coordinate Attention-Based Convolution Neural Network for In-loop Filter of AVS3
CN117676143A (en) Encoding and decoding method and device
CN117880512A (en) A multi-temporal layered filtering method, device, equipment and medium for B frame
CN114666586A (en) A Temporal Perceptual Coding Method Based on Transform Block Motion