1. Field of the Disclosure
The disclosure relates to an encoding method and a decoding method for encoding and decoding a coding unit block, and a codec system, an encoder and a decoder using the methods.
2. Description of Related Art
Along with development of technology, resolution, specification and sizes of video displays become higher and higher, and people's demand on quality and size of video images is also enhanced. In order to satisfy such demand, a video coding experts group under the international telecommunications union-telecommunication (ITU-T) and a moving picture experts group (MPEG) under the international standards organization/international electrotechnical commission (ISO/IEC) co-found a joint collaborative team on video coding (JCT-VC), and start a high efficiency video coding (H.265/HEVC) project, and a target thereof is to provide a coding efficiency higher than that of an advanced video coding (H.264/AVC) video compression standard (about 50% bit rate is saved under a same subjective quality), especially for high resolution videos of high definition (HD), ultra high definition (ultra HD), etc.
An application environment of the large size and high resolution videos is mainly natural video images, and customisation thereof is completed in 2013, and the currently customized standard is a HEVC screen content coding (HEVC SCC) standard. A video content shared by the screen generally has a mixed video content material, for example, an image may simultaneously include a nature image, a large amount of text pictures, a mouse indicator and various lines, etc., and since the screen application environment is no longer conformed with a design target of the H.265/HEVC, the JCT-VC has transferred its focus to develop a new high-efficiency screen coding standard technique recently. Development of new coding tools of the HEVC SCC standard is implemented based on the existing structure of the H.265/HEVC, for example, the new coding tool explored by the JCT-VC includes a palette mode, an intra block copy (IBC) mode, etc.
However, image and video compression requires a large amount of computations, so that it is important to improve a coding efficiency of the image and video compression, so as to decrease unnecessary transmission and computations in the coding operation.
The disclosure is directed to a method for encoding and a method for decoding, and a system for encoding and decoding, an encoder and a decoder using the methods, by which a coding performance of a screen content coding technique is effectively improved.
An exemplary embodiment of the disclosure provides a decoder including a storage circuit and a processor circuit. The storage circuit records a plurality of modules, and the processor circuit is connected to the storage circuit, and is configured to access the storage circuit and execute a neighboring block multi-color prediction mode through the modules. The modules include a receiving module, a flag state determination module, a color setting module and a decoding module. The receiving module receives a first flag corresponding to a coding unit block, and the flag state determination module determines a state value of the first flag corresponding to the coding unit block, and when the state value of the first flag is conformed with a predetermined state value, the receiving module further receives a second flag corresponding to the coding unit block and an index value corresponding to each pixel of the coding unit block. The color setting module reads the second flag corresponding to the coding unit block and the index value corresponding to each pixel of the coding unit block received by the receiving module when the state value of the first flag is conformed with the predetermined state value, and selects N colors corresponding to N pixels from a plurality of pixels in a neighboring area of the coding unit block according to the second flag, where the second flag indicates an amount of the N colors corresponding to the N pixels, and the N colors are all different, and N is a positive integer. The decoding module reconstructs pixels of the coding unit block according to the N colors corresponding to the N pixels.
An exemplary embodiment of the disclosure provides an encoder including a storage circuit and a processor circuit. The storage circuit records a plurality of modules, and the processor circuit is connected to the storage circuit, and is configured to access the storage circuit and execute a neighboring block multi-color prediction mode through the modules. The modules include a flag setting module, a color setting module and a coding module. The flag setting module sets a state value of a first flag corresponding to a coding unit block, and the color setting module selects N colors corresponding to N pixels from a plurality of pixels in a neighboring area of the coding unit block when the state value of the first flag is conformed with a predetermined state value. Moreover, the flag setting module sets a second flag corresponding to the coding unit block to an amount of the N colors corresponding to the N pixels, where the N colors are all different, and N is a positive integer. The coding module indexes each pixel in the coding unit block such that a color of each pixel in the coding unit block is represented by index values of the N pixels. Moreover, the coding module further transmits the first flag corresponding to the coding unit block to a decoder, and when the state value of the first flag is conformed with the predetermined state value, the coding module transmits the second flag corresponding to the coding unit block and an index value corresponding to each pixel of the coding unit block to the decoder.
An exemplary embodiment of the disclosure provides a decoding method for a coding unit block having a plurality of pixels, the decoding method includes receiving a first flag corresponding to the coding unit block; and receiving and reading a second flag corresponding to the coding unit block and an index value corresponding to each pixel of the coding unit block when a state value of the first flag is conformed with a predetermined state value. The method also includes selecting N colors corresponding to N pixels from a plurality of pixels in a neighboring area of the coding unit block according to the second flag, where the second flag indicates an amount of the N colors corresponding to the N pixels, where the N colors are all different, and N is a positive integer. The method further includes reconstructing the pixels of the coding unit block according to the N colors corresponding to the N pixels.
An exemplary embodiment of the disclosure provides an encoding method for a coding unit block having a plurality of pixels, the encoding method includes setting a state value of a first flag corresponding to the coding unit block; and selecting N colors corresponding to N pixels from a plurality of pixels in a neighboring area of the coding unit block when the state value of the first flag is conformed with a predetermined state value; and setting a second flag corresponding to the coding unit block to an amount of the N colors corresponding to the N pixels, where the N colors are all different, and N is a positive integer. The encoding method further includes indexing each pixel in the coding unit block such that a color of each pixel in the coding unit block is represented by index values of the N pixels; and transmitting the first flag corresponding to the coding unit block to a decoding end, and transmitting the second flag corresponding to the coding unit block and an index value corresponding to each pixel of the coding unit block to the decoding end when the state value of the first flag is conformed with the predetermined state value.
An exemplary embodiment of the disclosure provides a codec system including an encoder and a decoder. The encoder is configured to set a state value of a first flag corresponding to a coding unit block, and selects N colors corresponding to N pixels from a plurality of pixels in a neighboring area of the coding unit block when the state value of the first flag is conformed with a predetermined state value. Moreover, the encoder further sets a second flag corresponding to the coding unit block to an amount of the N colors corresponding to the N pixels, where the N colors are all different, and N is a positive integer. The encoder further indexes each pixel in the coding unit block such that a color of each pixel in the coding unit block is represented by index values of the N pixels, and the encoder further transmits the first flag corresponding to the coding unit block to the decoder, and when the state value of the first flag is conformed with the predetermined state value, the encoder transmits the second flag corresponding to the coding unit block and an index value corresponding to each pixel of the coding unit block to the decoder.
According to the above descriptions, in the coding method and the decoding method, and the codec system, the encoder and the decoder using the methods provided by the exemplary embodiments of the invention, the set flag is used for indicating the amount and colors of the pixels used for predicting and reconstructing the current coding unit block in the neighboring area, so as to effectively save the amount of transmitted bits in the coding operation, and accordingly improve the coding efficiency.
In order to make the aforementioned and other features and advantages of the disclosure comprehensible, several exemplary embodiments accompanied with figures are described in detail below.
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the disclosure and, together with the description, serve to explain the principles of the disclosure.
Referring to
The flag setting module 112 sets a state value of a flag corresponding to a currently encoded coding unit block. To be specific, under the H.265/HEVC standard, one coding tree unit (CTU) is taken as a maximum processing block for coding a coding unit (CU), and a size of the CTU can be set as a block of 64×64. The coding unit block can be smaller than or equal to the block size of the CTU. For example, the coding unit block is a square rectangle and a size thereof can be a block of 64×64, 32×32, 16×16, 8×8, or 4×4. Moreover, the coding unit block in the exemplary embodiment of the disclosure has a plurality of pixels, and a unit of the size of the coding unit block is pixel.
The flag setting module 112 sets a flag (which is also referred to as a first flag) corresponding to the coding unit block to indicate whether to enable the neighboring block multi-color prediction mode. The neighboring block multi-color prediction mode of the disclosure is to use one or a plurality of colors of pixels in a neighboring area of the currently encoded coding unit block to predict the pixels of the currently encoded coding unit block. For example, when the neighboring block multi-color prediction mode is to be enabled, the flag setting module 112 sets the state value of the first flag corresponding to the coding unit block to a predetermined state value. Conversely, when the neighboring block multi-color prediction mode is not to be enabled, the flag setting module 112 may set the state value of the first flag corresponding to the coding unit block to other state value.
The color setting module 114 determines whether the state value of the first flag is conformed with the predetermined state value, and selects N colors corresponding to N pixels from a plurality of pixels in the neighboring area of the coding unit block when the state value of the first flag is conformed with the predetermined state value. The N colors selected by the color setting module 114 are all different. In other words, when the color setting module 114 determines that the state value of the first flag is conformed with the predetermined state value, the encoder 110 enters the neighboring block multi-color prediction mode to use one or a plurality of colors of the pixels in the neighboring area of the currently encoded coding unit block to predict the pixels of the currently encoded coding unit block. Then, the flag setting module 112 sets another flag (which is also referred to as a second flag) corresponding to the coding unit block to an amount of the selected N colors corresponding to the N pixels. The method that the color setting module 114 selects the N colors corresponding to the N pixels from the neighboring area 210 is described in detail later with reference of
It should be noted that one color referred in the disclosure is not limited to a color consisting of a single composition element, but can also be a color consisting of a plurality of composition elements, for example, colors corresponding to a YUV format or a RGB format and consisting of three composition elements. The YUV format is used for compiling a color space, where “Y” represents luminance (Luma), “U” and “V” respectively represent chrominance and chroma, and Y, Cb, Cr are used for describing other composition elements. The RGB format is a color additive model, and color lights of three primary colors (red, green and blue) are added in different proportions to produce a variety of color lights, where R, G and B are used for describing the composition elements.
Then, the coding module 116 is configured to index each pixel in the coding unit block such that a color of each pixel in the coding unit block is represented by index values of the N pixels. Then, the coding module 116 transmits the first flag corresponding to the coding unit block to a decoding end, and when the state value of the first flag is conformed with the predetermined state value, the coding module 116 transmits the second flag corresponding to the coding unit block and an index value corresponding to each pixel of the coding unit block to the decoding end.
In the present exemplary embodiment, after the encoder 110 completes the aforementioned coding operation, the encoder 110 transmits the encoded data to a decoder to perform a decoding operation. For example, the encoder 110 is implemented in an image transmitting terminal, and the decoder is implemented in an image receiving terminal, where the encoder and the decoder may communicate with each other through a wired or wireless manner.
Referring to
The receiving module 122 of the decoder 120 receives a first flag corresponding to the coding unit block, the second flag corresponding to the coding unit block and the index value corresponding to each pixel of the coding unit block from the encoder 110, and the decoder 120 reconstructs the corresponding coding unit block according to the received data. For example, the flag state determination module 124 determines whether the state value of the first flag corresponding to the coding unit block is conformed with the predetermined state value, and only when the state value of the first flag is conformed with the predetermined state value, the receiving module 122 further receives the second flag and the index value corresponding to each pixel of the coding unit block transmitted by the coding module 116. Then, the color setting module 126 reads the second flag corresponding to the coding unit block and the index value corresponding to each pixel of the coding unit block received by the receiving module 122. Since the second flag indicates the amount of the N colors corresponding to the aforementioned N pixels, the color setting module 126 may quickly select N colors from a plurality of pixels in the neighboring area of the coding unit block according to the second flag. In this way, the decoding module 128 may reconstruct the pixels of the coding unit block according to the N colors.
It should be noted that the aforementioned encoder and decoder are respectively implemented in different terminals, and transmit the required data to each other through a network. However, the disclosure is not limited thereto, and in another exemplary embodiment, the encoder and the decoder can also be implemented in a same chip or system.
Referring to
Similarly, the storage the storage circuit 100a is configured to store various data, program codes, or images to be processed or processed images. For example, the storage circuit 100a can be a storage medium such as a memory or a HDD, etc., though the disclosure is not limited thereto. In the present exemplary embodiment, the storage circuit 100a is further configured to record a plurality of modules, and the modules include the flag setting module 112, the color setting module 114 and the coding module 116 of the encoder 110 and the receiving module 122, the flag state determination module 124, the color setting module 126 and the decoding module 128 of the decoder 120.
The processor circuit 100b is coupled to the storage circuit 100a, and is configured to control a whole operation of the codec chip 100. For example, the processor circuit 120b sends an instruction to the storage circuit 100a to execute a coding operation and a decoding operation to an image through the encoder 110 and the decoder 120. For example, the processor circuit 100b can be a CPU, a micro-processor or an embedded controller, which is not limited by the disclosure.
It should be noted that the encoder and the decoder of the disclosure are implemented by software modules or program codes. For example, the storage circuit 100a may store the flag setting module 112, the color setting module 114, the coding module 116, the receiving module 122, the flag state determination module 124, the color setting module 126 and the decoding module 128, and when the codec chip 100 is enabled, the software program codes are loaded to a buffer memory (not shown) from the storage circuit 100a and are executed by the processor circuit 100b to implement the functions of the modules. However, the disclosure is not limited thereto, for example, in another exemplary embodiment of the disclosure, the codec chip, the encoder and the decoder can be implemented by hardware circuits. For example, the flag setting module 112, the color setting module 114, the coding module 116, the receiving module 122, the flag state determination module 124, the color setting module 126 and the decoding module 128 can be implemented as a flag setting circuit, a color setting circuit, an encoding circuit, a receiving circuit, a flag state determination circuit and a decoding circuit through the hardware circuits.
In order to clearly describe the operations of the encoder 110, the decoder 120 and the codec chip 100, an exemplary embodiment is provided below for description with reference of the codec chip 100 of
Referring to
For example, in the present exemplary embodiment, the neighboring area may include a neighboring area 210 neighboring to the coding unit block 200 in the at least one other coding unit block neighboring to the coding unit block 200. In other words, a plurality of pixels in the neighboring area 210 can be pixels located to the upper left corner of the pixels at a first column and a first row of the coding unit block 200, and any pixel neighboring to the left edge of the coding unit block 200 in the neighboring area 210 and any pixel neighboring to the upper edge of the coding unit block 200 in the neighboring area 210. Namely, in an example that the coding unit block 200 is a 4×4 block, the neighboring area 210 is composed of a block 222 with a size of 1×4, a block 224 with a size of 4×1 and a block 226 with a size of 1×1, i.e., a length H of the block 222 of the neighboring area 210 is 1, and a width W of the block 224 of the neighboring area 210 is 1. However, the size of the neighboring area 210 is not limited by the disclosure. For example, in another exemplary embodiment, the length H of the block 222 and the width W of the block 224 in the neighboring area 210 of the coding unit block 200 with the size of 4×4 can be respectively 2.
Referring to
Then, the color setting module 114 obtains a candidate color mapping table 320 according to the sorting order 300, where the candidate color mapping table 320 records the color situations corresponding to different number selections, for example, when 3 colors corresponding to the pixels in the neighbouring area 210 are used for predicting the pixels of the coding unit block 200, since the colors corresponding to the number “3” are the color C8, the color C3 and the color C10, the color C8, the color C3 and the color C10 are used for predicting the pixels of the coding unit block 200. Particularly, in the coding operation, the color setting module 114 may respectively calculate distortion values between the pixels corresponding to the colors and the coding unit block 200 and bit numbers required for encoding the pixels corresponding to the colors and the coding unit block 200 in case that the colors corresponding to different numbers are selected. For example, the color setting module 114 calculates cost values respectively between the pixels corresponding to the colors and the coding unit block 200 according to the aforementioned distortion values and the bit numbers in case that the colors corresponding to different numbers are selected. Moreover, the color setting module 114 selects the pixels with the minimum cost value and the corresponding colors thereof to predict the pixels of the coding unit block 200 according to the cost values. In this way, the color setting module 114 may select an optimal set of colors to serve as the colors for predicting the pixels of the coding unit block 200. In other words, in the present exemplary embodiment, the color setting module 114 respectively performs a cost value operation to the 10 sets of colors in the candidate color mapping table 320 to obtain the optimal set of colors. However, the disclosure is not limited thereto, for example, in another exemplary embodiment, the color setting module 114 may omit the cost value operation to directly select one set of colors from the candidate color mapping table 320.
Here, it is assumed that the amount of colors in one set of colors with the minimum cost value is “3”, and the color setting module 114 selects the color C8, the color C3 and the color C10 to serve as the colors for predicting the pixels of the coding unit block 200 according to the candidate color mapping table 320. Namely, in the coding operation of selecting the N colors corresponding to the N pixels from the neighboring area, the color setting module 114 may select 3 clusters (i.e. the cluster 308, the cluster 303 and the cluster 310) from the 10 clusters according to the sorting order 300, and sets the 3 colors (i.e. the color C8, the color C3 and the color C10) corresponding to the 3 clusters as 3 colors for predicting the pixels of the coding unit block 200. Here, the pixels corresponding to the selected 3 colors respectively belong to the cluster 308, the cluster 303 and the cluster 310.
Referring to
Referring to
Then, the color setting module 114 arranges the colors C1-C5 respectively corresponding to the 5 clusters in a descending order according to the amount of the pixels in each of the 5 clusters, and arranges the color P1, the color P2, the color P3, the color P4 and the color P5 behind the colors C1-C5 to obtain a sorting order 400. Similarly, the color setting module 114 obtains a candidate color mapping table 410 according to the sorting order 400 to record the color situations corresponding to different number selections. Then, the color setting module 114 also calculates the cost values between the pixels corresponding to the colors and the coding unit block 200 to obtain the pixels with the minimum cost value and the corresponding colors thereof to predict the pixels of the coding unit block 200 in case that the colors corresponding to different numbers are selected. It should be noted that the colors used for filling the sorting order 400 to make the amount of the colors therein to be equal to the predetermined candidate color amount are not limited by the disclosure. For example, in another exemplary embodiment, a predetermined value is used to fill the sorting order 400, and the predetermined value is, for example, a color with the pixel value of 128 or 256.
Referring to
Then, the color setting module 114 obtains a candidate color mapping table 510 according to the sorting order 500 to record color situations corresponding to different number selections, and respectively calculates the cost values between the pixels corresponding to the colors and the coding unit block 200 to obtain the pixels with the minimum cost value and the corresponding colors thereof to predict the pixels of the coding unit block 200 in case that the colors corresponding to different numbers are selected.
After the color setting module 114 obtains one or a plurality of colors used for predicting the pixels of the coding unit block 200 according to one of a plurality of methods for selecting the N colors corresponding to the N pixels from the neighboring area 210 as shown in
Referring to
In another exemplary embodiment, taking
Referring to
In step S703, the encoder 110 selects N colors corresponding to N pixels from a plurality of pixels in the neighboring area 210 of the coding unit block 200 when determining that the state value of the first flag is conformed with a predetermined state value, and sets a second flag corresponding to the coding unit block 200 to an amount of the N colors corresponding to the N pixels, where the N colors are all different, and N is a positive integer.
In step S705, the encoder 110 indexes each pixel in the coding unit block 200 such that a color of each pixel in the coding unit block is represented by index values of the N pixels.
In step S707, the encoder 110 transmits the first flag corresponding to the coding unit block 200 to the decoder 120, and transmits the second flag corresponding to the coding unit block 200 and an index value corresponding to each pixel of the coding unit block 200 to the decoder 120 when the state value of the first flag is conformed with the predetermined state value.
Various steps of
In the present exemplary embodiment, since the first flag is used for indicating whether to enable the neighboring block multi-color prediction mode, when the receiving module 122 of the decoder 120 receives the first flag corresponding to the coding unit block 200 from the coding module 116, the flag state determination module 124 determines the state value of the first flag corresponding to the coding unit block 200, and only when the flag state determination module 124 determines that the state value of the first flag is conformed with the predetermined state value, the receiving module 122 further receives the second flag and the index value corresponding to each pixel of the coding unit block 200 that are transmitted by the coding module 116. Then, since the state value of the first flag is conformed with the predetermined state value, the color setting module 126 may read the second flag corresponding to the coding unit block 200 and the index value corresponding to each pixel of the coding unit block 200 that are received by the receiving module 122, so as to execute the decoding operation of using the one or a plurality of colors of the pixels in the neighboring area of the currently encoded coding unit block to predict and reconstruct the pixels of the currently encoded coding unit block.
In the decoding operation, the decoder 120 may receive information from the encoder 110 to reconstruct the pixels of the coding unit block 200. For example, when the flag state determination module 124 determines that the first flag is conformed with the predetermined state value, the color setting module 126 selects N colors corresponding to N pixels from a plurality of pixels in the neighboring area 210 of the coding unit block 200 according to the received second flag to serve as the N colors used for reconstructing the pixels of the coding unit block 200. In the present exemplary embodiment, the method that the color setting module 126 selects N colors corresponding to N pixels from the neighboring area 210 to obtain the one or a plurality of colors used for reconstructing the pixels of the coding unit block 200 is similar to one of the methods shown in
Taking
In another exemplary embodiment in the example that the color setting module 114 of the encoder 110 sets the second flag corresponding to the coding unit block 200 to “1”, the colors of each pixel of the coding unit block 200 are all represented by a same index value (for example, 0), so that the coding unit 116 is unnecessary to transmit the index values corresponding to the colors of each pixel of the coding unit block 200 to the decoder 120 one by one, and the color setting module 126 of the decoder 120 directly and sequentially selects one color (i.e. the color C8) corresponding to one pixel from the sorting order 300 only according to the second flag received from the encoder 110, and takes the one color as the color used for reconstructing the pixels of the coding unit block 200. Then, the decoding module 128 reconstructs the pixels of the coding unit block 200 by using such one color (i.e. the color C8).
Referring to
In step S803, the decoder 120 receives and reads the second flag corresponding to the coding unit block 200 and the index value corresponding to each pixel of the coding unit block 200 when determining that the state value of the first flag is conformed with the predetermined state value, and selects N colors corresponding to N pixels from a plurality of pixels in the neighboring area 210 of the coding unit block 200 according to the second flag, where the second flag indicates an amount of the N colors corresponding to the N pixels, and the N colors are all different, and N is a positive integer.
In step S805, the decoder 120 reconstructs the pixels of the coding unit block 200 according to the N colors corresponding to the N pixels.
Various steps of
Referring to
Referring to
Referring to
Referring to
To be specific, the test results shown in
In summary, in the coding method and the decoding method and the codec system, the encoder and the decoder using the methods provided by the exemplary embodiments of the disclosure, the set flag is used for indicating the amount and colors of the pixels used for predicting and reconstructing the current coding unit block in the neighboring area, so as to save the amount of transmitted bits and effectively decrease a transmission amount of the coding operation, and accordingly improve the efficiency of the SCC.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the disclosure without departing from the scope or spirit of the disclosure. In view of the foregoing, it is intended that the disclosure cover modifications and variations of this disclosure provided they fall within the scope of the following claims and their equivalents.
| Number | Date | Country | Kind |
|---|---|---|---|
| 104130995 | Sep 2015 | TW | national |
This application claims the priority benefits of U.S. provisional application Ser. No. 62/058,111, filed on Oct. 1, 2014, and Taiwan application serial no. 104130995, filed on Sep. 18, 2015. The entirety of each of the above-mentioned patent applications is hereby incorporated by reference herein and made a part of this specification.
| Number | Date | Country | |
|---|---|---|---|
| 62058111 | Oct 2014 | US |