[go: up one dir, main page]

TWI432031B - Distortion-free image compression method - Google Patents

Distortion-free image compression method Download PDF

Info

Publication number
TWI432031B
TWI432031B TW99117839A TW99117839A TWI432031B TW I432031 B TWI432031 B TW I432031B TW 99117839 A TW99117839 A TW 99117839A TW 99117839 A TW99117839 A TW 99117839A TW I432031 B TWI432031 B TW I432031B
Authority
TW
Taiwan
Prior art keywords
pixels
distortion
image
compression method
pixel
Prior art date
Application number
TW99117839A
Other languages
Chinese (zh)
Other versions
TW201146017A (en
Inventor
Chen Hung Chan
Hong Long Chou
Original Assignee
Altek Corp
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 Altek Corp filed Critical Altek Corp
Priority to TW99117839A priority Critical patent/TWI432031B/en
Publication of TW201146017A publication Critical patent/TW201146017A/en
Application granted granted Critical
Publication of TWI432031B publication Critical patent/TWI432031B/en

Links

Landscapes

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

Description

無失真的影像壓縮方法Imageless compression method

本發明係關於一種無失真的影像壓縮方法,尤其是一種需要較少記憶體空間的無失真的影像壓縮方法。The present invention relates to a distortion-free image compression method, and more particularly to a distortion-free image compression method that requires less memory space.

隨著電子以及資訊技術的進步,在電腦或各式各樣之電子裝置上處理以及顯示影像的技術發展也越來越普遍。早期之電子資訊技術只能儲存或處理較低畫素之數位影像。然而,人們對高品質影像的需求越來越多,如何處理以及儲存高品質影像也成為非常熱門的重點。為了得到高品質影像,在進行影像壓縮時常採用無失真的壓縮方式。With advances in electronics and information technology, technological advances in processing and displaying images on computers or a wide variety of electronic devices are becoming more common. Early electronic information technology could only store or process digital pixels with lower pixels. However, there is an increasing demand for high-quality images, and how to handle and store high-quality images has become a hot topic. In order to obtain high-quality images, distortion-free compression is often used for image compression.

然而無失真之高品質影像需要儲存較高的畫素,對於計算機之運算速度以及儲存媒體之容量也形成一大挑戰。例如在無失真壓縮演算法中,無失真靜態影像壓縮標準(Joint photographic experts group Lossless,JPEG-LS)是利用預測和前文模式(context modeling)來達到較好的壓縮比。前文模式係需要至少暫存影像的一整排的像素才能夠進行各種模式下的預測,因此需要大量的運算和儲存空間,而使得編碼器(encoder)所需的成本上升。且JPEG-LS對於不需要高壓縮率的應用來說,演算複雜度還是較高,而增加編碼器的負擔。However, high-quality images without distortion need to store higher pixels, which poses a challenge to the computing speed of the computer and the capacity of the storage medium. For example, in the distortion-free compression algorithm, the Joint photographic experts group Lossless (JPEG-LS) uses prediction and context modeling to achieve a better compression ratio. The former mode requires a full row of pixels of the temporary image to be able to perform prediction in various modes, thus requiring a large amount of computation and storage space, and the cost required for the encoder is increased. And JPEG-LS has a higher computational complexity for applications that do not require high compression ratios, and increases the burden on the encoder.

再加上使用者對於影像的解析度的要求越來越高,亦增加了影像壓縮時的負擔。若使用習知的無失真的壓縮方式,一旦影像的解析度提高,編碼器更得要耗費漫長的時間以及更大量的儲存空間才能處理為高品質影像。換句話說,習知的無失真的壓縮方式具有運算複雜度太高而導致運算效率低落,以及所需暫存空間龐大的問題。In addition, the user's requirements for image resolution are getting higher and higher, and the burden on image compression is also increased. If the conventional distortion-free compression method is used, once the resolution of the image is increased, the encoder takes a long time and a large amount of storage space to be processed into a high-quality image. In other words, the conventional distortion-free compression method has a problem that the computational complexity is too high, resulting in low computational efficiency, and a large amount of temporary storage space.

因此,如何設計一種無失真的壓縮方法,能夠兼顧高視覺品質、低運算複雜度以及低暫存空間之需求是工業界相當重要的。Therefore, how to design a distortion-free compression method that is capable of balancing high visual quality, low computational complexity, and low temporary storage space is quite important in the industry.

為解決上述問題,本發明提供一種無失真(lossless,亦稱為無損)的影像壓縮方法。無失真的影像壓縮方法僅需使用較少的記憶體空間,且能以較快的速度處理具有多個像素的一影像。其中影像的一影像寬度為W。無失真的影像壓縮方法包括下述步驟:(a)由影像中選取連續的N個像素,其中N為大於或等於2的正整數,且N小於影像寬度W;(b)執行一差異脈波碼調變(Differential pulse code modulation,DPCM)手段,以依據此N個像素的值,得到對應此N個像素的N個非負數差值;(c)依據此N個非負數差值,計算得到一編碼參數(coding parameter);以及(d)依據編碼參數,將此N個非負數差值進行編碼。In order to solve the above problems, the present invention provides a lossless (also known as lossless) image compression method. The distortion-free image compression method requires less memory space and can process an image with multiple pixels at a faster rate. The image has an image width of W. The distortion-free image compression method comprises the following steps: (a) selecting successive N pixels from the image, wherein N is a positive integer greater than or equal to 2, and N is smaller than the image width W; (b) performing a differential pulse wave Differential pulse code modulation (DPCM) means to obtain N non-negative difference values corresponding to the N pixels according to the values of the N pixels; (c) calculating according to the N non-negative difference values a coding parameter; and (d) encoding the N non-negative differences according to the coding parameters.

為了壓縮整張影像,無失真的影像壓縮方法另可包括下述步驟:(e)接續選取影像的下N個連續的像素;以及(f)返回步驟(b),直到壓縮完影像的所有像素。In order to compress the entire image, the distortion-free image compression method may further comprise the steps of: (e) successively selecting the next N consecutive pixels of the image; and (f) returning to step (b) until all pixels of the image are compressed. .

其中步驟(a)可由一暫存器直接接收影像中被選取的N個像素。Wherein step (a) can directly receive the selected N pixels in the image by a temporary register.

而步驟(b)之差異脈波碼調變手段可包括:依據此N個像素的值,得到個別對應於此N個像素的N個像素差值;以及個別對此N個像素差值執行一變換(mapping)手段,以得到個別對應於此N個像素差值的N個非負數差值。The differential pulse code modulation means of the step (b) may include: obtaining N pixel difference values corresponding to the N pixels according to the values of the N pixels; and performing an individual for the N pixel difference values. Mapping means to obtain N non-negative difference values that individually correspond to the N pixel difference values.

根據本發明之一實施範例,「依據此N個像素的值,得到個別對應於此N個像素的N個像素差值」的步驟可包括:將此N個像素中的第一個像素的值P0 作為第一個像素差值d0 ;以及分別計算此N個像素中的第i個像素的值Pi 與其前一個像素的值Pi-1 的差,作為其他N-1個像素差值,其中i為正整數,且0<i<N。According to an embodiment of the present invention, the step of: obtaining N pixel difference values corresponding to the N pixels according to the values of the N pixels may include: determining a value of the first pixel of the N pixels P 0 is the first pixel difference value d 0 ; and the difference between the value P i of the ith pixel of the N pixels and the value P i-1 of the previous pixel is calculated as the other N-1 pixel differences Value, where i is a positive integer and 0 < i < N.

變換手段則可包括:當此N個像素差值中的第i個像素差值di 大於或等於零時,對應的第i個非負數差值ni 為像素差值di 乘以2,其中0<=i=N;以及當此N個像素差值中的第i個像素差值di 小於零時,對應的第i個非負數差值ni 為像素差值di 乘以2再減1。The transforming means may further include: when the ith pixel difference value d i of the N pixel difference values is greater than or equal to zero, the corresponding ith non-negative number difference value n i is the pixel difference value d i multiplied by 2, wherein 0<=i=N; and when the i-th pixel difference d i of the N pixel difference values is less than zero, the corresponding i-th non-negative difference value n i is the pixel difference value d i multiplied by 2 Minus 1.

用以編碼此N個非負數差值的編碼參數可以是,其中ni 為此N個非負數差值中的第i個非負數差值。The encoding parameter used to encode the N non-negative difference values may be Where n i is the ith non-negative difference in the N non-negative difference values.

而上述步驟(d)可包括:依據編碼參數,以哥倫布-萊斯編碼(Golomb-Rice code)將此N個非負數差值進行編碼。The above step (d) may include: encoding the N non-negative difference values by a Golomb-Rice code according to the encoding parameters.

綜上所述,根據本發明之無失真的影像壓縮方法選取影像中的N個像素,並以可變長度編碼將此N個像素的值編碼。處理此N個像素時並不需要用到影像中的其他像素,因此編碼器之暫存器不需保存其他像素的值。故無失真的影像壓縮方法具有節省大量的暫存空間,且壓縮方式簡單有效率等優點。In summary, the distortion-free image compression method according to the present invention selects N pixels in the image and encodes the values of the N pixels by variable length coding. The processing of the N pixels does not require the use of other pixels in the image, so the encoder's scratchpad does not need to save the values of other pixels. Therefore, the image compression method without distortion has the advantages of saving a large amount of temporary storage space, and the compression method is simple and efficient.

以下在實施方式中詳細敘述本發明之詳細特徵以及優點,其內容足以使任何熟習相關技藝者了解本發明之技術內容並據以實施,且根據本說明書所揭露之內容、申請專利範圍及圖式,任何熟習相關技藝者可輕易地理解本發明相關之目的及優點。The detailed features and advantages of the present invention are set forth in the Detailed Description of the Detailed Description of the <RTIgt; </ RTI> <RTIgt; </ RTI> </ RTI> </ RTI> <RTIgt; The objects and advantages associated with the present invention can be readily understood by those skilled in the art.

本發明提供一種無失真(lossless,亦稱為無損)的影像壓縮方法,用以處理具有多個像素的一影像,以將影像壓縮。無失真的影像壓縮方法係可實作於一編碼器(encoder)。The present invention provides a lossless (also known as lossless) image compression method for processing an image having a plurality of pixels to compress an image. The distortion-free image compression method can be implemented as an encoder.

請參照「第1圖」與「第2圖」,其分別為根據本發明一實施範例之影像之示意圖與無失真的影像壓縮方法之流程圖。Please refer to FIG. 1 and FIG. 2, which are flowcharts of an image and a distortion-free image compression method according to an embodiment of the present invention, respectively.

影像20具有WxL個像素,其中W為影像20的一影像寬度,L為一影像長度。例如影像20可以具有640x480個像素,或是128x128個像素的;則影像寬度W則會是640(像素)或是128(像素)。由於處於影像20中同一排的像素彼此之間具有強大的關聯性,因而可被利用於影像壓縮。Image 20 has WxL pixels, where W is an image width of image 20 and L is an image length. For example, image 20 may have 640 x 480 pixels or 128 x 128 pixels; then image width W will be 640 (pixels) or 128 (pixels). Since the pixels in the same row in the image 20 have strong correlation with each other, they can be utilized for image compression.

執行無失真的影像壓縮方法時,首先由影像20中選取連續的N個像素(步驟S30);其中N為大於或等於2的正整數,且N小於影像寬度W。為了更有效率地執行無失真的影像壓縮方法,可以取能整除影像寬度W的數值作為N。換句話說,N能夠整除影像20的影像寬度W。例如當影像寬度W為128(像素)時,可取N為16。而選取連續N個像素的步驟S30可以以一處理窗22實作之。處理窗22的長度為N,被處理窗22所框選的N個像素便是依下述流程被壓縮的N個像素。When the distortion-free image compression method is performed, successive N pixels are first selected from the image 20 (step S30); wherein N is a positive integer greater than or equal to 2, and N is smaller than the image width W. In order to perform the distortion-free image compression method more efficiently, the value of the image width W can be divisible as N. In other words, N can divise the image width W of the image 20. For example, when the image width W is 128 (pixels), N may be 16. The step S30 of selecting consecutive N pixels can be implemented by a processing window 22. The length of the processing window 22 is N, and the N pixels framed by the processing window 22 are N pixels compressed according to the following flow.

編碼器具有一暫存器(buffer),以將影像20中需要被處理的部分暫存於暫存器。更詳細地說,影像20可以是被存放於記憶體中的檔案,亦可以是由一影像擷取裝置的一感光單元傳送之影像資料。而步驟S30則可在由記憶體或是感光單元收到的影像20中選取連續的此N個像素,並由暫存器直接接收此N個像素的值P0 ~PN-1The encoder has a buffer to temporarily store the portion of the image 20 that needs to be processed in the scratchpad. In more detail, the image 20 may be a file stored in a memory, or may be image data transmitted by a photosensitive unit of an image capturing device. In step S30, the consecutive N pixels are selected in the image 20 received by the memory or the photosensitive unit, and the values P 0 to P N-1 of the N pixels are directly received by the register.

因此無失真的影像壓縮方法壓縮影像20時,僅需要用到處理窗22的N個像素,而不需用到影像20中的其他像素。因此編碼器的暫存器中亦僅需要存有此N個像素即可,而不需存放影像20中整排的W個像素。Therefore, when the image compression method without distortion is used to compress the image 20, only N pixels of the processing window 22 are needed, and other pixels in the image 20 are not needed. Therefore, only the N pixels need to be stored in the register of the encoder, and the entire row of W pixels in the image 20 need not be stored.

選取連續的N個像素之後,對此N個像素執行一差異脈波碼調變(Differential pulse code modulation,DPCM)手段;以依據此N個像素的值P0 ~PN-1 ,得到對應此N個像素的N個非負數差值n0 ~nN-1 (步驟S40)。像素的值例如可以是灰階值、三原色值(RGB value)或是HSL色彩空間的色相(hue)、飽和度(saturation)、與亮度(lightness)。無失真的影像壓縮方法並不對像素的值之內容有所限制。After selecting consecutive N pixels, a differential pulse code modulation (DPCM) method is performed on the N pixels; corresponding to the values P 0 ~ P N-1 of the N pixels N non-negative difference values n 0 to n N-1 of N pixels (step S40). The value of the pixel may be, for example, a grayscale value, an RGB value, or a hue, saturation, and lightness of the HSL color space. The distortion-free image compression method does not limit the content of the pixel values.

請參照「第3圖」,其係為根據本發明一實施範例之差異脈波碼調變手段之流程圖。Please refer to FIG. 3, which is a flowchart of a differential pulse code modulation method according to an embodiment of the present invention.

無失真的影像壓縮方法利用差異脈波碼調變手段得到對應於處理窗22的N個非負數差值n0 ~nN-1 ,以進行無失真的壓縮。差異脈波碼調變手段可以先依據此N個像素的值P0 ~PN-1 ,得到個別對應於此N個像素的N個像素差值d0 ~dN-1 (步驟S41)。接著再個別對此N個像素差值執行一變換(mapping)手段,以得到個別對應於此N個像素差值的N個非負數差值n0 ~nN-1 (步驟S46)。The distortion-free image compression method uses the differential pulse code modulation means to obtain N non-negative difference values n 0 to n N-1 corresponding to the processing window 22 for distortion-free compression. The differential pulse code modulation means may first obtain N pixel difference values d 0 to d N-1 corresponding to the N pixels based on the values P 0 to P N-1 of the N pixels (step S41). Then, a mapping means is performed on the N pixel difference values to obtain N non-negative difference values n 0 to n N-1 corresponding to the N pixel difference values (step S46).

請配合「第3圖」並參照「第4圖」以及「第5圖」,其分別為根據本發明一實施範例之步驟S41之流程圖,以及步驟S46中的變換手段之流程圖。Please refer to "Fig. 3" and refer to "Fig. 4" and "Fig. 5", which are flowcharts of step S41 according to an embodiment of the present invention, and a flow chart of the changing means in step S46, respectively.

於步驟S41中,係可依據下述「式1」以及「式2」計算得到像素差值d0 ~dN-1In step S41, the pixel difference values d 0 to d N-1 can be calculated according to the following "Formula 1" and "Formula 2".

d0 =P0 .........................................................................式1d 0 =P 0 ............................................. ............................Formula 1

di =Pi -Pi-1 ,0<i<N,且i為正整數...................式2d i =P i -P i-1 , 0<i<N, and i is a positive integer.

其中P0 為處理窗22中的N個像素中的第一個像素的值,Pi 為處理窗22中的N個像素中的第i個像素的值。而d0 為對應P0 的像素差值,di 為對應Pi 的像素差值。Where P 0 is the value of the first of the N pixels in the processing window 22, and P i is the value of the ith pixel of the N pixels in the processing window 22. And d 0 is the pixel difference corresponding to P 0 , and d i is the pixel difference corresponding to P i .

「式1」係將N個像素中的第一個像素的值P0 作為第一個像素差值d0 (步驟S42)。「式2」分別計算此N個像素中的第i個像素的值Pi 與其前一個像素的值Pi-1 的差,作為其他N-1個像素差值d1 ~dN-1 ,其中0<i<N(步驟S43)。換句話說,像素差值d1 ~dN-1 係將相鄰的像素的值P0 ~PN-1 兩兩相減得到。"Formula 1" takes the value P 0 of the first pixel among the N pixels as the first pixel difference value d 0 (step S42). "Formula 2" This value of the N pixels P i of the i-th pixel and its preceding pixel P i-1 values were calculated difference, as other N-1 pixel difference value d 1 ~ d N-1, Where 0 < i < N (step S43). In other words, the pixel difference values d 1 to d N-1 are obtained by subtracting the values P 0 to P N-1 of the adjacent pixels.

根據本發明之另一實施範例,可保存有影像20中處理窗22之第一個像素的前一個像素的值P-1 。而對應處理窗22之第一個像素差值d0 的值即為P0 與P-1 的差值。According to another embodiment of the present invention, the value P -1 of the previous pixel of the first pixel of the processing window 22 in the image 20 can be saved. The value of the first pixel difference value d 0 corresponding to the processing window 22 is the difference between P 0 and P -1 .

在步驟S41得到處理窗22對應之像素差值d0 ~dN-1 之後,變換手段可先逐一判斷這些像素差值di 是否大於或等於0(步驟S47),再依下述「式3」以及「式4」計算得到非負數差值n0 ~nN-1After obtaining the pixel difference values d 0 to d N-1 corresponding to the processing window 22 in step S41, the conversion means may first determine whether the pixel difference values d i are greater than or equal to 0 (step S47), and then according to the following formula 3 And "Formula 4" calculate the non-negative difference n 0 ~ n N-1 .

ni =2×di ,if di ≧0....................................................式3n i = 2 × d i , if d i ≧0..................................... ...............3

ni =2×di -1,if di <0.................................................式4n i = 2 × d i -1, if d i <0................................... ..............Form 4

其中ni 為N個非負數差值n0 ~nN-1 中的第i個像素的值,且0≦i<N。Where n i is the value of the i-th pixel of the N non-negative difference values n 0 to n N-1 , and 0 ≦ i < N.

對於大於或等於0的像素差值di ,「式3」係將像素差值di 乘以2作為非負數差值ni 。也就是說非負數差值ni 為像素差值di 乘以2(步驟S48)。而對於小於0的像素差值di ,「式4」係將像素差值di 乘以2再減1的值作為非負數差值ni 。也就是說非負數差值ni 為像素差值di 乘以2再減1(步驟S49)。For a pixel difference value d i greater than or equal to 0, "Formula 3" multiplies the pixel difference value d i by 2 as a non-negative difference value n i . That is, the non-negative difference value n i is the pixel difference value d i multiplied by 2 (step S48). For a pixel difference value d i smaller than 0, "Expression 4" is a value obtained by multiplying the pixel difference value d i by 2 and subtracting 1 as a non-negative difference value n i . That is, the non-negative difference value n i is the pixel difference value d i multiplied by 2 and then decreased by 1 (step S49).

如此一來,便可在步驟S40中依據N個像素的值P0 ~PN-1 ,得到對應這N個像素的N個非負數差值n0 ~nN-1In this way, N non-negative difference values n 0 to n N-1 corresponding to the N pixels can be obtained according to the values P 0 to P N-1 of the N pixels in step S40.

請回到「第2圖」。接著依據此N個非負數差值n0 ~nN-1 ,計算得到一編碼參數(coding parameter)k(步驟S50);並依據編碼參數k,將此N個非負數差值n0 ~nN-1 進行編碼(步驟S60)。Please return to "Figure 2." Then, according to the N non-negative difference values n 0 ~ n N-1 , a coding parameter k is calculated (step S50); and according to the coding parameter k, the N non-negative difference values n 0 ~ n N-1 is encoded (step S60).

其中步驟S60可包括:依據編碼參數k,以哥倫布-萊斯編碼(Golomb-Rice code)將此N個非負數差值n0 ~nN-1 進行編碼。The step S60 may include: encoding the N non-negative difference values n 0 ~ n N-1 according to the coding parameter k by a Golomb-Rice code.

用以處理此N個非負數差值的編碼參數可以是The encoding parameter used to process the N non-negative difference values may be .

哥倫布-萊斯編碼係為一種可變長度編碼(variable-length code,VLC),其將出現機率較高的值予以較短的編碼。依據哥倫布-萊斯編碼,係先依據編碼參數k設定一除數m。再將此N個非負數差值n0 ~nN-1 除以除數m,得到對應的N個商數Q以及餘數R。其中除數m為2的k次方(2k )。The Columbus-Rice code is a variable-length code (VLC) that encodes a higher probability value for a shorter one. According to the Columbus-Les code, a divisor m is first set according to the coding parameter k. By dividing the N non-negative difference values n 0 to n N-1 by the divisor m, the corresponding N quotients Q and the remainder R are obtained. Where the divisor m is the kth power (2 k ) of 2.

哥倫布-萊斯編碼接著將得到的商數Q編碼成一元碼(unary code),並將於數R編碼成k位元長度的二進位碼(binary code)。The Columbus-Rice code then encodes the resulting quotient Q into a unary code and encodes the number R into a binary code of length k bits.

舉例而言,假設非負數差值n0 為163,編碼參數k為5。因此可以算出非負數差值n0 的商數Q為5,餘數R為3。則非負數差值n0 的商數Q可以以一元碼被編碼成「111110」,餘數R則以二進位碼被編碼成「00011」。For example, assume that the non-negative difference n 0 is 163 and the encoding parameter k is 5. Therefore, the quotient Q of the non-negative difference n 0 can be calculated as 5, and the remainder R is 3. Then, the quotient Q of the non-negative difference value n 0 can be encoded as "111110" by the unary code, and the remainder R is encoded as "00011" by the binary code.

如此一來,處理窗22內的N個像素的值P0 ~PN-1 即可被壓縮成無失真的可變長度編碼。而整個影像20能夠被無失真的影像壓縮方法壓縮。請參照「第6圖」,其係為根據本發明另一實施範例之無失真的影像壓縮方法之流程圖。In this way, the values P 0 to P N-1 of the N pixels in the processing window 22 can be compressed into distortion-free variable length coding. The entire image 20 can be compressed by a distortion-free image compression method. Please refer to FIG. 6 , which is a flowchart of a distortion-free image compression method according to another embodiment of the present invention.

執行步驟S30到步驟S60將處理窗22的N個像素壓縮後,另可判斷是否壓縮完影像20的所有像素(步驟S70)。若影像20尚未完全被壓縮完成,則接續選取影像20的下N個連續的像素(步驟S80),並以步驟S40、S50以及S60處理於步驟S80中被選取的N個像素。若影像20已被壓縮完成為一壓縮影像檔案,則可結束。After performing the steps S30 to S60 to compress the N pixels of the processing window 22, it is further determined whether or not all the pixels of the image 20 are compressed (step S70). If the image 20 has not been completely compressed, the next N consecutive pixels of the image 20 are successively selected (step S80), and the selected N pixels in step S80 are processed in steps S40, S50, and S60. If the image 20 has been compressed to a compressed image file, it can end.

也就是說,無失真的影像壓縮方法在於步驟S30中被選取的N個像素之後接續選取另外N個像素,且可將另外選取的N個像素作為新的處理窗22在處理之。That is to say, the distortion-free image compression method is that the N pixels selected in step S30 are successively selected to select another N pixels, and the additionally selected N pixels are processed as the new processing window 22.

綜上所述,根據本發明之無失真的影像壓縮方法選取影像中N個像素,並將選取的像素的值以可變長度編碼進行編碼。由於在壓縮時並不需要用到影像中的其他像素,因此編碼器之暫存器僅需保存此N個像素的值,而能夠節省大量的暫存空間。且無失真的影像壓縮方法僅逐一處理各影像窗內的N個像素值到壓縮完整個影像,而具有壓縮方式簡單有效率的優點。In summary, the distortion-free image compression method according to the present invention selects N pixels in the image and encodes the values of the selected pixels with variable length coding. Since the other pixels in the image are not needed during compression, the register of the encoder only needs to save the values of the N pixels, and can save a lot of temporary storage space. The distortion-free image compression method only processes N pixel values in each image window one by one to compress a complete image, and has the advantages of simple and efficient compression mode.

20...影像20. . . image

22...處理窗twenty two. . . Processing window

第1圖係為根據本發明一實施範例之影像之示意圖;1 is a schematic diagram of an image according to an embodiment of the present invention;

第2圖係為根據本發明一實施範例之無失真的影像壓縮方法之流程圖;2 is a flow chart of a distortion-free image compression method according to an embodiment of the present invention;

第3圖係為根據本發明一實施範例之差異脈波碼調變手段之流程圖;Figure 3 is a flow chart of a differential pulse code modulation means according to an embodiment of the present invention;

第4圖係為根據本發明一實施範例之步驟S41之流程圖;Figure 4 is a flow chart of step S41 according to an embodiment of the present invention;

第5圖係為根據本發明一實施範例之變換手段之流程圖;以及Figure 5 is a flow chart of a transformation means according to an embodiment of the present invention;

第6圖係為根據本發明另一實施範例之無失真的影像壓縮方法之流程圖。Figure 6 is a flow chart of a distortion-free image compression method according to another embodiment of the present invention.

Claims (8)

一種無失真的影像壓縮方法,用以處理具有多個像素的一影像,其中該影像的一影像寬度為W,該無失真的影像壓縮方法包括:(a)由該影像中選取連續的N個該些像素,其中N為大於或等於2的正整數,且N小於該影像寬度W;(b)執行一差異脈波碼調變手段,以依據該N個像素的值,得到對應該N個像素的N個非負數差值;(c)依據該N個非負數差值,計算得到一編碼參數;以及(d)依據該編碼參數,將該N個非負數差值進行編碼。A distortion-free image compression method for processing an image having a plurality of pixels, wherein an image width of the image is W, and the distortion-free image compression method comprises: (a) selecting consecutive N from the image The pixels, wherein N is a positive integer greater than or equal to 2, and N is less than the image width W; (b) performing a differential pulse code modulation means to obtain corresponding N according to the values of the N pixels N non-negative difference values of the pixels; (c) calculating an encoding parameter according to the N non-negative difference values; and (d) encoding the N non-negative difference values according to the encoding parameters. 如申請專利範圍第1項所述之無失真的影像壓縮方法,另包括:(e)接續選取該影像的下N個連續的該些像素;以及(f)返回步驟(b),直到壓縮完該影像的所有該些像素。The distortion-free image compression method of claim 1, further comprising: (e) successively selecting the next N consecutive pixels of the image; and (f) returning to step (b) until the compression is completed. All of these pixels of the image. 如申請專利範圍第1項所述之無失真的影像壓縮方法,其中該差異脈波碼調變手段包括:依據該N個像素的值,得到個別對應於該N個像素的N個像素差值;以及個別對該N個像素差值執行一變換手段,以得到個別對應於該N個像素差值的該N個非負數差值。The distortion-free image compression method of claim 1, wherein the differential pulse code modulation means comprises: obtaining N pixel difference values corresponding to the N pixels according to the values of the N pixels. And performing a transforming means for the N pixel difference values to obtain the N non-negative difference values individually corresponding to the N pixel difference values. 如申請專利範圍第3項所述之無失真的影像壓縮方法,其中該依據該N個像素的值,得到個別對應於該N個像素的N個像素差值的步驟包括:將該N個像素中的第一個該像素的值P0 作為第一個該像素差值d0 ;以及分別計算該N個像素中的第i個該像素的值Pi 與其前一個該像素的值Pi-1 的差,作為其他N-1個該些像素差值,其中i為正整數,且0<i<N。The distortion-free image compression method of claim 3, wherein the step of obtaining N pixel difference values corresponding to the N pixels according to the values of the N pixels comprises: N pixels the first one of the pixel value P 0 as the first one of the pixel difference value d 0; and calculates a value of the pixel prior to its i-th value of the pixel of the N pixels P i P i- The difference of 1 is taken as the other N-1 pixel difference values, where i is a positive integer and 0 < i < N. 如申請專利範圍第3項所述之無失真的影像壓縮方法,其中該變換手段包括:當該N個像素差值中的第i個該像素差值di 大於或等於零時,對應的第i個該非負數差值ni 為該像素差值di 乘以2,其中0<=i<N;以及當該N個像素差值中的第i個該像素差值di 小於零時,對應的第i個該非負數差值ni 為該像素差值di 乘以2再減1。The distortion-free image compression method of claim 3, wherein the transforming means comprises: when the i-th pixel difference d i of the N pixel difference values is greater than or equal to zero, the corresponding i-th the difference is a non-negative n i D i for the pixel difference value is multiplied by 2, where 0 <= i <N; and when the difference in the N pixels of the i-th pixel difference D i is less than zero, the corresponding The i-th non-negative difference n i is the pixel difference d i multiplied by 2 and then decremented by one. 如申請專利範圍第1項所述之無失真的影像壓縮方法,其中該編碼參數為,其中ni 為該N個非負數差值中的第i個該非負數差值。The distortion-free image compression method according to claim 1, wherein the coding parameter is Where n i is the ith of the N non-negative difference values of the non-negative difference. 如申請專利範圍第1項所述之無失真的影像壓縮方法,其中該步驟(d)包括:依據該編碼參數,以哥倫布-萊斯編碼將該N個非負數差值進行編碼。The distortion-free image compression method of claim 1, wherein the step (d) comprises: encoding the N non-negative difference values by a Columbus-Rice code according to the encoding parameter. 如申請專利範圍第1項所述之無失真的影像壓縮方法,其中該步驟(a)係由一暫存器直接接收該影像中被選取的該N個像素。The distortion-free image compression method according to claim 1, wherein the step (a) directly receives the selected N pixels in the image by a temporary register.
TW99117839A 2010-06-02 2010-06-02 Distortion-free image compression method TWI432031B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW99117839A TWI432031B (en) 2010-06-02 2010-06-02 Distortion-free image compression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW99117839A TWI432031B (en) 2010-06-02 2010-06-02 Distortion-free image compression method

Publications (2)

Publication Number Publication Date
TW201146017A TW201146017A (en) 2011-12-16
TWI432031B true TWI432031B (en) 2014-03-21

Family

ID=46766071

Family Applications (1)

Application Number Title Priority Date Filing Date
TW99117839A TWI432031B (en) 2010-06-02 2010-06-02 Distortion-free image compression method

Country Status (1)

Country Link
TW (1) TWI432031B (en)

Also Published As

Publication number Publication date
TW201146017A (en) 2011-12-16

Similar Documents

Publication Publication Date Title
CN105184759B (en) Image self-adaptive enhancement method based on histogram compactness transformation
CN102907101A (en) An image compression method with random access capability
CN107105208A (en) A kind of lossless coding and coding/decoding method of Bayer images
CN101494788B (en) Method and apparatus for compressing and decompressing video image
CN102271251A (en) Lossless Image Compression Method
CN110971904B (en) Control method for image compression
US9460525B2 (en) Tile-based compression and decompression for graphic applications
JP2004166083A (en) Encoding device and method
CN110087085A (en) Image processing apparatus
CN101472182B (en) Virtually lossless video data compression
US8559741B2 (en) Lossless image compression method
CN108200429B (en) Bayer image compression method and device
JP2005191956A (en) Display data compression/expansion method
JP2011234363A (en) Image processing system and method
WO2011064073A1 (en) Method, device and system for image compression and decompression using support vector regression
TWI506965B (en) A coding apparatus, a decoding apparatus, a coding / decoding system, a coding method, and a decoding method
US8428381B2 (en) Image compression method with variable quantization parameter
CN101547352A (en) Image compression method and decompression method
TWI432031B (en) Distortion-free image compression method
JP6722651B2 (en) How to choose a compression algorithm depending on the type of image
JP2009077183A (en) Data compression apparatus, data compression / decompression system, and data compression method
CN114339242B (en) Image compression method and device
JP2008017472A (en) Ultrasonic image compression method
TWI401965B (en) Image Compression Method with Variable Quantization Parameters
JP2011109172A (en) Video encoder and data processing method for the same

Legal Events

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