TW201547257A - Method for encoding, method for decoding, system for encoding and decoding, encoder and decoder - Google Patents
Method for encoding, method for decoding, system for encoding and decoding, encoder and decoder Download PDFInfo
- Publication number
- TW201547257A TW201547257A TW104115230A TW104115230A TW201547257A TW 201547257 A TW201547257 A TW 201547257A TW 104115230 A TW104115230 A TW 104115230A TW 104115230 A TW104115230 A TW 104115230A TW 201547257 A TW201547257 A TW 201547257A
- Authority
- TW
- Taiwan
- Prior art keywords
- coding unit
- unit block
- primary colors
- palette table
- flag
- Prior art date
Links
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
本揭露是有關於一種適用於具有多個畫素的編碼單元區塊的編碼方法與解碼方法,以及使用此方法的編解碼系統、編碼器與解碼器。 The present disclosure relates to an encoding method and a decoding method suitable for a coding unit block having a plurality of pixels, and a codec system, an encoder and a decoder using the same.
隨著科技的演進,視訊顯示器的解析、規格、尺寸越來越高,人們對視訊畫面品質與尺寸的要求也隨之不斷上升。為滿足此需求,國際電信聯盟(ITU-T)下的視訊編碼專家小組VCEG(Video Coding Experts Group)與國際標準化組織ISO/IEC下的動態畫像專家小組MPEG(Moving Picture Experts Group)共同成立視訊編碼聯合工作小組JCT-VC(Joint Collaborative Team on Video Coding),並開始H.265/HEVC(High Efficiency Video Coding)專案,目標為提供比H.264/AVC(Advanced Video Coding)視訊壓縮標準更高的編碼效率,尤其以高解析度(High Definition,HD)、超高解析度(Ultra High Definition,Ultra HD)等解析度高之視訊為重。 With the evolution of technology, the resolution, specifications and size of video displays are getting higher and higher, and people's requirements for video picture quality and size are also rising. In order to meet this demand, the Video Coding Experts Group under the International Telecommunication Union (ITU-T) and the MPEG (Moving Picture Experts Group) under the International Organization for Standardization ISO/IEC have established video coding. Joint Working Group JCT-VC (Joint Collaborative Team on Video Coding) and started the H.265/HEVC (High Efficiency Video Coding) project with the goal of providing higher video compression standards than H.264/AVC (Advanced Video Coding). The coding efficiency is especially important for high-resolution video such as High Definition (HD) and Ultra High Definition (Ultra HD).
此大尺寸與高解析度之視訊應用的環境多以自然視訊影像為主,並已於2013年完成制訂。目前正在制定的是HEVC SCC(Screen Content Coding,SCC)標準。螢幕分享的視訊內容通常會有混合的視訊內容素材,例如畫面可能同時包含自然影像、大量文字圖片、滑鼠指標及各種線條等,由於此螢幕應用環境已不符H.265/HEVC當初所設計的目標,故JCT-VC近來已將重心轉至發展新的高效能螢幕編碼標準技術。SCC標準乃基於H.265/HEVC現有的工具下進行開發,例如,調色盤模式(Palette mode)便是專屬於SCC標準的編碼技術。調色盤模式的技術概念則是搜尋一個或多個主要顏色來代表現在正在編碼中的編碼單元(Coding Unit,CU)區塊內之畫面,並利用這些主要顏色所對應到的索引來對編碼單元內的畫素進行索引編號。編碼端會使用此些主要顏色所對應到的索引來建立出一個索引地圖,並將一個或多個主要顏色以及索引地圖內對應每個畫素的顏色的索引傳送到解碼端。 This large-size and high-resolution video application environment is dominated by natural video images and was developed in 2013. Currently being developed is the HEVC SCC (Screen Content Coding, SCC) standard. The video content shared by the screen usually has mixed video content material. For example, the screen may contain natural images, a large number of text images, mouse pointers and various lines, etc., because the screen application environment has not been designed by H.265/HEVC. The goal, so JCT-VC has recently shifted its focus to the development of new high-performance screen coding standard technology. The SCC standard is developed based on the existing tools of H.265/HEVC. For example, the Palette mode is an encoding technology specific to the SCC standard. The technical concept of palette mode is to search for one or more main colors to represent the pictures in the Coding Unit (CU) block that is currently being encoded, and to use the index corresponding to the main colors to encode the code. The pixels in the cell are indexed. The encoding end uses the index corresponding to the primary colors to create an index map, and transmits one or more primary colors and an index of the color corresponding to each pixel in the index map to the decoding end.
然而,為了保有編碼運算的彈性,在調色盤模式中會保留一個索引,以提供給編碼單元區塊內不使用主要顏色來表示的畫素使用,此些畫素稱為跳脫畫素(escape pixel),而所保留的索引稱為跳脫索引(escape index)。由此可知,在上述調色盤模式下的傳輸過程中,由於所傳輸的索引會包括主要顏色的索引以及跳脫索引,因此,若正在編碼的編碼單元區塊根本不存在跳脫畫素,保留這個跳脫索引便會增加傳輸編碼單元區塊的每個索引時不必要的負擔。 However, in order to preserve the flexibility of the encoding operation, an index is reserved in the palette mode to provide pixel usage in the coding unit block without using the main color, which is called a tripping pixel ( Escape pixel), and the index retained is called the escape index. It can be seen that, in the transmission process in the above palette mode, since the index to be transmitted includes the index of the primary color and the index of the hopping, if the coding unit block being encoded does not have a hopping pixel at all, Retaining this hop index increases the unnecessary burden of transferring each index of the coding unit block.
本揭露提供一種編碼方法與解碼方法以及使用此方法的編解碼系統、編碼器與解碼器,其能夠有效地提升螢幕視訊編碼技術的編碼效能。 The present disclosure provides an encoding method and a decoding method, and a codec system, an encoder and a decoder using the same, which can effectively improve the encoding performance of the screen video encoding technology.
本揭露的一範例實施例提出一種用於具有多個畫素的編碼單元區塊的編碼方法,本編碼方法包括:在調色盤模式中,當所述編碼單元區塊的每一畫素的顏色皆由編碼單元區塊的一個或多個主要顏色來表示時,將對應所述編碼單元區塊的旗標設定為第一狀態值。當所述編碼單元區塊的畫素之中的其中之至少一畫素的顏色不由一個或多個主要顏色來表示時,將對應所述編碼單元區塊的旗標設定為第二狀態值。本編碼方法還包括:根據所述旗標的狀態值與所述一個或多個主要顏色建立對應所述編碼單元區塊的調色盤表。 An exemplary embodiment of the present disclosure proposes an encoding method for a coding unit block having a plurality of pixels, the encoding method including: in the palette mode, when each pixel of the coding unit block When the colors are all represented by one or more primary colors of the coding unit block, the flag corresponding to the coding unit block is set to the first state value. When the color of at least one of the pixels of the coding unit block is not represented by one or more primary colors, the flag corresponding to the coding unit block is set to the second state value. The encoding method further includes: establishing a palette table corresponding to the coding unit block according to the state value of the flag and the one or more primary colors.
本揭露的一範例實施例提出一種用於具有多個畫素的編碼單元區塊的解碼方法,本解碼方法包括:在調色盤模式中,判斷對應所述編碼單元區塊的旗標的狀態值。當所述旗標為第一狀態值時,判斷對應所述編碼單元區塊的索引數目大小為所述編碼單元區塊的一個或多個主要顏色的數目。當所述旗標為第二狀態值時,判斷對應所述編碼單元區塊的索引數目大小為所述編碼單元區塊的一個或多個主要顏色的數目加1。 An exemplary embodiment of the present disclosure provides a decoding method for a coding unit block having a plurality of pixels. The decoding method includes: determining, in a palette mode, a state value of a flag corresponding to the coding unit block. . When the flag is the first state value, determining that the number of indexes corresponding to the coding unit block is the number of one or more primary colors of the coding unit block. When the flag is the second state value, it is determined that the number of indexes corresponding to the coding unit block is one of the number of one or more primary colors of the coding unit block plus one.
本揭露的一範例實施例提出一種編碼器,此編碼器包括:旗標設定模組以及調色盤表建立模組。在調色盤模式中,當 具有多個畫素的所述編碼單元區塊的每一畫素的顏色皆由編碼單元區塊的一個或多個主要顏色來表示時,旗標設定模組將對應所述編碼單元區塊的旗標設定為第一狀態值。當所述編碼單元區塊的畫素之中之至少一畫素的顏色不由一個或多個主要顏色來表示時,旗標設定模組將對應所述編碼單元區塊的旗標設定為第二狀態值。調色盤表建立模組根據所述旗標的狀態值與所述一個或多個主要顏色建立對應所述編碼單元區塊的調色盤表。 An exemplary embodiment of the present disclosure provides an encoder including: a flag setting module and a palette table building module. In the palette mode, when When the color of each pixel of the coding unit block having a plurality of pixels is represented by one or more main colors of the coding unit block, the flag setting module will correspond to the coding unit block. The flag is set to the first state value. When the color of at least one pixel of the pixels of the coding unit block is not represented by one or more primary colors, the flag setting module sets the flag corresponding to the coding unit block to the second Status value. The palette table establishing module establishes a palette table corresponding to the coding unit block according to the state value of the flag and the one or more primary colors.
本揭露的一範例實施例提出一種解碼器,此解碼器包括旗標狀態判定模組。旗標狀態判定模組在調色盤模式中判斷對應編碼單元區塊的旗標的狀態值。當所述旗標為第一狀態值時,旗標狀態判定模組判斷對應所述編碼單元區塊的索引數目大小為所述編碼單元區塊的一個或多個主要顏色的數目。當所述旗標為第二狀態值時,旗標狀態判定模組判斷對應所述編碼單元區塊的索引數目大小為所述編碼單元區塊的一個或多個主要顏色的數目加1。 An exemplary embodiment of the present disclosure proposes a decoder that includes a flag state determination module. The flag state determination module determines the state value of the flag of the corresponding coding unit block in the palette mode. When the flag is the first state value, the flag state determination module determines that the number of indexes corresponding to the coding unit block is the number of one or more primary colors of the coding unit block. When the flag is the second state value, the flag state determination module determines that the number of indexes corresponding to the coding unit block is one of the number of one or more primary colors of the coding unit block plus one.
本揭露的一範例實施例提出一種編解碼系統,本編解碼系統包括:編碼器與解碼器。當具有多個畫素的所述編碼單元區塊的每一畫素的顏色皆由編碼單元區塊的一個或多個主要顏色來表示時,編碼器將對應所述編碼單元區塊的旗標設定為第一狀態值。當所述編碼單元區塊的畫素之中的其中之至少一畫素的顏色不由一個或多個主要顏色來表示時,編碼器將對應所述編碼單元區塊的旗標設定為第二狀態值。此外,編碼器根據所述旗標的狀 態值與所述一個或多個主要顏色建立對應所述編碼單元區塊的調色盤表。編碼器依據對應所述編碼單元區塊的調色盤表以及所述編碼單元區塊的畫素的顏色產生對應編碼單元區塊的索引地圖,並且傳送對應所述編碼單元區塊的旗標、對應所述編碼單元區塊的調色盤表與對應所述編碼單元區塊的索引地圖至所述解碼器。 An exemplary embodiment of the present disclosure provides a codec system, where the codec system includes an encoder and a decoder. When the color of each pixel of the coding unit block having a plurality of pixels is represented by one or more primary colors of the coding unit block, the encoder will correspond to the flag of the coding unit block. Set to the first state value. When the color of at least one of the pixels of the coding unit block is not represented by one or more primary colors, the encoder sets the flag corresponding to the coding unit block to the second state. value. In addition, the encoder is shaped according to the flag The state value establishes a palette table corresponding to the coding unit block with the one or more primary colors. The encoder generates an index map corresponding to the coding unit block according to the palette table corresponding to the coding unit block and the color of the pixel of the coding unit block, and transmits a flag corresponding to the coding unit block, Corresponding to the palette table of the coding unit block and an index map corresponding to the coding unit block to the decoder.
本揭露的一範例實施例提出一種解碼方法,適用於具有多個畫素的編碼單元區塊。本解碼方法包括:在調色盤模式中,判斷對應所述編碼單元區塊的旗標的狀態值。當所述旗標為第一狀態值時,判斷判斷所述編碼單元區塊未包含跳脫畫素。當所述旗標為第二狀態值時,判斷所述編碼單元區塊包含至少一跳脫畫素。 An exemplary embodiment of the present disclosure proposes a decoding method suitable for a coding unit block having a plurality of pixels. The decoding method includes determining, in the palette mode, a state value corresponding to a flag of the coding unit block. When the flag is the first state value, it is determined that the coding unit block does not include a hopping pixel. When the flag is the second state value, it is determined that the coding unit block includes at least one hopping pixel.
基於上述,本揭露之範例實施例所提出的編碼方法與解碼方法及使用此方法的編解碼系統、編碼器與解碼器能夠藉由所設定的旗標決定是否保留跳脫索引的欄位,進而有效地節省編碼運算時的傳輸位元,由此提升編碼效能。 Based on the above, the encoding method and the decoding method and the codec system, the encoder and the decoder using the method of the present disclosure can determine whether to retain the field of the index by using the set flag, and further The transmission bit in the coding operation is effectively saved, thereby improving the coding efficiency.
為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the invention will be apparent from the following description.
100‧‧‧編解碼晶片 100‧‧‧ Codec Chip
102、130、150‧‧‧儲存電路 102, 130, 150‧‧‧ storage circuits
104、140、160‧‧‧處理器電路 104, 140, 160‧‧‧ processor circuits
106‧‧‧緩衝記憶體 106‧‧‧Buffered memory
110‧‧‧編碼器 110‧‧‧Encoder
120‧‧‧解碼器 120‧‧‧Decoder
112‧‧‧旗標設定模組 112‧‧‧flag setting module
114‧‧‧調色盤表建立模組 114‧‧‧Color palette creation module
116‧‧‧索引地圖建立模組 116‧‧‧ Index map building module
118‧‧‧編碼模組 118‧‧‧Code Module
122‧‧‧接收模組 122‧‧‧ receiving module
124‧‧‧旗標狀態判定模組 124‧‧‧flag status determination module
126‧‧‧解碼模組 126‧‧‧Decoding module
200‧‧‧編碼單元區塊 200‧‧‧ coding unit block
300、800‧‧‧調色盤表 300, 800‧‧‧ palette table
302、802‧‧‧索引值欄位 302, 802‧‧‧ index value field
304、804‧‧‧顏色欄位 304, 804‧‧‧ color field
400、900‧‧‧索引地圖 400, 900‧‧‧ index map
810‧‧‧調色盤表中的第一列 810‧‧‧The first column in the palette table
820‧‧‧調色盤表中的第二列 820‧‧‧Second column in the palette table
S501、S503、S505、S507、S509、S511、S513‧‧‧編碼方法的步驟 Steps of the S501, S503, S505, S507, S509, S511, S513‧‧ ‧ encoding methods
601、602、603、604、605、606、607、608‧‧‧使用CABAC解碼的程序 601, 602, 603, 604, 605, 606, 607, 608‧‧‧ Programs using CABAC decoding
S601、S603、S605、S607、S609、S611、S613、S615、S617、S619‧‧‧解碼方法的步驟 Steps of S601, S603, S605, S607, S609, S611, S613, S615, S617, S619‧‧‧ decoding method
C1、C2、C3、C4、C5‧‧‧顏色 C1, C2, C3, C4, C5‧‧‧ colors
C Escape ‧‧‧跳脫畫素 C Escape ‧‧‧Bounce
圖1A是根據本揭露之範例實施例所繪示的編碼器。 FIG. 1A is an encoder according to an exemplary embodiment of the disclosure.
圖1B是根據本揭露之範例實施例所繪示的解碼器。 FIG. 1B is a diagram illustrating a decoder according to an exemplary embodiment of the disclosure.
圖1C是根據本揭露之範例實施例所繪示的編解碼晶片。 FIG. 1C is a codec wafer according to an exemplary embodiment of the present disclosure.
圖2A與圖2B是根據本揭露之一範例實施例所繪示的影像編碼運作示意圖。 FIG. 2A and FIG. 2B are schematic diagrams of image encoding operations according to an exemplary embodiment of the present disclosure.
圖3是根據本揭露之一範例實施例所繪示的調色盤表的一個範例。 FIG. 3 is an illustration of a palette table in accordance with an exemplary embodiment of the present disclosure.
圖4是根據本揭露之一範例實施例所繪示的建立索引地圖的一個範例。 FIG. 4 is an example of establishing an index map according to an exemplary embodiment of the disclosure.
圖5為根據本揭露一範例實施例所繪示的編碼方法的流程圖。 FIG. 5 is a flowchart of an encoding method according to an exemplary embodiment of the disclosure.
圖6A為根據本揭露一範例實施例所繪示的進行解碼的程式碼。 FIG. 6A is a code diagram for decoding according to an exemplary embodiment of the disclosure.
圖6B-1與圖6B-2為根據本揭露一範例實施例所繪示的解碼方法的流程圖。 FIG. 6B-1 and FIG. 6B-2 are flowcharts illustrating a decoding method according to an exemplary embodiment of the disclosure.
圖7A與圖7B是根據本揭露之另一範例實施例所繪示的影像編碼運作示意圖。 7A and 7B are schematic diagrams showing an image encoding operation according to another exemplary embodiment of the present disclosure.
圖8是根據本揭露之另一範例實施例所繪示的調色盤表的一個範例。 FIG. 8 is an example of a palette table according to another exemplary embodiment of the present disclosure.
圖9是根據本揭露之另一範例實施例所繪示的建立索引地圖的一個範例。 FIG. 9 is an example of establishing an index map according to another exemplary embodiment of the disclosure.
圖10A與圖10B是根據本揭露之範例實施例所繪示的影像編解碼的測試結果示意圖。 FIG. 10A and FIG. 10B are schematic diagrams showing test results of image codec according to an exemplary embodiment of the present disclosure.
圖1A是根據本揭露之範例實施例所繪示的編碼器。 FIG. 1A is an encoder according to an exemplary embodiment of the disclosure.
請參照圖1A,編碼器110包括旗標設定模組112、調色盤表建立模組114、索引地圖建立模組116、編碼模組118、儲存電路130與處理器電路140。 Referring to FIG. 1A , the encoder 110 includes a flag setting module 112 , a palette table establishing module 114 , an index map establishing module 116 , an encoding module 118 , a storage circuit 130 , and a processor circuit 140 .
在本範例實施例中,儲存電路130用以儲存各種資料、程式碼,或是待處理及處理後的影像。例如,儲存電路130可以是記憶體(memory)或硬碟(Hard Disk Drive,HDD)等儲存媒體,但不限於此。處理器電路140用以控制編碼器110的整體運作。例如,處理器電路140可以是中央處理器(CPU)、微處理器(micro-processor)或嵌入式控制器(embedded controller),本揭露並不加以限制。處理器電路140是耦接至儲存電路130,並且用以控制旗標設定模組112、調色盤表建立模組114、索引地圖建立模組116與編碼模組118來進行編碼操作。 In the present exemplary embodiment, the storage circuit 130 is configured to store various data, code, or images to be processed and processed. For example, the storage circuit 130 may be a storage medium such as a memory or a Hard Disk Drive (HDD), but is not limited thereto. The processor circuit 140 is used to control the overall operation of the encoder 110. For example, the processor circuit 140 may be a central processing unit (CPU), a micro-processor, or an embedded controller, and the disclosure is not limited. The processor circuit 140 is coupled to the storage circuit 130 and configured to control the flag setting module 112, the palette table creation module 114, the index map creation module 116, and the encoding module 118 to perform an encoding operation.
在H.265/HEVC的標準下,是以一個編碼樹單元(Coding Tree Unit,CTU)作為編碼單元(Coding Unit,CU)編碼時的最大處理區塊,此編碼樹單元的大小可以設定為64×64的區塊。編碼單元區塊則可以是小於或等於編碼樹單元的區塊大小。舉例而言,編碼單元區塊為一正方矩形並且其大小可以是64×64、32×32、16×16或8×8的區塊。另外,在本揭露範例實施例中所述的編碼單元區塊具有多個畫素,並且編碼單元區塊大小的單位為畫素。在本範例實施例中,為了方便說明,以下以編碼單元區塊的大小為4× 4的區塊做為例示。 Under the standard of H.265/HEVC, the maximum processing block is encoded by a Coding Tree Unit (CTU) as a coding unit (CU). The size of this coding tree unit can be set to 64. × 64 blocks. The coding unit block may then be smaller or equal to the block size of the coding tree unit. For example, the coding unit block is a square rectangle and its size may be a 64x64, 32x32, 16x16 or 8x8 block. In addition, the coding unit block described in the exemplary embodiment of the disclosure has a plurality of pixels, and the unit of the coding unit block size is a pixel. In the present exemplary embodiment, for convenience of description, the size of the coding unit block is 4×. The block of 4 is taken as an example.
在本範例實施例中,旗標設定模組112用以在調色盤模式中為編碼單元區塊設定一旗標。例如,當編碼單元區塊的每一畫素的顏色皆由編碼單元區塊的一個或多個主要顏色來表示時,旗標設定模組112將對應編碼單元區塊的旗標設定為第一狀態值。反之,當編碼單元區塊的畫素之中的至少一畫素的顏色不以一個或多個主要顏色來表示時,旗標設定模組112將對應編碼單元區塊的旗標設定為第二狀態值。又例如,當編碼單元區塊中不包含跳脫畫素(escape pixel)時,旗標設定模組112將對應編碼單元區塊的旗標設定為第一狀態值。反之,當編碼單元區塊中包含跳脫畫素時,旗標設定模組112將對應編碼單元區塊的旗標設定為第二狀態值。值得注意的是,本揭露所指的一個顏色並不侷限於由單一組成元素所組成的顏色,也可以是指由數個組成元素所組成之對應顏色,例如,是指由三個組成元素所組成之對應YUV格式或RGB格式的顏色。YUV格式用以編譯顏色空間(color space),其中「Y」表示明亮度(Luminance、Luma),「U」和「V」則是表示色度與濃度(Chrominance、Chroma),並且Y、Cb、Cr用來描述其組成元素。RGB格式是一種加色模型,用以將紅(Red)、綠(Green)、藍(Blue)三原色的色光以不同的比例相加,以產生多種多樣的色光,其中R、G、B用來描述其組成元素。 In the present exemplary embodiment, the flag setting module 112 is configured to set a flag for the coding unit block in the palette mode. For example, when the color of each pixel of the coding unit block is represented by one or more main colors of the coding unit block, the flag setting module 112 sets the flag of the corresponding coding unit block to the first. Status value. On the other hand, when the color of at least one pixel in the pixels of the coding unit block is not represented by one or more main colors, the flag setting module 112 sets the flag of the corresponding coding unit block to the second. Status value. For another example, when the coding unit block does not include an escape pixel, the flag setting module 112 sets the flag of the corresponding coding unit block to the first state value. Conversely, when the coding unit block includes the hopping pixels, the flag setting module 112 sets the flag of the corresponding coding unit block to the second state value. It should be noted that the color referred to in the present disclosure is not limited to a color composed of a single constituent element, and may also be a corresponding color composed of a plurality of constituent elements, for example, by three constituent elements. The color corresponding to the YUV format or the RGB format. The YUV format is used to compile color space, where "Y" indicates brightness (Luminance, Luma), "U" and "V" indicate chromaticity and concentration (Chrominance, Chroma), and Y, Cb, Cr is used to describe its constituent elements. The RGB format is an additive color model for adding the red, red, and blue primary colors in different proportions to produce a variety of color lights, of which R, G, and B are used. Describe its constituent elements.
調色盤表建立模組114用以建立對應編碼單元區塊的一調色盤表(Palette table)。 The palette table creation module 114 is configured to create a palette table corresponding to the coding unit block.
索引地圖建立模組116用以依據對應編碼單元區塊的調色盤表以及編碼單元區塊的畫素的顏色產生對應編碼單元區塊的索引地圖。 The index map establishing module 116 is configured to generate an index map corresponding to the coding unit block according to the color palette table of the corresponding coding unit block and the color of the pixel of the coding unit block.
編碼模組118用以將對應編碼單元區塊的旗標、調色盤表與索引地圖進行編碼,編碼模組118用以進行編碼的方式可以是使用全文參考適應性二元算術編碼(Context-based Adaptive Binary Arithmetic Coding,CABAC)的旁路模式(bypass mode),也可以是使用CABAC的全文模式(context mode)。 The encoding module 118 is configured to encode the flag, the palette table and the index map of the corresponding coding unit block, and the encoding module 118 can perform encoding by using the full-text reference adaptive binary arithmetic coding (Context- Based on Binary Arithmetic Coding (CABAC), the bypass mode can also be a context mode using CABAC.
編碼器110可將編碼後的旗標、調色盤表與索引地圖傳送至解碼器,也可將旗標、調色盤表與索引地圖直接傳送至解碼器,而未經過編碼。換言之,編碼器110可將經過編碼後的旗標、調色盤表與索引地圖,或者是未經過編碼的旗標、調色盤表與索引地圖傳送至解碼器。在一範例實施例中,旗標、調色盤表與索引地圖可由編碼模組118透過上述旁路模式被傳送至解碼器。在另一範例實施例中,上述旗標、調色盤表與索引地圖是透過上述全文模式被壓縮後再傳送至解碼器。特別是,在本範例實施例中,編碼器110還可將調色盤表中索引值的位元數和跳脫畫素的畫素值編碼後傳送至解碼器,或者是不將調色盤表中索引值的位元數和跳脫畫素的畫素值編碼而傳送至解碼器。在另一範例實施例中,旗標、調色盤表和索引地圖亦可以透過不同的編碼模式而被編碼,例如,編碼模組118使用旁路模式對旗標編碼,且使用全文模式對調色盤表與索引地圖編碼,並且由編碼器110一併將編 碼後的旗標、調色盤表與索引地圖傳送至解碼器。此外,編碼器110可實作在影像發送終端中,而解碼器可實作在影像接收終端中,並且編碼器與解碼器可透過有線或無線方式來通訊。 The encoder 110 may transmit the encoded flag, palette table and index map to the decoder, or may directly transmit the flag, the palette table and the index map to the decoder without being encoded. In other words, the encoder 110 can transmit the encoded flag, palette table and index map, or unencoded flag, palette table and index map to the decoder. In an exemplary embodiment, the flag, palette table, and index map may be transmitted to the decoder by the encoding module 118 via the bypass mode described above. In another exemplary embodiment, the flag, the palette table, and the index map are compressed by the full text mode and then transmitted to the decoder. In particular, in the present exemplary embodiment, the encoder 110 may further encode the number of bits of the index value in the palette table and the pixel value of the skipping pixel to the decoder, or may not use the palette. The number of bits of the index value in the table and the pixel value of the hopping pixel are encoded and transmitted to the decoder. In another exemplary embodiment, the flag, the palette table, and the index map may also be encoded through different encoding modes. For example, the encoding module 118 encodes the flag using the bypass mode and uses the full-text mode to adjust the flag. Color wheel table and index map code, and will be edited by encoder 110 The flag after the code, the palette table and the index map are transmitted to the decoder. In addition, the encoder 110 can be implemented in the image transmitting terminal, and the decoder can be implemented in the image receiving terminal, and the encoder and the decoder can communicate by wire or wirelessly.
圖1B是根據本揭露之範例實施例所繪示的解碼器。 FIG. 1B is a diagram illustrating a decoder according to an exemplary embodiment of the disclosure.
請參照圖1B,解碼器120包括接收模組122、旗標狀態判定模組124、解碼模組126、儲存電路150與處理器電路160。 Referring to FIG. 1B , the decoder 120 includes a receiving module 122 , a flag state determining module 124 , a decoding module 126 , a storage circuit 150 , and a processor circuit 160 .
儲存電路150用以儲存各種資料、程式碼,或是待處理及處理後的影像。例如,儲存電路150可以是記憶體或硬碟等儲存媒體,但不限於此。處理器電路160用以控制編碼器120的整體運作。在本範例實施例中,處理器電路160會控制接收模組122、旗標狀態判定模組124與解碼模組126完成解碼操作。例如,處理器電路160可以是中央處理器、微處理器或嵌入式控制器,本揭露並不加以限制。 The storage circuit 150 is used to store various data, code, or images to be processed and processed. For example, the storage circuit 150 may be a storage medium such as a memory or a hard disk, but is not limited thereto. The processor circuit 160 is used to control the overall operation of the encoder 120. In the present exemplary embodiment, the processor circuit 160 controls the receiving module 122, the flag state determining module 124, and the decoding module 126 to complete the decoding operation. For example, processor circuit 160 can be a central processing unit, a microprocessor, or an embedded controller, and the disclosure is not limited.
相對於編碼器110,解碼器120的接收模組122用以在調色盤模式(Palette mode)中接收編碼器110傳來的對應編碼單元區塊的旗標與調色盤表。而解碼器120的解碼模組126接收對應編碼單元區塊的索引地圖。由於從編碼器110傳來的旗標、調色盤表與對應編碼單元區塊的索引地圖可能是經過CABAC編碼後的旗標、調色盤表與對應編碼單元區塊的索引地圖,也可能是未經過CABAC編碼的旗標、調色盤表與對應編碼單元區塊的索引地圖,因此,接收模組122會判斷對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表是否使用CABAC而被壓縮,而解碼模組 126會判斷對應編碼單元區塊的索引地圖是否使用CABAC而被壓縮。在本範例實施例中,解碼器120的接收模組122會先接收到對應編碼單元區塊的旗標與調色盤表,並且判斷對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表是否使用CABAC而被壓縮,倘若接收模組122判斷所接收的對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表是使用CABAC而被壓縮,則接收模組122會將經過CABAC編碼的旗標與調色盤表做CABAC解碼以獲得調色盤表的索引數目大小的最大值。之後,解碼器120的解碼模組126接收到索引地圖,並且在解碼模組126判斷對應編碼單元區塊的索引地圖亦是使用CABAC而被壓縮時,解碼模組126會根據上述索引數目大小的最大值對經過CABAC編碼的對應編碼單元區塊的索引地圖進行CABAC解碼。然而,本揭露並不限於此,例如,在另一範例實施例中,在接收模組122接收對應編碼單元區塊的旗標與調色盤表的同時,解碼模組126也會接收到對應編碼單元區塊的索引地圖。因此,接收模組122與解碼模組126會分別將經過CABAC編碼的旗標、調色盤表與對應編碼單元區塊的索引地圖做CABAC解碼。又例如,在另一範例實施例中,在接收模組122對旗標與調色盤表做CABAC解碼時,解碼器120的解碼模組126接收到索引地圖,並在接收模組122對旗標與調色盤表解碼後,解碼器120的解碼模組126再將接收到索引地圖解碼。 With respect to the encoder 110, the receiving module 122 of the decoder 120 is configured to receive the flag of the corresponding coding unit block and the palette table transmitted by the encoder 110 in a Palette mode. The decoding module 126 of the decoder 120 receives the index map of the corresponding coding unit block. Since the flag, the palette table, and the index map of the corresponding coding unit block transmitted from the encoder 110 may be a CABAC-encoded flag, a palette table, and an index map of the corresponding coding unit block, it is also possible The flag map, the palette table, and the index map of the corresponding coding unit block are not subjected to CABAC coding. Therefore, the receiving module 122 determines the flag table of the corresponding coding unit block and the palette table of the corresponding coding unit block. Whether to use CABAC to be compressed, and the decoding module 126 will determine whether the index map of the corresponding coding unit block is compressed using CABAC. In the present exemplary embodiment, the receiving module 122 of the decoder 120 first receives the flag and the palette table of the corresponding coding unit block, and determines the flag of the corresponding coding unit block and the corresponding coding unit block. Whether the palette table is compressed using CABAC, if the receiving module 122 determines that the received flag of the corresponding coding unit block and the palette table of the corresponding coding unit block are compressed using CABAC, the receiving module 122 will perform CABAC decoding on the CABAC-encoded flag and the palette table to obtain the maximum value of the index number of the palette table. Then, the decoding module 126 of the decoder 120 receives the index map, and when the decoding module 126 determines that the index map of the corresponding coding unit block is also compressed by using CABAC, the decoding module 126 may be based on the number of indexes. The maximum value performs CABAC decoding on the index map of the corresponding coding unit block that is coded by CABAC. However, the disclosure is not limited thereto. For example, in another exemplary embodiment, when the receiving module 122 receives the flag of the corresponding coding unit block and the palette table, the decoding module 126 also receives the corresponding An index map of the coding unit block. Therefore, the receiving module 122 and the decoding module 126 respectively perform CABAC decoding on the CABAC-encoded flag, the palette table, and the index map of the corresponding coding unit block. For another example, in another exemplary embodiment, when the receiving module 122 performs CABAC decoding on the flag and the palette table, the decoding module 126 of the decoder 120 receives the index map and the flag in the receiving module 122. After the target and the palette table are decoded, the decoding module 126 of the decoder 120 will decode the received index map.
在此,如同編碼模組118的編碼方式,接收模組122與 解碼模組126可以使用CABAC的旁路模式,或者使用CABAC的全文模式來解碼接收到的旗標、調色盤表與對應編碼單元區塊的索引地圖。在另一範例實施例中,接收模組122也可接收編碼器110所傳來的調色盤表中索引值的位元數和跳脫畫素的畫素值,類似地,若收到的資料是經過CABAC編碼的資料則會進行CABAC解碼。此外,如上所述,由於旗標、調色盤表和索引地圖可以分別地透過不同的編碼模式而被編碼,因此,倘若接收模組122接收到使用旁路模式編碼的旗標與使用全文模式編碼的調色盤表,而解碼模組126接收到使用全文模式編碼的索引地圖,則接收模組122會使用旁路模式對所接收之旗標進行解碼且使用全文模式對所接收之調色盤表進行解碼,而解碼模組126會使用全文模式對所接收之索引地圖進行解碼。 Here, as with the encoding mode of the encoding module 118, the receiving module 122 and The decoding module 126 may use the bypass mode of CABAC or use the full text mode of CABAC to decode the received flag, the palette table, and the index map of the corresponding coding unit block. In another exemplary embodiment, the receiving module 122 can also receive the number of bits of the index value in the palette table transmitted by the encoder 110 and the pixel value of the hopping pixel, similarly, if received. The data is CABAC encoded data will be CABAC decoding. In addition, as described above, since the flag, the palette table, and the index map can be encoded through different encoding modes, respectively, if the receiving module 122 receives the flag encoded using the bypass mode and uses the full text mode. The encoded palette table, and the decoding module 126 receives the index map using the full-text mode encoding, the receiving module 122 decodes the received flag using the bypass mode and uses the full-text mode to receive the received color The disc table is decoded, and the decoding module 126 decodes the received index map using the full text mode.
旗標狀態判定模組124用以從接收模組122接收對應編碼單元區塊的旗標,並且判斷所接收之對應編碼單元區塊的旗標的狀態值。例如,當所接收的旗標為第一狀態值時,旗標狀態判定模組124判斷對應此編碼單元區塊的畫素不包含跳脫畫素,因此得知對應此編碼單元區塊的調色盤表的索引數目大小為編碼單元區塊的一個或多個主要顏色的數目。反之,當所接收的旗標為第二狀態值時,旗標狀態判定模組124判斷對應此編碼單元區塊的畫素包含跳脫畫素,因此得知對應此編碼單元區塊的調色盤表的索引數目大小為編碼單元區塊的一個或多個主要顏色的數目加1。 The flag state determination module 124 is configured to receive a flag of the corresponding coding unit block from the receiving module 122, and determine a state value of the received flag of the corresponding coding unit block. For example, when the received flag is the first state value, the flag state determination module 124 determines that the pixel corresponding to the coding unit block does not include the hopping pixel, and thus knows the tone corresponding to the coding unit block. The index number size of the color wheel table is the number of one or more primary colors of the coding unit block. On the other hand, when the received flag is the second state value, the flag state determining module 124 determines that the pixel corresponding to the coding unit block includes the hopping pixel, and thus learns the color grading corresponding to the coding unit block. The index number of the disk table is increased by one for the number of one or more primary colors of the coding unit block.
如上所述,在本範例實施例中,解碼模組126用以接收索引地圖,而由於編碼器110傳來的索引地圖可能是經過CABAC編碼後的索引地圖,也可能是未經過CABAC編碼的索引地圖,若是解碼模組126接收到經過CABAC編碼的索引地圖,解碼模組126會根據旗標狀態判定模組124得知對應編碼單元區塊的調色盤表的索引數目大小將經過CABAC編碼的索引地圖做CABAC解碼,並解碼出索引地圖的索引,在此,解碼模組126可以使用CABAC的旁路模式,或者使用CABAC的全文模式來解碼。此外,解碼模組126會根據調色盤表中編碼單元區塊的畫素的顏色與索引地圖的多個索引值重建編碼單元區塊的畫素,以還原此編碼單元區塊。 As described above, in the present exemplary embodiment, the decoding module 126 is configured to receive the index map, and the index map transmitted by the encoder 110 may be a CABAC-encoded index map, or may be an index that has not been CABAC-encoded. If the decoding module 126 receives the CABAC-encoded index map, the decoding module 126 learns, according to the flag state determination module 124, that the index number of the palette table corresponding to the coding unit block is CABAC-encoded. The index map is CABAC decoded and the index of the index map is decoded. Here, the decoding module 126 can use the CABAC bypass mode or use the CABAC full text mode to decode. In addition, the decoding module 126 reconstructs the pixels of the coding unit block according to the color of the pixel of the coding unit block in the palette table and the plurality of index values of the index map to restore the coding unit block.
上述編碼器與解碼器可分別實作於不同的終端中,並且透過網路傳遞彼此所需要的資料,然而,本揭露不限於此。在另一範例實施例中,編碼器與解碼器可實作於同一個晶片或系統中。 The above encoder and decoder can be implemented in different terminals respectively, and the materials required for each other are transmitted through the network. However, the disclosure is not limited thereto. In another exemplary embodiment, the encoder and decoder may be implemented in the same wafer or system.
圖1C是根據本揭露之第一範例實施例所繪示的編解碼晶片。 FIG. 1C is a codec wafer according to a first exemplary embodiment of the present disclosure.
請參照圖1C,編解碼晶片100(亦可為一編解碼系統)包括儲存電路102、處理器電路104、緩衝記憶體106、編碼器110以及解碼器120。 Referring to FIG. 1C, the codec chip 100 (which may also be a codec system) includes a storage circuit 102, a processor circuit 104, a buffer memory 106, an encoder 110, and a decoder 120.
儲存電路102用以儲存各種資料、程式碼,或是待處理及處理後的影像。例如,儲存電路102可以是記憶體或硬碟等儲存媒體,但不限於此。 The storage circuit 102 is configured to store various data, code, or images to be processed and processed. For example, the storage circuit 102 may be a storage medium such as a memory or a hard disk, but is not limited thereto.
處理器電路104用以控制編解碼晶片100的整體運作。例如,處理器電路104會下達指令給儲存電路102,以執行編碼器110與解碼器120來對影像進行編碼與解碼的操作。例如,處理器電路104可以是中央處理器、微處理器或嵌入式控制器,本揭露並不加以限制。 The processor circuit 104 is used to control the overall operation of the codec wafer 100. For example, processor circuit 104 will issue an instruction to storage circuit 102 to perform an operation of encoding and decoding the image by encoder 110 and decoder 120. For example, processor circuit 104 can be a central processing unit, a microprocessor, or an embedded controller, and the disclosure is not limited.
緩衝記憶體106耦接至處理器電路104,並且用以暫存資料。在本範例實施例中,緩衝記憶體106為靜態隨機存取記憶體(Static Random-Access Memory,SRAM),但不限於此,在另一範例實施例中,緩衝記憶體106可以是動態隨機存取記憶體(Dynamic Random Access Memory)或其他記憶體。在另一範例實施例中,編解碼晶片100可與其他系統共用儲存電路102、處理器電路104及/或緩衝記憶體106。 The buffer memory 106 is coupled to the processor circuit 104 and is used to temporarily store data. In the present exemplary embodiment, the buffer memory 106 is a static random access memory (SRAM), but is not limited thereto. In another exemplary embodiment, the buffer memory 106 may be dynamically randomized. Take a memory (Dynamic Random Access Memory) or other memory. In another exemplary embodiment, codec wafer 100 may share storage circuit 102, processor circuit 104, and/or buffer memory 106 with other systems.
儲存電路102耦接至處理器電路104與緩衝記憶體106。編碼器110與解碼器120的運作是分別相似於上述圖1A與圖1B中所示的編碼器與解碼器。例如,編碼器110包括旗標設定模組112、調色盤表建立模組114、索引地圖建立模組116與編碼模組118。解碼器120包括接收模組122、旗標狀態判定模組124、解碼模組126。 The storage circuit 102 is coupled to the processor circuit 104 and the buffer memory 106. The operation of encoder 110 and decoder 120 are similar to the encoder and decoder shown in Figures 1A and 1B, respectively. For example, the encoder 110 includes a flag setting module 112, a palette table creating module 114, an index map creating module 116, and an encoding module 118. The decoder 120 includes a receiving module 122, a flag state determining module 124, and a decoding module 126.
本揭露中的編碼器與解碼器可由軟體模組或程式碼來實作,例如,儲存電路102儲存上述旗標設定模組112、調色盤表建立模組114、索引地圖建立模組116、編碼模組118、接收模組122、旗標狀態判定模組124以及解碼模組126,並且當編解碼晶片100 致能時,此些軟體程式碼從儲存電路102被載入至緩衝記憶體106且由處理器電路102執行以運作旗標設定模組112、調色盤表建立模組114、索引地圖建立模組116、編碼模組118、接收模組122、旗標狀態判定模組124以及解碼模組126的功能。然而,本揭露不限於此,例如,在本揭露另一範例實施例中,編解碼晶片、編碼器與解碼器可以是由硬體電路來實作。例如,上述旗標設定模組112、調色盤表建立模組114、索引地圖建立模組116、編碼模組118、接收模組122、旗標狀態判定模組124以及解碼模組126可以硬體電路實作為旗標設定電路、調色盤表建立電路、索引地圖建立電路、編碼電路、接收電路、旗標狀態判定電路以及解碼電路。在本揭露另一範例實施例中,編碼器與解碼器可以由硬體電路實作於一晶片中。在本揭露另一範例實施例中,編碼器與解碼器可以由硬體電路實作為一編碼晶片和一解碼晶片。 The encoder and the decoder in the disclosure may be implemented by a software module or a code. For example, the storage circuit 102 stores the flag setting module 112, the palette table creating module 114, the index map building module 116, Encoding module 118, receiving module 122, flag state determining module 124, and decoding module 126, and when encoding and decoding wafer 100 When enabled, the software code is loaded from the storage circuit 102 to the buffer memory 106 and executed by the processor circuit 102 to operate the flag setting module 112, the palette table creation module 114, and the index map creation module. The functions of the group 116, the encoding module 118, the receiving module 122, the flag state determining module 124, and the decoding module 126. However, the disclosure is not limited thereto. For example, in another exemplary embodiment of the disclosure, the codec chip, the encoder, and the decoder may be implemented by a hardware circuit. For example, the flag setting module 112, the palette table establishing module 114, the index map building module 116, the encoding module 118, the receiving module 122, the flag state determining module 124, and the decoding module 126 can be hard. The body circuit is used as a flag setting circuit, a palette table establishing circuit, an index map establishing circuit, an encoding circuit, a receiving circuit, a flag state determining circuit, and a decoding circuit. In another exemplary embodiment of the present disclosure, the encoder and the decoder may be implemented in a chip by a hardware circuit. In another exemplary embodiment of the present disclosure, the encoder and the decoder may be implemented by a hardware circuit as a coded chip and a decoded chip.
為了更清楚地描述編碼器110、解碼器120與編解碼晶片100的運作,以下將參照圖1C的編解碼晶片100以一範例實施例來進行說明。 To more clearly describe the operation of the encoder 110, the decoder 120, and the codec wafer 100, an exemplary embodiment will be described below with reference to the codec wafer 100 of FIG. 1C.
圖2A與圖2B是根據本揭露之一範例實施例所繪示的影像編碼運作示意圖。為了方便說明,以下以編碼單元區塊200的大小為4×4做為例示。 FIG. 2A and FIG. 2B are schematic diagrams of image encoding operations according to an exemplary embodiment of the present disclosure. For convenience of explanation, the following is exemplified by the size of the coding unit block 200 being 4×4.
請參照圖2A,在調色盤模式中,編碼器110搜尋一個或多個主要顏色來代表現在正在編碼中的編碼單元區塊200內之畫面,並利用此一個或多個主要顏色所對應到的索引來對編碼單元 內的每一個畫素進行索引編號。 Referring to FIG. 2A, in the palette mode, the encoder 110 searches for one or more primary colors to represent the picture within the coding unit block 200 that is currently being encoded, and uses the one or more primary colors to correspond to Index to the coding unit Each pixel within the index is indexed.
舉例來說,調色盤表建立模組114會建立對應編碼單元區塊200的調色盤表,以使得索引地圖建立模組116可依據對應編碼單元區塊200的調色盤表以及編碼單元區塊的畫素的顏色產生對應編碼單元區塊的索引地圖。在建立對應編碼單元區塊200的調色盤表的操作中,調色盤表建立模組114是根據編碼單元區塊200的畫素的顏色選擇對應編碼單元區塊200的一個或多個主要顏色。在本範例實施例中,編碼單元區塊200的每一原始畫素的畫素值(即,10、11、100、200與255)所對應到的顏色以顏色C1、顏色C2、顏色C3、顏色C4與顏色C5表示,在一實施例中,顏色C1的值即為畫素值10,同樣地,顏色C2、顏色C3、顏色C4與顏色C5的值即為畫素值11、100、200與255;而在另一實施例中,顏色C1、顏色C2、顏色C3、顏色C4與顏色C5可依實際需要根據畫素值10、11、100、200與255編碼而得。由於顏色C1與顏色C2的顏色相近(例如,對應顏色C1與顏色C2之畫素的畫素值的差值小於顏色差距門檻值(例如,顏色差距門檻值被設定為5)),因此,調色盤表建立模組114會僅選擇顏色C1作為對應畫素值為10與畫素值為11的畫素的主要顏色。最後,調色盤表建立模組114所選擇的對應編碼單元區塊200的主要顏色分別是顏色C1、顏色C3、顏色C4與顏色C5。 For example, the palette table creation module 114 establishes a palette table corresponding to the coding unit block 200, so that the index map creation module 116 can depend on the palette table and the coding unit of the corresponding coding unit block 200. The color of the pixel of the block produces an index map corresponding to the block of the coding unit. In the operation of establishing the palette table corresponding to the coding unit block 200, the palette table creation module 114 selects one or more main portions of the corresponding coding unit block 200 according to the color of the pixels of the coding unit block 200. colour. In the present exemplary embodiment, the color values corresponding to the pixel values of each original pixel of the coding unit block 200 (ie, 10, 11, 100, 200, and 255) are color C1, color C2, color C3, The color C4 and the color C5 indicate that, in one embodiment, the value of the color C1 is the pixel value of 10. Similarly, the values of the color C2, the color C3, the color C4, and the color C5 are the pixel values of 11, 100, and 200. And in another embodiment, the color C1, the color C2, the color C3, the color C4, and the color C5 can be encoded according to actual pixel values 10, 11, 100, 200, and 255. Since the color C1 is similar to the color of the color C2 (for example, the difference between the pixel values of the pixels corresponding to the color C1 and the color C2 is smaller than the color difference threshold (for example, the color difference threshold is set to 5)) The color wheel table creation module 114 selects only the color C1 as the main color of the pixel having a corresponding pixel value of 10 and a pixel value of 11. Finally, the main colors of the corresponding coding unit block 200 selected by the palette table creation module 114 are color C1, color C3, color C4, and color C5, respectively.
請參照圖2B,接著,調色盤表建立模組114分別設定對應此些主要顏色的索引值,例如,調色盤表建立模組114根據先 前所選擇的主要顏色C1、C3、C4與C5,而使用編號0、1、2、3作為分別對應主要顏色C1、C3、C4與C5的索引值。 Referring to FIG. 2B, the palette table creation module 114 respectively sets index values corresponding to the main colors. For example, the palette table creation module 114 is based on The main colors C1, C3, C4, and C5 are selected previously, and the numbers 0, 1, 2, and 3 are used as index values corresponding to the main colors C1, C3, C4, and C5, respectively.
在本範例實施例中,由於編碼單元區塊200的每一畫素的顏色皆可由編碼單元區塊200的主要顏色表示,而不需跳脫畫素,因此,旗標設定模組112將其所建立之對應編碼單元區塊200的旗標設定為第一狀態值。例如,此第一狀態值是以布林值來表示,並且旗標設定模組112將此第一狀態值設為0。據此,調色盤表建立模組114可根據旗標的第一狀態值得知編碼單元區塊200並不存在跳脫畫素(escape pixel),並且將對應編碼單元區塊200的調色盤表的索引數目大小設定為編碼單元區塊200的主要顏色的數目。 In the present exemplary embodiment, since the color of each pixel of the coding unit block 200 can be represented by the main color of the coding unit block 200 without jumping off the pixel, the flag setting module 112 will The flag of the corresponding corresponding coding unit block 200 is set to the first state value. For example, the first state value is represented by a Boolean value, and the flag setting module 112 sets the first state value to zero. Accordingly, the palette table creating module 114 can know that the encoding unit block 200 does not have an escape pixel according to the first state value of the flag, and the palette table corresponding to the encoding unit block 200 is The index number size is set to the number of primary colors of the coding unit block 200.
圖3是根據本揭露之一範例實施例所繪示的調色盤表的一個範例。 FIG. 3 is an illustration of a palette table in accordance with an exemplary embodiment of the present disclosure.
請參照圖3,在本範例實施例中,如上所述,由於編碼單元區塊200的每一畫素的顏色皆可由編碼單元區塊200的主要顏色來表示,據此,調色盤表建立模組114將對應編碼單元區塊200的調色盤表的索引數目大小設定為編碼單元區塊200的主要顏色的數目。例如,編碼單元區塊200的主要顏色的數目為4(即,主要顏色C1、C3、C4與C5),因此,如圖3所示,調色盤表建立模組114將對應編碼單元區塊200的調色盤表300的索引數目大小設定為剛好可記錄此4個主要顏色的大小。並且,調色盤表建立模組114將此些主要顏色(即,主要顏色C1、C3、C4與C5,其畫 素值分別為10、100、200與255)與對應此些主要顏色的索引值(即,0~3)分別記錄於調色盤表300的顏色欄位304與索引值欄位302中。 Referring to FIG. 3, in the present exemplary embodiment, as described above, since the color of each pixel of the coding unit block 200 can be represented by the main color of the coding unit block 200, accordingly, the palette table is established. The module 114 sets the index number size of the palette table corresponding to the coding unit block 200 to the number of primary colors of the coding unit block 200. For example, the number of primary colors of the coding unit block 200 is 4 (ie, primary colors C1, C3, C4, and C5), and therefore, as shown in FIG. 3, the palette table creation module 114 will correspond to the coding unit block. The index number size of the palette table 300 of 200 is set to just the size of the four main colors. And, the palette table creation module 114 takes these main colors (ie, the main colors C1, C3, C4, and C5, and draws them The prime values of 10, 100, 200, and 255, respectively, and the index values corresponding to the primary colors (i.e., 0 to 3) are recorded in the color field 304 and the index value field 302 of the palette table 300, respectively.
在本範例實施例中,在調色盤表300中,主要顏色的索引值中的最大值(即,3)為對應編碼單元區塊200的主要顏色的數目減1。此外,對應此編碼單元區塊200的主要顏色的數目等於記錄在調色盤表300中主要顏色的索引值的總數目。換言之,當編碼單元區塊200的每一畫素的顏色皆可由編碼單元區塊200的主要顏色來表示時,即代表正在編碼的編碼單元區塊200不存在跳脫畫素。因此,在此情況下,調色盤表建立模組114所建立的調色盤表300並不會保留對應跳脫畫素的跳脫索引的欄位,以減少索引值的編碼位元數,由此可避免多餘位元的傳輸,以減少傳輸索引時不必要的浪費。在本範例實施例中,為了清楚說明,以主要顏色:畫素值(例如C1:10、C3:100、C4:200與C5:255)的方式表示顏色欄位304,在一實施例中,顏色欄位304為畫素值10、100、200與255。 In the present exemplary embodiment, in the palette table 300, the maximum value (i.e., 3) of the index values of the primary colors is the number of primary colors corresponding to the coding unit block 200 minus one. Further, the number of primary colors corresponding to this coding unit block 200 is equal to the total number of index values of the main colors recorded in the palette table 300. In other words, when the color of each pixel of the coding unit block 200 can be represented by the main color of the coding unit block 200, that is, the coding unit block 200 being encoded does not have a hopping pixel. Therefore, in this case, the palette table 300 created by the palette table creating module 114 does not retain the field corresponding to the skip index of the skipping pixel, so as to reduce the number of encoding bits of the index value. This avoids the transmission of redundant bits to reduce unnecessary waste when transferring indexes. In the present exemplary embodiment, for clarity of description, the color field 304 is represented in a primary color: pixel value (eg, C1:10, C3:100, C4:200, and C5:255), in one embodiment, The color field 304 is a pixel value of 10, 100, 200, and 255.
圖4是根據本揭露之一範例實施例所繪示的建立索引地圖的一個範例。 FIG. 4 is an example of establishing an index map according to an exemplary embodiment of the disclosure.
請參照圖4,之後,索引地圖建立模組116即可根據對應主要顏色C1、C3、C4與C5的索引值0、1、2與3,對編碼單元區塊200中的每一畫素進行索引編號以產生索引地圖400。換言之,在索引地圖400中,編碼單元區塊200的每一畫素的顏色是 以對應主要顏色C1、C3、C4與C5的索引值0、1、2與3來呈現。 Referring to FIG. 4, afterwards, the index map building module 116 can perform each pixel in the coding unit block 200 according to the index values 0, 1, 2, and 3 of the corresponding primary colors C1, C3, C4, and C5. The index number is used to generate an index map 400. In other words, in the index map 400, the color of each pixel of the coding unit block 200 is It is presented with index values 0, 1, 2, and 3 corresponding to the main colors C1, C3, C4, and C5.
接著,編碼模組118會將旗標、對應編碼單元區塊200的調色盤表300與索引地圖400經過CABAC編碼並傳送至解碼器120,或者是直接將旗標、對應編碼單元區塊200的調色盤表300與索引地圖400傳送至解碼器120。 Next, the encoding module 118 passes the flag table, the palette table 300 of the corresponding encoding unit block 200 and the index map 400 to the decoder 120 through CABAC encoding, or directly flags the corresponding encoding unit block 200. The palette table 300 and the index map 400 are transmitted to the decoder 120.
具體而言,在本範例實施例中,調色盤表建立模組114並不會強制保留跳脫索引的欄位,且編碼單元區塊200的主要顏色的數目為4,因此有4個索引值。在此,假設在本範例實施例中,是使用等機率編碼方法,因此,僅需使用2個位元來編碼此4個索引值。例如,對應主要顏色C1、C3、C4與C5的索引值為0、1、2與3,則索引地圖建立模組116可使用二進位制的“00”、“01”、“10”與“11”來編碼此4個索引值,並將二進位制的“00”、“01”、“10”與“11”記錄於索引地圖中。由此可知,在強制保留跳脫索引的情況下,由於索引值的數目增加為5個,將需要使用3個位元來編碼5個索引值。據此,藉由本範例實施例的編碼方法,每傳送一個畫素的索引值即可節省一個位元。在本實施例中,由於編碼單元區塊200的大小為4×4,對應編碼單元區塊200的索引地圖400的大小也是4×4,在未進行壓縮及其他處理的情形下,傳送4×4個畫素的索引值可節省十六個位元的傳輸量。 Specifically, in the present exemplary embodiment, the palette table creation module 114 does not forcibly retain the field of the index of jumping, and the number of primary colors of the coding unit block 200 is 4, so there are 4 indexes. value. Here, it is assumed that in the present exemplary embodiment, the equal probability encoding method is used, and therefore, only two bits are used to encode the four index values. For example, if the index values of the primary colors C1, C3, C4, and C5 are 0, 1, 2, and 3, the index map creation module 116 can use the binary system "00", "01", "10", and " 11" to encode the four index values, and record the "00", "01", "10" and "11" of the binary system in the index map. It can be seen that in the case of forcibly retaining the hopping index, since the number of index values is increased to five, it is necessary to use three bits to encode five index values. Accordingly, with the encoding method of the present exemplary embodiment, one bit can be saved for each index of the pixel. In this embodiment, since the size of the coding unit block 200 is 4×4, the size of the index map 400 corresponding to the coding unit block 200 is also 4×4, and in the case where compression and other processing are not performed, 4× is transmitted. The index value of 4 pixels can save 16 bits of transmission.
圖5為根據本揭露一範例實施例所繪示的編碼方法的流程圖。 FIG. 5 is a flowchart of an encoding method according to an exemplary embodiment of the disclosure.
請參照圖5,在步驟S501中,編碼器110在調色盤模式中為編碼單元區塊設定一旗標。 Referring to FIG. 5, in step S501, the encoder 110 sets a flag for the coding unit block in the palette mode.
在步驟S503中,編碼器110判斷編碼單元區塊的每一畫素的顏色是否由此編碼單元區塊的一個或多個主要顏色表示。 In step S503, the encoder 110 determines whether the color of each pixel of the coding unit block is represented by one or more primary colors of the coding unit block.
在步驟S505中,當編碼單元區塊的每一畫素的顏色皆由編碼單元區塊的一個或多個主要顏色來表示時,編碼器110會將對應編碼單元區塊的旗標設定為第一狀態值。而在步驟S507中,當編碼單元區塊的畫素之中的其中之至少一畫素的顏色不以一個或多個主要顏色來表示時,將對應編碼單元區塊的旗標設定為第二狀態值。 In step S505, when the color of each pixel of the coding unit block is represented by one or more main colors of the coding unit block, the encoder 110 sets the flag of the corresponding coding unit block to the first A state value. In step S507, when the color of at least one of the pixels of the coding unit block is not represented by one or more main colors, the flag of the corresponding coding unit block is set to the second. Status value.
接著,在步驟S509中,編碼器110根據旗標的狀態值與所述一個或多個主要顏色建立對應編碼單元區塊的調色盤表。 Next, in step S509, the encoder 110 establishes a palette table corresponding to the coding unit block with the one or more primary colors according to the state value of the flag.
在步驟S511中,編碼器110依據對應編碼單元區塊的調色盤表以及編碼單元區塊的畫素的顏色產生對應編碼單元區塊的索引地圖。 In step S511, the encoder 110 generates an index map corresponding to the coding unit block according to the palette table of the corresponding coding unit block and the color of the pixel of the coding unit block.
之後,在步驟S513中,編碼器110將對應編碼單元區塊的旗標、對應編碼單元區塊的調色盤表與對應編碼單元區塊的索引地圖使用CABAC進行壓縮,並傳送壓縮後的對應編碼單元區塊的旗標、對應編碼單元區塊的調色盤表與對應編碼單元區塊的索引地圖至解碼端的解碼器或是編解碼晶片100的解碼器120。或者,編碼器110會傳送未壓縮的對應編碼單元區塊的旗標、對應編碼單元區塊的調色盤表與對應編碼單元區塊的索引地圖至解碼 端的解碼器或是編解碼晶片100的解碼器120。其中,CABAC編碼的方式可以是使用CABAC的旁路模式,也可以是使用CABAC的全文模式。在另一範例實施例中,編碼器110將對應編碼單元區塊的旗標、對應編碼單元區塊的調色盤表與對應編碼單元區塊的索引地圖使用CABAC進行壓縮後,傳送到一儲存媒體中儲存,或者,編碼器110會傳送未壓縮的對應編碼單元區塊的旗標、對應編碼單元區塊的調色盤表與對應編碼單元區塊的索引地圖到儲存媒體中儲存,儲存媒體可以是編碼器110的儲存電路130或編解碼晶片100的儲存電路102,或是編碼端的另一儲存媒體(例如,硬碟),也可以是不在編碼端中的另一儲存媒體(例如,雲端硬碟)。 Then, in step S513, the encoder 110 compresses the flag of the corresponding coding unit block, the palette table of the corresponding coding unit block, and the index map of the corresponding coding unit block using CABAC, and transmits the compressed correspondence. A flag of the coding unit block, a palette table corresponding to the coding unit block, and an index map of the corresponding coding unit block to the decoder of the decoding end or the decoder 120 of the codec chip 100. Alternatively, the encoder 110 transmits an uncompressed flag of the corresponding coding unit block, a palette table of the corresponding coding unit block, and an index map to the corresponding coding unit block to decode. The decoder at the end is also the decoder 120 of the codec wafer 100. Among them, the CABAC coding method may be a bypass mode using CABAC or a full-text mode using CABAC. In another exemplary embodiment, the encoder 110 compresses the flag of the corresponding coding unit block, the palette table of the corresponding coding unit block, and the index map of the corresponding coding unit block by using CABAC, and then transmits the result to a storage. The medium is stored in the medium, or the encoder 110 transmits the uncompressed flag of the corresponding coding unit block, the palette table of the corresponding coding unit block and the index map of the corresponding coding unit block to the storage medium, and the storage medium is stored. It may be the storage circuit 130 of the encoder 110 or the storage circuit 102 of the codec chip 100, or another storage medium (for example, a hard disk) at the encoding end, or another storage medium (for example, the cloud) that is not in the encoding end. Hard disk).
在本範例實施例中,當解碼器120的接收模組122接收上述對應編碼單元區塊200的旗標與對應編碼單元區塊200的調色盤表300時,若是接收的對應編碼單元區塊200的旗標與對應編碼單元區塊200的調色盤表300是經過CABAC編碼的資料,接收模組122會先進行CABAC解碼。例如,若是接收的對應編碼單元區塊200的旗標經過CABAC的旁路模式或CABAC的全文模式壓縮,則接收模組122會對應的使用CABAC的旁路模式或CABAC的全文模式解壓縮,以解出對應編碼單元區塊200的旗標;同樣地,若接收的對應編碼單元區塊200的調色盤表300經過CABAC的旁路模式或CABAC的全文模式壓縮,則接收模組122會對應的使用CABAC的旁路模式或CABAC的全文模式解壓縮,以解出對應編碼單元區塊200的調色盤表300。之後,旗標狀態判定模組 124會先判斷對應編碼單元區塊200的旗標的狀態值。例如,在本範例實施例中,旗標狀態判定模組124判斷所接收的旗標被設定為第一狀態值(例如,0),據此,旗標狀態判定模組124可得知編碼單元區塊200並不存在跳脫畫素,並且判斷對應編碼單元區塊200的調色盤表300的索引數目大小為編碼單元區塊的主要顏色的數目。在另一實施例中,若是旗標狀態判定模組124判斷所接收的旗標被設定為第二狀態值(例如,1),據此,旗標狀態判定模組124可得知編碼單元區塊200存在跳脫畫素,並判斷對應編碼單元區塊200的調色盤表300的索引數目大小為編碼單元區塊的主要顏色的數目加1。 In the present exemplary embodiment, when the receiving module 122 of the decoder 120 receives the flag of the corresponding coding unit block 200 and the palette table 300 of the corresponding coding unit block 200, if the corresponding coding unit block is received. The flag of 200 and the palette table 300 corresponding to the coding unit block 200 are CABAC-encoded data, and the receiving module 122 performs CABAC decoding first. For example, if the received flag of the corresponding coding unit block 200 is compressed by the CABAC bypass mode or the CABAC full-text mode, the receiving module 122 may use the CABAC bypass mode or the CABAC full-text mode decompression to The flag of the corresponding coding unit block 200 is solved. Similarly, if the received palette table 300 of the corresponding coding unit block 200 is subjected to the CABAC bypass mode or the CABAC full-text mode compression, the receiving module 122 corresponds. The use of CABAC bypass mode or CABAC full-text mode decompression to solve the palette table 300 corresponding to the coding unit block 200. Flag state determination module 124 will first determine the status value of the flag corresponding to the coding unit block 200. For example, in the present exemplary embodiment, the flag state determination module 124 determines that the received flag is set to a first state value (eg, 0), according to which the flag state determination module 124 can know the coding unit. The block 200 does not have a hopping pixel, and it is judged that the index number size of the palette table 300 corresponding to the coding unit block 200 is the number of main colors of the coding unit block. In another embodiment, if the flag state determination module 124 determines that the received flag is set to a second state value (eg, 1), the flag state determination module 124 can learn the coding unit area. The block 200 has a hopping pixel, and judges that the index number of the palette table 300 corresponding to the coding unit block 200 is the number of primary colors of the coding unit block plus one.
接著,解碼模組126接收索引地圖400,若是接收的索引地圖400是經過CABAC編碼的資料,解碼模組126會先進行CABAC解碼。例如,若是接收的對應編碼單元區塊200的索引地圖400經過CABAC的旁路模式或CABAC的全文模式壓縮,則解碼模組126會對應的使用CABAC的旁路模式或CABAC的全文模式解壓縮,並根據對應編碼單元區塊200的調色盤表300的索引數目大小解出對應編碼單元區塊200的索引地圖400的索引值。之後,解碼模組126重建編碼單元區塊200。詳細的說,解碼模組126根據索引地圖400的畫素的索引值搜尋調色盤表300(例如,使用查表法),符合索引值所對應的主要顏色其所表示的畫素值即為編碼單元區塊200中畫素的畫素值。例如,索引地圖400中的其中一個畫素的索引值為0,而調色盤表300中,索引值為0所對 應的主要顏色是C1,且其畫素值為10,因此,解碼模組126會將編碼單元區塊200的畫素值重建為10,並且,以此類推,解碼模組126會一一重建編碼單元區塊200的畫素,以重建編碼單元區塊200。在本範例實施例中,解碼器120接收編解碼晶片100的編碼器110或編碼端的編碼器傳來的旗標、調色盤表300和索引地圖400。在另一範例實施例中解碼器120可以接收由一儲存媒體傳來的旗標、調色盤表300和索引地圖400,此儲存媒體可以是解碼器120的儲存電路150或編解碼晶片100的儲存電路102,或是解碼端的另一儲存媒體(例如,硬碟),也可以是不在解碼端中的另一儲存媒體(例如,雲端硬碟)。 Next, the decoding module 126 receives the index map 400. If the received index map 400 is CABAC encoded data, the decoding module 126 performs CABAC decoding first. For example, if the received index map 400 of the corresponding coding unit block 200 is subjected to the CABAC bypass mode or the CABAC full-text mode compression, the decoding module 126 may use the CABAC bypass mode or the CABAC full-text mode decompression, And the index value of the index map 400 corresponding to the coding unit block 200 is solved according to the index number size of the palette table 300 corresponding to the coding unit block 200. Thereafter, the decoding module 126 reconstructs the coding unit block 200. In detail, the decoding module 126 searches the palette table 300 according to the index value of the pixels of the index map 400 (for example, using a look-up table method), and the pixel value represented by the main color corresponding to the index value is The pixel value of the pixel in the coding unit block 200. For example, the index value of one of the pixels in the index map 400 is 0, and in the palette table 300, the index value is 0. The primary color should be C1, and its pixel value is 10. Therefore, the decoding module 126 reconstructs the pixel value of the coding unit block 200 to 10, and so on, the decoding module 126 reconstructs one by one. The pixels of the unit block 200 are encoded to reconstruct the coding unit block 200. In the present exemplary embodiment, the decoder 120 receives the flag, the palette table 300, and the index map 400 from the encoder 110 of the codec wafer 100 or the encoder of the encoder. In another exemplary embodiment, the decoder 120 may receive a flag, a palette table 300, and an index map 400 transmitted from a storage medium, which may be the storage circuit 150 of the decoder 120 or the codec chip 100. The storage circuit 102, or another storage medium (for example, a hard disk) at the decoding end, may also be another storage medium (for example, a cloud hard disk) that is not in the decoding end.
圖6A為根據本揭露一範例實施例所繪示的使用CABAC對對應編碼單元區塊的旗標、對應編碼單元區塊的調色盤表與對應編碼單元區塊的索引地圖進行解碼的程式碼。請參照圖6A,在此範例實施例中,假設對目前正在解碼的旗標、調色盤表與索引地圖所使用的解壓縮方式為CABAC的旁路模式,其中旁路模式以圖6A中的參數“decodeBinEP”表示,執行CABAC解碼的動作以“parse”表示,而參數“PLTMode”代表調色盤模式,參數“PLTSize”與“PLT”分別代表主要顏色的數目與主要顏色,參數“uiIndexMaxSize”代表調色盤表的索引數目大小的最大值,以及參數“uiSignalEscapc”代表旗標。 FIG. 6A is a code diagram for decoding a flag of a corresponding coding unit block, a palette table of a corresponding coding unit block, and an index map of a corresponding coding unit block by using CABAC according to an exemplary embodiment of the disclosure. . Referring to FIG. 6A, in this exemplary embodiment, it is assumed that the decompression mode used for the flag, the palette table and the index map currently being decoded is the bypass mode of CABAC, wherein the bypass mode is as shown in FIG. 6A. The parameter "decodeBinEP" indicates that the action of performing CABAC decoding is represented by "parse", and the parameter "PLTMode" represents the palette mode, the parameters "PLTSize" and "PLT" respectively represent the number of primary colors and the primary color, and the parameter "uiIndexMaxSize" The maximum value of the index number representing the palette table, and the parameter "uiSignalEscapc" represents the flag.
請再參照圖6A,在程序601中,解碼器120確認目前的解碼模式是否為調色盤模式。若判斷目前是使用調色盤模式,則 解碼器120在程序602中,使用CABAC解碼主要顏色的數目與主要顏色。接著,在程序603中,將變數“uiIndexMaxSize”的值設定為主要顏色的數目。 Referring again to FIG. 6A, in the program 601, the decoder 120 confirms whether the current decoding mode is the palette mode. If it is judged that the palette mode is currently used, then In program 602, decoder 120 decodes the number of primary colors and primary colors using CABAC. Next, in the program 603, the value of the variable "uiIndexMaxSize" is set as the number of main colors.
在程序604中,解碼器120使用CABAC的旁路模式來解碼旗標,在此,若是在程序605中,解碼器120判斷對應編碼單元區塊200的旗標的狀態值為1,則解碼器120會得知目前正在解碼的編碼單元區塊存在跳脫畫素。因此,在程序606中,解碼器120會進一步地將對應編碼單元區塊的調色盤表的索引數目大小(即,uiIndexMaxSize)設為編碼單元區塊的主要顏色的數目加1。此時,索引值介於0~uiIndexMaxSize-2的索引皆為主要顏色的索引,而索引值為uiIndexMaxSize-1的索引為跳脫畫素的索引。 In routine 604, decoder 120 decodes the flag using the bypass mode of CABAC, where, in program 605, decoder 120 determines that the flag value of the flag of corresponding coding unit block 200 is one, then decoder 120 It will be known that there is a hopping pixel in the coding unit block currently being decoded. Therefore, in the program 606, the decoder 120 further sets the index number size (i.e., uiIndexMaxSize) of the palette table corresponding to the coding unit block to the number of primary colors of the coding unit block plus one. At this time, the index whose index value is between 0 and uiIndexMaxSize-2 is the index of the primary color, and the index whose index value is uiIndexMaxSize-1 is the index of the skipping pixel.
之後,在程序607中,解碼器120解碼索引地圖內的索引。在此範例實施例中,由於目前正在解碼之編碼單元存在跳脫畫素,因此,在程序608中,解碼器120會解碼跳脫畫素的畫素值。如此一來,解碼器120可藉由解碼與重建正在解碼之編碼單元區塊的每一個畫素來重建編碼單元區塊。 Thereafter, in program 607, decoder 120 decodes the index within the index map. In this exemplary embodiment, since the coding unit currently being decoded has a hopping pixel, in the program 608, the decoder 120 decodes the pixel value of the hopping pixel. As such, the decoder 120 may reconstruct the coding unit block by decoding and reconstructing each pixel of the coding unit block being decoded.
圖6B-1與圖6B-2為根據本揭露一範例實施例所繪示的解碼方法的流程圖。 FIG. 6B-1 and FIG. 6B-2 are flowcharts illustrating a decoding method according to an exemplary embodiment of the disclosure.
請參照圖6B-1與圖6B-2,在步驟S601中,解碼器120接收對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表。 Referring to FIG. 6B-1 and FIG. 6B-2, in step S601, the decoder 120 receives the palette of the corresponding coding unit block and the palette table of the corresponding coding unit block.
在步驟S603中,解碼器120判斷對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表是否使用全文參考適應性二元 算術編碼而被壓縮。 In step S603, the decoder 120 determines whether the flag of the corresponding coding unit block and the palette table of the corresponding coding unit block use the full-text reference adaptive binary. Arithmetic coding is compressed.
倘若所接收的對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表是使用全文參考適應性二元算術編碼而被壓縮,則在步驟S605中,解碼器120會使用全文參考適應性二元算術編碼的旁路模式或是使用全文參考適應性二元算術編碼的全文模式進行解壓縮。反之,倘若所接收的對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表並未使用全文參考適應性二元算術編碼而被壓縮,則進入步驟S607。在本範例實施例中,解碼器120會判斷對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表是否使用全文參考適應性二元算術編碼而被壓縮,在另一範例實施例中,解碼器120不會判斷對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表是否使用全文參考適應性二元算術編碼而被壓縮,而直接使用全文參考適應性二元算術編碼的旁路模式或是使用全文參考適應性二元算術編碼的全文模式進行解壓縮,也就是說,在進行步驟S601後,並不會進行步驟S603,而會進行步驟S605。在一範例實施例中,編碼器110與解碼器120可依設定決定要使用全文參考適應性二元算術編碼的旁路模式或是全文模式進行壓縮、解壓縮,也可依編碼器110與解碼器120之間的溝通(例如,資訊交換)決定要使用全文參考適應性二元算術編碼的旁路模式或是全文模式進行壓縮、解壓縮。 If the received flag of the corresponding coding unit block and the palette table of the corresponding coding unit block are compressed using full-text reference adaptive binary arithmetic coding, then in step S605, the decoder 120 uses the full-text reference. The bypass mode of adaptive binary arithmetic coding is either decompressed using the full-text mode of full-text reference adaptive binary arithmetic coding. On the other hand, if the received flag of the corresponding coding unit block and the palette table of the corresponding coding unit block are not compressed using the full-text reference adaptive binary arithmetic coding, the process proceeds to step S607. In this exemplary embodiment, the decoder 120 determines whether the flag of the corresponding coding unit block and the palette table of the corresponding coding unit block are compressed using full-text reference adaptive binary arithmetic coding, in another example implementation. In an example, the decoder 120 does not determine whether the flag of the corresponding coding unit block and the palette table of the corresponding coding unit block are compressed using the full-text reference adaptive binary arithmetic coding, and directly uses the full-text reference adaptive two. The bypass mode of the meta-arithmetic coding is decompressed using the full-text mode of the full-text reference adaptive binary arithmetic coding, that is, after step S601, step S603 is not performed, and step S605 is performed. In an exemplary embodiment, the encoder 110 and the decoder 120 may determine whether to use the bypass mode or the full-text mode of the full-text reference adaptive binary arithmetic coding to perform compression or decompression according to the setting, or may use the encoder 110 and the decoding. The communication between the devices 120 (for example, information exchange) determines whether to use the full-text reference adaptive binary arithmetic coding bypass mode or full-text mode for compression and decompression.
在步驟S607中,解碼器120在調色盤模式中判斷對應編碼單元區塊的旗標的狀態值為第一狀態值或第二狀態值。 In step S607, the decoder 120 determines in the palette mode that the state value of the flag of the corresponding coding unit block is the first state value or the second state value.
當旗標為第一狀態值時,在步驟S609中,解碼器120會判斷對應編碼單元區塊的調色盤表的索引數目大小為編碼單元區塊的一個或多個主要顏色的數目。 When the flag is the first state value, in step S609, the decoder 120 determines that the index number of the palette table of the corresponding coding unit block is the number of one or more primary colors of the coding unit block.
當旗標為第二狀態值時,在步驟S611中,解碼器120會判斷對應編碼單元區塊的調色盤表的索引數目大小為編碼單元區塊的一個或多個主要顏色的數目加1。 When the flag is the second state value, in step S611, the decoder 120 determines that the index number of the palette table of the corresponding coding unit block is the number of one or more main colors of the coding unit block plus one. .
接著,在圖6B-2中的步驟S613中,解碼器120會接收對應編碼單元區塊的索引地圖,並且判斷此對應編碼單元區塊的索引地圖是否使用全文參考適應性二元算術編碼而被壓縮。 Next, in step S613 in FIG. 6B-2, the decoder 120 receives the index map of the corresponding coding unit block, and determines whether the index map of the corresponding coding unit block is used by the full-text reference adaptive binary arithmetic coding. compression.
倘若所接收的對應編碼單元區塊的索引地圖是使用全文參考適應性二元算術編碼而被壓縮,則在步驟S615中,解碼器120會根據調色盤表的索引數目大小的值使用旁路模式或全文模式對對應編碼單元區塊的索引地圖進行解壓縮,以獲得索引地圖的多個索引值。反之,倘若所接收的對應編碼單元區塊的旗標與對應編碼單元區塊的調色盤表並未使用全文參考適應性二元算術編碼而被壓縮,則在步驟S617中,解碼器120會根據調色盤表的索引數目大小的值對對應編碼單元區塊的索引地圖進行解壓縮,以獲得索引地圖的多個索引值。在另一實施例中,解碼器120接收對應編碼單元區塊的索引地圖後,不判斷此對應編碼單元區塊的索引地圖是否使用全文參考適應性二元算術編碼而被壓縮,而直接根據調色盤表的索引數目大小的值使用旁路模式或全文模式對對應編碼單元區塊的索引地圖進行解壓縮,以獲得索引地圖的多個 索引值,也就是說,在步驟S613接收對應編碼單元區塊的索引地圖後,不進行判斷即進入步驟S615,而不會進入S617。在一範例實施例中,編碼器110與解碼器120可依設定決定要使用全文參考適應性二元算術編碼的旁路模式或是全文模式進行壓縮、解壓縮,也可依編碼器110與解碼器120之間的溝通(例如,資訊交換)決定要使用全文參考適應性二元算術編碼的旁路模式或是全文模式進行壓縮、解壓縮。 If the received index map of the corresponding coding unit block is compressed using full-text reference adaptive binary arithmetic coding, then in step S615, the decoder 120 uses the bypass according to the value of the index number of the palette table. The mode or full-text mode decompresses the index map corresponding to the coding unit block to obtain multiple index values of the index map. On the other hand, if the received flag of the corresponding coding unit block and the palette table of the corresponding coding unit block are not compressed using the full-text reference adaptive binary arithmetic coding, then in step S617, the decoder 120 The index map corresponding to the coding unit block is decompressed according to the value of the index number size of the palette table to obtain a plurality of index values of the index map. In another embodiment, after receiving the index map of the corresponding coding unit block, the decoder 120 does not determine whether the index map of the corresponding coding unit block is compressed by using the full-text reference adaptive binary arithmetic coding, and directly according to the adjustment. The value of the index number size of the color disk table is used to decompress the index map of the corresponding coding unit block by using the bypass mode or the full text mode to obtain multiple indexes of the index map. The index value, that is, after receiving the index map of the corresponding coding unit block in step S613, proceeds to step S615 without making a decision, and does not proceed to S617. In an exemplary embodiment, the encoder 110 and the decoder 120 may determine whether to use the bypass mode or the full-text mode of the full-text reference adaptive binary arithmetic coding to perform compression or decompression according to the setting, or may use the encoder 110 and the decoding. The communication between the devices 120 (for example, information exchange) determines whether to use the full-text reference adaptive binary arithmetic coding bypass mode or full-text mode for compression and decompression.
之後,在步驟S619中,解碼器120根據調色盤表中編碼單元區塊的畫素的顏色與索引地圖的多個索引值重建編碼單元區塊。 Thereafter, in step S619, the decoder 120 reconstructs the coding unit block from the plurality of index values of the index map according to the color of the pixel of the coding unit block in the palette table.
值得一提的是,在本揭露的另一範例實施例中,對應編碼單元區塊的旗標、對應編碼單元區塊的調色盤表與對應編碼單元區塊的索引地圖亦可以同時地被解碼器120所接收,再經由解碼器120解碼。 It is to be noted that, in another exemplary embodiment of the disclosure, the flag of the corresponding coding unit block, the palette table of the corresponding coding unit block, and the index map of the corresponding coding unit block may also be simultaneously The decoder 120 receives and decodes via the decoder 120.
在本揭露之另一範例實施例中,編碼器可利用跳脫畫素取代對應主要顏色之部份的畫素以節省編碼傳輸的位元。 In another exemplary embodiment of the present disclosure, the encoder may replace the pixels corresponding to a portion of the primary color with a hopping pixel to save the bit of the encoded transmission.
圖7A與圖7B是根據本揭露之另一範例實施例所繪示的影像編碼運作示意圖。 7A and 7B are schematic diagrams showing an image encoding operation according to another exemplary embodiment of the present disclosure.
請參照圖7A,在本範例實施例中,在建立對應編碼單元區塊200的調色盤表的操作中,調色盤表建立模組114根據編碼單元區塊200的畫素的顏色選擇對應編碼單元區塊200的一個或多個候選顏色。具體而言,編碼單元區塊200的每一原始畫素的 畫素值(即,10、11、100、200與255)分別以顏色C1、顏色C2、顏色C3、顏色C4與顏色C5表示,在一實施例中,顏色C1的值即為畫素值10,同樣地,顏色C2、顏色C3、顏色C4與顏色C5的值即為畫素值11、100、200與255;而在另一實施例中,顏色C1、顏色C2、顏色C3、顏色C4與顏色C5可依實際需要根據畫素值10、11、100、200與255編碼而得。由於顏色C1與顏色C2的顏色相近(例如,對應顏色C1與顏色C2之畫素的畫素值的差值小於顏色差距門檻值(例如,顏色差距門檻值為5)),因此,調色盤表建立模組114選擇顏色C1作為對應畫素值為10與畫素值為11的畫素的候選顏色。因此,調色盤表建立模組114所選擇的對應編碼單元區塊200的多個候選顏色分別是顏色C1、顏色C3、顏色C4與顏色C5。 Referring to FIG. 7A, in the exemplary embodiment, in the operation of establishing the palette table corresponding to the coding unit block 200, the palette table creation module 114 selects the color according to the color of the pixels of the coding unit block 200. One or more candidate colors of the coding unit block 200. Specifically, each original pixel of the coding unit block 200 The pixel values (ie, 10, 11, 100, 200, and 255) are represented by color C1, color C2, color C3, color C4, and color C5, respectively. In one embodiment, the value of color C1 is the pixel value of 10 Similarly, the values of color C2, color C3, color C4, and color C5 are pixel values 11, 100, 200, and 255; and in another embodiment, color C1, color C2, color C3, color C4 and The color C5 can be encoded according to the actual value of the pixel values 10, 11, 100, 200 and 255. Since the color C1 is similar to the color of the color C2 (for example, the difference between the pixel values of the pixels corresponding to the color C1 and the color C2 is smaller than the color difference threshold (for example, the color difference threshold is 5)), therefore, the palette The table creation module 114 selects the color C1 as the candidate color of the pixel having a corresponding pixel value of 10 and a pixel value of 11. Therefore, the plurality of candidate colors of the corresponding coding unit block 200 selected by the palette table creation module 114 are color C1, color C3, color C4, and color C5, respectively.
接著,調色盤表建立模組114根據多個候選顏色C1、C3、C4與C5,將對應於畫素值為10與畫素值為11的畫素量化至候選顏色C1,將對應於畫素值為100的畫素量化至候選顏色C3,將對應於畫素值為200的畫素量化至候選顏色C4,以及將對應於畫素值為255的畫素量化至候選顏色C5。 Next, the palette table creating module 114 quantizes the pixel corresponding to the pixel value of 10 and the pixel value of 11 to the candidate color C1 according to the plurality of candidate colors C1, C3, C4, and C5, which will correspond to the drawing. A pixel having a prime value of 100 is quantized to the candidate color C3, a pixel corresponding to a pixel value of 200 is quantized to the candidate color C4, and a pixel corresponding to a pixel value of 255 is quantized to the candidate color C5.
在本範例實施例中,調色盤表建立模組114根據每一候選顏色的畫素值將候選顏色分別設定為一個或多個主要顏色與跳脫畫素。舉例來說,調色盤表建立模組114根據一數目門檻值,選擇並設定對應編碼單元區塊200的一個或多個主要顏色。例如,當一候選顏色的數目大於此數目門檻值,則將此候選顏色設定為 一主要顏色,而若是一候選顏色的數目小於或等於此數目門檻值,則將此候選顏色設定為跳脫畫素。在本範例實施例中,假設數目門檻值為2,由於對應於顏色C1的畫素的數目(即,11)大於此數目門檻值,因此,調色盤表建立模組114選擇候選顏色C1作為對應編碼單元區塊200的一個主要顏色C1,主要顏色C1的值可以是畫素值10或是其對應的編碼值。 In the present exemplary embodiment, the palette table creation module 114 sets the candidate colors to one or more primary colors and skip pixels, respectively, according to the pixel values of each candidate color. For example, the palette table creation module 114 selects and sets one or more primary colors of the corresponding coding unit block 200 based on a threshold number of thresholds. For example, when the number of candidate colors is greater than the threshold value, the candidate color is set to A primary color, and if the number of candidate colors is less than or equal to the threshold, the candidate color is set to the hopping pixel. In the present exemplary embodiment, assuming that the number threshold is 2, since the number of pixels corresponding to the color C1 (ie, 11) is greater than the threshold value, the palette table creating module 114 selects the candidate color C1 as the candidate. Corresponding to a primary color C1 of the coding unit block 200, the value of the primary color C1 may be a pixel value of 10 or its corresponding encoded value.
由於對應於候選顏色C3的畫素的數目(即,2)等於此數目門檻值,對應於候選顏色C4的畫素的數目(即,2)等於此數目門檻值,且對應於候選顏色C5的畫素的數目(即,1)小於此數目門檻值,因此,調色盤表建立模組114將候選顏色C3、C4與C5設定為跳脫畫素C Escape 。 Since the number of pixels corresponding to the candidate color C3 (ie, 2) is equal to the number threshold value, the number of pixels corresponding to the candidate color C4 (ie, 2) is equal to the number threshold value, and corresponds to the candidate color C5. The number of pixels (i.e., 1) is less than the threshold value, and therefore, the palette table creation module 114 sets the candidate colors C3, C4, and C5 as the escaping C Escape .
由此可知,在本範例實施例中,量化至主要顏色的候選顏色的畫素的數目大於上述數目門檻值(即,2),而量化為跳脫畫素C Escape 的候選顏色的畫素的數目不大於上述數目門檻值。值得一提的是,本揭露並不加以限制顏色差距門檻值與數目門檻值的大小。例如,在另一範例實施例中,顏色差距門檻值與數目門檻值的大小會隨著編碼運算的量化參數而被動態地調整。 It can be seen that, in the present exemplary embodiment, the number of pixels of the candidate color quantized to the primary color is greater than the number threshold (ie, 2), and the pixel of the candidate color of the hopping pixel C Escape is quantized. The number is not greater than the above threshold. It is worth mentioning that this disclosure does not limit the threshold of the color gap threshold and the number of thresholds. For example, in another exemplary embodiment, the magnitude of the color difference threshold and the number threshold may be dynamically adjusted as the quantization parameter of the encoding operation.
請參照圖7B,接著,調色盤表建立模組114分別地設定對應主要顏色Ci與對應跳脫畫素C Escape 的索引值。例如,調色盤表建立模組114使用編號0、1作為分別對應主要顏色C1與對應跳脫畫素C Escape 的索引值。 Referring to FIG. 7B, the palette table creation module 114 then sets the index values corresponding to the primary color Ci and the corresponding hopping pixel C Escape , respectively. For example, the palette table creation module 114 uses the numbers 0, 1 as index values corresponding to the primary color C1 and the corresponding hopping pixel C Escape , respectively.
在本範例實施例中,由於編碼單元區塊200的至少一畫 素的顏色並非以編碼單元區塊200的一個或多個主要顏色表示,因此,旗標設定模組112將其所建立之對應編碼單元區塊200的旗標設定為第二狀態值。例如,此第二狀態值是以布林值來表示,並且當編碼單元區塊200的至少一畫素的顏色並非以編碼單元區塊200的一個或多個主要顏色來表示時,旗標設定模組112將旗標設定設為1。據此,調色盤表建立模組114可根據此第二狀態值得知編碼單元區塊200存在跳脫畫素並且將對應編碼單元區塊200的調色盤表的索引數目大小設定為編碼單元區塊200的主要顏色的數目加1。 In the present exemplary embodiment, at least one picture of the coding unit block 200 The color of the prime is not represented by one or more primary colors of the coding unit block 200. Therefore, the flag setting module 112 sets the flag of the corresponding coding unit block 200 that it has established as the second state value. For example, the second state value is represented by a Boolean value, and when the color of at least one pixel of the coding unit block 200 is not represented by one or more main colors of the coding unit block 200, the flag setting Module 112 sets the flag setting to one. Accordingly, the palette table creation module 114 can learn that the coding unit block 200 has a hopping pixel according to the second state value and set the index number of the palette table of the corresponding coding unit block 200 to the coding unit. The number of primary colors of block 200 is increased by one.
圖8是根據本揭露之另一範例實施例所繪示的調色盤表的一個範例。 FIG. 8 is an example of a palette table according to another exemplary embodiment of the present disclosure.
請參照圖8,在本範例實施例中,由於並非編碼單元區塊200的每一畫素的顏色皆由編碼單元區塊200的主要顏色來表示,因此,調色盤表建立模組114將對應編碼單元區塊200的調色盤表的索引數目大小設定為編碼單元區塊200的主要顏色的數目加1。例如,編碼單元區塊200的主要顏色的數目為1(即,主要顏色C1),因此,如圖8所示,調色盤表建立模組114將對應編碼單元區塊200的調色盤表800的索引數目大小設定為2。並且,調色盤表建立模組114會將此一個主要顏色C1與對應此一個主要顏色的索引值(即,0)記錄於調色盤表800中的第一列810的顏色欄位804與索引值欄位802中,並且將對應此跳脫畫素C Escape 的索引值(即,1)記錄於調色盤表800中的第二列820的索引值欄位802 中。此外,在調色盤表800中,調色盤表建立模組114會將多個索引值中的最大值設為對應編碼單元區塊的一個或多個主要顏色的數目,例如,索引值中的最大值(即,1)為對應編碼單元區塊200的主要顏色(即,主要顏色C1)的數目。並且對應此編碼單元區塊200的主要顏色的數目加1(即,2)等於記錄在調色盤表800中主要顏色的索引值的總數目加1。 Referring to FIG. 8, in the present exemplary embodiment, since the color of each pixel of the coding unit block 200 is not represented by the main color of the coding unit block 200, the palette table creation module 114 will The index number size of the palette table corresponding to the coding unit block 200 is set to be one of the number of main colors of the coding unit block 200 plus one. For example, the number of primary colors of the coding unit block 200 is 1 (ie, the primary color C1), and therefore, as shown in FIG. 8, the palette table creation module 114 will correspond to the palette table of the coding unit block 200. The index number of 800 is set to 2. Moreover, the palette table creation module 114 records the one primary color C1 and the index value corresponding to the one primary color (ie, 0) in the color field 804 of the first column 810 in the palette table 800. The index value field 802 is entered, and the index value (i.e., 1) corresponding to this hopping factor C Escape is recorded in the index value field 802 of the second column 820 in the palette table 800. Further, in the palette table 800, the palette table creation module 114 sets the maximum of the plurality of index values to the number of one or more primary colors of the corresponding coding unit block, for example, in the index value. The maximum value (i.e., 1) is the number of primary colors (i.e., primary color C1) corresponding to the coding unit block 200. And the number of primary colors corresponding to this coding unit block 200 plus 1 (i.e., 2) is equal to the total number of index values of the primary colors recorded in the palette table 800 plus one.
圖9是根據本揭露之另一範例實施例所繪示的建立索引地圖的一個範例。 FIG. 9 is an example of establishing an index map according to another exemplary embodiment of the disclosure.
請參照圖9,之後,索引地圖建立模組116即可根據對應主要顏色C1的索引值(即,0)與跳脫畫素C Escape 的索引值(即,1),使用調色盤模式對編碼單元區塊200中的每一畫素進行索引編號以產生索引地圖900。換言之,在索引地圖900中編碼單元區塊200的每一畫素的顏色是以對應主要顏色C1與對應跳脫畫素C Escape 的索引值0與1來呈現。在一範例實施例中,請同時參照圖8與圖9,索引值被設定為1的畫素(即跳脫畫素C Escape )之畫素值以傳統方式逐一傳送至解碼端,因此在圖8之第二列820的顏色欄位804並不需限定為特定畫素值。 Referring to FIG. 9, after that, the index map creating module 116 can use the palette mode pair according to the index value (ie, 0) of the corresponding primary color C1 and the index value (ie, 1) of the hopping pixel C Escape . Each pixel in the coding unit block 200 is indexed to generate an index map 900. In other words, the color of each pixel of the coding unit block 200 in the index map 900 is presented with index values 0 and 1 corresponding to the primary color C1 and the corresponding hopping C Escape . In an exemplary embodiment, please refer to FIG. 8 and FIG. 9 simultaneously, and the pixel values of the pixels whose index value is set to 1 (ie, the hopping pixel C Escape ) are transmitted to the decoding end one by one in a conventional manner, so The color field 804 of the second column 820 of 8 is not necessarily limited to a particular pixel value.
接著,編碼模組118會將旗標、調色盤表800與索引地圖900經過CABAC編碼傳送至解碼器120,或者是將旗標、調色盤表800與索引地圖900傳送至解碼器120。在本範例實施例中,編碼模組118還會將屬於跳脫畫素C Escape 之顏色C3、C4與C5所對應的原始畫素的畫素值傳送至解碼器120。然而,本揭露並不限於 此,例如,在另一範例實施例中,編碼模組118所傳送的調色盤表800僅包含主要顏色和其索引值(在本範例實施例中為調色盤表800的第一列810),而未包含跳脫畫素之對應欄位(在本範例實施例中為調色盤表800的第二列820);又例如,在另一範例實施例中,編碼模組118所傳送的調色盤表800僅包含主要顏色(在本範例實施例中為調色盤表800的第一列810的顏色欄位804),而未包含索引值(在本範例實施例中為調色盤表800的第一列810的索引欄位802),也未包含跳脫畫素之對應欄位,解碼端接收到主要顏色時,可依設定或是與編碼端的協定自行決定索引,例如,收到的第一個主要顏色其索引值為0,收到的第二個主要顏色其索引值為1,以此類推。 Next, the encoding module 118 transmits the flag, palette table 800 and index map 900 to the decoder 120 via CABAC encoding, or transmits the flag, palette table 800 and index map 900 to the decoder 120. In the present exemplary embodiment, the encoding module 118 also transmits the pixel values of the original pixels corresponding to the colors C3, C4, and C5 of the hopping C Escape to the decoder 120. However, the disclosure is not limited thereto. For example, in another exemplary embodiment, the palette table 800 transmitted by the encoding module 118 includes only the primary color and its index value (in the present exemplary embodiment, the palette) The first column 810) of the table 800 does not include a corresponding field of the hopping pixels (in the present exemplary embodiment, the second column 820 of the palette table 800); again, for example, in another exemplary embodiment The palette table 800 transmitted by the encoding module 118 contains only the primary color (the color field 804 of the first column 810 of the palette table 800 in the present exemplary embodiment), but does not include the index value (in the present In the exemplary embodiment, the index field 802) of the first column 810 of the palette table 800 does not include the corresponding field of the skip pixel. When the decoder receives the main color, it can be set or matched with the encoding end. The agreement determines the index by itself, for example, the first primary color received has an index value of 0, the second primary color received has an index value of 1, and so on.
具體而言,在本範例實施例中,調色盤表建立模組114使用跳脫畫素來取代可由主要顏色來表示的部份的畫素,以使得在本範例實施例中僅有一個對應編碼單元區塊200之主要顏色的索引與一個跳脫索引,因此僅有2個索引值需傳送至解碼器120。在此,假設在使用等機率編碼方法,因此可使用1個位元來編碼此2個索引值。例如,對應主要顏色C1與跳脫畫素C Escape 的索引值分別為0與1,則索引地圖建立模組116可使用二進位制的“0”與“1”來編碼此2個索引值,並將二進位制的“0”與“1”記錄於索引地圖中。而在強制保留跳脫索引且未使用將主要顏色的畫素改為跳脫畫素的機制的情況下,將需要使用3個位元來編碼5個索引值。也就是說,藉由本範例實施例的編碼方法,編碼模組 118每傳送一個畫素的索引值即可節省兩個位元,在本實施例中,由於編碼單元區塊200的大小為4×4,對應編碼單元區塊200的索引地圖400的大小也是4×4,在未進行壓縮及其他處理的情形下,傳送4×4個畫素的索引值可節省三十二個位元的傳輸量。 Specifically, in the present exemplary embodiment, the palette table creation module 114 uses the hopping pixels instead of the pixels of the portion that can be represented by the primary color, so that there is only one corresponding encoding in the present exemplary embodiment. The index of the primary color of unit block 200 is indexed with one hop, so only two index values need to be passed to decoder 120. Here, it is assumed that the equal probability encoding method is used, so that the two index values can be encoded using one bit. For example, if the index values corresponding to the primary color C1 and the detached pixel C Escape are 0 and 1, respectively, the index map building module 116 can encode the two index values by using the binary "0" and "1". The binary "0" and "1" are recorded in the index map. In the case of forcing a reservation to skip the index and not using a mechanism to change the primary color of the pixel to the hopping pixel, it would be necessary to use 3 bits to encode the 5 index values. That is to say, with the encoding method of the exemplary embodiment, the encoding module 118 can save two bits per index of the pixel. In this embodiment, the size of the encoding unit block 200 is 4×. 4. The size of the index map 400 corresponding to the coding unit block 200 is also 4×4. In the case where compression and other processing are not performed, transmitting the index value of 4×4 pixels can save the transmission of thirty-two bits. the amount.
另一方面,當解碼器120的接收模組122在調色盤模式中接收(及解碼)上述對應編碼單元區塊200的旗標、對應編碼單元區塊200的調色盤表800時,旗標狀態判定模組124會判斷對應編碼單元區塊200的旗標的狀態值。例如,在本範例實施例中,旗標狀態判定模組124判斷所接收的旗標被設定為第二狀態值(例如,1),據此,旗標狀態判定模組124得知編碼單元區塊200存在跳脫畫素且判斷對應編碼單元區塊200的調色盤表800的索引數目大小為編碼單元區塊的主要顏色的數目加1。 On the other hand, when the receiving module 122 of the decoder 120 receives (and decodes) the flag of the corresponding coding unit block 200 and the palette table 800 of the corresponding coding unit block 200 in the palette mode, the flag is received. The flag state determination module 124 determines the state value of the flag corresponding to the coding unit block 200. For example, in the present exemplary embodiment, the flag state determination module 124 determines that the received flag is set to a second state value (eg, 1), according to which the flag state determination module 124 knows the coding unit area. The block 200 has a hopping pixel and judges that the index number of the palette table 800 of the corresponding coding unit block 200 is the number of primary colors of the coding unit block plus one.
接著,解碼模組126根據索引數目大小,使用CABAC將索引地圖900解碼,並重建編碼單元區塊200。更詳細地說,解碼模組126在將索引地圖900解碼後,根據索引地圖900的畫素之索引值搜尋調色盤表800(例如使用查表法),符合索引值所對應的主要顏色其所表示的畫素值即為編碼單元區塊200中畫素的畫素值。例如,索引地圖900的其中一畫素的索引值為0,而調色盤表800中,索引值為0所對應的主要顏色是C1且其畫素值為10,因此,解碼模組126會將編碼單元區塊200的畫素值重建為10。並且,以此類推,解碼模組126會一一重建編碼單元區塊200的每個畫素以重建編碼單元區塊200。又例如,索引地圖900的其中 一畫素的索引值為1,而索引值為1所表示的是跳脫畫素,則解碼模組126將以傳統方式根據逐一接收到的跳脫畫素一一重建編碼單元區塊200。此外,在一範例實施例中,接收到的跳脫畫素會先經過接收模組122(例如,以CABAC的旁路模式或CABAC的全文模式)解碼。 Next, the decoding module 126 decodes the index map 900 using CABAC according to the number of indexes, and reconstructs the coding unit block 200. In more detail, after decoding the index map 900, the decoding module 126 searches the palette table 800 according to the index value of the pixels of the index map 900 (for example, using a look-up table method), and conforms to the main color corresponding to the index value. The pixel value represented is the pixel value of the pixel in the coding unit block 200. For example, the index value of one of the pixels of the index map 900 is 0, and in the palette table 800, the primary color corresponding to the index value of 0 is C1 and its pixel value is 10. Therefore, the decoding module 126 will The pixel value of the coding unit block 200 is reconstructed to 10. And, and so on, the decoding module 126 reconstructs each pixel of the coding unit block one by one to reconstruct the coding unit block 200. For another example, the index map 900 is The index value of one pixel is 1, and the index value is 1 indicates that the pixel is skipped. Then, the decoding module 126 reconstructs the coding unit block 200 one by one according to the skipped pixels received one by one in a conventional manner. Moreover, in an exemplary embodiment, the received hopping pixels are first decoded by the receiving module 122 (eg, in a CABAC bypass mode or a CABAC full-text mode).
圖10A與圖10B是根據本揭露之範例實施例所繪示的影像編解碼的測試結果示意圖。 FIG. 10A and FIG. 10B are schematic diagrams showing test results of image codec according to an exemplary embodiment of the present disclosure.
請參照圖10A與圖10B,為了評估本揭露所提出的編碼方法與解碼方法,根據JCT-VC標準組織核心實驗所規範的實驗環境下,將本揭露實作於所述組織所提供的參考軟體HM14.0+RExt7.0+SCM1.0+Q0094+Q0047BF中,並比較AllIntra-lossy(全靜態編碼-失真)壓縮模式的結果。而被測試的視訊格式有YUV格式和RGB格式兩種,總共26個測試視訊檔案。此26個測試的視訊檔案根據視訊內容的不同及格式的不同可以分成12種類別,此12種類別即為圖10A與圖10B中的左邊第一欄中的說明。這12種類別中,“text & graphics with motion”是SCC較常遇到的視訊應用,其內容大多為簡報、軟體呈現等SCC常見應用,而“mixed content”則是包含SCC常用的視訊應用與HEVC常見的自然影像之應用,而“animation”則是動畫視訊,其中“animation”的應用較少用於SCC環境。這些視訊類別根據大小又區分成720p,1080p和1440p三種。在此,所呈現的數據都是BDrate,BDrate是JCT-VC標準組織通用習知的視訊品質的客觀評 比量測方法,當數據小於零且越小表示相同位元率(bitrate)的視覺品質越好。 Referring to FIG. 10A and FIG. 10B, in order to evaluate the coding method and the decoding method proposed by the present disclosure, the disclosure is implemented in the reference software provided by the organization according to the experimental environment specified by the JCT-VC standard organization core experiment. HM14.0+RExt7.0+SCM1.0+Q0094+Q0047BF and compare the results of the AllIntra-lossy compression mode. The video format tested was YUV format and RGB format, and a total of 26 test video files. The video files of the 26 tests can be divided into 12 categories according to the difference of the video content and the format, and the 12 categories are the descriptions in the first column on the left side in FIGS. 10A and 10B. Among the 12 categories, “text & graphics with motion” is a video application that SCC encounters more frequently. Its content is mostly SCC common applications such as newsletter and software presentation, while “mixed content” is a video application commonly used by SCC. HEVC is commonly used for natural imagery, while "animation" is animated video, where "animation" is less used in SCC environments. These video categories are further divided into three types according to size: 720p, 1080p and 1440p. Here, the data presented is BDrate, which is an objective evaluation of the video quality commonly used by the JCT-VC standards organization. The ratio measurement method, when the data is smaller than zero and smaller, indicates that the visual quality of the same bitrate is better.
具體來說,圖10A與圖10B所示的測試結果分為對應本揭露編碼單元區塊不具有跳脫畫素之實施例與編碼單元區塊具有跳脫畫素之實施例的BDrate效能。由數據結果可發現,本揭露所提的做法相較目前標準之作法,在複雜度幾乎不改變的情況下,即可有很大的效能提升,此兩個實施例的效能分別最大可達到-0.7%與-1.4%的提升。這些效能的提升尤其以“text & graphics with motion”這種SCC較常遇到的視訊應用類別較為顯著。 Specifically, the test results shown in FIG. 10A and FIG. 10B are divided into BDrate performances corresponding to embodiments in which the coding unit block does not have a hopping pixel and the coding unit block has a detached pixel. From the data results, it can be found that the proposed method is much better than the current standard practice, and the performance of the two embodiments can be maximized when the complexity is hardly changed. 0.7% and -1.4% increase. These performance enhancements are particularly noticeable in the category of video applications that are more commonly encountered by SCCs such as "text & graphics with motion."
綜上所述,本揭露之範例實施例所提出的編碼方法與解碼方法以及使用此方法的編解碼系統、編碼器與解碼器藉由所設定的旗標決定是否保留跳脫索引的欄位,由此能夠節省傳輸位元並有效地減少編碼運算時的傳輸量,進而提升螢幕視訊編碼的效能。 In summary, the encoding method and the decoding method and the codec system, the encoder and the decoder using the method of the present disclosure determine whether to retain the field of the index by using the flag set by the codec system, the encoder and the decoder. Thereby, the transmission bit can be saved and the transmission amount during the coding operation can be effectively reduced, thereby improving the performance of the video coding of the screen.
S501、S503、S505、S507、S509、S511、S513‧‧‧編碼方法的步驟 Steps of the S501, S503, S505, S507, S509, S511, S513‧‧ ‧ encoding methods
Claims (45)
Priority Applications (7)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510304620.9A CN105323583B (en) | 2014-06-13 | 2015-06-05 | Encoding method, decoding method, encoding/decoding system, encoder and decoder |
US14/733,976 US10187639B2 (en) | 2014-06-13 | 2015-06-09 | Encoding method, decoding method, encoding/decoding system, encoder, and decoder |
EP15171301.3A EP2955919B1 (en) | 2014-06-13 | 2015-06-10 | Decoding method, encoder, and decoder |
US15/822,215 US10944969B2 (en) | 2014-06-13 | 2017-11-27 | Encoding method, decoding method, encoding/decoding system, encoder, and decoder |
US17/168,142 US11785215B2 (en) | 2014-06-13 | 2021-02-04 | Encoding method, decoding method, encoding/decoding system, encoder, and decoder |
US18/460,622 US20230412804A1 (en) | 2014-06-13 | 2023-09-04 | Encoding method, decoding method, encoding/decoding system, encoder, and decoder |
US18/460,624 US20230412805A1 (en) | 2014-06-13 | 2023-09-04 | Encoding method, decoding method, encoding/decoding system, encoder, and decoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US201462011585P | 2014-06-13 | 2014-06-13 |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201547257A true TW201547257A (en) | 2015-12-16 |
TWI581616B TWI581616B (en) | 2017-05-01 |
Family
ID=55407635
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW104115230A TWI581616B (en) | 2014-06-13 | 2015-05-13 | Method for encoding, method for decoding, system for encoding and decoding, encoder and decoder |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI581616B (en) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8243340B2 (en) * | 2006-02-23 | 2012-08-14 | Microsoft Corporation | Pre-processing of image data for enhanced compression |
-
2015
- 2015-05-13 TW TW104115230A patent/TWI581616B/en active
Also Published As
Publication number | Publication date |
---|---|
TWI581616B (en) | 2017-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11785215B2 (en) | Encoding method, decoding method, encoding/decoding system, encoder, and decoder | |
US10715801B2 (en) | Method for palette table initialization and management | |
US8977048B2 (en) | Method medium system encoding and/or decoding an image using image slices | |
US20130114687A1 (en) | Fixed intra run-level mode for cavlc in hevc | |
US20160234498A1 (en) | Methods and systems for palette table coding | |
WO2019210822A1 (en) | Video encoding and decoding method, device, and system, and storage medium | |
EP3002948A1 (en) | Decoder, decoding method, and codec system | |
JP7225375B2 (en) | Encoding Apparatus, Decoding Apparatus and Corresponding Method Using Palette Encoding | |
US20130114684A1 (en) | Electronic devices for selective run-level coding and decoding | |
JP3462867B2 (en) | Image compression method and apparatus, image compression program, and image processing apparatus | |
KR20200065780A (en) | Frame buffer compressor and Image processing device comprising the same | |
CN110087074B (en) | Image processing apparatus and method for operating the same | |
WO2014050150A1 (en) | Signaling decoder picture buffer information | |
CN110087072B (en) | Image processing apparatus and method | |
TWI581616B (en) | Method for encoding, method for decoding, system for encoding and decoding, encoder and decoder | |
CN113301339A (en) | Data encoding and decoding method and device | |
CN111669590B (en) | Method, apparatus and system for sub-block based entropy decoding | |
KR102543449B1 (en) | Image processing device and method for operating image processing device | |
WO2023138391A1 (en) | Coefficient decoding method and apparatus, and image decoder and electronic device | |
TWI565302B (en) | Decoder, encoder, method for decoding, method for encoding, and system for encoding and decoding | |
TWI846680B (en) | Image processing device and method for operating image processing device | |
KR20190091181A (en) | Image processing device | |
TWI581617B (en) | Method and system for encoding and decoding, encoder and decoder | |
CN113163212A (en) | Video decoding method and apparatus, video encoding method and apparatus, medium, and device | |
US20170055003A1 (en) | Context Reduction Of Palette Run Type In High Efficiency Video Coding (HEVC) Screen Content Coding (SCC) |