WO2016033791A1 - Generating method and apparatus for palette, and image processing device - Google Patents

Generating method and apparatus for palette, and image processing device Download PDF

Info

Publication number
WO2016033791A1
WO2016033791A1 PCT/CN2014/085981 CN2014085981W WO2016033791A1 WO 2016033791 A1 WO2016033791 A1 WO 2016033791A1 CN 2014085981 W CN2014085981 W CN 2014085981W WO 2016033791 A1 WO2016033791 A1 WO 2016033791A1
Authority
WO
WIPO (PCT)
Prior art keywords
palette
pixel
index
copy information
pixel value
Prior art date
Application number
PCT/CN2014/085981
Other languages
French (fr)
Chinese (zh)
Inventor
徐张磊
Original Assignee
富士通株式会社
徐张磊
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 富士通株式会社, 徐张磊 filed Critical 富士通株式会社
Priority to PCT/CN2014/085981 priority Critical patent/WO2016033791A1/en
Publication of WO2016033791A1 publication Critical patent/WO2016033791A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present invention relates to the field of graphic image technology, and in particular, to a method and device for generating a color palette and an image processing device.
  • Palette-based coding is widely used in graphic image technology (especially video coding technology).
  • a coding unit for the image area to be encoded, for example, a coding unit (CU), including a plurality of pixels having color values (for example, RGB mode, having 24 bits of true color); in order to reduce the storage bits
  • the storage capacity of the image image which can usually point the pixel to the data index of the palette.
  • the color value of each output pixel can be determined by looking up a palette with a corresponding data index.
  • the palette is a set of pixel values. For pixels whose pixel values are in the palette, only the pixel index corresponding to the pixel value in the palette is used. Thereby, only the palette and the index corresponding to the pixels in the coding unit can be bit-stream encoded, and the bit cost of the coding can be reduced.
  • index run information can be used when performing bit stream encoding. For example, if the pixel value of a pixel in the CU is the same as the pixel value of the left pixel, the index copy information may be generated in a copy left mode; if the pixel value of a pixel in the CU and the pixel value of the upper pixel Similarly, the index copy information can be generated in a copy above mode.
  • Non-Patent Document 1 JCTVC-O0182.Xun Guo, etc, Microsoft, Major-color-based screen content coding.
  • Non-Patent Document 2 JCTVC-N0249. Liwei Guo, etc, Qualcomm, Modified Palette Mode for Screen Content Coding.
  • Non-Patent Document 3 JCTVC-Q0094.Wei Pu,etc.,Suggested Software for Palette Coding based on RExt6.0.
  • the palette can be determined based on the number of times the pixel value appears in the image region to be encoded (eg, CU), and the pixel index of the palette is represented by a variable-length code.
  • the pixel value with the most occurrence corresponds to the smallest pixel index (for example, index is 0, denoted by 0)
  • the pixel number of the second most frequent occurrence corresponds to the second small pixel index (for example, index is 1, indicated by 10), ....
  • Embodiments of the present invention provide a method, an apparatus, and an image processing apparatus for generating a color palette. Further optimize the palette to better reduce the bit cost of the encoding.
  • a method for generating a color palette including:
  • a device for generating a color palette including:
  • the initial palette determining unit determines, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
  • a copy information determining unit that determines index copy information of the image area to be encoded based on the initial palette
  • the palette updating unit updates the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  • an image processing apparatus comprising the apparatus for generating a palette as described above.
  • a computer readable program wherein when the program is executed in an image processing apparatus, the program causes a computer to perform color grading as described above in the image processing apparatus The method of generating the board.
  • a storage medium storing a computer readable program, wherein the computer readable program causes a computer to execute a method of generating a color palette as described above in an image processing apparatus.
  • An advantageous effect of the embodiment of the present invention is that the initial palette is updated to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  • the palette can be further optimized to better reduce the bit cost of the encoding.
  • FIG. 1 is a schematic diagram of an example of a coding unit according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a method for generating a color palette according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an image encoding method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a device for generating a color palette according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an image encoding apparatus according to an embodiment of the present invention.
  • Fig. 6 is a block diagram showing the configuration of an image processing apparatus according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram showing an example of a coding unit according to an embodiment of the present invention, showing a case of a coding unit (CU).
  • the coding unit has 8 x 8 pixels; wherein the 8 x 8 pixels have different 7 pixel values (representing different colors).
  • pixels having the same pixel value in FIG. 1 use the same symbol to represent pixel values, for example, C0, C1, ..., C6 are used to represent different pixel values.
  • the initial palette may be determined according to the number of times the pixel value appears in the image area to be encoded.
  • Table 1 shows the palette determined by the CU shown in Fig. 1 or 2. As shown in Table 1, C0 appears 43 times in the CU, C1 appears 8 times in the CU, C2 appears 6 times in the CU, C3 appears 4 times in the CU, and C4, C5 C6 appears in the CU one time. Therefore, the pixel index corresponding to C0 is determined to be 0, the pixel index corresponding to C1 is 1, the pixel index corresponding to C2 is 2, the pixel index corresponding to C3 is 3, the pixel index corresponding to C4 is 4, and the pixel index corresponding to C5 is 5. The pixel index corresponding to C6 is 6; the palette thus determined is as shown in the first two rows of Table 1.
  • the index copy information generated based on the palette may be as shown in Table 2 below.
  • Table 2 shows the index run information of the CU shown in Fig. 1 which is formed based on the palette of Table 1.
  • the CU there are 7 pixels having the same pixel value as the corresponding pixel of the previous row (the pixel values are C0, C0, C0, C3, C1, C2, C1, respectively), thus forming the index copy information in Table 2 (6); having one pixel in the CU having a pixel value of C5 (the corresponding pixel index in the palette is 5), thus forming the index copy information Left(5, 0) in Table 2; in the CU a pixel having a pixel value of C6 (the corresponding pixel index in the palette is 6), thus forming the index copy information Left(6, 0) in Table 2;
  • index copy information when bit stream encoding is performed, it is necessary to encode, for example, 0 and 31 in Left (0, 31).
  • the variable length code when the variable length code is used to represent the pixel index, as shown in the last row of Table 1, the pixel indexes "1" and "2" appear three times, respectively, and therefore need to be more More bits can be encoded.
  • the embodiments of the present invention are described in detail below, and the palette is further optimized to reduce the bit cost of encoding.
  • FIG. 2 is a schematic diagram of a method for generating a color palette according to an embodiment of the present invention. As shown in FIG. 2, the generating method includes:
  • Step 201 Determine, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
  • Step 202 Determine index copy information of an image region to be encoded based on an initial palette
  • Step 203 Update the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  • the image area to be encoded may be a coding unit CU or a maximum coding unit LCU (Largest Coding Unit); the following uses CU as an example for description.
  • Embodiments of the present invention are applicable to the case of adopting a palette mode, and in the case of mixing a palette mode and a non-palette mode (for example, an escape mode), Embodiments of the invention are equally applicable.
  • the number of times the pixel value appears in the image area to be encoded may be arranged in descending order, and the pixel index corresponding to the pixel value in the initial palette is determined according to the sorting result.
  • the initial palette can be determined based on the number of times the pixel value appears in the image region to be encoded.
  • index copy information of the image region to be encoded may be determined based on the initial palette.
  • the index copy information can be generated by pressing the Copy Left mode and/or the Copy Above mode.
  • index copy information may be generated in other manners.
  • the following uses CopyLeft and CopyAbove as an example for description.
  • index copy information as shown in Table 2 can be obtained.
  • the index copy information may be counted to obtain the number of occurrences of the pixel index in the index copy information. For example, as shown in the last row of Table 1, when the CU of FIG. 1 adopts the palette as shown in Table 1, the pixel indexes 0 to 6 corresponding to the pixel values C0 to C6 appear in the index as shown in Table 2. The number of times in the copy information is 1, 3, 3, 1, 1, 1, and 1, respectively.
  • step 203 may update the initial palette to determine the updated palette based on the number of occurrences of the pixel index in the index copy information. Specifically, the number of occurrences of the pixel index corresponding to the pixel value in the index copy information may be arranged in descending order, and the pixel index corresponding to the pixel value in the updated palette may be determined according to the sorting result.
  • 1, 3, 3, 1, 1, 1, 1 can be arranged in descending order to 3, 3, 1, 1, 1, 1, 1, and the corresponding pixel index is changed correspondingly according to the arrangement result.
  • the pixel index corresponding to the pixel value C1 that appears three times is changed from 1 to 0, and the pixel index corresponding to the pixel value C2 that appears three times is changed from 2 to 1, and the pixel value C0 that will appear once corresponds to The pixel index is changed from 0 to 2, thus forming Table 3 below:
  • FIG. 3 is a schematic diagram of an image encoding method according to an embodiment of the present invention, which uses bit index copy information formed based on an updated palette to perform bit stream encoding.
  • the image encoding method includes:
  • Step 301 Determine, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
  • Step 302 Determine index copy information of an image region to be encoded based on an initial palette
  • Step 303 Update the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  • Step 304 re-determining index copy information of the image area to be encoded based on the updated palette
  • Step 305 Perform bitstream encoding on a plurality of pixels adopting the palette mode based on the re-determined index copy information.
  • Steps 301 to 303 may be as described in the previous steps 201 to 203.
  • the index copy information of the image region to be encoded may be re-determined based on the updated palette. For example, for the CU shown in FIG. 1 and the updated palette shown in Table 3, the updated index copy information shown in Table 4 below can be determined.
  • bitstream encoding of a plurality of pixels in a palette mode may be performed based on the re-determined index copy information.
  • the pixel index in the updated palette is represented by a variable length code.
  • the pixel index 0 is represented by "0" (1 bit)
  • the pixel index 1 is represented by "10" (two bits), ....
  • Pixel index Variable length code 0 0 1 10 2 110 3 1110 4 11110 5 111110 6 1111110
  • Table 5 only schematically shows the variable length code of the embodiment of the present invention, but the present invention is not limited thereto.
  • other variable length codes may be determined according to actual conditions.
  • the pixel index 0 (corresponding pixel value C0) appears once in the index copy information
  • the pixel index 1 (corresponding pixel value C1) is in the index copy information.
  • the pixel index 2 (corresponding to the pixel value C2) appears 3 times in the index copy information.
  • the pixel index 0 (corresponding to the pixel value C1) appears three times in the index copy information
  • the pixel index 1 (corresponding to the pixel value C2) is in the index copy information.
  • the pixel index 2 (corresponding to the pixel value C0) appears once in the index copy information.
  • the initial palette is updated to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  • the palette can be further optimized to better reduce the bit cost of the encoding.
  • the embodiment of the present invention provides a device for generating a color palette, which corresponds to the method for generating a color palette in the first embodiment, and the same content is not described herein.
  • the palette generating apparatus 400 includes an initial palette determining unit 401, a copy information determining unit 402, and a color palette. Board update unit 403;
  • the initial palette determining unit 401 determines, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
  • the information determining unit 402 determines the index copy information of the image region to be encoded based on the initial palette; and the number of times the palette updating unit 403 appears in the index copy information according to the pixel index corresponding to the pixel value,
  • the initial palette is updated to determine the updated palette.
  • the pixel index in the updated palette is represented by a variable length code.
  • the index copy information may include information generated by a copy left (Copy Left) mode and/or a copy above (Copy Above) mode.
  • the present invention is not limited thereto, and for example, other methods may be used to generate index copy information.
  • the initial palette determining unit 401 is specifically configured to: arrange the number of times the pixel value appears in the image to be encoded region in descending order, and determine the pixel value according to the sorting result.
  • the palette updating unit 403 may be specifically configured to: arrange the number of occurrences of the pixel index corresponding to the pixel value in the index copy information in descending order, and determine the pixel according to the sorting result.
  • the value is the pixel index corresponding to the updated palette.
  • the palette generating apparatus 400 may further include: a copy information updating unit and a bit stream encoding unit (not shown in FIG. 4); wherein the copy information updating unit re-determines based on the updated palette Index copy information of the image area to be encoded; and the bit stream encoding unit performs bit stream encoding on the plurality of pixels in the palette mode based on the re-determined index copy information.
  • FIG. 5 is a schematic diagram of an image encoding apparatus according to an embodiment of the present invention, including a palette generating apparatus 400 as shown in FIG. As shown in FIG. 5, the palette generating apparatus 400 includes an initial palette determining unit 401, a copy information determining unit 402, and a palette updating unit 403.
  • the image encoding apparatus 500 may further include: a copy information updating unit 404 and a bit stream encoding unit 405; wherein the copy information updating unit 404 re-determines the index copy information of the image area to be encoded based on the updated palette And the bitstream encoding unit 405 performs bitstream encoding on a plurality of pixels adopting the palette mode based on the re-determined index copy information.
  • the initial palette is updated to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  • the palette can be further optimized to better reduce the bit cost of the encoding.
  • An embodiment of the present invention provides an image processing apparatus including: a palette generating apparatus 400 as described in Embodiment 2, or an image encoding apparatus 500.
  • Fig. 6 is a block diagram showing the configuration of an image processing apparatus according to an embodiment of the present invention.
  • the image processing apparatus 600 may include a central processing unit (CPU) 100 and a memory 110; the memory 110 is coupled to the central processing unit 100.
  • the memory 110 can store various data; in addition, a program for information processing is stored, and the program is executed under the control of the central processing unit 100.
  • the functions of the palette generating device 400 or the image encoding device 500 may be integrated into the central processing unit 100.
  • the central processing unit 100 may be configured to implement the method for generating a color palette or the image encoding method as described in Embodiment 1.
  • the palette generating device 400 or the image encoding device 500 may be configured separately from the central processing unit.
  • the palette generating device 400 or the image encoding device 500 may be configured to be connected to the central processing unit 100.
  • the chip implements the functions of the palette generating device 400 or the image encoding device 500 by the control of the central processing unit.
  • the image processing apparatus 600 may further include: an input and output unit 120, a display unit 130, and the like; wherein the functions of the above components are similar to those of the prior art, and are not described herein again. It is to be noted that the image processing apparatus 600 does not necessarily have to include all of the components shown in FIG. 6; in addition, the image processing apparatus 600 may further include components not shown in FIG. 6, and reference may be made to the related art.
  • the image processing apparatus 600 may further include: an image decoding device that can perform decoding correspondingly.
  • the image processing apparatus 600 can implement the functions of the image decoding apparatus by the control of the central processing unit 100 as described above.
  • the embodiment of the present invention further provides a computer readable program, wherein when the program is executed in an image processing device, the program causes a computer to execute the generation of the color palette described in Embodiment 1 in the image processing device Method or image coding method.
  • the embodiment of the present invention further provides a storage medium storing a computer readable program, wherein the computer readable program causes a computer to execute the method for generating a palette or the image encoding method described in Embodiment 1 in an image processing device.
  • the above apparatus and method of the present invention may be implemented by hardware or by hardware in combination with software.
  • the present invention relates to a computer readable program that, when executed by a logic component, enables the logic component to implement the apparatus or components described above, or to cause the logic component to implement the various methods described above Or steps.
  • the present invention also relates to a storage medium for storing the above program, such as a hard disk, a magnetic disk, an optical disk, a DVD, a flash memory, or the like.
  • One or more of the functional blocks described in the figures and/or one or more combinations of functional blocks may be implemented as a general purpose processor, digital signal processor (DSP) for performing the functions described herein.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • One or more of the functional blocks described with respect to the figures and/or one or more combinations of functional blocks may also be implemented as a combination of computing devices, eg, a combination of a DSP and a microprocessor, multiple microprocessors One or more microprocessors in conjunction with DSP communication or any other such configuration.

Abstract

Provided are a generating method and apparatus for a palette, and an image processing device. The generating method comprises: determining an initial palette according to the occurrence frequency of pixel values of a plurality of pixels, adopting palette modes in an image region to be coded, in the image region to be coded; determining index copy information of the image region to be coded based on the initial palette; and according to the occurrence frequency of pixel indexes corresponding to the pixel values in the index copy information, updating the initial palette to determine the updated palette. The palette can be further optimized, and the bit cost for coding is better reduced.

Description

调色板的生成方法、装置以及图像处理设备Palette generation method, device and image processing device 技术领域Technical field
本发明涉及一种图形图像技术领域,特别涉及一种调色板的生成方法、装置以及图像处理设备。The present invention relates to the field of graphic image technology, and in particular, to a method and device for generating a color palette and an image processing device.
背景技术Background technique
基于调色板(Palette-based)的编码在图形图像技术(尤其是视频编码技术)中得到了广泛应用。在编码过程中,对于待编码图像区域,例如一个编码单元(CU,coding Unit),包含多个具有色彩值(例如采用RGB模式,具有24比特的真彩色)的像素;为了减少用于存储位图图像的存储容量,通常可以将像素指向调色板的数据索引。在译码过程中,每一输出像素的色彩值可以通过查找具有相应数据索引的调色板来决定。Palette-based coding is widely used in graphic image technology (especially video coding technology). In the encoding process, for the image area to be encoded, for example, a coding unit (CU), including a plurality of pixels having color values (for example, RGB mode, having 24 bits of true color); in order to reduce the storage bits The storage capacity of the image image, which can usually point the pixel to the data index of the palette. During the decoding process, the color value of each output pixel can be determined by looking up a palette with a corresponding data index.
其中,调色板为一系列像素值(pixel value)的集合,对于像素值位于调色板中的像素,仅需使用该像素值在调色板中对应的像素索引(pixel index)。由此可以仅将调色板以及编码单元中的像素所对应的索引进行比特流编码,可以减少编码的比特代价(bit cost)。The palette is a set of pixel values. For pixels whose pixel values are in the palette, only the pixel index corresponding to the pixel value in the palette is used. Thereby, only the palette and the index corresponding to the pixels in the coding unit can be bit-stream encoded, and the bit cost of the coding can be reduced.
为了进一步降低比特代价,在进行比特流编码时可以采用索引拷贝(index run)信息。例如,若一像素在CU中的像素值与左边像素的像素值相同,则可以采用按左拷贝(copy left)模式生成索引拷贝信息;若一像素在CU中的像素值与上边像素的像素值相同,则可以采用按上拷贝(copy above)模式生成索引拷贝信息。In order to further reduce the bit cost, index run information can be used when performing bit stream encoding. For example, if the pixel value of a pixel in the CU is the same as the pixel value of the left pixel, the index copy information may be generated in a copy left mode; if the pixel value of a pixel in the CU and the pixel value of the upper pixel Similarly, the index copy information can be generated in a copy above mode.
下面列出了对于理解本发明和常规技术有益的文献,通过引用将它们并入本文中,如同在本文中完全阐明了一样。The following is a list of documents useful for understanding the present invention and conventional techniques, which are incorporated herein by reference as if fully set forth herein.
[非专利文献1]:JCTVC-O0182.Xun Guo,etc,Microsoft,Major-color-based screen content coding.[Non-Patent Document 1]: JCTVC-O0182.Xun Guo, etc, Microsoft, Major-color-based screen content coding.
[非专利文献2]:JCTVC-N0249.Liwei Guo,etc,Qualcomm,Modified Palette Mode for Screen Content Coding.[Non-Patent Document 2]: JCTVC-N0249. Liwei Guo, etc, Qualcomm, Modified Palette Mode for Screen Content Coding.
[非专利文献3]:JCTVC-Q0094.Wei Pu,etc.,Suggested Software for Palette Coding based on RExt6.0. [Non-Patent Document 3]: JCTVC-Q0094.Wei Pu,etc.,Suggested Software for Palette Coding based on RExt6.0.
应该注意,上面对技术背景的介绍只是为了方便对本发明的技术方案进行清楚、完整的说明,并方便本领域技术人员的理解而阐述的。不能仅仅因为这些方案在本发明的背景技术部分进行了阐述而认为上述技术方案为本领域技术人员所公知。It should be noted that the above description of the technical background is only for the purpose of facilitating a clear and complete description of the technical solutions of the present invention, and is convenient for understanding by those skilled in the art. The above technical solutions are not considered to be well known to those skilled in the art simply because these aspects are set forth in the background section of the present invention.
发明内容Summary of the invention
目前,可以根据像素值在待编码图像区域(例如CU)中出现的次数来确定调色板,并且调色板的像素索引采用变长码(variable-length code)表示。例如,出现次数最多的像素值对应最小的像素索引(例如index为0,采用0表示),出现次数第二多的像素值对应第二小的像素索引(例如index为1,采用10表示),……。Currently, the palette can be determined based on the number of times the pixel value appears in the image region to be encoded (eg, CU), and the pixel index of the palette is represented by a variable-length code. For example, the pixel value with the most occurrence corresponds to the smallest pixel index (for example, index is 0, denoted by 0), and the pixel number of the second most frequent occurrence corresponds to the second small pixel index (for example, index is 1, indicated by 10), ....
但是发明人发现:目前的方案中并没有考虑到使用索引拷贝信息的情况,在使用索引拷贝信息的情况下仍然需要较多的比特,不能进一步优化调色板,不能更好地减少编码的比特代价。However, the inventor found that the current scheme does not take into account the use of index copy information. In the case of using index copy information, more bits are still needed, and the palette cannot be further optimized, and the encoded bits cannot be better reduced. cost.
本发明实施例提供一种调色板的生成方法、装置以及图像处理设备。进一步优化调色板,更好地减少编码的比特代价。Embodiments of the present invention provide a method, an apparatus, and an image processing apparatus for generating a color palette. Further optimize the palette to better reduce the bit cost of the encoding.
根据本发明实施例的第一个方面,提供一种调色板的生成方法,包括:According to a first aspect of the embodiments of the present invention, a method for generating a color palette is provided, including:
对于待编码图像区域中采用调色板模式的多个像素,根据所述像素的像素值在所述待编码图像区域中出现的次数确定初始调色板;Determining, by the plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
基于所述初始调色板确定所述待编码图像区域的索引拷贝信息;以及Determining index copy information of the image area to be encoded based on the initial palette;
根据所述像素值对应的像素索引在所述索引拷贝信息中出现的次数,对所述初始调色板进行更新以确定更新后的调色板。And updating the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
根据本发明实施例的第二个方面,提供一种调色板的生成装置,包括:According to a second aspect of the embodiments of the present invention, a device for generating a color palette is provided, including:
初始调色板确定单元,对于待编码图像区域中采用调色板模式的多个像素,根据所述像素的像素值在所述待编码图像区域中出现的次数确定初始调色板;The initial palette determining unit determines, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
拷贝信息确定单元,基于所述初始调色板确定所述待编码图像区域的索引拷贝信息;以及a copy information determining unit that determines index copy information of the image area to be encoded based on the initial palette;
调色板更新单元,根据所述像素值对应的像素索引在所述索引拷贝信息中出现的次数,对所述初始调色板进行更新以确定更新后的调色板。The palette updating unit updates the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
根据本发明实施例的第三个方面,提供一种图像处理设备,包括如上所述的调色板的生成装置。 According to a third aspect of the embodiments of the present invention, there is provided an image processing apparatus comprising the apparatus for generating a palette as described above.
根据本发明实施例的又一个方面,提供一种计算机可读程序,其中当在图像处理设备中执行所述程序时,所述程序使得计算机在所述图像处理设备中执行如上所述的调色板的生成方法。According to still another aspect of an embodiment of the present invention, a computer readable program is provided, wherein when the program is executed in an image processing apparatus, the program causes a computer to perform color grading as described above in the image processing apparatus The method of generating the board.
根据本发明实施例的又一个方面,提供一种存储有计算机可读程序的存储介质,其中所述计算机可读程序使得计算机在图像处理设备中执行如上所述的调色板的生成方法。According to still another aspect of an embodiment of the present invention, a storage medium storing a computer readable program, wherein the computer readable program causes a computer to execute a method of generating a color palette as described above in an image processing apparatus.
本发明实施例的有益效果在于,根据像素值所对应的像素索引在索引拷贝信息中出现的次数,对初始调色板进行更新以确定更新后的调色板。可以进一步优化调色板,更好地减少编码的比特代价。An advantageous effect of the embodiment of the present invention is that the initial palette is updated to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information. The palette can be further optimized to better reduce the bit cost of the encoding.
参照后文的说明和附图,详细公开了本发明的特定实施方式,指明了本发明的原理可以被采用的方式。应该理解,本发明的实施方式在范围上并不因而受到限制。在所附权利要求的精神和条款的范围内,本发明的实施方式包括许多改变、修改和等同。Specific embodiments of the present invention are disclosed in detail with reference to the following description and the drawings, in which <RTIgt; It should be understood that the embodiments of the invention are not limited in scope. The embodiments of the present invention include many variations, modifications, and equivalents within the scope of the appended claims.
针对一种实施方式描述和/或示出的特征可以以相同或类似的方式在一个或更多个其它实施方式中使用,与其它实施方式中的特征相组合,或替代其它实施方式中的特征。Features described and/or illustrated with respect to one embodiment may be used in one or more other embodiments in the same or similar manner, in combination with, or in place of, features in other embodiments. .
应该强调,术语“包括/包含”在本文使用时指特征、整件、步骤或组件的存在,但并不排除一个或更多个其它特征、整件、步骤或组件的存在或附加。It should be emphasized that the term "comprising" or "comprises" or "comprising" or "comprising" or "comprising" or "comprising" or "comprises"
附图说明DRAWINGS
参照以下的附图可以更好地理解本发明的很多方面。附图中的部件不是成比例绘制的,而只是为了示出本发明的原理。为了便于示出和描述本发明的一些部分,附图中对应部分可能被放大或缩小。Many aspects of the invention can be better understood with reference to the following drawings. The components in the figures are not drawn to scale, but only to illustrate the principles of the invention. In order to facilitate the illustration and description of some parts of the invention, the corresponding parts in the figures may be enlarged or reduced.
在本发明的一个附图或一种实施方式中描述的元素和特征可以与一个或更多个其它附图或实施方式中示出的元素和特征相结合。此外,在附图中,类似的标号表示几个附图中对应的部件,并可用于指示多于一种实施方式中使用的对应部件。Elements and features described in one of the figures or one embodiment of the invention may be combined with elements and features illustrated in one or more other figures or embodiments. In the accompanying drawings, like reference numerals refer to the
图1是本发明实施例的编码单元的一实例示意图;1 is a schematic diagram of an example of a coding unit according to an embodiment of the present invention;
图2是本发明实施例的调色板的生成方法的一示意图;2 is a schematic diagram of a method for generating a color palette according to an embodiment of the present invention;
图3是本发明实施例的图像编码方法的一示意图;3 is a schematic diagram of an image encoding method according to an embodiment of the present invention;
图4是本发明实施例的调色板的生成装置的一示意图; 4 is a schematic diagram of a device for generating a color palette according to an embodiment of the present invention;
图5是本发明实施例的图像编码装置的一示意图;FIG. 5 is a schematic diagram of an image encoding apparatus according to an embodiment of the present invention; FIG.
图6是本发明实施例的图像处理设备的一构成示意图。Fig. 6 is a block diagram showing the configuration of an image processing apparatus according to an embodiment of the present invention.
具体实施方式detailed description
参照附图,通过下面的说明书,本发明的前述以及其它特征将变得明显。在说明书和附图中,具体公开了本发明的特定实施方式,其表明了其中可以采用本发明的原则的部分实施方式,应了解的是,本发明不限于所描述的实施方式,相反,本发明包括落入所附权利要求的范围内的全部修改、变型以及等同物。The foregoing and other features of the present invention will be apparent from the The specific embodiments of the present invention are disclosed in the specification and the drawings, which are illustrated in the embodiment of the invention The invention includes all modifications, variations and equivalents falling within the scope of the appended claims.
图1是本发明实施例的编码单元的一实例示意图,示出了一个编码单元(CU)的情况。如图1所示,该编码单元具有8×8个像素;其中该8×8个像素具有不同的7个像素值(代表不同的颜色)。为简单起见,图1中具有相同像素值的像素采用同一符号来表示像素值,例如采用C0、C1、……、C6来表示不同的像素值。1 is a schematic diagram showing an example of a coding unit according to an embodiment of the present invention, showing a case of a coding unit (CU). As shown in FIG. 1, the coding unit has 8 x 8 pixels; wherein the 8 x 8 pixels have different 7 pixel values (representing different colors). For the sake of simplicity, pixels having the same pixel value in FIG. 1 use the same symbol to represent pixel values, for example, C0, C1, ..., C6 are used to represent different pixel values.
其中,可以根据像素值在待编码图像区域中出现的次数来确定初始调色板。表1示出了图1或2所示的CU所确定的调色板。如表1所示,C0在该CU中出现了43次,C1在该CU中出现了8次,C2在该CU中出现了6次,C3在该CU中出现了4次,而C4、C5、C6在该CU中分别出现了1次。因此,C0对应的像素索引确定为0,C1对应的像素索引为1,C2对应的像素索引为2,C3对应的像素索引为3,C4对应的像素索引为4,C5对应的像素索引为5,C6对应的像素索引为6;由此确定的调色板如表1的前两行所示。Wherein, the initial palette may be determined according to the number of times the pixel value appears in the image area to be encoded. Table 1 shows the palette determined by the CU shown in Fig. 1 or 2. As shown in Table 1, C0 appears 43 times in the CU, C1 appears 8 times in the CU, C2 appears 6 times in the CU, C3 appears 4 times in the CU, and C4, C5 C6 appears in the CU one time. Therefore, the pixel index corresponding to C0 is determined to be 0, the pixel index corresponding to C1 is 1, the pixel index corresponding to C2 is 2, the pixel index corresponding to C3 is 3, the pixel index corresponding to C4 is 4, and the pixel index corresponding to C5 is 5. The pixel index corresponding to C6 is 6; the palette thus determined is as shown in the first two rows of Table 1.
表1Table 1
像素索引 Pixel index 00 11 22 33 44 55 66
像素值Pixel values C0C0 C1C1 C2C2 C3C3 C4C4 C5C5 C6C6
像素值在CU中出现的次数The number of times a pixel value appears in the CU 4343 88 66 44 11 11 11
索引在index run中出现的次数The number of times the index appears in the index run 11 33 33 11 11 11 11
但是,当采用索引拷贝信息时,根据该调色板生成的索引拷贝信息可如下表2所示。表2示出了基于表1的调色板而形成的图1所示的CU的索引拷贝(index run)信息。 However, when the index copy information is employed, the index copy information generated based on the palette may be as shown in Table 2 below. Table 2 shows the index run information of the CU shown in Fig. 1 which is formed based on the palette of Table 1.
表2Table 2
Left(0,31)Left(0,31)
Left(2,0)Left(2,0)
Above(3)Above(3)
Left(3,0)Left(3,0)
Left(1,0)Left(1,0)
Left(2,0)Left(2,0)
Left(1,0)Left(1,0)
Left(4,0)Left(4,0)
Above(6)Above(6)
Left(5,0)Left(5,0)
Left(6,0)Left(6,0)
Above(5)Above(5)
Left(1,0)Left(1,0)
Left(2,0)Left(2,0)
Above(4)Above(4)
如图1所示,在该CU中具有连续32个像素值为C0(调色板中对应的像素索引为0)的像素,因此形成表2中的索引拷贝信息Left(0,31);然后在该CU中具有1个像素值为C2(调色板中对应的像素索引为2)的像素,因此形成表2中的索引拷贝信息Left(2,0);然后在该CU中具有与上一行相应像素的像素值相同的4个像素(像素值分别为C0,C0,C0,C0),因此形成表2中的索引拷贝信息Above(3);As shown in FIG. 1, there are pixels in the CU having 32 consecutive pixel values of C0 (the corresponding pixel index in the palette is 0), thus forming the index copy information Left(0, 31) in Table 2; There is one pixel in the CU having a pixel value of C2 (the corresponding pixel index in the palette is 2), thus forming the index copy information Left(2, 0) in Table 2; then having and above in the CU a row of corresponding pixels with the same pixel value of 4 pixels (pixel values are C0, C0, C0, C0), thus forming the index copy information in Table 2 Above (3);
然后在该CU中具有1个像素值为C3(调色板中对应的像素索引为3)的像素,因此形成表2中的索引拷贝信息Left(3,0);在该CU中具有1个像素值为C1(调色板中对应的像素索引为1)的像素,因此形成表2中的索引拷贝信息Left(1,0);在该CU中具有1个像素值为C2(调色板中对应的像素索引为2)的像素,因此形成表2中的索引拷贝信息Left(2,0);在该CU中具有1个像素值为C1(调色板中对应的像素索引为1)的像素,因此形成表2中的索引拷贝信息Left(1,0);在该CU中具有1个像素值为C4(调色板中对应的像素索引为4)的像素,因此形成表2中的索引拷贝信息Left(4,0); Then there is one pixel in the CU having a pixel value of C3 (the corresponding pixel index in the palette is 3), thus forming index copy information Left(3, 0) in Table 2; having 1 in the CU A pixel having a pixel value of C1 (the corresponding pixel index in the palette is 1), thus forming index copy information Left(1, 0) in Table 2; having 1 pixel value in the CU is C2 (palette) The corresponding pixel index is 2) pixels, thus forming the index copy information Left(2,0) in Table 2; there is 1 pixel value C1 in the CU (the corresponding pixel index in the palette is 1) Pixels, thus forming the index copy information Left(1,0) in Table 2; having 1 pixel value in the CU with a pixel value of C4 (the corresponding pixel index in the palette is 4), thus forming Table 2 Index copy information Left(4,0);
然后,在该CU中具有与上一行相应像素的像素值相同的7个像素(像素值分别为C0,C0,C0,C3,C1,C2,C1),因此形成表2中的索引拷贝信息Above(6);在该CU中具有1个像素值为C5(调色板中对应的像素索引为5)的像素,因此形成表2中的索引拷贝信息Left(5,0);在该CU中具有1个像素值为C6(调色板中对应的像素索引为6)的像素,因此形成表2中的索引拷贝信息Left(6,0);Then, in the CU, there are 7 pixels having the same pixel value as the corresponding pixel of the previous row (the pixel values are C0, C0, C0, C3, C1, C2, C1, respectively), thus forming the index copy information in Table 2 (6); having one pixel in the CU having a pixel value of C5 (the corresponding pixel index in the palette is 5), thus forming the index copy information Left(5, 0) in Table 2; in the CU a pixel having a pixel value of C6 (the corresponding pixel index in the palette is 6), thus forming the index copy information Left(6, 0) in Table 2;
然后,在该CU中具有与上一行相应像素的像素值相同的6个像素(像素值分别为C0,C0,C3,C1,C2,C1),因此形成表2中的索引拷贝信息Above(5);在该CU中具有1个像素值为C1(调色板中对应的像素索引为1)的像素,因此形成表2中的索引拷贝信息Left(1,0);在该CU中具有1个像素值为C2(调色板中对应的像素索引为2)的像素,因此形成表2中的索引拷贝信息Left(2,0);最后,在该CU中具有与上一行相应像素的像素值相同的5个像素(像素值分别为C0,C0,C3,C1,C2),因此形成表2中的索引拷贝信息Above(4)。Then, in the CU, there are 6 pixels having the same pixel value as the corresponding pixel of the previous row (the pixel values are C0, C0, C3, C1, C2, C1, respectively), thus forming the index copy information in Table 2 (5) a pixel having 1 pixel value C1 (the corresponding pixel index in the palette is 1) in the CU, thus forming index copy information Left(1, 0) in Table 2; having 1 in the CU The pixel value is C2 (the corresponding pixel index in the palette is 2), thus forming the index copy information Left(2, 0) in Table 2; finally, the pixel having the corresponding pixel in the CU in the CU The five pixels having the same value (the pixel values are C0, C0, C3, C1, C2, respectively), thus forming the index copy information Above (4) in Table 2.
在生成如上的索引拷贝信息之后,进行比特流编码时,需要将例如Left(0,31)中的0和31进行编码。但是,基于如上调色板形成的索引拷贝信息,在采用变长码表示像素索引时,如表1的最后一行所示,像素索引“1”和“2”分别出现了3次,因此需要更多的比特才能进行编码。以下对本发明实施例进行详细说明,进一步优化调色板使得减少编码的比特代价。After the above-described index copy information is generated, when bit stream encoding is performed, it is necessary to encode, for example, 0 and 31 in Left (0, 31). However, based on the index copy information formed by the above palette, when the variable length code is used to represent the pixel index, as shown in the last row of Table 1, the pixel indexes "1" and "2" appear three times, respectively, and therefore need to be more More bits can be encoded. The embodiments of the present invention are described in detail below, and the palette is further optimized to reduce the bit cost of encoding.
实施例1Example 1
本发明实施例提供一种调色板的生成方法,图2是本发明实施例的调色板的生成方法的一示意图。如图2所示,所述生成方法包括:The embodiment of the present invention provides a method for generating a color palette, and FIG. 2 is a schematic diagram of a method for generating a color palette according to an embodiment of the present invention. As shown in FIG. 2, the generating method includes:
步骤201,对于待编码图像区域中采用调色板模式的多个像素,根据像素的像素值在待编码图像区域中出现的次数确定初始调色板;Step 201: Determine, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
步骤202,基于初始调色板确定待编码图像区域的索引拷贝信息;以及Step 202: Determine index copy information of an image region to be encoded based on an initial palette; and
步骤203,根据像素值所对应的像素索引在该索引拷贝信息中出现的次数,对初始调色板进行更新以确定更新后的调色板。Step 203: Update the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
在本实施例中,待编码图像区域可以为一编码单元CU或最大编码单元LCU(Largest Coding Unit);以下以CU为例进行说明。本发明实施例适用于采用调色板模式的情况,对于混合使用调色板模式和非调色板模式(例如escape mode)的情况, 本发明实施例同样适用。In this embodiment, the image area to be encoded may be a coding unit CU or a maximum coding unit LCU (Largest Coding Unit); the following uses CU as an example for description. Embodiments of the present invention are applicable to the case of adopting a palette mode, and in the case of mixing a palette mode and a non-palette mode (for example, an escape mode), Embodiments of the invention are equally applicable.
在本实施例中,步骤201中可以将像素值在待编码图像区域中出现的次数按降序进行排列,以及按照排序结果确定像素值在初始调色板中所对应的像素索引。如之前所述,可以根据像素值在待编码图像区域中出现的次数确定初始调色板。In this embodiment, in step 201, the number of times the pixel value appears in the image area to be encoded may be arranged in descending order, and the pixel index corresponding to the pixel value in the initial palette is determined according to the sorting result. As described earlier, the initial palette can be determined based on the number of times the pixel value appears in the image region to be encoded.
并且,在步骤202中可以基于初始调色板确定待编码图像区域的索引拷贝信息。可以通过按左拷贝(Copy Left)模式和/或按上拷贝(Copy Above)模式,生成该索引拷贝信息。但本发明不限于此,例如还可以采用其他的方式生成索引拷贝信息,以下以CopyLeft以及CopyAbove为例进行说明。例如,可以获得如表2所示的索引拷贝信息。And, in step 202, index copy information of the image region to be encoded may be determined based on the initial palette. The index copy information can be generated by pressing the Copy Left mode and/or the Copy Above mode. However, the present invention is not limited thereto. For example, index copy information may be generated in other manners. The following uses CopyLeft and CopyAbove as an example for description. For example, index copy information as shown in Table 2 can be obtained.
之后,可以对该索引拷贝信息进行统计,获得像素索引在该索引拷贝信息中的出现次数。例如,如表1中最后一行所示,图1的CU在采用如表1所示的调色板时,像素值C0至C6所对应的像素索引0至6出现在如表2所示的索引拷贝信息中的次数分别为1,3,3,1,1,1,1。After that, the index copy information may be counted to obtain the number of occurrences of the pixel index in the index copy information. For example, as shown in the last row of Table 1, when the CU of FIG. 1 adopts the palette as shown in Table 1, the pixel indexes 0 to 6 corresponding to the pixel values C0 to C6 appear in the index as shown in Table 2. The number of times in the copy information is 1, 3, 3, 1, 1, 1, and 1, respectively.
在本实施例中,步骤203可以根据像素索引在索引拷贝信息中出现的次数,对初始调色板进行更新以确定更新后的调色板。具体地,可以将像素值对应的像素索引在该索引拷贝信息中出现的次数按降序进行排列,以及按照排序结果确定像素值在更新后的调色板中所对应的像素索引。In this embodiment, step 203 may update the initial palette to determine the updated palette based on the number of occurrences of the pixel index in the index copy information. Specifically, the number of occurrences of the pixel index corresponding to the pixel value in the index copy information may be arranged in descending order, and the pixel index corresponding to the pixel value in the updated palette may be determined according to the sorting result.
例如,可以将1,3,3,1,1,1,1按照降序排列成3,3,1,1,1,1,1,按照该排列结果相应地改变对应的像素索引。例如将出现3次的像素值C1所对应的像素索引从1变为0,将出现3次的像素值C2所对应的像素索引从2变为1,而将出现1次的像素值C0所对应的像素索引从0变为2,由此形成如下表3:For example, 1, 3, 3, 1, 1, 1, 1 can be arranged in descending order to 3, 3, 1, 1, 1, 1, 1, and the corresponding pixel index is changed correspondingly according to the arrangement result. For example, the pixel index corresponding to the pixel value C1 that appears three times is changed from 1 to 0, and the pixel index corresponding to the pixel value C2 that appears three times is changed from 2 to 1, and the pixel value C0 that will appear once corresponds to The pixel index is changed from 0 to 2, thus forming Table 3 below:
表3table 3
像素索引 Pixel index 00 11 22 33 44 55 66
像素值Pixel values C1C1 C2C2 C0C0 C3C3 C4C4 C5C5 C6C6
像素值在CU中出现的次数The number of times a pixel value appears in the CU 88 66 4343 44 11 11 11
索引在index run中出现的次数The number of times the index appears in the index run 33 33 11 11 11 11 11
由此,形成的更新后的调色板如表3中的前两行所示。Thus, the resulting updated palette is as shown in the first two rows of Table 3.
在本实施例中,在形成更新后的调色板之后,还可以基于该更新后的调色板重新 确定待编码图像区域的索引拷贝信息;以及基于重新确定后的索引拷贝信息,对采用调色板模式的多个像素进行比特流编码。In this embodiment, after forming the updated palette, it is also possible to re-based the updated palette. Determining index copy information of the image area to be encoded; and performing bit stream encoding on the plurality of pixels in the palette mode based on the re-determined index copy information.
图3是本发明实施例的图像编码方法的一示意图,使用基于更新后的调色板而形成的索引拷贝信息进行比特流编码。如图3所示,所述图像编码方法包括:3 is a schematic diagram of an image encoding method according to an embodiment of the present invention, which uses bit index copy information formed based on an updated palette to perform bit stream encoding. As shown in FIG. 3, the image encoding method includes:
步骤301,对于待编码图像区域中采用调色板模式的多个像素,根据像素的像素值在待编码图像区域中出现的次数确定初始调色板;Step 301: Determine, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
步骤302,基于初始调色板确定待编码图像区域的索引拷贝信息;以及Step 302: Determine index copy information of an image region to be encoded based on an initial palette;
步骤303,根据像素值所对应的像素索引在该索引拷贝信息中出现的次数,对初始调色板进行更新以确定更新后的调色板。Step 303: Update the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
步骤304,基于更新后的调色板重新确定待编码图像区域的索引拷贝信息;以及 Step 304, re-determining index copy information of the image area to be encoded based on the updated palette;
步骤305,基于重新确定后的索引拷贝信息,对采用调色板模式的多个像素进行比特流编码。Step 305: Perform bitstream encoding on a plurality of pixels adopting the palette mode based on the re-determined index copy information.
步骤301至步骤303可以如前步骤201至步骤203所述。 Steps 301 to 303 may be as described in the previous steps 201 to 203.
在步骤304中,可以基于更新后的调色板重新确定待编码图像区域的索引拷贝信息。例如,对于图1所示的CU以及表3所示的更新后的调色板,可以确定出如下表4所示的更新后的索引拷贝信息。In step 304, the index copy information of the image region to be encoded may be re-determined based on the updated palette. For example, for the CU shown in FIG. 1 and the updated palette shown in Table 3, the updated index copy information shown in Table 4 below can be determined.
表4Table 4
Left(2,31)Left(2,31)
Left(1,0)Left(1,0)
Above(3)Above(3)
Left(3,0)Left(3,0)
Left(0,0)Left(0,0)
Left(1,0)Left(1,0)
Left(0,0)Left(0,0)
Left(4,0)Left(4,0)
Above(6)Above(6)
Left(5,0)Left(5,0)
Left(6,0)Left(6,0)
Above(5)Above(5)
Left(0,0)Left(0,0)
Left(1,0)Left(1,0)
Above(4)Above(4)
在步骤305中,可以基于重新确定的索引拷贝信息,对采用调色板模式的多个像素进行比特流编码。In step 305, bitstream encoding of a plurality of pixels in a palette mode may be performed based on the re-determined index copy information.
在本实施例中,关于具体如何进行比特流编码,可以参考相关技术。以下仅以一个实例来说明采用本发明实施例的更新后的调色板,如何进一步减小编码的比特代价。In this embodiment, regarding the specific how to perform bit stream coding, reference may be made to related art. The following uses only the updated palette of the embodiment of the present invention to illustrate how to further reduce the bit cost of the encoding.
在本实施例中,更新后的调色板中的像素索引使用变长码进行表示。例如如表5所示,像素索引0采用“0”(1比特)进行表示,像素索引1采用“10”(两比特)进行表示,……。In the present embodiment, the pixel index in the updated palette is represented by a variable length code. For example, as shown in Table 5, the pixel index 0 is represented by "0" (1 bit), and the pixel index 1 is represented by "10" (two bits), ....
表5table 5
像素索引Pixel index 变长码 Variable length code
00 00
11 1010
22 110110
33 11101110
44 1111011110
55 111110111110
66 11111101111110
值得注意的是,表5仅示意性示出了本发明实施例的变长码,但本发明不限于此,例如还可以根据实际情况确定其他的变长码。It should be noted that Table 5 only schematically shows the variable length code of the embodiment of the present invention, but the present invention is not limited thereto. For example, other variable length codes may be determined according to actual conditions.
由此,当采用表1所示的初始调色板时,由于像素索引0(对应像素值C0)在索引拷贝信息中出现了1次,像素索引1(对应像素值C1)在索引拷贝信息中出现了3次,像素索引2(对应像素值C2)在索引拷贝信息中出现了3次,则对于如表2所示的索引拷贝信息,像素值C0、C1、C2相应的部分需要的比特为1*1+2*3+3*3=16比特。 Thus, when the initial palette shown in Table 1 is employed, since the pixel index 0 (corresponding pixel value C0) appears once in the index copy information, the pixel index 1 (corresponding pixel value C1) is in the index copy information. Appeared 3 times, the pixel index 2 (corresponding to the pixel value C2) appears 3 times in the index copy information. For the index copy information as shown in Table 2, the corresponding bits of the pixel values C0, C1, C2 are required. 1*1+2*3+3*3=16 bits.
而当采用表3所示的更新后的调色板时,由于像素索引0(对应像素值C1)在索引拷贝信息中出现了3次,像素索引1(对应像素值C2)在索引拷贝信息中出现了3次,像素索引2(对应像素值C0)在索引拷贝信息中出现了1次,则对于如表4所示的索引拷贝信息,像素值C0、C1、C2相应的部分需要的比特为1*3+2*3+3*1=12比特。由此减少了16-12=4比特。When the updated palette shown in Table 3 is used, since the pixel index 0 (corresponding to the pixel value C1) appears three times in the index copy information, the pixel index 1 (corresponding to the pixel value C2) is in the index copy information. Appeared 3 times, the pixel index 2 (corresponding to the pixel value C0) appears once in the index copy information. For the index copy information as shown in Table 4, the corresponding bits of the pixel values C0, C1, C2 are required. 1*3+2*3+3*1=12 bits. This reduces 16-12 = 4 bits.
由上述实施例可知,根据像素值所对应的像素索引在索引拷贝信息中出现的次数,对初始调色板进行更新以确定更新后的调色板。可以进一步优化调色板,更好地减少编码的比特代价。It can be seen from the above embodiment that the initial palette is updated to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information. The palette can be further optimized to better reduce the bit cost of the encoding.
实施例2Example 2
本发明实施例提供一种调色板的生成装置,对应于实施例1中的调色板的生成方法,相同的内容不再赘述。The embodiment of the present invention provides a device for generating a color palette, which corresponds to the method for generating a color palette in the first embodiment, and the same content is not described herein.
图4是本发明实施例的调色板的生成装置的一示意图,如图4所示,该调色板的生成装置400包括:初始调色板确定单元401、拷贝信息确定单元402和调色板更新单元403;4 is a schematic diagram of a color palette generating apparatus according to an embodiment of the present invention. As shown in FIG. 4, the palette generating apparatus 400 includes an initial palette determining unit 401, a copy information determining unit 402, and a color palette. Board update unit 403;
其中,初始调色板确定单元401对于待编码图像区域中采用调色板模式的多个像素,根据所述像素的像素值在所述待编码图像区域中出现的次数确定初始调色板;拷贝信息确定单元402基于所述初始调色板确定所述待编码图像区域的索引拷贝信息;以及调色板更新单元403根据所述像素值对应的像素索引在所述索引拷贝信息中出现的次数,对所述初始调色板进行更新以确定更新后的调色板。Wherein, the initial palette determining unit 401 determines, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded; The information determining unit 402 determines the index copy information of the image region to be encoded based on the initial palette; and the number of times the palette updating unit 403 appears in the index copy information according to the pixel index corresponding to the pixel value, The initial palette is updated to determine the updated palette.
在本实施例中,更新后的调色板中的像素索引使用变长码进行表示。索引拷贝信息可以包括:由按左拷贝(Copy Left)模式和/或按上拷贝(Copy Above)模式所生成的信息。但本发明不限于此,例如还可以采用其他方法生成索引拷贝信息。In the present embodiment, the pixel index in the updated palette is represented by a variable length code. The index copy information may include information generated by a copy left (Copy Left) mode and/or a copy above (Copy Above) mode. However, the present invention is not limited thereto, and for example, other methods may be used to generate index copy information.
在本实施例中,初始调色板确定单元401具体可以用于:将所述像素值在所述待编码图像区域中出现的次数按降序进行排列,以及按照排序结果确定所述像素值在所述初始调色板中所对应的像素索引。In this embodiment, the initial palette determining unit 401 is specifically configured to: arrange the number of times the pixel value appears in the image to be encoded region in descending order, and determine the pixel value according to the sorting result. The pixel index corresponding to the initial palette.
在本实施例中,调色板更新单元403具体可以用于:将所述像素值所对应的像素索引在所述索引拷贝信息中出现的次数按降序进行排列,以及按照排序结果确定所述像素值在所述更新后的调色板中所对应的像素索引。 In this embodiment, the palette updating unit 403 may be specifically configured to: arrange the number of occurrences of the pixel index corresponding to the pixel value in the index copy information in descending order, and determine the pixel according to the sorting result. The value is the pixel index corresponding to the updated palette.
在本实施例中,调色板的生成装置400还可以包括:拷贝信息更新单元和比特流编码单元(图4中未示出);其中,拷贝信息更新单元基于更新后的调色板重新确定待编码图像区域的索引拷贝信息;以及比特流编码单元基于重新确定的索引拷贝信息对采用调色板模式的多个像素进行比特流编码。In this embodiment, the palette generating apparatus 400 may further include: a copy information updating unit and a bit stream encoding unit (not shown in FIG. 4); wherein the copy information updating unit re-determines based on the updated palette Index copy information of the image area to be encoded; and the bit stream encoding unit performs bit stream encoding on the plurality of pixels in the palette mode based on the re-determined index copy information.
图5是本发明实施例的图像编码装置的一示意图,包括如图4所示的调色板的生成装置400。如图5所示,该调色板的生成装置400包括:初始调色板确定单元401、拷贝信息确定单元402和调色板更新单元403。FIG. 5 is a schematic diagram of an image encoding apparatus according to an embodiment of the present invention, including a palette generating apparatus 400 as shown in FIG. As shown in FIG. 5, the palette generating apparatus 400 includes an initial palette determining unit 401, a copy information determining unit 402, and a palette updating unit 403.
如图5所示,图像编码装置500还可以包括:拷贝信息更新单元404和比特流编码单元405;其中,拷贝信息更新单元404基于更新后的调色板重新确定待编码图像区域的索引拷贝信息;以及比特流编码单元405基于重新确定的索引拷贝信息,对采用调色板模式的多个像素进行比特流编码。As shown in FIG. 5, the image encoding apparatus 500 may further include: a copy information updating unit 404 and a bit stream encoding unit 405; wherein the copy information updating unit 404 re-determines the index copy information of the image area to be encoded based on the updated palette And the bitstream encoding unit 405 performs bitstream encoding on a plurality of pixels adopting the palette mode based on the re-determined index copy information.
由上述实施例可知,根据像素值所对应的像素索引在索引拷贝信息中出现的次数,对初始调色板进行更新以确定更新后的调色板。可以进一步优化调色板,更好地减少编码的比特代价。It can be seen from the above embodiment that the initial palette is updated to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information. The palette can be further optimized to better reduce the bit cost of the encoding.
实施例3Example 3
本发明实施例提供一种图像处理设备,所述图像处理设备包括:如实施例2所述的调色板的生成装置400,或者图像编码装置500。An embodiment of the present invention provides an image processing apparatus including: a palette generating apparatus 400 as described in Embodiment 2, or an image encoding apparatus 500.
图6是本发明实施例的图像处理设备的一构成示意图。如图6所示,图像处理设备600可以包括:中央处理器(CPU)100和存储器110;存储器110耦合到中央处理器100。其中该存储器110可存储各种数据;此外还存储信息处理的程序,并且在中央处理器100的控制下执行该程序。Fig. 6 is a block diagram showing the configuration of an image processing apparatus according to an embodiment of the present invention. As shown in FIG. 6, the image processing apparatus 600 may include a central processing unit (CPU) 100 and a memory 110; the memory 110 is coupled to the central processing unit 100. The memory 110 can store various data; in addition, a program for information processing is stored, and the program is executed under the control of the central processing unit 100.
在一个实施方式中,调色板的生成装置400或者图像编码装置500的功能可以被集成到中央处理器100中。其中,中央处理器100可以被配置为实现如实施例1所述的调色板的生成方法或者图像编码方法。In one embodiment, the functions of the palette generating device 400 or the image encoding device 500 may be integrated into the central processing unit 100. The central processing unit 100 may be configured to implement the method for generating a color palette or the image encoding method as described in Embodiment 1.
在另一个实施方式中,调色板的生成装置400或者图像编码装置500可以与中央处理器分开配置,例如可以将调色板的生成装置400或者图像编码装置500配置为与中央处理器100连接的芯片,通过中央处理器的控制来实现调色板的生成装置400或者图像编码装置500的功能。 In another embodiment, the palette generating device 400 or the image encoding device 500 may be configured separately from the central processing unit. For example, the palette generating device 400 or the image encoding device 500 may be configured to be connected to the central processing unit 100. The chip implements the functions of the palette generating device 400 or the image encoding device 500 by the control of the central processing unit.
此外,如图6所示,图像处理设备600还可以包括:输入输出单元120和显示单元130等;其中,上述部件的功能与现有技术类似,此处不再赘述。值得注意的是,图像处理设备600也并不是必须要包括图6中所示的所有部件;此外,图像处理设备600还可以包括图6中没有示出的部件,可以参考现有技术。In addition, as shown in FIG. 6, the image processing apparatus 600 may further include: an input and output unit 120, a display unit 130, and the like; wherein the functions of the above components are similar to those of the prior art, and are not described herein again. It is to be noted that the image processing apparatus 600 does not necessarily have to include all of the components shown in FIG. 6; in addition, the image processing apparatus 600 may further include components not shown in FIG. 6, and reference may be made to the related art.
在本实施例中,图像处理设备600还可以包括:图像解码装置,该图像解码装置可以相应地进行解码。图像处理设备600可以如上所述地,通过中央处理器100的控制来实现图像解码装置的功能。In the present embodiment, the image processing apparatus 600 may further include: an image decoding device that can perform decoding correspondingly. The image processing apparatus 600 can implement the functions of the image decoding apparatus by the control of the central processing unit 100 as described above.
本发明实施例还提供一种计算机可读程序,其中当在图像处理设备中执行所述程序时,所述程序使得计算机在所述图像处理设备中执行实施例1所述的调色板的生成方法或者图像编码方法。The embodiment of the present invention further provides a computer readable program, wherein when the program is executed in an image processing device, the program causes a computer to execute the generation of the color palette described in Embodiment 1 in the image processing device Method or image coding method.
本发明实施例还提供一种存储有计算机可读程序的存储介质,其中所述计算机可读程序使得计算机在图像处理设备中执行实施例1所述的调色板的生成方法或者图像编码方法。The embodiment of the present invention further provides a storage medium storing a computer readable program, wherein the computer readable program causes a computer to execute the method for generating a palette or the image encoding method described in Embodiment 1 in an image processing device.
本发明以上的装置和方法可以由硬件实现,也可以由硬件结合软件实现。本发明涉及这样的计算机可读程序,当该程序被逻辑部件所执行时,能够使该逻辑部件实现上文所述的装置或构成部件,或使该逻辑部件实现上文所述的各种方法或步骤。本发明还涉及用于存储以上程序的存储介质,如硬盘、磁盘、光盘、DVD、flash存储器等。The above apparatus and method of the present invention may be implemented by hardware or by hardware in combination with software. The present invention relates to a computer readable program that, when executed by a logic component, enables the logic component to implement the apparatus or components described above, or to cause the logic component to implement the various methods described above Or steps. The present invention also relates to a storage medium for storing the above program, such as a hard disk, a magnetic disk, an optical disk, a DVD, a flash memory, or the like.
针对附图中描述的功能方框中的一个或多个和/或功能方框的一个或多个组合,可以实现为用于执行本申请所描述功能的通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件或者其任意适当组合。针对附图描述的功能方框中的一个或多个和/或功能方框的一个或多个组合,还可以实现为计算设备的组合,例如,DSP和微处理器的组合、多个微处理器、与DSP通信结合的一个或多个微处理器或者任何其它这种配置。One or more of the functional blocks described in the figures and/or one or more combinations of functional blocks may be implemented as a general purpose processor, digital signal processor (DSP) for performing the functions described herein. An application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or any suitable combination thereof. One or more of the functional blocks described with respect to the figures and/or one or more combinations of functional blocks may also be implemented as a combination of computing devices, eg, a combination of a DSP and a microprocessor, multiple microprocessors One or more microprocessors in conjunction with DSP communication or any other such configuration.
以上结合具体的实施方式对本发明进行了描述,但本领域技术人员应该清楚,这些描述都是示例性的,并不是对本发明保护范围的限制。本领域技术人员可以根据本发明的精神和原理对本发明做出各种变型和修改,这些变型和修改也在本发明的范围内。 The present invention has been described in connection with the specific embodiments thereof, and it should be understood by those skilled in the art that A person skilled in the art can make various modifications and changes to the present invention within the scope of the present invention.

Claims (14)

  1. 一种调色板的生成方法,其特征在于,所述生成方法包括:A method for generating a color palette, wherein the generating method comprises:
    对于待编码图像区域中采用调色板模式的多个像素,根据所述像素的像素值在所述待编码图像区域中出现的次数确定初始调色板;Determining, by the plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
    基于所述初始调色板确定所述待编码图像区域的索引拷贝信息;以及Determining index copy information of the image area to be encoded based on the initial palette;
    根据所述像素值对应的像素索引在所述索引拷贝信息中出现的次数,对所述初始调色板进行更新以确定更新后的调色板。And updating the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  2. 根据权利要求1所述的生成方法,其中,所述更新后的调色板中的像素索引使用变长码进行表示。The generating method according to claim 1, wherein the pixel index in the updated palette is represented by a variable length code.
  3. 根据权利要求1所述的生成方法,其中,所述方法还包括:The generating method according to claim 1, wherein the method further comprises:
    基于所述更新后的调色板重新确定所述待编码图像区域的索引拷贝信息;以及Re-determining index copy information of the image area to be encoded based on the updated palette;
    基于重新确定的索引拷贝信息,对所述采用调色板模式的多个像素进行比特流编码。The bit stream encoding is performed on the plurality of pixels in the palette mode based on the re-determined index copy information.
  4. 根据权利要求1所述的生成方法,其中,根据所述像素的像素值在所述待编码图像区域中出现的次数确定初始调色板,包括:The generating method according to claim 1, wherein determining an initial palette according to a number of occurrences of pixel values of the pixel in the image region to be encoded comprises:
    将所述像素值在所述待编码图像区域中出现的次数按降序进行排列,以及Arranging the number of times the pixel value appears in the image area to be encoded in descending order, and
    按照排序结果确定所述像素值在所述初始调色板中所对应的像素索引。A pixel index corresponding to the pixel value in the initial palette is determined according to the sorting result.
  5. 根据权利要求1所述的生成方法,其中,根据所述像素值对应的像素索引在所述索引拷贝信息中出现的次数,对所述初始调色板进行更新以确定更新后的调色板,包括:The generating method according to claim 1, wherein the initial palette is updated to determine an updated palette according to a number of occurrences of the pixel index corresponding to the pixel value in the index copy information. include:
    将所述像素索引在所述索引拷贝信息中出现的次数按降序进行排列,以及Arranging the number of occurrences of the pixel index in the index copy information in descending order, and
    按照排序结果确定所述像素值在所述更新后的调色板中所对应的像素索引。Determining, according to the sorting result, a pixel index corresponding to the pixel value in the updated palette.
  6. 根据权利要求1所述的生成方法,其中,所述索引拷贝信息包括:由按左拷贝模式和/或按上拷贝模式所生成的信息。The generating method according to claim 1, wherein the index copy information comprises information generated by pressing the left copy mode and/or pressing the copy mode.
  7. 一种调色板的生成装置,其特征在于,所述生成装置包括:A palette generating device, wherein the generating device comprises:
    初始调色板确定单元,对于待编码图像区域中采用调色板模式的多个像素,根据所述像素的像素值在所述待编码图像区域中出现的次数确定初始调色板;The initial palette determining unit determines, for a plurality of pixels adopting the palette mode in the image region to be encoded, an initial palette according to the number of times the pixel value of the pixel appears in the image region to be encoded;
    拷贝信息确定单元,基于所述初始调色板确定所述待编码图像区域的索引拷贝信 息;以及a copy information determining unit that determines an index copy letter of the image area to be encoded based on the initial palette Interest;
    调色板更新单元,根据所述像素值对应的像素索引在所述索引拷贝信息中出现的次数,对所述初始调色板进行更新以确定更新后的调色板。The palette updating unit updates the initial palette to determine the updated palette according to the number of occurrences of the pixel index corresponding to the pixel value in the index copy information.
  8. 根据权利要求7所述的生成装置,其中,所述更新后的调色板中的像素索引使用变长码进行表示。The generating apparatus according to claim 7, wherein the pixel index in the updated palette is represented by a variable length code.
  9. 根据权利要求7所述的生成装置,其中,所述装置还包括:The generating device of claim 7, wherein the device further comprises:
    拷贝信息更新单元,基于所述更新后的调色板重新确定所述待编码图像区域的索引拷贝信息;以及a copy information update unit that re-determines index copy information of the image area to be encoded based on the updated palette;
    比特流编码单元,基于重新确定的索引拷贝信息,对所述采用调色板模式的多个像素进行比特流编码。The bitstream encoding unit performs bitstream encoding on the plurality of pixels in the palette mode based on the re-determined index copy information.
  10. 根据权利要求7所述的生成装置,其中,所述初始调色板确定单元用于:将所述像素值在所述待编码图像区域中出现的次数按降序进行排列,以及按照排序结果确定所述像素值在所述初始调色板中所对应的像素索引。The generating apparatus according to claim 7, wherein the initial palette determining unit is configured to: arrange the number of occurrences of the pixel value in the image area to be encoded in descending order, and determine the result according to the sorting result The pixel index corresponding to the pixel value in the initial palette.
  11. 根据权利要求7所述的生成装置,其中,所述调色板更新单元用于:将所述像素值所对应的像素索引在所述索引拷贝信息中出现的次数按降序进行排列,以及按照排序结果确定所述像素值在所述更新后的调色板中所对应的像素索引。The generating device according to claim 7, wherein the palette updating unit is configured to: arrange the number of occurrences of the pixel index corresponding to the pixel value in the index copy information in descending order, and sort by The result determines a pixel index corresponding to the pixel value in the updated palette.
  12. 根据权利要求7所述的生成装置,其中,所述索引拷贝信息包括:由按左拷贝模式和/或按上拷贝模式所生成的信息。The generating apparatus according to claim 7, wherein said index copy information comprises information generated by pressing left copy mode and/or pressing copy mode.
  13. 一种图像处理设备,所述图像处理设备包括:如权利要求7至12任一项所述的调色板的生成装置。An image processing apparatus comprising: a palette generating device according to any one of claims 7 to 12.
  14. 根据权利要求13所述的图像处理设备,其中,所述图像处理设备还包括:The image processing device according to claim 13, wherein the image processing device further comprises:
    解码装置,对比特流进行解码以获得图像。 A decoding device that decodes the bitstream to obtain an image.
PCT/CN2014/085981 2014-09-05 2014-09-05 Generating method and apparatus for palette, and image processing device WO2016033791A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/085981 WO2016033791A1 (en) 2014-09-05 2014-09-05 Generating method and apparatus for palette, and image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/085981 WO2016033791A1 (en) 2014-09-05 2014-09-05 Generating method and apparatus for palette, and image processing device

Publications (1)

Publication Number Publication Date
WO2016033791A1 true WO2016033791A1 (en) 2016-03-10

Family

ID=55439037

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/085981 WO2016033791A1 (en) 2014-09-05 2014-09-05 Generating method and apparatus for palette, and image processing device

Country Status (1)

Country Link
WO (1) WO2016033791A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5883633A (en) * 1997-04-15 1999-03-16 Microsoft Corporation Method and system of variable run length image encoding using sub-palette
US20030161541A1 (en) * 2002-02-28 2003-08-28 Nokia Corporation Method and device for reducing image by palette modification
US20030169932A1 (en) * 2002-03-06 2003-09-11 Sharp Laboratories Of America, Inc. Scalable layered coding in a multi-layer, compound-image data transmission system
US20060104530A1 (en) * 2002-06-28 2006-05-18 Microsoft Corporation Adaptive entropy encoding/decoding for screen capture content
CN103957412A (en) * 2014-05-06 2014-07-30 北京大学 Base color and index map algorithm for correcting inter-frame residual errors of screen video

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5883633A (en) * 1997-04-15 1999-03-16 Microsoft Corporation Method and system of variable run length image encoding using sub-palette
US20030161541A1 (en) * 2002-02-28 2003-08-28 Nokia Corporation Method and device for reducing image by palette modification
US20030169932A1 (en) * 2002-03-06 2003-09-11 Sharp Laboratories Of America, Inc. Scalable layered coding in a multi-layer, compound-image data transmission system
US20060104530A1 (en) * 2002-06-28 2006-05-18 Microsoft Corporation Adaptive entropy encoding/decoding for screen capture content
CN103957412A (en) * 2014-05-06 2014-07-30 北京大学 Base color and index map algorithm for correcting inter-frame residual errors of screen video

Similar Documents

Publication Publication Date Title
KR102381999B1 (en) Method and system for decoding variable length coded input and method for modifying codebook
WO2017000404A1 (en) Method and device for compressing and decompressing data information, drive compensation method and device, and display device
RU2630750C1 (en) Device and method for encoding and decoding initial data
JP2018142974A (en) Backwards compatible extended image format
US20220114454A1 (en) Electronic apparatus for decompressing a compressed artificial intelligence model and control method therefor
US11961267B2 (en) Color conversion between color spaces using reduced dimension embeddings
WO2021130754A1 (en) Systems and methods of data compression
CN106133791B (en) Clustering and coding for color compressed
CN114222129A (en) Image compression encoding method, image compression encoding device, computer equipment and storage medium
WO2016033791A1 (en) Generating method and apparatus for palette, and image processing device
DE102020119183A1 (en) System and method for identifying and decoding Reed-Muller codes in polar codes
US20220004857A1 (en) Neural network processing apparatus, neural network processing method, and neural network processing program
CN104682966B (en) The lossless compression method of table data
US8018359B2 (en) Conversion of bit lengths into codes
Mathpal et al. A research paper on lossless data compression techniques
WO2016192053A1 (en) Copy information coding method and apparatus, and image processing device
CN112991209B (en) Image processing method, device, electronic equipment and storage medium
TWI498891B (en) Decoding circuit and associated encoding method and decoding method
CN107368430B (en) Method and device for reducing video memory
WO2016197317A1 (en) Copy information encoding and decoding method and apparatus, and image processing device
WO2016045077A1 (en) Image coding method and apparatus and image processing device
WO2017072011A1 (en) Method and device for selecting a process to be applied on video data from a set of candidate processes driven by a common set of information data
US10585626B2 (en) Management of non-universal and universal encoders
JP6981540B2 (en) Mode information coding and decoding methods, equipment and electronics
Hu et al. Lossless index coding for indexed colour images

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14901329

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14901329

Country of ref document: EP

Kind code of ref document: A1