TWI396431B - Method of color components compression - Google Patents

Method of color components compression Download PDF

Info

Publication number
TWI396431B
TWI396431B TW97150124A TW97150124A TWI396431B TW I396431 B TWI396431 B TW I396431B TW 97150124 A TW97150124 A TW 97150124A TW 97150124 A TW97150124 A TW 97150124A TW I396431 B TWI396431 B TW I396431B
Authority
TW
Taiwan
Prior art keywords
video data
color components
pixel
compressing
color component
Prior art date
Application number
TW97150124A
Other languages
Chinese (zh)
Other versions
TW201026022A (en
Inventor
Ying Ru Chen
Original Assignee
Himax Tech Ltd
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 Himax Tech Ltd filed Critical Himax Tech Ltd
Priority to TW97150124A priority Critical patent/TWI396431B/en
Publication of TW201026022A publication Critical patent/TW201026022A/en
Application granted granted Critical
Publication of TWI396431B publication Critical patent/TWI396431B/en

Links

Description

顏色分量的壓縮方法Color component compression method

本發明是有關於一種壓縮的方法,且特別是有關於一種顏色分量的壓縮方法。The present invention relates to a method of compression, and more particularly to a method of compressing a color component.

在一般積體電路(Integrated Circuit,IC)的設計中,積體電路與記憶體之間傳輸的資料尺寸大小被認為是限制積體電路性能的主要因素。為了要減少傳輸資料的時間與儲存資料的空間,在資料尺寸大小相對來說龐大時,通常會在儲存資料於記憶體之前執行資料壓縮(data compression)程序。In the design of a general integrated circuit (IC), the size of the data transmitted between the integrated circuit and the memory is considered to be a major factor limiting the performance of the integrated circuit. In order to reduce the time for transferring data and the space for storing data, when the size of the data is relatively large, the data compression program is usually executed before the data is stored in the memory.

在一般視訊資料壓縮的程序中,視訊資料係被壓縮成標準的壓縮格式,例如H.261、H.263、MPEG-1、MPEG-2與MPEG-4,然後被壓縮的視訊資料會被儲存到光碟(Compact Disc,CD)或數位影音光碟(Digital Video Disc,DVD)中。當需要讀取這些被儲存的視訊資料時,壓縮資料會先被解壓縮,然後儲存到記憶體中。由於解壓縮資料的位元速率非常高,因此可將一些能夠即時處理資料之簡單壓縮/解壓縮的方法應用在積體電路與記憶體之間的資料路徑上。In the general video data compression process, the video data is compressed into a standard compression format, such as H.261, H.263, MPEG-1, MPEG-2 and MPEG-4, and then the compressed video data is stored. Go to a compact disc (CD) or a digital video disc (DVD). When the stored video data needs to be read, the compressed data is first decompressed and then stored in the memory. Since the bit rate of the decompressed data is very high, some simple compression/decompression methods capable of processing data in real time can be applied to the data path between the integrated circuit and the memory.

然而,當視訊資料被壓縮時,一些視訊資料的細節會在前述的壓縮過程中喪失。故此,如何在不影響視訊資料品質的情況下將視訊資料壓縮成較小的資料尺寸大小實為積體電路製造廠商要解決的主要議題。However, when the video material is compressed, the details of some video data are lost during the aforementioned compression process. Therefore, how to compress video data into smaller data sizes without affecting the quality of video data is a major issue to be solved by integrated circuit manufacturers.

有鑑於此,本發明提供一種顏色分量的壓縮方法,此方法中利用兩種壓縮模式來壓縮視訊資料,因此能夠降低視訊資料的尺寸大小且同時維持視訊資料的品質。In view of the above, the present invention provides a color component compression method in which two compression modes are used to compress video data, thereby reducing the size of the video material while maintaining the quality of the video material.

為了達到上述或其他目的,本發明提供一種顏色分量的壓縮方法。此方法首先接受一筆以4:4:4取樣格式編碼的視訊資料,此視訊資料包括多個像素的資料。接著,在一降低取樣模式中,將視訊資料中之多組鄰近像素的顏色分量降低取樣,並計算此視訊資料在被降低取樣前後的第一差值。接著,在一截斷模式中,則是將視訊資料中各像素之顏色分量截斷,並計算此視訊資料在被截斷前後的第二差值。最後則比較第一差值與第二差值,並選擇降低取樣模式或截斷模式中具有較小差值者來將視訊資料壓縮成一4:2:2取樣格式。In order to achieve the above or other objects, the present invention provides a compression method of a color component. This method first accepts a video material encoded in a 4:4:4 sampling format, which includes data for multiple pixels. Then, in a reduced sampling mode, the color components of the plurality of sets of adjacent pixels in the video data are downsampled, and the first difference of the video data before and after the down sampling is calculated. Then, in a truncation mode, the color component of each pixel in the video data is truncated, and the second difference before and after the video data is truncated is calculated. Finally, the first difference and the second difference are compared, and the difference between the sampling mode or the truncation mode is selected to compress the video data into a 4:2:2 sampling format.

在本發明的一實施例中,視訊資料會被分解成多組鄰近像素,且每一組鄰近像素包括兩個像素。In an embodiment of the invention, the video material is decomposed into a plurality of sets of adjacent pixels, and each set of adjacent pixels includes two pixels.

在本發明的一實施例中,上述將視訊資料中每一組鄰近像素的顏色分量進行降低取樣的步驟係在每一組鄰近像素中的兩個像素之中,保留其中一個像素的顏色分量,且忽略另一個像素的顏色分量。In an embodiment of the invention, the step of downsampling the color components of each set of adjacent pixels in the video data is performed in two pixels of each set of adjacent pixels, and the color component of one of the pixels is retained. And ignore the color component of another pixel.

在本發明的一實施例中,上述將視訊資料中每一組鄰近像素的顏色分量進行截斷的步驟係將視訊資料中各像素之顏色分量的最後四個位元截斷。In an embodiment of the invention, the step of truncating the color component of each set of adjacent pixels in the video material is to cut off the last four bits of the color component of each pixel in the video material.

在本發明的一實施例中,上述將視訊資料中每一組鄰近像素的顏色分量進行截斷的步驟還包括計算各像素之顏色分量的最後四個位元的十進位值(decimal value),且判定此十進位值是否大於8。若十進位值大於8時,則將顏色分量之第五個位元進位1。In an embodiment of the invention, the step of truncating the color components of each set of adjacent pixels in the video data further includes calculating a decimal value of the last four bits of the color component of each pixel, and Determine if this decimal value is greater than 8. If the decimal value is greater than 8, the fifth bit of the color component is incremented by one.

在本發明的一實施例中,在上述將視訊資料壓縮為4:2::2取樣格式後,本方法還進一步將壓縮的視訊資料存入記憶體中。In an embodiment of the invention, after compressing the video data into the 4:2::2 sampling format, the method further stores the compressed video data into the memory.

在本發明的一實施例中,在上述將壓縮的視訊資料存入記憶體之前,本方法還包含在各像素之亮度(luminance)的最後一個位元儲存一個指標,此指標紀錄被選擇用以壓縮像素之顏色分量的壓縮模式。In an embodiment of the invention, before the compressing the compressed video data into the memory, the method further includes storing an indicator in the last bit of the luminance of each pixel, wherein the indicator record is selected for use. A compression mode that compresses the color components of a pixel.

在本發明的一實施例中,在上述將壓縮的視訊資料存入記憶體之後,本方法還包括將記憶體中的壓縮視訊資料解壓縮。In an embodiment of the invention, after the compressing the video data into the memory, the method further comprises decompressing the compressed video data in the memory.

在本發明的一實施例中,上述將記憶體中的壓縮視訊資料解壓縮之步驟係先從記憶體存取被壓縮視訊資料之各像素的指標,據以判斷壓縮像素之顏色分量的壓縮模式。假設壓縮模式被判定為降低取樣模式,則計算鄰近像素之顏色分量的加權總和(亦即將左邊像素的顏色分量與右邊像素的顏色方量加總後除以二),並以此加權總和作為每一組鄰近像素集之間之像素之顏色分量。若壓縮模式被判定為截斷模式,則將所紀錄之各像素的顏色分量位移四個位元且將顏色分量之最後四個位元補零。最後,以4:4:4取樣格式輸出被解壓縮的視訊資料。In an embodiment of the invention, the step of decompressing the compressed video data in the memory first accesses an index of each pixel of the compressed video data from the memory, and determines a compression mode of the color component of the compressed pixel. . Assuming that the compression mode is determined to reduce the sampling mode, the weighted sum of the color components of the neighboring pixels is calculated (ie, the color component of the left pixel and the color square of the right pixel are summed and divided by two), and the weighted sum is used as per The color component of a group of pixels between adjacent sets of pixels. If the compression mode is determined to be the truncation mode, the recorded color component of each pixel is shifted by four bits and the last four bits of the color component are padded with zeros. Finally, the decompressed video data is output in a 4:4:4 sampling format.

在本發明的一實施例中,在以4:4:4取樣格式輸出被解壓縮的視訊資料之前,本方法還檢查是否各像素相鄰近之兩個鄰近像素被解壓縮後的亮度相同但與此像素被解壓縮後的亮度不同。若此情形成立,則此像素的顏色分量會被修改為鄰近像素的顏色分量。In an embodiment of the invention, before outputting the decompressed video data in a 4:4:4 sampling format, the method further checks whether the two neighboring pixels adjacent to each pixel are decompressed with the same brightness but The brightness of this pixel after decompression is different. If this is the case, the color component of this pixel will be modified to the color component of the neighboring pixel.

在本發明的一實施例中,上述之顏色分量包括U顏色分量與V顏色分量。In an embodiment of the invention, the color component described above includes a U color component and a V color component.

本發明係針對所接收之視訊資料進行直接降低取樣與截斷運算,且將壓縮後的視訊資料與原本的視訊資料比較以決定壓縮視訊資料的最佳模式。如此,可降低視訊資料的顏色分量之尺寸大小且可將視訊資料的品質保持在一個可接受的範圍內。基於上述,本發明可增加視訊資料的傳送速率,同時也可減少用以儲存視訊資料的空間。The present invention directly reduces the sampling and truncation operations for the received video data, and compares the compressed video data with the original video data to determine the best mode for compressing the video data. In this way, the size of the color component of the video material can be reduced and the quality of the video material can be maintained within an acceptable range. Based on the above, the present invention can increase the transmission rate of video data, and can also reduce the space for storing video data.

為讓本發明之上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。The above described features and advantages of the present invention will be more apparent from the following description.

彩色視訊資料(color video data)通常是以亮度(luminance)及顏色分量(color components)的格式來傳送,其中,亮度保留原本視訊資料百分之九十的細節。當對彩色視訊資料進行失真壓縮(distortion compression)時,亮度的失真容易被人眼辨識出來。故此,本發明提供一種顏色分量的壓縮方法。Color video data is usually transmitted in the form of luminance and color components, where the brightness retains 90% of the original video data. When the color video data is subjected to distortion compression, the distortion of the brightness is easily recognized by the human eye. Therefore, the present invention provides a method of compressing color components.

視訊資料通常是用真(real)4:4:4取樣格式(sampling format)傳送或者是以4:2:2內插所得之偽(pseudo)4:4:4取樣格式傳送。雖然這兩種視訊資料看起來都像是4:4:4取樣格式的資料,但是兩種視訊資料的特徵卻仍然不相同。因此,若兩種視訊資料都被視為是經過內插處理、直接取樣之4:4:4取樣格式的資料,並存入記憶體,這將會減損資料在真4:4:4取樣格式中的特徵。Video data is usually transmitted in real 4:4:4 sampling format or in a pseudo 4:4:4 sampling format resulting from 4:2:2 interpolation. Although the two types of video data appear to be in the 4:4:4 sampling format, the characteristics of the two video materials are still different. Therefore, if both video data are considered as interpolated, directly sampled 4:4:4 sampling format data and stored in memory, this will detract the data in true 4:4:4 sampling format. Characteristics in the middle.

圖1是依照本發明之一實施例所繪示的一種顏色分量的壓縮方法的示意圖。請參照圖1,本實施例使用兩種壓縮方法來進行視訊資料的壓縮。其中一種方法是直接進行降低取樣(down-sampling)方法,此降低取樣方法係保留任兩個像素中8位元的U分量及8位元的V分量,適合對有較少視訊分量變化的視訊資料進行壓縮。另一種方法是截斷(truncation)方法,此截斷方法僅保留各像素的4位元的U分量及4位元的V分量,適合對有較多視訊分量變化的視訊資料進行壓縮。FIG. 1 is a schematic diagram of a method of compressing a color component according to an embodiment of the invention. Referring to FIG. 1, this embodiment uses two compression methods to compress video data. One of the methods is to directly perform a down-sampling method, which preserves the U component of 8 bits and the V component of 8 bits in any two pixels, and is suitable for video with less video component changes. The data is compressed. Another method is a truncation method, which only retains the U component of the 4-bit and the V component of the 4-bit of each pixel, and is suitable for compressing video data having more video component changes.

請參照圖1,在壓縮110過程中,當接受到以4:4:4資料位元速率(data rate)取樣的視訊資料時,即在此視訊資料上進行直接降低取樣模式112與截斷模式114。而壓縮資料則被用來作為模式選擇116的基礎,其中包括計算壓縮資料與原本資料的差值,並選擇直接降低取樣模式112與截斷模式114中具有較少差值者來將視訊資料壓縮為4:2:2的取樣格式。最後則將此以4:2:2資料位元速率取樣的壓縮資料存入記憶體120中。Referring to FIG. 1, during the compression 110 process, when the video data sampled at the 4:4:4 data bit rate is received, the direct down sampling mode 112 and the truncation mode 114 are performed on the video data. . The compressed data is used as the basis for the mode selection 116, which includes calculating the difference between the compressed data and the original data, and selecting to directly reduce the sampling mode 112 and the truncating mode 114 with less difference to compress the video data into 4:2:2 sampling format. Finally, the compressed data sampled at the 4:2:2 data bit rate is stored in the memory 120.

接著,當接收到讀取指令時,儲存在記憶體120中的壓縮視訊資料會被存取(retrieved),且在被存取的已壓縮視訊資料上進行解壓縮130程序以將視訊資料回復到4:4:4的資料位元速率。最後則以正常的4:4:4取樣格式輸出視訊資料。為了描述利用以上架構來壓縮與解壓縮視訊資料之顏色分量,以下提供兩個實施例來說明之。Then, when the read command is received, the compressed video data stored in the memory 120 is retrieved, and the decompressed 130 program is performed on the accessed compressed video data to restore the video data to 4:4:4 data bit rate. Finally, the video data is output in the normal 4:4:4 sampling format. To describe the use of the above architecture to compress and decompress the color components of the video material, two embodiments are provided below to illustrate.

圖2是依照本發明之一實施例所繪示的一種顏色分量的壓縮方法的流程圖。請參照圖2,本實施例描述壓縮視訊資料之流程,其中視訊資料原本是使用4:4:4的資料位元速率進行取樣的。2 is a flow chart of a method for compressing a color component according to an embodiment of the invention. Referring to FIG. 2, this embodiment describes a process of compressing video data, wherein the video data is originally sampled using a data bit rate of 4:4:4.

首先,接收以4:4:4取樣格式編碼之視訊資料(步驟S202),其中視訊資料可以被分解為多組鄰近像素且每一組鄰近像素包含兩個像素。First, video data encoded in a 4:4:4 sampling format is received (step S202), wherein the video material can be decomposed into a plurality of sets of adjacent pixels and each set of adjacent pixels includes two pixels.

接者,在一降低取樣模式中,會將視訊資料中鄰近像素的顏色分量進行降低取樣,且計算在降低取樣前後視訊資料之顏色分量的第一差值(步驟S204)。更精確地說,在降低取樣模式中,每一組鄰近像素的兩個像素之中,會保留其中一個像素的顏色分量,並忽略另一個像素的顏色分量。當計算第一差值時,將降低取樣到4:2:2取樣格式之視訊資料內插處理為以4:4:4取樣格式取樣的視訊資料,然後計算所得之4:4:4取樣格式的視訊資料之顏色分量與所接收之原始視訊資料之顏色分量之間的差值,而將此差值作為第一差值。In a reduced sampling mode, the color components of the adjacent pixels in the video data are downsampled, and the first difference of the color components of the video data before and after the sampling is reduced (step S204). More precisely, in the reduced sampling mode, among the two pixels of each set of adjacent pixels, the color component of one of the pixels is retained, and the color component of the other pixel is ignored. When the first difference is calculated, the video data sampled into the 4:2:2 sampling format is reduced to the video data sampled in the 4:4:4 sampling format, and then the calculated 4:4:4 sampling format is calculated. The difference between the color component of the video material and the color component of the received original video material, and the difference is taken as the first difference.

同時,在一截斷模式中,會將視訊資料中各像素的顏色分量截斷且計算視訊資料在被截斷前後顏色分量之第二差值(步驟S206)。更精確地說,在截斷模式中,視訊資料中各像素之顏色分量的最後四個位元會被截斷。當要計算第二差值時,則會將截斷成4位元之視訊資料擴展為8位元,然後再計算所得之4:4:4取樣格式的視訊資料之顏色分量與所接收之原始視訊資料之顏色分量之間的差值,而將此差值作為第二差值。Meanwhile, in a truncation mode, the color component of each pixel in the video material is truncated and the second difference of the color components of the video material before and after being truncated is calculated (step S206). More precisely, in the truncation mode, the last four bits of the color component of each pixel in the video material are truncated. When the second difference is to be calculated, the video data truncated to 4 bits is expanded to 8 bits, and then the color component of the video data of the 4:4:4 sampling format is obtained and the original video received is received. The difference between the color components of the data, and this difference is taken as the second difference.

在本實施例中值得一提的是,當在截斷視訊資料中各像素之顏色分量時,本實施例之顏色分量的壓縮方法還計算各像素之顏色分量最後四個位元的十進位值並判定此十進位數值是否大於8。若此十進位數值大於8,則將此顏色分量之第五個位元進位1。如此,各像素之被截斷的顏色分量會更接近原本的顏色分量,因為被截斷之顏色分量的第5個位元會被無條件進位(round up)或無條件捨去(round down)。In this embodiment, it is worth mentioning that when the color component of each pixel in the video data is truncated, the compression method of the color component of the embodiment further calculates the decimal value of the last four bits of the color component of each pixel and Determine if this decimal value is greater than 8. If the decimal value is greater than 8, the fifth bit of the color component is incremented by one. Thus, the truncated color component of each pixel will be closer to the original color component because the fifth bit of the truncated color component will be unconditionally rounded up or unconditionally rounded down.

最後,比較前述步驟中計算所得的第一差值與第二差值,以選擇降低取樣模式或截斷模式中具有較小之差值者,將視訊資料壓縮為4:2:2取樣格式(步驟S208)。更精確地說,若第一差值比第二差值小,則會選擇以降低取樣模式來將視訊資料壓縮為4:2:2取樣格式。相反地,若第二差值比第一差值小,則會選擇以截斷模式來將視訊資料壓縮為4:2:2取樣格式。Finally, comparing the first difference value and the second difference value calculated in the foregoing step to select to reduce the difference between the sampling mode or the truncation mode, and compress the video data into the 4:2:2 sampling format (step S208). More precisely, if the first difference is smaller than the second difference, then the sampling mode is selected to compress the video data into a 4:2:2 sampling format. Conversely, if the second difference is smaller than the first difference, then the truncation mode is selected to compress the video data into a 4:2:2 sampling format.

藉由上述的壓縮方法,即可在不喪失視訊資料之顏色分量的細節的情況下,相對性地縮減視訊資料的尺寸大小。故此,此視訊資料的傳送速率(transmission rate)將會增加,而積體電路存取記憶體內視訊資料的性能(performance)也會提昇。With the above compression method, the size of the video material can be relatively reduced without losing the details of the color component of the video material. Therefore, the transmission rate of the video data will increase, and the performance of the integrated circuit to access the video data in the memory will also increase.

值得一提的是,壓縮後的視訊資料還被傳送並儲存到記憶體中。為了辨識視訊資料實際被壓縮的模式,本實施例還在各個像素之亮度的最後一個位元中儲存一個指標,其中此指標紀錄了當初被選擇用以壓縮視訊資料之顏色分量的模式。據此,以下提供一個實施例以說明一種根據前述紀錄之指標,而對視訊資料進行解壓縮的方法。It is worth mentioning that the compressed video data is also transmitted and stored in the memory. In order to identify the mode in which the video material is actually compressed, this embodiment also stores an indicator in the last bit of the brightness of each pixel, wherein the indicator records the mode that was originally selected to compress the color component of the video material. Accordingly, an embodiment is provided below to illustrate a method of decompressing video material based on the aforementioned criteria for recording.

圖3是依照本發明之一實施例所繪示的一種視訊資料的顏色分量之解壓縮方法的流程圖。請參照圖3,本實施例描述視訊資料解壓縮之流程,此視訊資料係被降低取樣或被截斷成4:2:2取樣格式,並由指標記錄其原先被壓縮的模式,而儲存於記憶體內。FIG. 3 is a flow chart of a method for decompressing color components of video data according to an embodiment of the invention. Referring to FIG. 3, this embodiment describes a process of decompressing video data. The video data is downsampled or truncated into a 4:2:2 sampling format, and the original compressed mode is recorded by the indicator, and stored in the memory. in vivo.

首先,從記憶體中存取壓縮視訊資料中各個像素的指標(步驟S302),以判定之前壓縮此像素之顏色分量時所採用的模式。所述指標可以藉由存取各個像素之亮度的最後一個位元而取得,並用以辨識此像素原本被壓縮時採用的模式。舉例來說,若所讀取的指標為0,則視訊資料的壓縮模式辨識為直接降低取樣模式。若所讀取的指標為1,則視訊資料的壓縮模式辨識為截斷模式。First, an index of each pixel in the compressed video material is accessed from the memory (step S302) to determine a mode used when compressing the color component of the pixel. The indicator can be obtained by accessing the last bit of the brightness of each pixel and used to identify the mode that the pixel was originally compressed. For example, if the index read is 0, the compression mode of the video data is recognized as a direct down sampling mode. If the index read is 1, the compression mode of the video data is recognized as the truncation mode.

若視訊資料的壓縮模式被判定為直接降低取樣模式,則可將鄰近像素之顏色分量的加權總和作為在每一組鄰近像素之間之像素的顏色分量(步驟S306),以此來還原在4:4:4取樣格式下的視訊資料。更精確地說,每一個目標像素的左邊像素與右邊像素的顏色分量相加後除以二,亦即(左邊像素的顏色分量+右邊像素的顏色分量)/2,而以此加權總和作為目標像素的顏色分量。If the compression mode of the video data is determined to directly reduce the sampling mode, the weighted sum of the color components of the adjacent pixels may be used as the color component of the pixel between each set of adjacent pixels (step S306), thereby restoring at 4 : 4:4 video data in the sample format. More precisely, the color component of the left pixel and the right pixel of each target pixel is added and divided by two, that is, (the color component of the left pixel + the color component of the right pixel)/2, and the weighted sum is used as the target. The color component of the pixel.

若視訊資料的壓縮模式被判定為截斷模式,則所紀錄各個像素之顏色分量會被移位四個位元,且在最後四個位元補零(步驟S308),以此來還原4:4:4取樣格式的視訊資料。If the compression mode of the video data is determined to be the truncation mode, the color component of each pixel recorded is shifted by four bits, and the last four bits are padded with zeros (step S308), thereby restoring 4:4. : 4 video format in sample format.

值得一提的是,為了減少在解壓縮過程中可能發生之鄰近像素亮度上的明顯差異,在解壓縮完成後,本實施例還會檢查是否各個像素相鄰近之兩個像素解壓縮後的亮度相同但與其間像素之解壓縮後的亮度不同(步驟S310)。若此相鄰近之兩個像素解壓縮後的亮度相同但與其間像素之解壓縮後的亮度不同,則將此像素的顏色分量修改為鄰近像素的顏色分量(步驟S312)。It is worth mentioning that, in order to reduce the significant difference in the brightness of adjacent pixels that may occur during the decompression process, after the decompression is completed, the embodiment also checks whether the brightness of the two pixels adjacent to each pixel is decompressed. The same but different from the decompressed luminance of the pixels (step S310). If the decompressed luminances of the two adjacent pixels are the same but the decompressed luminances of the pixels are different, the color components of the pixels are modified to the color components of the adjacent pixels (step S312).

更精確地說,針對一個目標像素,本實施例還檢查此目標像素左右兩邊的一個像素,並判斷此兩個鄰近像素的亮度是否相同。若兩個鄰近像素的亮度相同,則本實施例還判斷此目標像素之亮度是否與此兩個鄰近像素的亮度相同。若此目標像素之亮度與此兩個鄰近像素的亮度不同,則可以判定在此目標像素上有明顯的亮度差異。因此,本實施例會將此目標像素的顏色分量以兩個鄰近像素的顏色分量取代,以使壓縮後的視訊資料更為平順。More precisely, for one target pixel, the embodiment also checks one pixel on the left and right sides of the target pixel, and determines whether the brightness of the two adjacent pixels is the same. If the brightness of two adjacent pixels is the same, the embodiment further determines whether the brightness of the target pixel is the same as the brightness of the two adjacent pixels. If the brightness of the target pixel is different from the brightness of the two adjacent pixels, it can be determined that there is a significant difference in brightness on the target pixel. Therefore, in this embodiment, the color component of the target pixel is replaced by the color components of two adjacent pixels to make the compressed video data smoother.

最後,在步驟S310與步驟S312的”平順”過程後,解壓縮之視訊資料會以4:4:4的取樣格式輸出(步驟S314)。根據以上所述的解壓縮方法,4:2:2取樣格式的視訊資料可以被還原為4:4:4取樣格式的視訊資料,且大部分視訊資料之顏色分量的細節都會可被保留。Finally, after the "smoothing" process of steps S310 and S312, the decompressed video data is output in a 4:4:4 sampling format (step S314). According to the decompression method described above, the video material of the 4:2:2 sampling format can be restored to the video material of the 4:4:4 sampling format, and the details of the color components of most of the video data can be retained.

綜上所述,本發明提供一種顏色分量的壓縮方法,其係在對所接收的視訊資料進行直接降低取樣模式與截斷模式,以找出具有較少細節流失的模式來壓縮視訊資料,如此可減少用以儲存視訊資料的空間,且仍可保留視訊資料的品質。另外,僅以各個像素之亮度的一個位元來作為紀錄所述兩種模式的指標,而藉由讀取指標,即可辨識出原本用以壓縮視訊資料之顏色分量的模式,而能夠用來正確地將視訊資料解壓縮為4:4:4取樣格式。In summary, the present invention provides a method for compressing color components by directly reducing the sampling mode and the truncation mode of the received video data to find a mode with less detail loss to compress the video data. Reduce the space for storing video data and still preserve the quality of video data. In addition, only one bit of the brightness of each pixel is used as an index for recording the two modes, and by reading the index, the mode for compressing the color component of the video data can be recognized, and can be used. Properly decompress video data into a 4:4:4 sampling format.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,故本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims.

110...壓縮110. . . compression

112...降低取樣112. . . Reduce sampling

114...截斷114. . . Truncated

116...模式選擇116. . . Mode selection

120...記憶體120. . . Memory

130...解壓縮130. . . unzip

S202~S208...本發明一實施例之顏色分量的壓縮方法之各步驟S202~S208. . . Each step of the compression method of the color component according to an embodiment of the present invention

S302~S314...本發明一實施例之視訊資料之顏色分量的解壓縮方法之各步驟S302~S314. . . Each step of a method for decompressing color components of video data according to an embodiment of the present invention

圖1是依照本發明之一實施例所繪示的一種顏色分量的壓縮方法的示意圖。FIG. 1 is a schematic diagram of a method of compressing a color component according to an embodiment of the invention.

圖2是依照本發明之一實施例所繪示的一種顏色分量的壓縮方法的流程圖。2 is a flow chart of a method for compressing a color component according to an embodiment of the invention.

圖3是依照本發明之一實施例所繪示的一種對視訊資料的顏色分量解壓縮之方法的流程圖。FIG. 3 is a flow chart of a method for decompressing color components of video data according to an embodiment of the invention.

S202~S208...步驟S202~S208. . . step

Claims (11)

一種顏色分量的壓縮方法,包括下列步驟:接受以一4:4:4取樣格式編碼的一視訊資料,該視訊資料包括多個像素的資料;在一降低取樣模式中,對該視訊資料之多組鄰近像素的顏色分量進行降低取樣,且計算降低取樣前後該視訊資料之該些顏色分量的一第一差值;在一截斷模式中,對該視訊資料中各像素的該些顏色分量進行截斷,且計算截斷前後該視訊資料之該些顏色分量的一第二差值;以及比較該第一差值與該第二差值,並選擇該降低取樣模式與該截斷模式中具有較小差值者,以壓縮該視訊資料為一4:2:2取樣格式。 A method for compressing a color component, comprising the steps of: accepting a video data encoded in a 4:4:4 sampling format, the video data comprising data of a plurality of pixels; and in a reduced sampling mode, the amount of the video data The color component of the group of adjacent pixels is subjected to down sampling, and calculating a first difference of the color components of the video data before and after the sampling is reduced; in a truncation mode, the color components of each pixel in the video data are truncated And calculating a second difference of the color components of the video data before and after the truncation; and comparing the first difference with the second difference, and selecting the reduced sampling mode and the truncated mode to have a smaller difference To compress the video data into a 4:2:2 sampling format. 如申請專利範圍第1項所述顏色分量的壓縮方法,其中每一組鄰近像素包括兩個像素。 A method of compressing color components as recited in claim 1, wherein each set of adjacent pixels comprises two pixels. 如申請專利範圍第1項所述顏色分量的壓縮方法,其中對該視訊資料之該些鄰近像素的顏色分量進行降低取樣之步驟包括:保留每一組鄰近像素中兩個像素其中之一的該些顏色分量且忽略另一像素的該些顏色分量。 The method for compressing a color component according to claim 1, wherein the step of downsampling the color components of the neighboring pixels of the video data comprises: retaining the one of the two pixels of each set of adjacent pixels These color components are ignored and the color components of the other pixel are ignored. 如申請專利範圍第1項所述顏色分量的壓縮方法,其中對該視訊資料中各像素的該些顏色分量進行截斷的步驟包括:截斷該視訊資料中各像素之該些顏色分量的最後四個位元。 The method for compressing color components according to claim 1, wherein the step of truncating the color components of each pixel in the video material comprises: truncating the last four of the color components of each pixel in the video data Bit. 如申請專利範圍第4項所述顏色分量的壓縮方法,其 中對該視訊資料中各像素之該些顏色分量進行截斷的步驟更包括:計算各像素之該顏色分量之最後四個位元的一十進位值;判定該十進位值是否大於8;以及若該十進位值大於8,則將該顏色分量之第五個位元進位1。 a method of compressing a color component as described in claim 4 of the patent application, The step of truncating the color components of each pixel in the video data further includes: calculating a decimal value of the last four bits of the color component of each pixel; determining whether the decimal value is greater than 8; If the decimal value is greater than 8, the fifth bit of the color component is incremented by one. 如申請專利範圍第1項所述顏色分量的壓縮方法,其中在壓縮該視訊資料為該4:2:2取樣格式的步驟之後,更包括:儲存被壓縮之該視訊資料於一記憶體中。 The method for compressing a color component according to claim 1, wherein after compressing the video data into the 4:2:2 sampling format, the method further comprises: storing the compressed video data in a memory. 如申請專利範圍第6項所述顏色分量的壓縮方法,其中在儲存被壓縮之該視訊資料於該記憶體的步驟之前,更包括:儲存一指標於各像素之亮度的最後一個位元中,其中該指標紀錄被選擇用以壓縮該視訊資料之該些顏色分量的一壓縮模式。 The method for compressing a color component according to claim 6 , wherein before storing the compressed video data in the memory, the method further comprises: storing an indicator in a last bit of the brightness of each pixel, The indicator record is selected to compress a compression mode of the color components of the video material. 如申請專利範圍第6項所述顏色分量的壓縮方法,其中在儲存被壓縮之該視訊資料於該記憶體的步驟之後,更包括:解壓縮該記憶體中被壓縮之該視訊資料。 The method for compressing a color component as described in claim 6 , wherein after the step of storing the compressed video material in the memory, the method further comprises: decompressing the compressed video material in the memory. 如申請專利範圍第8項所述顏色分量的壓縮方法,其中解壓縮該記憶體中被壓縮之該視訊資料的步驟更包括:從該記憶體中存取被壓縮之該視訊資料中各像素的指標,以判定被選擇用以壓縮該像素之該些顏色分量的該壓縮模式;若該壓縮模式被判定為該降低取樣模式,則採用該些鄰近像素之該些顏色分量的一加權總和作為在每一組鄰近像素之 間之像素的該些顏色分量;若該壓縮模式被判定為該截斷模式,則將各像素之該些顏色分量移位四個位元且將最後四個位元補零;以及以該4:4:4取樣格式輸出被解壓縮之該視訊資料。 The method for compressing a color component according to claim 8 , wherein the step of decompressing the compressed video material in the memory further comprises: accessing, by the memory, each pixel in the compressed video material. An indicator to determine the compressed mode selected to compress the color components of the pixel; if the compressed mode is determined to be the reduced sampling mode, a weighted sum of the color components of the neighboring pixels is used as Each group of adjacent pixels The color components of the pixels between the pixels; if the compression mode is determined to be the truncation mode, shifting the color components of each pixel by four bits and zeroing the last four bits; and the 4: The 4:4 sampling format outputs the decompressed video material. 如申請專利範圍第9項所述顏色分量的壓縮方法,其中在以該4:4:4取樣格式輸出被解壓縮的該視訊資料的步驟之前,更包括:檢查是否各像素之兩個鄰近像素解壓縮後的亮度相同但與該像素解壓縮後的亮度不同;以及若該些鄰近像素解壓縮後的亮度相同但與該像素解壓縮後的亮度不同,則將該像素之該些顏色分量修改為該些鄰近像素的該些顏色分量。 The method for compressing a color component according to claim 9 , wherein before the step of outputting the decompressed video material in the 4:4:4 sampling format, the method further comprises: checking whether two adjacent pixels of each pixel are used. The decompressed brightness is the same but different from the decompressed brightness of the pixel; and if the decompressed brightness of the neighboring pixels is the same but different from the decompressed brightness of the pixel, the color components of the pixel are modified These color components of the neighboring pixels. 如申請專利範圍第1項所述顏色分量的壓縮方法,其中該些顏色分量包括U顏色分量及V顏色分量。A method of compressing color components as recited in claim 1, wherein the color components comprise U color components and V color components.
TW97150124A 2008-12-22 2008-12-22 Method of color components compression TWI396431B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97150124A TWI396431B (en) 2008-12-22 2008-12-22 Method of color components compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97150124A TWI396431B (en) 2008-12-22 2008-12-22 Method of color components compression

Publications (2)

Publication Number Publication Date
TW201026022A TW201026022A (en) 2010-07-01
TWI396431B true TWI396431B (en) 2013-05-11

Family

ID=44852794

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97150124A TWI396431B (en) 2008-12-22 2008-12-22 Method of color components compression

Country Status (1)

Country Link
TW (1) TWI396431B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW545057B (en) * 1999-02-18 2003-08-01 Gen Instrument Corp Method and architecture for converting MPEG-2 4:2:2-profile bitstreams into main-profile bitstreams
EP1648180A1 (en) * 2003-07-18 2006-04-19 Sony Corporation Image information encoding device and method, and image information decoding device and method
JP2006304203A (en) * 2005-04-25 2006-11-02 Nikon Corp Electronic camera with color difference interleave conversion function
US7376265B2 (en) * 2004-06-17 2008-05-20 Seiko Epson Corporation Segmentation-based hybrid compression scheme for scanned documents

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW545057B (en) * 1999-02-18 2003-08-01 Gen Instrument Corp Method and architecture for converting MPEG-2 4:2:2-profile bitstreams into main-profile bitstreams
EP1648180A1 (en) * 2003-07-18 2006-04-19 Sony Corporation Image information encoding device and method, and image information decoding device and method
US7376265B2 (en) * 2004-06-17 2008-05-20 Seiko Epson Corporation Segmentation-based hybrid compression scheme for scanned documents
JP2006304203A (en) * 2005-04-25 2006-11-02 Nikon Corp Electronic camera with color difference interleave conversion function

Also Published As

Publication number Publication date
TW201026022A (en) 2010-07-01

Similar Documents

Publication Publication Date Title
JP4687216B2 (en) Image signal processing apparatus, camera system, and image signal processing method
JP5256025B2 (en) Video processing apparatus, recording medium, video signal processing method, video signal processing program, and integrated circuit
US8094931B2 (en) Method of color components compression
CN103634598B (en) The transposition buffering of Video processing
JP4687215B2 (en) Image signal processing apparatus, camera system, and image signal processing method
CN101107862B (en) Encoding device and dynamic image recording system having the encoding device
US20140212033A1 (en) Image compression mehtod, image compression device and mobile terminal
US20150103086A1 (en) Display device with graphics frame compression and methods for use therewith
TWI400954B (en) Method for rendering compressed multimedia data, method for decoding compressed multimedia data, apparatus for decoding compressed multimedia data and method for decoding and displaying compressed multimedia data in a system
JP2010171609A (en) Image processing apparatus
US5502778A (en) Image data compression method for applying different compression ratios to different portions of an image
CN103109535B (en) Image-reproducing method, image-reproducing apparatus, camera system and regenerative system
TWI308459B (en) Context-aware frame memory scheme for motion compensation in video decoding
CA2131980C (en) Picture compression apparatus, picture reproducing apparatus and picture drawing apparatus
TWI396431B (en) Method of color components compression
KR20160040930A (en) Method and apparatus for re-encoding an image
US8126952B2 (en) Unified inverse discrete cosine transform (IDCT) microcode processor engine
WO2010021153A1 (en) Motion detection device
US20020090031A1 (en) Method and apparatus for decoding image having format for digital camcorder
JP3774988B2 (en) Still image capturing apparatus, color copying apparatus, and display apparatus
JP4334940B2 (en) Data file compression method
US6614934B1 (en) Method and apparatus for concatenating bits of odd-length words
WO2012160614A1 (en) Moving image decoding device
US20100328332A1 (en) System and method for reducing memory access bandwidth in video decoding
JPH07146927A (en) Image file device

Legal Events

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