WO2022109916A1 - Image encoding method and device, image decoding method and device, image processing system, mobile platform, image transmission system and storage medium - Google Patents
Image encoding method and device, image decoding method and device, image processing system, mobile platform, image transmission system and storage medium Download PDFInfo
- Publication number
- WO2022109916A1 WO2022109916A1 PCT/CN2020/131718 CN2020131718W WO2022109916A1 WO 2022109916 A1 WO2022109916 A1 WO 2022109916A1 CN 2020131718 W CN2020131718 W CN 2020131718W WO 2022109916 A1 WO2022109916 A1 WO 2022109916A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- encoding
- encoded
- image
- information
- target
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 158
- 238000012545 processing Methods 0.000 title claims abstract description 54
- 230000005540 biological transmission Effects 0.000 title claims abstract description 18
- 238000007906 compression Methods 0.000 claims abstract description 41
- 230000006835 compression Effects 0.000 claims abstract description 39
- 230000008569 process Effects 0.000 claims description 46
- 238000013507 mapping Methods 0.000 claims description 38
- 238000010801 machine learning Methods 0.000 claims description 9
- 230000001131 transforming effect Effects 0.000 claims description 9
- 230000001360 synchronised effect Effects 0.000 claims description 6
- 230000009466 transformation Effects 0.000 description 15
- 230000000694 effects Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 12
- 238000001914 filtration Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000011218 segmentation Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000003384 imaging method Methods 0.000 description 3
- 230000003595 spectral effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000002156 mixing Methods 0.000 description 2
- 238000007619 statistical method Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000011514 reflex Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/13—Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
Definitions
- the present application relates to the technical field of image processing, and in particular, to an image encoding method, a decoding method, an apparatus, an image processing system, a movable platform, an image transmission system, and a storage medium.
- high-definition imaging technologies characterized by high resolution, high frame rate, and high bit depth are applied in imaging devices, such as high-definition video cameras or single-lens reflex cameras.
- these high-definition image data will cause a problem of excessive bandwidth loss during storage or transmission.
- a large amount of high-definition image data generated by these imaging devices is cached in the memory.
- these high-definition images need to be read from the memory or written into the memory, a large amount of read and write bandwidth is required, resulting in limited device performance. and increased power consumption. Therefore, it is necessary to provide an image coding method to compress images.
- one of the objectives of the present application is to provide an image encoding method, decoding method, apparatus, image processing system, movable platform, image transmission system and storage medium.
- an embodiment of the present application provides an image encoding method, including:
- an encoded code stream for the to-be-encoded image block is generated.
- an embodiment of the present application provides an image decoding method, including:
- the encoded code stream includes first encoding information and second encoding information
- the decoded image block is obtained by using the plurality of frequency coefficients.
- an embodiment of the present application provides an image encoding apparatus, including:
- memory for storing processor-executable instructions
- the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
- an encoded code stream of the image block to be encoded is generated.
- an embodiment of the present application provides an image decoding apparatus, characterized in that it includes:
- memory for storing processor-executable instructions
- the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
- the encoded code stream includes first encoding information and second encoding information
- the decoded image block is obtained by using the plurality of frequency coefficients.
- an embodiment of the present application provides an image processing system, including an image processing module, an image encoding device, an image decoding device, and a memory;
- the image processing module is used to process the image, and transmit the processed image to the image encoding device;
- the image encoding device is configured to, after dividing the processed image into a plurality of image blocks to be encoded, perform compression encoding processing on the image blocks to be encoded to generate an encoded code stream;
- the memory is used for storing the encoded code stream
- the image decoding device is configured to decode the encoded code stream, and transmit the decoded result to the image processing module.
- an embodiment of the present application provides a movable platform, including the above-mentioned image encoding apparatus; or, including the above-mentioned image processing system.
- an embodiment of the present application provides an image transmission system, including an image transmitter and an image receiver; wherein the image transmitter includes the above-mentioned image encoding apparatus, and the image receiver includes the above-mentioned image decoding apparatus ;
- the image transmitter is configured to send the encoded code stream generated after encoding by the image encoding device to the image receiver;
- the image receiver is configured to use the image decoding device to decode the encoded code stream after receiving the encoded code stream.
- an embodiment of the present application provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, implement the method described in the first aspect or the second aspect.
- An image encoding method, decoding method, device, image processing system, movable platform, image transmission system, and storage medium convert the encoding of the zero-bit plane into the encoding of the first non-zero-bit plane
- the encoding of position information eliminates the need to encode all zero bit planes in each coefficient block, realizes efficient compression of the image block to be encoded, improves the compression rate, and also improves the compression efficiency of the image block to be encoded.
- FIG. 1 is a schematic diagram of an image processing system provided by an embodiment of the present application.
- FIG. 2 is a schematic structural diagram of an image transmission system provided by an embodiment of the present application.
- FIG. 3 is a schematic flowchart of an image encoding method provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of a mirror-symmetric filling provided by an embodiment of the present application.
- FIG. 6 is a schematic diagram of a front-to-back inversion provided by an embodiment of the present application.
- FIG. 7 is a schematic diagram of a bit plane and a coefficient block provided by an embodiment of the present application.
- FIG. 8 is a schematic diagram of the position of the first non-zero bit plane in the bit plane provided by an embodiment of the present application.
- FIG. 9 is a schematic diagram of a coding unit in a coefficient block provided by an embodiment of the present application.
- FIG. 10 is a schematic diagram of a scanning sequence provided by an embodiment of the present application.
- FIG. 11 is a schematic diagram of a mixed scanning of coding units of YUV components provided by an embodiment of the present application.
- FIG. 12 is a schematic diagram of a second coding mode corresponding to a target coding unit provided by an embodiment of the present application.
- FIG. 13 is a schematic flowchart of an image decoding method provided by an embodiment of the present application.
- FIG. 14 is a schematic structural diagram of an image encoding apparatus provided by an embodiment of the present application.
- the embodiments of the present application provide an image encoding method and an image decoding method. Before storing or transmitting high-definition image data, this The applied image encoding method encodes these high-definition image data to obtain an encoded code stream, and then caches the encoded code stream in the memory or transmits the encoded code stream.
- the amount of data is smaller, which can effectively reduce the loss of read and write bandwidth or transmission bandwidth, and also help to improve the read-write efficiency or transmission efficiency of high-definition image data;
- the encoded code stream corresponding to the high-definition image data can be read from the memory or the encoded code stream transmitted by the external device can be received, and then the image decoding method provided by the embodiment of the present application can be used to decode the encoded code stream.
- the encoded code stream is decoded to obtain a decoded image, and then the decoded image can be processed according to actual needs.
- the image may be firstly divided into multiple image blocks to be encoded, and for each image block to be encoded, multiple frequency coefficients of the image block to be encoded are obtained; Regarding the bit planes of the plurality of frequency coefficients, obtain one or more coefficient blocks; the coefficient blocks include binary bits of at least one frequency coefficient, and then determine the position information of the first non-zero bit plane in each of the coefficient blocks , and then encode the position information of the first non-zero bit plane of each of the coefficient blocks to generate the first encoding information; encoding the bits to generate second encoding information; finally, according to the first encoding information and the second encoding information, generate an encoded code stream about the to-be-encoded image block; finally, based on a plurality of to-be-encoded image blocks
- the encoded code stream of the image can be obtained.
- the coding of the zero bit plane is converted into the coding of the position information of the first non-zero bit plane, so that it is not necessary to encode all the zero bit planes in each coefficient block, and efficient compression of the image block to be coded is realized. , and the compression efficiency of the to-be-coded image block is also improved.
- the image encoding method can be applied to an image encoding apparatus.
- the image encoding apparatus may be an electronic device with data processing capability, such as a computer, a server, a cloud server or terminal, a movable platform (such as an unmanned aerial vehicle, an unmanned vehicle, or a mobile robot, etc.) Wait.
- the image encoding device may also be a computer chip or integrated circuit with data processing capability, such as a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP) , Application Specific Integrated Circuit (ASIC) or off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA), etc.
- the image coding device as a computer chip or an integrated circuit can be installed on an electronic device, such as a movable platform.
- the image decoding apparatus may be an electronic device with data processing capability, such as a computer, a server, a cloud server or a terminal, a movable platform (such as an unmanned aerial vehicle, an unmanned vehicle, or a mobile robot, etc.) Wait.
- the image decoding apparatus may also be a computer chip or integrated circuit with data processing capability, such as a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP) , Application Specific Integrated Circuit (ASIC) or off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA), etc.
- the image decoding device as a computer chip or an integrated circuit can be installed on an electronic device, such as a movable platform.
- the image decoding apparatus and the image coding apparatus may be the same electronic equipment or different electronic equipment; when used as computer chips or integrated circuits, the image decoding apparatus and all The image encoding apparatus may be set in the same device, or may be set in different devices, and specific settings may be made according to actual application scenarios.
- the image decoding device and the image encoding device are computer chips or integrated circuits
- the image decoding device and the image encoding device are set in the same device as an example for description:
- the image decoding device and the image encoding device can be applied to the image processing system as shown in FIG. 1 , and the image processing system can be installed on a movable platform (such as an unmanned aerial vehicle), a terminal device or a server equipped with images. processing functions on electronic devices.
- the image processing system includes an image processing module 11 , the image decoding device 13 , the image encoding device 12 and a memory 14 , and the image processing module 11 passes the image encoding device 12 before writing the image into the memory 14 .
- the image is encoded and compressed, and the encoded code stream of the image is obtained and stored in the memory 14, so that the bandwidth required for writing to the memory 14 can be reduced; when the image processing module 11 needs to When the image is processed, the coded code stream of the image is read from the memory 14, which can also effectively reduce the reading bandwidth, and the coded code stream of the image is further processed by the image decoding device 13.
- the image is obtained by decoding processing, and then the image processing module 11 can process the image.
- the encoded code stream of the image is stored in the memory 14 instead of the image. , since the data amount of the encoded code stream of the image is smaller than that of the image, the loss of the read and write bandwidth can be reduced, and the read and write efficiency can be improved at the same time.
- the image processing module 11 includes but is not limited to a graphics processing unit (GPU) or an image signal processor (ISP), etc.
- the memory 14 includes but is not limited to DDR memory, static random access memory (SRAM), magnetic memory, Disk or CD etc.
- the image decoding device and the image encoding device are computer chips or integrated circuits
- the image decoding device and the image encoding device are set in different devices as an example for description :
- the image decoding device 13 and the image encoding device 12 can be applied to the image transmission system as shown in FIG. 2 , and the image transmission system includes an image transmitter 21 and an image receiver 31 ; wherein, the image transmission system
- the image encoder 21 is installed with the image encoding device 12, the image receiver 31 is installed with the image decoding device 13;
- the image transmitter 21 can be installed on a movable platform 20 (such as an unmanned aerial vehicle), so
- the image receiver 31 can be installed on the terminal device 30 (eg, a remote controller).
- the image transmitter 21 can use the image encoding device 12 to compress and encode the image, generate an encoded code stream of the image, and send it to the image receiver 31.
- the receiver 31 can use the image encoding device 12 to decode the encoded code stream to obtain the image, and then the terminal device can decode the image.
- the image is further processed or displayed on its own display.
- the encoded code stream of the image to be transmitted since the data amount of the encoded code stream of the image is smaller than that of the image, the loss of transmission bandwidth can be reduced. , but also help to improve the transmission efficiency.
- FIG. 3 is a schematic flowchart of an image encoding method provided by the embodiment of the present application.
- the image encoding method is applied to an image encoding device.
- the methods described include:
- step S101 a plurality of frequency coefficients of the image block to be encoded are acquired.
- step S102 one or more coefficient blocks are obtained according to the bit planes about the plurality of frequency coefficients; the coefficient blocks include binary bits of at least one frequency coefficient.
- step S103 the position information of the first non-zero bit plane in each of the coefficient blocks is determined.
- step S104 the position information of the first non-zero bit plane of each of the coefficient blocks is encoded to generate first encoding information; and, for each of the coefficient blocks starting from the first non-zero bit plane The bits on the plane are encoded to generate second encoded information.
- step S105 an encoded code stream for the to-be-encoded image block is generated according to the first encoding information and the second encoding information.
- the to-be-coded image block may be part or all of the to-be-coded image; for example, taking the to-be-coded image block as a part of the to-be-coded image as an example, the image coding apparatus obtains the to-be-coded image
- the image to be encoded may be divided into a plurality of image blocks to be encoded, and then each image block to be encoded is encoded separately.
- the encoded code stream of one of the image blocks may be obtained according to the actual situation to perform encoding. It is not necessary to decode all encoded code streams corresponding to all image blocks of the entire image, so that the granularity of random access can be maintained.
- an image may be divided into image blocks with sizes such as 64x4, 64x2, or 32x1, but not limited thereto.
- the image encoding apparatus When encoding the image block to be encoded, the image encoding apparatus first transforms the image block to be encoded from the time domain to the frequency domain, so as to obtain a plurality of frequency coefficients of the image block to be encoded.
- the image to be encoded may be wavelet transformed to generate the plurality of frequency coefficients. It can be understood that this embodiment does not impose any restrictions on the wavelet transform algorithm, and can be specifically selected according to actual application scenarios.
- the wavelet transform algorithm may be 5/3 wavelet transform or Haar wavelet transform, etc., but not limited to. this.
- Wavelet transform is briefly introduced here.
- the image block to be encoded is divided into a high frequency region with high spectral frequency and a low frequency region with low spectral frequency.
- Efficient compression coding is performed by dividing the data of bands with low spectral frequencies into smaller regions.
- "L” and “H” represent the low frequency region and the high frequency region, respectively.
- the numbers before “L” and “H” indicate the division level of each area.
- the division level of the to-be-coded image block shown in FIG. 4 is 4, that is, it has undergone division and transformation processing four times.
- transformation and segmentation processing is performed on the image block to be encoded in the vertical direction, and the image to be encoded
- the block partition is transformed into 2 regions (that is, 2 sub-bands (sub-bands for short)) with a size of 32x2, which are the "1L” sub-band (with the most low-frequency components) and the "1H" sub-band (with the most high-frequency components) ), and then perform division processing in the horizontal direction to divide the to-be-encoded image into 4 regions with a size of 32 ⁇ 1, which are “1LL, 1LH, 1HL and 1HH” respectively, wherein the “1HH” subband has the most of high frequency components, the "1LL” subband has the most low frequency components.
- the low-frequency components are continuously transformed and segmented, and efficient compression coding is performed.
- the "1LL" subband is continuously transformed and segmented in the vertical direction to obtain the "2L” subband and the "2H” subband, with a size of 16x1, Among them, the "2L” subband has the most low frequency components after the second transformation and division.
- the "2L" sub-band is continuously transformed and divided in the vertical direction, and the "3L" sub-band and the "3H” sub-band are obtained, and the size is 8x1.
- the "3L” subband After transformation and segmentation, the "3L” subband has the most low frequency components.
- the "3L” sub-band is continuously transformed and divided in the vertical direction, and the "4L” sub-band and the "4H” sub-band are obtained, and the size is 4x1.
- the "4L” subband After transformation and segmentation, the "4L" subband has the most low frequency components. After 4 transformations and divisions, a total of 7 subbands are generated.
- the present application does not impose any restrictions on the division level and division direction, and in each transformation and division process, the transformation and division can be selected in the vertical direction and/or the horizontal direction. , which can be set according to the actual application scenario.
- the image block to be processed may be wavelet transformed using a filter bank including high frequency filters and low frequency filters, for example, the image block to be encoded is temporarily stored in a buffer, including high frequency filters and low frequency filters.
- the filter bank of the filter reads the image block to be encoded from the buffer, performs filtering processing on the read image block to be encoded, so as to generate frequency coefficients in the low-frequency region and high-frequency region, and then stores the frequency coefficients in the buffer. .
- a filter bank including a high-frequency filter and a low-frequency filter reads the frequency coefficients from the buffer, and uses an analysis filter to filter the read frequency coefficients, thereby generating further The resulting frequency coefficients are then stored on the buffer again. The above process is repeated, and when the division level reaches a predetermined level, a plurality of frequency coefficients on the buffer are acquired for subsequent processing.
- the 5/3 wavelet transform algorithm or the Haar wavelet transform algorithm may be used to transform the image block to be encoded.
- each pixel It needs to rely on the neighboring pixels on the left and right sides, and the pixels at the border will lack a part of the neighboring pixels, so that the pixels on the border cannot meet the width requirements of the filter when the wavelet transform is performed. Therefore, in order to process the border pixels, it is necessary to The border is filled with pixels.
- each grid represents a pixel.
- n is a natural number not less than 0, counting from 0, and the number of the first pixel is 0, the number of the last pixel is n-1.
- a mirror-symmetric filling method can be used to achieve accurate processing of the boundary pixel A and the boundary pixel U, as shown in Figure 5
- the gray part of is the filled pixel.
- the low-frequency coefficients are usually located on the left side, and the high-frequency coefficients are located on the right side, and the high-frequency coefficients on the right side are generally discarded.
- an adaptive filter will be used to perform deblocking filtering, and the deblocking filtering process will use the rear pixels of the previous image block to correct the current image block. The image block is filtered, and the rear pixels of the previous image block have errors because some coefficients are lost in the wavelet transform process.
- the to-be-coded image block is flipped back and forth.
- the to-be-coded image block includes pixels A, B, C, After D and E are flipped back and forth, pixels E, D, C, B and A are obtained; then the wavelet transform is performed on the image to be encoded after flipping back and forth, and then in the subsequent deblocking filtering process, due to the The front and back are reversed, so that the pixels of the lost part of the coefficients are on the front side instead of the back side.
- the acquired pixels on the back side are no longer the pixels whose coefficients have been lost, making the pixels with small error loss. It can be referenced by de-blocking, which is beneficial to improve the quality of image processing.
- wavelet transform is used to implement wavelet transform on the image to be encoded after being flipped back and forth.
- the image encoding device After transforming the image block to be encoded from the time domain to the frequency to generate the plurality of frequency coefficients, the image encoding device performs compression encoding according to the plurality of frequency coefficients.
- the image encoding device First determine the bit plane of the plurality of frequency coefficients, for example, the plurality of frequency coefficients can be expanded on the bit plane, for example, please refer to Fig. 7, Fig. 7 is to expand the 10 frequency coefficients expressed in hexadecimal into place
- the image encoding apparatus may obtain one or more coefficient blocks including binary bits of at least one frequency coefficient according to the bit planes with respect to the plurality of frequency coefficients; that is, according to every n( n is an integer greater than 0) the binary bits of the frequency coefficients divide the bit plane, so as to obtain one or more coefficient blocks on the bit plane, for example, please refer to FIG. 7, the binary bits of every 8 frequency coefficients can be divided into bits as a block of coefficients.
- step S103 the image coding apparatus determines the position information of the first non-zero bit plane in each of the coefficient blocks, wherein the zero bit plane refers to the bit planes that are all 0, then the non-zero bit plane Refers to the bit plane that is not all 0 (that is, some bits are 1); the image encoding device can be along the direction of gradually increasing bit depth, please refer to FIG.
- each coefficient block includes 8 coefficients, and the area of 4L and 4H is 4x1, so the 4L and 4H areas are used as 1 coefficient block, the 3H area is 1 coefficient block, and the 2H area includes 2 coefficient blocks.
- the 1H region includes 4 coefficient blocks, where the ordinate represents the bit depth, and the abscissa represents the position information of the first non-zero bit plane in each coefficient block. It can be seen that in the coefficient blocks including the 4L and 4H regions, the The location of the first non-zero bit plane is bit depth 4.
- the image encoding apparatus may not encode the zero bit plane in each coefficient block, but use the position information of the first non-zero bit plane
- the position information is used to replace the zero bit plane, and the position information of the first non-zero bit plane of each of the coefficient blocks is encoded to generate the first encoding information;
- the bits on each bit plane starting from the plane are encoded to generate second encoding information; finally, an encoded code stream about the to-be-encoded image block is generated according to the first encoding information and the second encoding information.
- the encoding of the zero bit plane is converted into the encoding of the position information of the first non-zero bit plane, so that it is not necessary to encode all the zero bit planes in each coefficient block.
- the data amount of the position information of the first non-zero bit plane of each coefficient block is usually less than the data amount of all the zero bit planes of each coefficient block, then the first code generated after encoding the position information of the first non-zero bit plane of each coefficient block.
- the data amount of the information is less, thereby realizing efficient compression of the image block to be encoded, and also improving the compression efficiency of the image block to be encoded.
- the frequency coefficients include both signed and absolute value components.
- the bit plane only includes a bit plane related to the absolute value of the frequency coefficients, for example, after acquiring the plurality of frequency coefficients, the image coding apparatus converts the plurality of frequency coefficients It is decomposed into a sign with respect to the plurality of frequency coefficients and an absolute value with respect to the plurality of frequency coefficients, and then a bit plane with respect to the plurality of frequency coefficients is determined according to the absolute values of the plurality of frequency coefficients.
- the image encoding apparatus encodes the signs of the plurality of frequency coefficients in units of the coefficient blocks, and generates third encoding information.
- a coefficient block includes binary bits of absolute values of 8 frequency coefficients, then the coefficient block can be used as a single block, and the symbols of the 8 frequency coefficients included in the coefficient block can be encoded as a whole,
- the third encoding information is generated, and then an encoded code stream of the image block to be encoded may be generated according to the first encoding information, the second encoding information and the third encoding information.
- the symbol of the part with the frequency coefficient of 0 may not be encoded, but only The signs of the frequency coefficients that are not 0 in each coefficient block are encoded to generate the third encoding information, so as to realize efficient compression of the signs of the frequency coefficients.
- the negative sign When encoding the sign of the frequency coefficient, the negative sign may be encoded as 1, and the positive sign may be encoded as 0; or, the negative sign may be encoded as 0, and the positive sign may be encoded as 0.
- the encoding is 1; but not limited to the above encoding.
- the image encoding device when encoding the position information of the first non-zero bit plane of each of the coefficient blocks, selects a target encoding mode from at least two first encoding modes, and uses the The target encoding mode encodes the position information of the first non-zero bit plane of each of the coefficient blocks.
- the image encoding apparatus may, based on each first encoding mode in the at least two first encoding modes, respectively adjust the first non-zero bit plane of each of the coefficient blocks.
- the location information is encoded to obtain at least two encoding results, and then the first encoding mode corresponding to the optimal encoding result among the at least two encoding results is determined as the target encoding mode; the optimal encoding result may be If the encoding length of the at least two encoding results is the smallest, the target encoding mode is the optimal one of the at least two first encoding modes, so that the image encoding device uses the target encoding mode to When the position information of the first non-zero bit plane of the coefficient block is encoded, the generated first encoded information has a better compression effect.
- the target encoding mode needs to be encoded, that is, the encoded code stream of the to-be-encoded image block includes There is encoding information of the target encoding mode, so that the image decoding apparatus can correctly decode the first encoding information according to the target encoding mode.
- the at least two first encoding modes include at least one encoding mode using a code table and/or at least one predictive encoding mode. It can be understood that this embodiment does not impose any limitations on the specific implementation of the predictive coding mode, which may be specifically selected according to actual application scenarios.
- the predictive coding mode may be DCMP (Differential Predictive Coding Modulation).
- the at least two first encoding modes may be variable length coding (VLC, Variable Length Coding) modes; in the mode of encoding using a code table, the code table may be a VLC code table; in the In the predictive coding mode, the obtained residual data can be subjected to VLC coding.
- VLC variable length coding
- the purpose of encoding is to reduce the amount of data of the image block to be encoded.
- the idea of encoding is usually to encode information symbols with high probability into short code words , while the information symbols with small probability are encoded with long code words, so that the average code word length is the shortest, that is, the encoded length of the finally obtained first encoded information is the shortest.
- the image information includes but not limited to image gradient information, signal-to-noise ratio, local variance or mean square error, etc.
- the image information includes but not limited to image gradient information, signal-to-noise ratio, local variance or mean square error, etc.
- the occurrence probability of various image information in the image or image block is not the same. If a unified code table is used to encode it, it may not get a better compression encoding effect, and the compression rate is not high. .
- the possible acquisition scenarios of the image or image block to be coded it is possible to pre-estimate the possible acquisition scenarios of the image or image block to be coded, and then determine a code table suitable for the scenario according to the acquisition scenario; for example, some reference data in the capture scenario can be obtained Images or reference image blocks, the distribution characteristics of the image information of these reference images or reference image blocks are counted, and then a code table suitable for the collection scene can be determined according to the distribution characteristics of the image information of these reference images or reference image blocks; or,
- the frequency distribution features can be obtained in the frequency domain according to these reference images or reference image blocks. For example, the frequency distribution features can be obtained according to these reference images or reference image blocks.
- the code table may be determined according to the estimated acquisition scene of the image block to be encoded. Further, a reference image block related to the estimated acquisition scene can be obtained, for example, the reference image block is acquired under the estimated acquisition scene, so that the code table can be based on the image of the reference image block Or, the position information of the first non-zero bit plane in each coefficient block can be obtained according to the frequency coefficient of the reference image block, so that the first non-zero bit plane in each coefficient block corresponding to the reference image block can be obtained according to the reference image block.
- the distribution feature of the position information of the non-zero bit plane determines the code table in the acquisition scene. Wherein, the distribution characteristics of the image information of the reference image block are also different depending on the acquisition scene.
- the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block are also different.
- the corresponding code tables are also different, so that the position information of the first non-zero bit plane in each coefficient block corresponding to the image block to be encoded can be encoded based on a suitable code table to obtain a first code with a shorter encoding length. information to improve the compression ratio.
- the possible acquisition scenarios of the image block to be encoded may be estimated in advance, and then the position of the first non-zero bit plane in each coefficient block corresponding to the image block to be encoded by an appropriate code table may be determined according to the estimated acquisition scenario.
- the encoding of the information is beneficial to obtain the first encoded information with a shorter encoding length, to realize an efficient compression process, and to improve the compression rate.
- a simple scene, a general scene, and a complex scene may be determined according to the complexity of the acquisition scene.
- the complexity may be determined by the number of types of acquisition objects included in the acquisition scene, such as In a sky image, if it only contains blue sky and white clouds, it can be determined to be a simple scene; if the sky image contains blue sky, white clouds, the sun and birds, it can be determined to belong to a general scene; if the sky image contains blue sky , white clouds, sun, birds, airplanes, mountains, etc., can be determined to belong to complex scenes.
- the degree of complexity can also be measured by other factors, for example, the degree of complexity can also be determined according to the amount of image information, the more image information, the more complex the image.
- all possible acquisition scenarios of the image or image block to be encoded can be estimated in advance, and then these acquisition scenarios can be divided into simple scenarios, general scenarios and complex scenarios.
- the suitable code table can be determined according to the characteristics of the simple scene, the general scene and the complex scene respectively; further, it can be determined according to the distribution characteristics of the image information of the reference image obtained under the simple scene, the general scene and the complex scene.
- the code table of the scene or, according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the image information of the reference image obtained under the simple scene, the general scene and the complex scene respectively, determine the corresponding scene. stopwatch.
- the mode of using the code table encoding in the first encoding mode can include the mode of using the code table under the simple scene to encode, the mode of using the code table under the general scene to encode, and the code table under the complex scene.
- encoding mode so that when encoding the position information of the first non-zero bit plane in each coefficient block corresponding to the image block to be encoded, encoding can be performed based on a suitable code table to obtain first encoding information with a shorter encoding length, To achieve an efficient compression process, it is beneficial to improve the compression rate.
- this embodiment independently performs coding according to different color components , which helps to improve the compression ratio.
- the image encoding device obtains the frequency coefficients corresponding to different color components of the to-be-coded image block, and then decomposes the corresponding frequency coefficients into bit planes according to different color components.
- Each of the plurality of bit planes includes a plurality of bit planes corresponding to different color components; wherein, at least one of the plurality of bit planes corresponding to the different color components corresponds to the at least two first encoding modes.
- the color components can be three color components of YUV, or three color components of RGB, that is, the bit planes corresponding to the plurality of different color components include the bit plane of the Y component, the bit plane of the U component, and the bit plane of the U component.
- a bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include a bit plane of the R component, a bit plane of the G component, and a bit plane of the B component.
- the image encoding device can obtain multiple frequency coefficients of the Y component, multiple frequency coefficients of the U component and multiple frequency coefficients of the V component of the to-be-coded image. a plurality of frequency coefficients of a color component, obtain one or more coefficient blocks of the color component according to the bit planes of the frequency coefficients of the color component, and determine the first non-zero bit plane in each of the coefficient blocks.
- the Y component, the U component and the V component respectively correspond to at least two first encoding modes, and the at least two first encoding modes include at least one mode encoded using a code table and/or at least one In the predictive coding mode, the code table is determined according to the estimated acquisition scene of the image block to be encoded. In the same acquisition scene or in different acquisition scenes, the code table corresponding to different color components may also be different.
- the image encoding device selects the target encoding mode of this color component from the at least two first encoding modes corresponding to each color component, and uses the target encoding mode of this color component to describe each of the color components
- the position information of the first non-zero bit plane of the coefficient block is encoded, thereby generating the first encoding information of the Y component, the first encoding information of the U component, and the first encoding information of the V component; this embodiment determines that it is suitable for different color components. to improve the compression rate of the image block to be encoded.
- the plurality of frequency coefficients are generated by transforming the image block to be encoded from the time domain to the frequency domain, and during the transformation process, the image block to be encoded will be divided into a plurality of different subbands , in different subbands, the distribution characteristics of its frequency coefficients are also different, or in other words, there may be one or more coefficient blocks in different subbands, and in different subbands, the first non-linear coefficient of the coefficient block
- the distribution characteristics of the position information of the zero plane are also different. Therefore, in order to obtain a better encoding and compression effect, each subband may be set to correspond to the at least two different first encoding modes, so as to be suitable for different subbands.
- the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient respectively belong to different subbands in the frequency domain; for example, the The first frequency coefficient belongs to the coefficient of the first frequency band, the second frequency coefficient belongs to the coefficient of the second frequency band, and the first frequency band and the second frequency band are one of high frequency or low frequency; the first frequency coefficient and the Each of the second frequency coefficients corresponds to the at least two first coding modes.
- different sub-bands correspond to different code tables. This embodiment improves the compression rate of the image block to be encoded by setting code tables suitable for different subbands.
- the image encoding device transforms the to-be-encoded image from the time domain to the frequency domain, and obtains multiple frequency coefficients belonging to different subbands, wherein the different subbands all correspond to the at least two first encoding modes, so the The at least two first encoding modes include at least one encoding mode using a code table and/or at least one predictive encoding mode, the code table is determined according to the estimated acquisition scene of the image block to be encoded, and in the same acquisition scene Or in different acquisition scenarios, the code tables corresponding to different sub-bands may also be different; then the image encoding device obtains one or more coefficient blocks according to the bit planes related to multiple frequency coefficients, and determines the first non-linear coefficient in each of the coefficient blocks.
- each color component belongs to different subbands, and each subband corresponds to three types of codes: simple scene, general scene and complex scene. surface. It is described in YUV444 format (each Y component corresponds to a set of UV components). The frequency coefficients of the Y component belong to 4 different subbands, and each subband has 3 code tables (corresponding to simple scenes, general scenes and complex scenes respectively) , then there are 12 code tables. Similarly, the frequency coefficients of the U component belong to 4 different sub-bands.
- Each sub-band has 3 code tables and 12 code tables.
- the V component also has 12 code tables.
- the image encoding apparatus further encodes the bits on the respective bit planes starting from the first non-zero bit plane in the respective coefficient blocks to generate the second encoding information, where During encoding, the image encoding apparatus encodes all bits of the same bit plane starting from a non-zero bit plane in the coefficient block as one encoding unit.
- the image encoding apparatus encodes all bits of the same bit plane starting from a non-zero bit plane in the coefficient block as one encoding unit.
- the non-zero bit plane in the coefficient block is the plane where the bit depth 0 is located, then all the bits of the bit plane where the bit depth 0 is located in the coefficient block is used as a coding unit, the coefficient All bits of the bit plane where the bit depth 1 is located in the block is regarded as a coding unit, and so on, the coefficient block has a total of 13 coding units.
- the size of the encoded code stream of the image block to be encoded is determined by the code rate, and the size of the code stream is proportional to the code rate. Therefore, the code rate corresponding to the image block to be encoded can be determined according to actual needs, For example, you can choose to configure the bit rate according to the lossless encoding method, or you can configure the bit rate according to the lossy encoding method, and perform specific configuration according to the actual application scenario.
- the image coding apparatus When the image coding apparatus encodes the coding units in the coefficient block, firstly, according to the target coding length indicated by the predetermined code rate, the target coding unit may be determined from the coding units according to a predetermined scanning order; The encoding unit indicates the object to be encoded in the encoding unit, and then the image encoding apparatus encodes the target encoding unit to generate the second encoding information.
- the image coding apparatus may sequentially determine the coding length of the coding unit according to a predetermined scanning order, and then according to the target coding length and the coding length of the coding unit, from the The number of target coding units is determined in the coding unit, that is, the image coding device can scan each coding unit in sequence according to a predetermined scan and accumulate the total coding length of all coding units currently scanned.
- the image encoding apparatus When the total coding length reaches During the target coding length indicated by the predetermined code rate, stop scanning the remaining coding units, determine that the scanned coding unit is the target coding unit, and record the position of the last target coding unit, the last target coding unit The position is the truncation position, and the image encoding apparatus also needs to encode the position information of the last target coding unit, so that when the image decoding apparatus performs decoding, the image decoding apparatus can The second encoding information is obtained from the encoded code stream according to the location information, so as to correctly decode the second encoding information.
- the predetermined scanning order includes at least the order from low frequency to high frequency and/or the order from the most significant bit bit plane to the least significant bit bit plane.
- the image encoding device acquires the frequency coefficients of different color components of the to-be-coded image block, and then expands the frequency coefficients of each color component to a bit plane, that is, the number of the bit planes is large.
- a plurality of the bit planes include a plurality of bit planes corresponding to different color components, and then one or more coefficient blocks of each color component are obtained on the bit planes corresponding to each different color component, and then the corresponding coefficient blocks of the different color components are obtained.
- Coding units in each coefficient block in order to implement fine rate control on the to-be-coded image block based on a predetermined code rate, the predetermined scan order instructs to mix a plurality of coding units corresponding to the different color components The order of scanning, so that different color components can be combined for fine rate control.
- the Y component corresponds to 2 coding units a1, a2
- the U component corresponds to 2 coding units b1, b2
- the V component corresponds to 2 coding units c1, c2
- the predetermined scanning sequence may be a1 ⁇ b1 ⁇ c1 ⁇ a2 ⁇ b2 ⁇ c2, which realizes the mixed scanning of YUV components, thereby ensuring the uniformity of the obtained YUV coding units, and making the image quality of the decompressed image blocks clear and natural.
- each The space represents a coding unit, and the number on each coding unit represents its scanning order.
- the coding units of the YUV components are mixed and scanned, so as to realize the joint and fine rate control of different color components, so as to ensure the obtained
- the uniformity of the coding unit of YUV makes the image quality of the decompressed image block clear and natural. It can be understood that the scanning sequence shown in FIG. 11 is only an example, but not limited to this. The gray part in the figure does not require coding. part.
- the image coding apparatus may code the target coding unit according to a second coding mode corresponding to the target coding unit.
- the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- the variable-length coding mode includes, but is not limited to, Huffman coding mode or Shannon coding mode.
- the second coding mode corresponding to the target coding unit may be determined according to the distribution characteristics of the target coding unit; or, the second coding mode corresponding to the target coding unit may be determined according to the location of the target coding unit.
- the position where the target coding unit is located includes at least one of the following: the bit depth of the bit plane corresponding to the target coding unit or the subband to which the target coding unit belongs. In this embodiment, determining a suitable second encoding mode according to the distribution characteristics of the target unit or its location helps to optimize the encoding effect of the second encoding information and improve the compression rate.
- the different distribution characteristics of the target coding indicate that the probabilities of various information symbols appearing in different target coding units may be different. Therefore, in order to achieve a better coding effect, the image coding apparatus may estimate in advance A possible collection scene of the image block to be encoded, then obtain a reference image related to the collection scene and the second encoding mode used in the compression encoding process, determine the target encoding unit of the reference image, and then according to the The distribution feature of the target coding unit of the image and the second coding mode used by it are referred to, and the mapping relationship between the distribution feature and the second coding mode is obtained.
- the second encoding mode corresponding to the target encoding unit can be obtained from the mapping relationship between the pre-stored distribution characteristic and the second encoding mode according to the distribution characteristic of the target encoding unit.
- the second encoding mode corresponding to the target coding unit may also be encoded to generate the encoded code stream; or the image decoding apparatus has pre-determined the the second coding mode corresponding to the target coding unit, it is not necessary to encode the second coding mode corresponding to the target coding unit.
- the mapping relationship between the distribution feature and the second encoding mode can be obtained through machine learning
- the distribution feature of the target encoding unit of the reference image and the second encoding mode used in the reference image can be used as training samples
- the The distribution feature of the target coding unit of the reference image is input into a preset model to obtain a prediction result, and then the parameters of the preset model are adjusted according to the difference between the prediction result and the second encoding mode used by the reference image, Further, the mapping relationship between the distribution feature and the second encoding mode is obtained through the adjusted model.
- the distribution characteristics of target coding units of a large number of reference images and the second coding mode used therefor may be obtained, and then statistical analysis is performed in a clustering manner to obtain the mapping relationship between the distribution characteristics and the second coding mode.
- the distribution characteristics of the target coding are different, so that the probabilities of various information symbols in different target coding units may be different. Therefore, in order to achieve better It is possible to pre-estimate the possible acquisition scene of the image block to be encoded, and then acquire the reference image related to the acquisition scene and the second encoding mode used in the compression encoding process, and determine the target of the reference image. The coding unit then obtains the mapping relationship between the position of the target coding unit and the second coding mode according to the position of the target coding unit of the reference image and the second coding mode used.
- the second encoding mode corresponding to the target encoding unit may be based on the position of the target encoding unit from the position of the pre-stored target encoding unit and the second encoding mode. Find it in the mapping relationship.
- the position where the target coding unit is located includes at least any one of the following: the bit depth of the bit plane corresponding to the target coding unit or the subband to which the target coding unit belongs.
- the second encoding mode corresponding to the target coding unit may also be encoded to generate the encoded code stream; or the image decoding apparatus has pre-determined the the second coding mode corresponding to the target coding unit, it is not necessary to encode the second coding mode corresponding to the target coding unit.
- the mapping relationship between the position of the target coding unit and the second coding mode may be obtained through machine learning, and the position of the target coding unit of the reference image and the second coding mode used may be used as training samples, input the position of the target coding unit of the reference image into a preset model, obtain a prediction result, and then adjust the parameters of the preset model, and then obtain the mapping relationship between the position of the target coding unit and the second coding mode through the adjusted model.
- the position of the target coding unit in a large number of reference images and the second coding mode used by it may be obtained, and then statistical analysis is performed through a clustering method, so as to obtain the position of the target coding unit and the second coding mode.
- Schema mapping relationship may be obtained, and then statistical analysis is performed through a clustering method, so as to obtain the position of the target coding unit and the second coding mode.
- a possible acquisition scene of the image block to be encoded may be estimated in advance, and then the target coding units of multiple reference images related to the acquisition scene may be acquired, and then according to the target coding unit of the target coding unit
- the distribution characteristics determine at least three second encoding modes, and the second encoding modes include at least fixed-length encoding modes and/or at least two variable-length encoding modes, that is, different distribution characteristics of the target coding unit correspond to different second encoding modes mode, for example, the distribution characteristics of the target coding unit can be divided into three types, for example, the distribution characteristics of the target coding unit are divided into the first type of distribution characteristics, the second type of distribution characteristics and the third type of distribution characteristics, respectively in For the first area, second area and third area of the bit plane, it is assumed that the second encoding mode corresponding to the first area (ie, the first type of distribution feature) is preset as the first variable-length encoding mode, and the second area (ie,
- Each of the at least two variable-length encoding modes includes a code table. Considering that the data volume of the coding unit is larger, when a code table is used to encode it, the more the table entries of the code table to be searched are. many, the coding efficiency is low, in order to further optimize the coding effect and improve the coding efficiency, each of the at least two variable-length coding modes includes at least two code tables, when the second coding mode corresponding to the target coding unit In the case of the variable-length encoding mode, the at least two code tables are used to encode different bits of the target encoding unit respectively, thereby helping to speed up the encoding speed and encoding efficiency, as well as optimizing the encoding effect and improving the compression rate. .
- the target coding unit is an 8-bit character string.
- variable-length encoding mode which can be determined according to the data volume of the encoding unit, such as setting a code table corresponding to every 4 bits, and the code
- the table may be determined according to distribution characteristics or locations of the coding units.
- the encoded length of the remaining bits of the target coding unit cannot meet the coding length indicated by the predetermined code rate, then preset data is added according to the coding length of the target coding unit, thereby ensuring that Finally, the encoding length of the encoded code stream of the image block to be encoded can conform to the encoding length indicated by the predetermined code rate, thereby enabling the image decoding apparatus to perform correct decoding.
- the length of the remaining bits of the target coding unit after being coded is 5 bits, and currently 10 bits may be required to meet the coding length indicated by the predetermined code rate, then the target coding unit needs to be coded according to the target coding length.
- the last target coding unit for encoding using the at least two variable-length encoding methods is used instead for encoding, and after the encoding is completed, the data length of the preset data to be added is re-determined, thereby helping to reduce the complexity of hardware implementation.
- the preset length may be the length of one coding unit.
- the image decoding apparatus can usually perform decoding from two ends synchronously.
- all The first encoding information is located at a first position in the encoded code stream
- the second encoding information is located at a second position in the encoded code stream, the first position and the second position for enabling the decoding end to synchronously decode the encoded code stream from the first position and the second position.
- the plurality of frequency coefficients are decomposed into symbols and absolute values for encoding respectively, in addition to the first encoding information and the second encoding information, the third encoding information obtained by encoding the symbols is also included.
- the first encoding information is located in a first position in the encoded code stream
- the second encoding information and the third encoding information are located in the second position in the encoded code stream
- the first position and the second position are used to enable the decoding end to synchronously decode the encoded code stream from the first position and the second position .
- one of the first position and the second position is the head position of the encoded code stream, and the other is the tail position of the encoded code stream.
- the target encoding mode and the position information of the last target encoding unit are also encoded, and these encoded information can be placed in the encoded
- the third position of the code stream for example, the third position is the head position of the encoded code stream, and one of the first position and the second position is the position after the third position , and the other is the tail position of the encoded code stream.
- an embodiment of the present application further provides an image decoding method, and the method includes:
- step S201 an encoded code stream is obtained, where the encoded code stream includes first encoding information and second encoding information.
- step S202 the first encoding information is decoded to obtain the position information of the first non-zero bit plane of each coefficient block; and the second encoding information is decoded to obtain the Bits on each bit plane starting with the first non-zero bit plane.
- step S203 according to the position information of the first non-zero bit plane of each coefficient block and the bits on each bit plane starting from the first non-zero bit plane in each coefficient block, obtain multiple frequency factor.
- step S204 a decoded image block is obtained through the plurality of frequency coefficients.
- the encoded code stream includes a target encoding mode corresponding to the generation of the first encoding information.
- the decoding the first encoding information includes: decoding the first encoding information according to the target encoding mode.
- the target encoding mode is one of the following: at least one mode using code table encoding and/or at least one predictive encoding mode.
- the code table in the mode of encoding using a code table, is determined according to an estimated acquisition scene of the decoded image block; or the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
- the code tables corresponding to different acquisition scenarios are different, or, the code tables corresponding to different distribution characteristics of the image information of the reference image block are different; or, the first one of the coefficient blocks corresponding to the reference image block is The code tables corresponding to different distribution characteristics of the position information of the non-zero bit plane are different.
- the plurality of frequency coefficients are generated after transforming the image block to be encoded from the time domain to the frequency domain; wherein the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, And the first frequency coefficient and the second frequency coefficient respectively belong to different subbands in the frequency domain.
- Both the first frequency coefficient and the second frequency coefficient correspond to the target coding mode; in other words, each of the different subbands corresponds to the target coding mode.
- the target encoding mode is the mode using the code table encoding
- different subbands correspond to different code tables.
- the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, at least one of the multiple bit planes corresponding to the different color components Corresponding to the target encoding mode.
- a plurality of bit planes corresponding to the different color components include a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include: The bit plane of the R component, the bit plane of the G component, and the bit plane of the B component.
- the encoded code stream further includes position information of the last target coding unit; the target coding unit indicates the object to be encoded in the coding unit.
- the method Before the decoding the second encoding information, the method includes: determining and acquiring the second encoding information from the encoded code stream according to the position information of the last target coding unit. It can be said that the position information of the last target coding unit plays a role in positioning, so that the second coding information can be determined from the coded code stream.
- the target coding unit is determined by the coding end after scanning the coding unit according to a predetermined scanning order.
- the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components; The order in which coding units are mixed-encoded.
- the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit-plane to the least significant bit-plane.
- the decoding the second encoding information further includes: decoding the second encoding information according to a second encoding mode corresponding to the second encoding information to obtain a target encoding unit.
- the encoded code stream includes the second encoding mode corresponding to the second encoding information; or, the image decoding apparatus obtains the second encoding mode corresponding to the second encoding information in advance.
- the second encoding mode is determined according to the distribution characteristics of the target coding unit; or, the second encoding mode is determined according to the position where the target coding unit is located.
- the second encoding mode is determined according to the distribution characteristics of the target coding unit and the mapping relationship between the pre-stored distribution characteristics and the second encoding mode.
- the second coding mode is determined according to the location of the target coding unit and a pre-stored mapping relationship between the location of the target coding unit and the second coding mode.
- the location where the target coding unit is located includes at least one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subband to which the target coding unit belongs.
- the pre-stored mapping relationship between the distribution feature and the second encoding mode or the pre-stored mapping relationship between the location of the target coding unit and the second encoding mode is obtained based on machine learning.
- the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- variable length coding mode includes at least two code tables.
- the decoding of the second encoding information further includes: when the second encoding mode is a variable-length encoding mode, using the at least two code tables to respectively decode different code words in the second encoding information to decode.
- the encoded code stream further includes third encoding information.
- the method further includes: decoding the third encoded information to obtain the sign of the frequency coefficient.
- the method further includes: acquiring the first encoding information from a first position of the encoded code stream, and acquiring the second encoding information from a second position of the encoded code stream encoding information.
- the decoding of the first encoded information and the decoding of the second encoded information include: synchronously decoding the first encoded information and the second encoded information.
- the method further includes: acquiring the first encoding information from a first position of the encoded code stream, and acquiring the second encoding information from a second position of the encoded code stream Encoded information or third stream.
- the decoding of the first encoded information and the decoding of the second encoded information include: synchronously decoding the first encoded information and the second encoded information; or,
- the decoding of the first encoded information and the decoding of the third encoded information include: synchronous decoding of the first encoded information and the third encoded information.
- one of the first position and the second position is the head position of the encoded code stream, and the other is the tail position of the encoded code stream.
- the decoded image is obtained by performing inverse wavelet transform on the plurality of frequency coefficients.
- the decoded image is obtained by performing inverse wavelet transform on the plurality of frequency coefficients, and then performing front-to-back inversion.
- an embodiment of the present application further provides an image encoding apparatus 12, including:
- memory 122 for storing instructions executable by processor 121
- the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
- an encoded code stream of the image block to be encoded is generated.
- the various embodiments described herein can be implemented using computer readable media such as computer software, hardware, or any combination thereof.
- the embodiments described herein can be implemented using application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays ( FPGA), processors, controllers, microcontrollers, microprocessors, electronic units designed to perform the functions described herein are implemented.
- ASICs application specific integrated circuits
- DSPs digital signal processors
- DSPDs digital signal processing devices
- PLDs programmable logic devices
- FPGA field programmable gate arrays
- processors controllers, microcontrollers, microprocessors, electronic units designed to perform the functions described herein are implemented.
- embodiments such as procedures or functions may be implemented with separate software modules that allow the performance of at least one function or operation.
- the software codes may be implemented by a software application (or program) written in any suitable programming language, which may be stored in
- FIG. 14 is only an example of the image coding apparatus 12, and does not constitute a limitation to the image coding apparatus 12, and may include more or less components than the one shown, or combine some components, or different Components, such as devices, may also include input and output devices, network access devices, buses, and the like.
- the processor 121 is further configured to: select a target encoding mode from at least two first encoding modes, and use the target encoding mode to perform a calculation on the first non-zero bit plane of each of the coefficient blocks. encoding the position information; and, the generating an encoded code stream for the image block to be encoded further includes: encoding the target encoding mode.
- the at least two first encoding modes include at least one encoding mode using a code table and/or at least one predictive encoding mode.
- the code table is determined according to the estimated acquisition scene of the image block to be encoded; or, the code table is determined according to the distribution characteristics of the image information of the reference image block related to the estimated acquisition scene or, the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
- the code tables corresponding to different acquisition scenarios are different, or, the code tables corresponding to different distribution characteristics of the image information of the reference image block are different; or, the first one of the coefficient blocks corresponding to the reference image block is The code tables corresponding to different distribution characteristics of the position information of the non-zero bit plane are different.
- the plurality of frequency coefficients are generated after transforming the image block to be encoded from the time domain to the frequency domain; wherein the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain respectively; the first frequency coefficient and the second frequency coefficient both correspond to the at least two first coding modes .
- different sub-bands correspond to different code tables.
- the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, at least one of the multiple bit planes corresponding to the different color components The at least two first encoding modes correspond to each other.
- a plurality of bit planes corresponding to the different color components include a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include: The bit plane of the R component, the bit plane of the G component, and the bit plane of the B component.
- the processor 121 is further configured to: based on each of the at least two first encoding modes, respectively, for the position information of the first non-zero bit plane of each of the coefficient blocks Encoding is performed to obtain at least two encoding results; the first encoding mode corresponding to the optimal encoding result in the at least two encoding results is determined as the target encoding mode
- all bits of the same bit plane in the coefficient block are regarded as one coding unit.
- the processor 121 is further configured to: determine a target coding unit from the coding units according to a predetermined scanning order according to a target coding length indicated by a predetermined code rate; the target coding unit indicates that the coding unit needs to be coded encoding the target coding unit to generate the second coding information; and coding the position information of the last target coding unit.
- the processor 121 is further configured to: sequentially determine the encoding length of the encoding unit according to a predetermined scanning order; Determines the number of target coding units in .
- the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components; The order in which the coding units are scanned for blending.
- the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit-plane to the least significant bit-plane.
- the processor 121 is further configured to: encode the target coding unit according to the second coding mode corresponding to the target coding unit.
- the second coding mode corresponding to the target coding unit is determined according to the distribution characteristics of the target coding unit; or, the second coding mode corresponding to the target coding unit is determined according to the location of the target coding unit. determined by the location.
- the second coding mode corresponding to the target coding unit is determined according to the distribution feature of the target coding unit and the mapping relationship between the pre-stored distribution feature and the second coding mode;
- the second encoding mode is determined according to the location of the target encoding unit and the pre-stored mapping relationship between the location of the target encoding unit and the second encoding mode.
- the location where the target coding unit is located includes at least one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subband to which the target coding unit belongs.
- the pre-stored mapping relationship between the distribution feature and the second encoding mode or the pre-stored mapping relationship between the location of the target coding unit and the second encoding mode is obtained based on machine learning.
- the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- each of the at least two variable-length encoding modes includes at least two code tables; the processor 121 is further configured to: when the second encoding mode corresponding to the target encoding unit is: In the variable-length coding mode, the at least two code tables are used to encode different bits of the target coding unit respectively.
- the processor 121 is further configured to: if the encoded length of the remaining bits of the target coding unit cannot meet the coding length indicated by the predetermined code rate, then according to the encoding length of the target coding unit Preset data is added to the encoding length.
- the processor 121 is further configured to: decompose the plurality of frequency coefficients into signs of the plurality of frequency coefficients and absolute values of the plurality of frequency coefficients;
- the symbols of the plurality of frequency coefficients are encoded to generate third encoded information.
- the processor 121 is further configured to: encode the sign of the frequency coefficient that is not 0.
- the first encoding information is located at a first position in the encoded code stream, and the second encoding information is located at a first position in the encoded code stream. at a second position in the encoded codestream.
- the first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
- the first encoding information is located at a first position in the encoded code stream, and the second encoding information is located at a first position in the encoded code stream. and the third encoding information is located at a second position in the encoded code stream.
- the first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
- the plurality of frequency coefficients are generated based on wavelet transform of the image block to be encoded.
- the plurality of frequency coefficients are generated based on wavelet transform of the image to be encoded after being flipped back and forth.
- an image decoding apparatus including:
- memory for storing processor-executable instructions
- the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
- the encoded code stream includes first encoding information and second encoding information
- the decoded image block is obtained by using the plurality of frequency coefficients.
- the encoded code stream includes a target encoding mode corresponding to the generation of the first encoding information.
- the processor is further configured to: decode the first encoding information according to the target encoding mode.
- the target encoding mode is one of the following: at least one mode using code table encoding and/or at least one predictive encoding mode.
- the code table in the mode of encoding using a code table, is determined according to an estimated acquisition scene of the decoded image block; or the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
- the code tables corresponding to different acquisition scenarios are different, or, the code tables corresponding to different distribution characteristics of the image information of the reference image block are different; or, the first one of the coefficient blocks corresponding to the reference image block is The code tables corresponding to different distribution characteristics of the position information of the non-zero bit plane are different.
- the plurality of frequency coefficients are generated after transforming the image block to be encoded from the time domain to the frequency domain; wherein the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, In addition, the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain, respectively; the first frequency coefficient and the second frequency coefficient both correspond to the target coding mode.
- the target encoding mode is the mode using the code table encoding
- different subbands correspond to different code tables.
- the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, at least one of the multiple bit planes corresponding to the different color components Corresponding to the target encoding mode.
- a plurality of bit planes corresponding to the different color components include a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include: The bit plane of the R component, the bit plane of the G component, and the bit plane of the B component.
- the encoded code stream further includes position information of the last target coding unit; the target coding unit indicates the object to be encoded in the coding unit.
- the processor is further configured to: obtain the second encoding information from the encoded code stream according to the position information of the last target encoding unit.
- the target coding unit is determined by the coding end after scanning the coding unit according to a predetermined scanning order.
- the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components; The order in which the coding units are scanned for blending.
- the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit-plane to the least significant bit-plane.
- the processor is further configured to: decode the second encoding information according to a second encoding mode corresponding to the second encoding information to obtain a target encoding unit.
- the second encoding mode is determined according to the distribution characteristics of the target coding unit; or, the second encoding mode is determined according to the position where the target coding unit is located.
- the second encoding mode is determined according to the distribution characteristics of the target coding unit and the mapping relationship between the pre-stored distribution characteristics and the second encoding mode; or, the second encoding mode It is determined according to the position of the target coding unit and the pre-stored mapping relationship between the position of the target coding unit and the second coding mode.
- the position where the target coding unit is located includes at least any one of the following: the bit depth of the bit plane corresponding to the target coding unit or the subband to which the target coding unit belongs.
- the pre-stored mapping relationship between the distribution feature and the second encoding mode or the pre-stored mapping relationship between the location of the target coding unit and the second encoding mode is obtained based on machine learning.
- the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- variable length coding mode includes at least two code tables.
- the processor is further configured to: when the second encoding mode is a variable-length encoding mode, use the at least two code tables to respectively decode different code words in the second encoding information.
- the encoded code stream further includes third encoding information.
- the processor is further configured to: decode the third encoded information to obtain the sign of the frequency coefficient.
- the processor is further configured to: obtain the first encoding information from a first position of the encoded code stream, and obtain the first encoding information from a second position of the encoded code stream second encoding information; synchronously decoding the first encoding information and the second encoding information.
- the processor is further configured to: obtain the first encoding information from a first position of the encoded code stream, and obtain the first encoding information from a second position of the encoded code stream the second encoded information or the third code stream;
- one of the first position and the second position is the head position of the encoded code stream, and the other is the tail position of the encoded code stream.
- an embodiment of the present application further provides an image processing system, including an image processing module, the above-mentioned image encoding apparatus, the above-mentioned image decoding apparatus, and a memory;
- the image processing module is used to process the image, and transmit the processed image to the image encoding device;
- the image encoding device is configured to, after dividing the processed image into a plurality of image blocks to be encoded, perform compression encoding processing on the image blocks to be encoded to generate an encoded code stream;
- the memory is used for storing the encoded code stream
- the image decoding device is configured to decode the encoded code stream, and transmit the decoded result to the image processing module.
- an embodiment of the present application further provides a movable platform, including the above-mentioned image encoding apparatus; or, including the above-mentioned image processing system.
- the movable platform includes at least an unmanned aerial vehicle, an unmanned vehicle or a mobile robot.
- an embodiment of the present application further provides an image transmission system, including an image transmitter and an image receiver; wherein the image transmitter includes the above-mentioned image encoding apparatus, and the image receiver includes The above-mentioned image decoding device;
- the image transmitter is configured to send the encoded code stream generated after encoding by the image encoding device to the image receiver;
- the image receiver is configured to use the image decoding device to decode the encoded code stream after receiving the encoded code stream.
- non-transitory computer-readable storage medium such as a memory including instructions, executable by a processor of an apparatus to perform the above-described method.
- the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
An image encoding method and device, an image decoding method and device, an image processing system, a mobile platform, an image transmission system and a storage medium. The encoding method comprises: acquiring a plurality of frequency coefficients of an image block to be encoded (S101); obtaining one or more coefficient blocks according to bit planes related to the plurality of frequency coefficients, the coefficient blocks comprising binary bits of at least one frequency coefficient (S102); determining position information of a first non-zero bit plane in each of the coefficient blocks (S103); and encoding the position information of the first non-zero bit plane of each of the coefficient blocks, and encoding bits on each of the bit planes starting from the first non-zero bit plane in each of the coefficient blocks (S104). The encoding method does not need to encode all zero-bit planes in each coefficient block, thereby achieving efficient compression of an image block to be encoded.
Description
本申请涉及图像处理技术领域,具体而言,涉及一种图像编码方法、解码方法、装置、图像处理系统、可移动平台、图传系统及存储介质。The present application relates to the technical field of image processing, and in particular, to an image encoding method, a decoding method, an apparatus, an image processing system, a movable platform, an image transmission system, and a storage medium.
随着技术的发展,以高分辨率、高帧速率以及高比特深度等为特征的高清晰度成像技术应用在成像设备中,比如高清摄像机或者单反照相机等等。但是这些高清图像数据在存储或者传输过程中会造成带宽损耗过大的问题。例如,这些成像设备产生的大量高清图像数据缓存于存储器中,当需要从存储器中读出这些高清图像或者将这些高清图像写入存储器中时,需要耗费大量的读写带宽,造成设备性能受限以及功耗的增加。因此,有必要提供一种图像编码方法对图像进行压缩。With the development of technology, high-definition imaging technologies characterized by high resolution, high frame rate, and high bit depth are applied in imaging devices, such as high-definition video cameras or single-lens reflex cameras. However, these high-definition image data will cause a problem of excessive bandwidth loss during storage or transmission. For example, a large amount of high-definition image data generated by these imaging devices is cached in the memory. When these high-definition images need to be read from the memory or written into the memory, a large amount of read and write bandwidth is required, resulting in limited device performance. and increased power consumption. Therefore, it is necessary to provide an image coding method to compress images.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请的目的之一是提供一种图像编码方法、解码方法、装置、图像处理系统、可移动平台、图传系统及存储介质。In view of this, one of the objectives of the present application is to provide an image encoding method, decoding method, apparatus, image processing system, movable platform, image transmission system and storage medium.
第一方面,本申请实施例提供了一种图像编码方法,包括:In a first aspect, an embodiment of the present application provides an image encoding method, including:
获取待编码图像块的多个频率系数;Obtain multiple frequency coefficients of the image block to be encoded;
根据关于所述多个频率系数的位平面,获得一个或多个系数块;所述系数块包括至少一个频率系数的二进制比特位;obtaining one or more blocks of coefficients from the bit planes for the plurality of frequency coefficients; the blocks of coefficients comprising binary bits of at least one frequency coefficient;
确定各个所述系数块中首个非零位平面的位置信息;determining the position information of the first non-zero bit plane in each of the coefficient blocks;
对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息;以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息;encoding the position information of the first non-zero bit plane of each of the coefficient blocks, to generate first encoding information; encoding to generate second encoding information;
根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编 码的码流。According to the first encoding information and the second encoding information, an encoded code stream for the to-be-encoded image block is generated.
第二方面,本申请实施例提供了一种图像解码方法,包括:In a second aspect, an embodiment of the present application provides an image decoding method, including:
获取已编码的码流,所述已编码的码流包括第一编码信息以及第二编码信息;obtaining an encoded code stream, where the encoded code stream includes first encoding information and second encoding information;
对所述第一编码信息进行解码,获取各个系数块的首个非零位平面的位置信息;以及,对所述第二编码信息进行解码,获取各个所述系数块中从首个非零位平面开始的各个位平面上的比特位;Decoding the first encoding information to obtain the position information of the first non-zero bit plane of each coefficient block; and decoding the second encoding information to obtain the first non-zero bit plane from the coefficient block in each coefficient block Bits on each bit plane at the beginning of the plane;
根据各个系数块的首个非零位平面的位置信息以及各个所述系数块中从首个非零位平面开始的各个位平面上的比特位,在位平面上获取多个频率系数;According to the position information of the first non-zero bit plane of each coefficient block and the bits on each bit plane starting from the first non-zero bit plane in each of the coefficient blocks, obtain a plurality of frequency coefficients on the bit plane;
通过所述多个频率系数获取解码后的图像块。The decoded image block is obtained by using the plurality of frequency coefficients.
第三方面,本申请实施例提供了一种图像编码装置,包括:In a third aspect, an embodiment of the present application provides an image encoding apparatus, including:
处理器;processor;
用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
其中,所述处理器调用所述可执行指令,当可执行指令被执行时,用于执行:Wherein, the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
获取待编码图像块的多个频率系数;Obtain multiple frequency coefficients of the image block to be encoded;
根据关于所述多个频率系数的位平面,获得一个或多个系数块;所述系数块包括至少一个频率系数的二进制比特位;obtaining one or more blocks of coefficients from the bit planes for the plurality of frequency coefficients; the blocks of coefficients comprising binary bits of at least one frequency coefficient;
确定各个所述系数块中首个非零位平面的位置信息;determining the position information of the first non-zero bit plane in each of the coefficient blocks;
对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息;以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息;encoding the position information of the first non-zero bit plane of each of the coefficient blocks, to generate first encoding information; encoding to generate second encoding information;
根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编码的码流。According to the first encoding information and the second encoding information, an encoded code stream of the image block to be encoded is generated.
第四方面,本申请实施例提供了一种图像解码装置,其特征在于,包括:In a fourth aspect, an embodiment of the present application provides an image decoding apparatus, characterized in that it includes:
处理器;processor;
用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
其中,所述处理器调用所述可执行指令,当可执行指令被执行时,用于执行:Wherein, the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
获取已编码的码流,所述已编码的码流包括第一编码信息以及第二编码信息;obtaining an encoded code stream, where the encoded code stream includes first encoding information and second encoding information;
对所述第一编码信息进行解码,获取各个系数块的首个非零位平面的位置信息;以及,对所述第二编码信息进行解码,获取各个所述系数块中从首个非零位平面开始的各个位平面上的比特位;Decoding the first encoding information to obtain the position information of the first non-zero bit plane of each coefficient block; and decoding the second encoding information to obtain the first non-zero bit plane from the coefficient block in each coefficient block Bits on each bit plane at the beginning of the plane;
根据各个系数块的首个非零位平面的位置信息以及各个所述系数块中从首个非零 位平面开始的各个位平面上的比特位,在位平面上获取多个频率系数;According to the position information of the first non-zero bit plane of each coefficient block and the bits on each bit plane starting from the first non-zero bit plane in each of the coefficient blocks, obtain a plurality of frequency coefficients on the bit plane;
通过所述多个频率系数获取解码后的图像块。The decoded image block is obtained by using the plurality of frequency coefficients.
第五方面,本申请实施例提供了一种图像处理系统,包括图像处理模块、图像编码装置、图像解码装置以及存储器;In a fifth aspect, an embodiment of the present application provides an image processing system, including an image processing module, an image encoding device, an image decoding device, and a memory;
所述图像处理模块用于对图像进行处理,并将处理后的图像传输给所述图像编码装置;The image processing module is used to process the image, and transmit the processed image to the image encoding device;
所述图像编码装置用于将所述处理后的图像划分成多个待编码图像块之后,对所述待编码图像块进行压缩编码处理,生成已编码的码流;The image encoding device is configured to, after dividing the processed image into a plurality of image blocks to be encoded, perform compression encoding processing on the image blocks to be encoded to generate an encoded code stream;
所述存储器用于存储所述已编码的码流;the memory is used for storing the encoded code stream;
所述图像解码装置用于对所述已编码的码流进行解码,并将解码后的结果传输给所述图像处理模块。The image decoding device is configured to decode the encoded code stream, and transmit the decoded result to the image processing module.
第六方面,本申请实施例提供了一种可移动平台,包括上述的图像编码装置;或者,包括上述的图像处理系统。In a sixth aspect, an embodiment of the present application provides a movable platform, including the above-mentioned image encoding apparatus; or, including the above-mentioned image processing system.
第七方面,本申请实施例提供了一种图传系统,包括图像发射器以及图像接收器;其中,所述图像发射器包括上述的图像编码装置,所述图像接收器包括上述的图像解码装置;In a seventh aspect, an embodiment of the present application provides an image transmission system, including an image transmitter and an image receiver; wherein the image transmitter includes the above-mentioned image encoding apparatus, and the image receiver includes the above-mentioned image decoding apparatus ;
所述图像发射器用于将所述图像编码装置编码后产生的已编码的码流发送给所述图像接收器;The image transmitter is configured to send the encoded code stream generated after encoding by the image encoding device to the image receiver;
所述图像接收器用于在接收所述已编码的码流之后,使用所述图像解码装置对所述已编码的码流进行解码。The image receiver is configured to use the image decoding device to decode the encoded code stream after receiving the encoded code stream.
第八方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现第一方面或者第二方面所述的方法。In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, implement the method described in the first aspect or the second aspect.
本申请实施例所提供的一种图像编码方法、解码方法、装置、图像处理系统、可移动平台、图传系统及存储介质,将对于零位平面的编码转换为对首个非零位平面的位置信息的编码,从而无需对各个系数块中的所有零位平面进行编码,实现对待编码图像块的高效压缩,提高压缩率,也提升对所述待编码图像块的压缩效率。An image encoding method, decoding method, device, image processing system, movable platform, image transmission system, and storage medium provided by the embodiments of the present application convert the encoding of the zero-bit plane into the encoding of the first non-zero-bit plane The encoding of position information eliminates the need to encode all zero bit planes in each coefficient block, realizes efficient compression of the image block to be encoded, improves the compression rate, and also improves the compression efficiency of the image block to be encoded.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附 图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.
图1是本申请一个实施例提供的一种图像处理系统的示意图;1 is a schematic diagram of an image processing system provided by an embodiment of the present application;
图2是本申请一个实施例提供的一种图传系统的结构示意图;2 is a schematic structural diagram of an image transmission system provided by an embodiment of the present application;
图3是本申请一个实施例提供的一种图像编码方法的流程示意图;3 is a schematic flowchart of an image encoding method provided by an embodiment of the present application;
图4是本申请一个实施例提供的不同子带示意图;4 is a schematic diagram of different subbands provided by an embodiment of the present application;
图5是本申请一个实施例提供的一种镜面对称填充的示意图;5 is a schematic diagram of a mirror-symmetric filling provided by an embodiment of the present application;
图6是本申请一个实施例提供的前后翻转的示意图;6 is a schematic diagram of a front-to-back inversion provided by an embodiment of the present application;
图7是本申请一个实施例提供的位平面、系数块的示意图;7 is a schematic diagram of a bit plane and a coefficient block provided by an embodiment of the present application;
图8是本申请一个实施例提供的位平面中首个非零位平面的位置的示意图;8 is a schematic diagram of the position of the first non-zero bit plane in the bit plane provided by an embodiment of the present application;
图9是本申请一个实施例提供的系数块中的编码单元的示意图;9 is a schematic diagram of a coding unit in a coefficient block provided by an embodiment of the present application;
图10是本申请一个实施例提供的扫描顺序的示意图;10 is a schematic diagram of a scanning sequence provided by an embodiment of the present application;
图11是本申请一个实施例提供的YUV分量的编码单元混合扫描的示意图;11 is a schematic diagram of a mixed scanning of coding units of YUV components provided by an embodiment of the present application;
图12是本申请一个实施例提供的目标编码单元对应的第二编码模式的示意图;12 is a schematic diagram of a second coding mode corresponding to a target coding unit provided by an embodiment of the present application;
图13是本申请一个实施例提供的一种图像解码方法的流程示意图;13 is a schematic flowchart of an image decoding method provided by an embodiment of the present application;
图14是本申请一个实施例提供的一种图像编码装置的结构示意图。FIG. 14 is a schematic structural diagram of an image encoding apparatus provided by an embodiment of the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
针对于高清图像数据在存储或者传输过程中会造成带宽损耗过大的问题,本申请实施例提供了一种图像编码方法以及图像解码方法,在对高清图像数据进行存储或者传输之前,可以通过本申请的图像编码方法对这些高清图像数据进行编码得到已编码的码流,进而在存储器中缓存已编码的码流或者传输已编码的码流,由于高清图像数据的已编码的码流的数据量相较于高清图像数据的数据量更少,可以有效减少读写带宽或者传输带宽的损耗,也有利于提高针对于高清图像数据的读写效率或者传输效率;进一步地,在需要对这些高清图像数据进行处理时,可以从存储器中读取这些高清图像数据对应的已编码的码流或者接收外部设备传输过来的已编码的码流,然后通过本申请实施例提供的图像解码方法对所述已编码的码流进行解码以得到解码后的图像, 进而可以根据实际需要对解码后的图像进行处理。In view of the problem that high-definition image data may cause excessive bandwidth loss during storage or transmission, the embodiments of the present application provide an image encoding method and an image decoding method. Before storing or transmitting high-definition image data, this The applied image encoding method encodes these high-definition image data to obtain an encoded code stream, and then caches the encoded code stream in the memory or transmits the encoded code stream. Compared with high-definition image data, the amount of data is smaller, which can effectively reduce the loss of read and write bandwidth or transmission bandwidth, and also help to improve the read-write efficiency or transmission efficiency of high-definition image data; When the data is processed, the encoded code stream corresponding to the high-definition image data can be read from the memory or the encoded code stream transmitted by the external device can be received, and then the image decoding method provided by the embodiment of the present application can be used to decode the encoded code stream. The encoded code stream is decoded to obtain a decoded image, and then the decoded image can be processed according to actual needs.
在使用本申请实施例提供的图像编码方法对图像进行编码时,首先可以将图像划分为多个待编码图像块,对于每一个待编码图像块,获取待编码图像块的多个频率系数;根据关于所述多个频率系数的位平面,获得一个或多个系数块;所述系数块包括至少一个频率系数的二进制比特位,然后确定各个所述系数块中首个非零位平面的位置信息,接着对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息;以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息;最后根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编码的码流;最后基于多个待编码图像块的已编码的码流可以获得所述图像的已编码的码流。本实施例中,将对于零位平面的编码转换为对首个非零位平面的位置信息的编码,从而无需对各个系数块中的所有零位平面进行编码,实现对待编码图像块的高效压缩,也提升对所述待编码图像块的压缩效率。When encoding an image by using the image encoding method provided in this embodiment of the present application, the image may be firstly divided into multiple image blocks to be encoded, and for each image block to be encoded, multiple frequency coefficients of the image block to be encoded are obtained; Regarding the bit planes of the plurality of frequency coefficients, obtain one or more coefficient blocks; the coefficient blocks include binary bits of at least one frequency coefficient, and then determine the position information of the first non-zero bit plane in each of the coefficient blocks , and then encode the position information of the first non-zero bit plane of each of the coefficient blocks to generate the first encoding information; encoding the bits to generate second encoding information; finally, according to the first encoding information and the second encoding information, generate an encoded code stream about the to-be-encoded image block; finally, based on a plurality of to-be-encoded image blocks The encoded code stream of the image can be obtained. In this embodiment, the coding of the zero bit plane is converted into the coding of the position information of the first non-zero bit plane, so that it is not necessary to encode all the zero bit planes in each coefficient block, and efficient compression of the image block to be coded is realized. , and the compression efficiency of the to-be-coded image block is also improved.
本申请实施例提供的图像编码方法可以应用于图像编码装置中。在一种实现方式中,所述图像编码装置可以是具有数据处理能力的电子设备,如电脑、服务器、云端服务器或者终端、可移动平台(例如无人飞行器、无人驾驶车辆或者移动机器人等)等。在另一种实现方式中,所述图像编码装置也可以是具有数据处理能力的计算机芯片或者集成电路,例如中央处理单元(Central Processing Unit,CPU)、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)或者现成可编程门阵列(Field-Programmable Gate Array,FPGA)等。其中,作为计算机芯片或者集成电路的图像编码装置可以安装于电子设备上,如安装于可移动平台。The image encoding method provided by the embodiments of the present application can be applied to an image encoding apparatus. In an implementation manner, the image encoding apparatus may be an electronic device with data processing capability, such as a computer, a server, a cloud server or terminal, a movable platform (such as an unmanned aerial vehicle, an unmanned vehicle, or a mobile robot, etc.) Wait. In another implementation manner, the image encoding device may also be a computer chip or integrated circuit with data processing capability, such as a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP) , Application Specific Integrated Circuit (ASIC) or off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA), etc. Wherein, the image coding device as a computer chip or an integrated circuit can be installed on an electronic device, such as a movable platform.
本申请实施例提供的图像解码方法可以应用于图像解码装置中。在一种实现方式中,所述图像解码装置可以是具有数据处理能力的电子设备,如电脑、服务器、云端服务器或者终端、可移动平台(例如无人飞行器、无人驾驶车辆或者移动机器人等)等。在另一种实现方式中,所述图像解码装置也可以是具有数据处理能力的计算机芯片或者集成电路,例如中央处理单元(Central Processing Unit,CPU)、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)或者现成可编程门阵列(Field-Programmable Gate Array,FPGA)等。其中,作为计算机芯片或者集成电路的图像解码装置可以安装于电子设备上,如安装于可移动平台。The image decoding method provided by the embodiments of the present application can be applied to an image decoding apparatus. In an implementation manner, the image decoding apparatus may be an electronic device with data processing capability, such as a computer, a server, a cloud server or a terminal, a movable platform (such as an unmanned aerial vehicle, an unmanned vehicle, or a mobile robot, etc.) Wait. In another implementation manner, the image decoding apparatus may also be a computer chip or integrated circuit with data processing capability, such as a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP) , Application Specific Integrated Circuit (ASIC) or off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA), etc. Wherein, the image decoding device as a computer chip or an integrated circuit can be installed on an electronic device, such as a movable platform.
可以理解的是,作为电子设备时,所述图像解码装置以及所述图像编码装置可以 是同一电子设备,也可以是不同的电子设备;作为计算机芯片或者集成电路时,所述图像解码装置和所述图像编码装置可以设置于同一设备中,也可以设置于不同设备中,可依据实际应用场景进行具体设置。It can be understood that when used as electronic equipment, the image decoding apparatus and the image coding apparatus may be the same electronic equipment or different electronic equipment; when used as computer chips or integrated circuits, the image decoding apparatus and all The image encoding apparatus may be set in the same device, or may be set in different devices, and specific settings may be made according to actual application scenarios.
在一示例性的实施例中,当所述图像解码装置和所述图像编码装置为计算机芯片或者集成电路时,以所述图像解码装置和所述图像编码装置设置于同一设备为例进行说明:所述图像解码装置和所述图像编码装置可以应用于如图1所示的图像处理系统中,所述图像处理系统可以安装于可移动平台(如无人飞行器)、终端设备或者服务器等具备图像处理功能的电子设备上。In an exemplary embodiment, when the image decoding device and the image encoding device are computer chips or integrated circuits, the image decoding device and the image encoding device are set in the same device as an example for description: The image decoding device and the image encoding device can be applied to the image processing system as shown in FIG. 1 , and the image processing system can be installed on a movable platform (such as an unmanned aerial vehicle), a terminal device or a server equipped with images. processing functions on electronic devices.
所述图像处理系统包括图像处理模块11、所述图像解码装置13、所述图像编码装置12和存储器14,所述图像处理模块11在将图像写入存储器14之前,通过所述图像编码装置12对所述图像进行编码压缩,获取所述图像的已编码的码流并存储在所述存储器14中,从而可以降低写入所述存储器14需要耗费的带宽;当所述图像处理模块11需要对图像进行处理时,从所述存储器14中读取所述图像的已编码的码流,也可以有效降低读取带宽,进一步通过所述图像解码装置13对所述图像的已编码的码流进行解码处理得到所述图像,进而所述图像处理模块11可以对所述图像进行处理,本实施例中,存储在所述存储器14中的是所述图像的已编码的码流而非所述图像,由于所述图像的已编码的码流的数据量相较于所述图像的数据量更少,因此能够降低读写带宽的损耗,同时也有利于提高读写效率。The image processing system includes an image processing module 11 , the image decoding device 13 , the image encoding device 12 and a memory 14 , and the image processing module 11 passes the image encoding device 12 before writing the image into the memory 14 . The image is encoded and compressed, and the encoded code stream of the image is obtained and stored in the memory 14, so that the bandwidth required for writing to the memory 14 can be reduced; when the image processing module 11 needs to When the image is processed, the coded code stream of the image is read from the memory 14, which can also effectively reduce the reading bandwidth, and the coded code stream of the image is further processed by the image decoding device 13. The image is obtained by decoding processing, and then the image processing module 11 can process the image. In this embodiment, the encoded code stream of the image is stored in the memory 14 instead of the image. , since the data amount of the encoded code stream of the image is smaller than that of the image, the loss of the read and write bandwidth can be reduced, and the read and write efficiency can be improved at the same time.
其中,所述图像处理模块11包括但不限于图形处理器(GPU)或者图像信号处理器(ISP)等,所述存储器14包括但不限于DDR存储器、静态随机访问存储器(SRAM)、磁性存储器、磁盘或者光盘等。Wherein, the image processing module 11 includes but is not limited to a graphics processing unit (GPU) or an image signal processor (ISP), etc., and the memory 14 includes but is not limited to DDR memory, static random access memory (SRAM), magnetic memory, Disk or CD etc.
在另一示例性的实施例中,当所述图像解码装置和所述图像编码装置为计算机芯片或者集成电路时,以所述图像解码装置和所述图像编码装置设置于不同设备为例进行说明:所述图像解码装置13和所述图像编码装置12可以应用于如图2所示的图传系统中,所述图传系统包括图像发射器21以及图像接收器31;其中,所述图像发射器21安装有所述的图像编码装置12,所述图像接收器31安装有所述的图像解码装置13;所述图像发射器21可以安装在可移动平台20(比如无人飞行器)上,所述图像接收器31可以安装在终端设备30(如遥控器)上。所述图像发射器21在发送图像之前,可以使用所述图像编码装置12对所述图像进行压缩编码,生成所述图像的已编码的码流并发送给所述图像接收器31,所述图像接收器31在接收所述图像的已编码的码流之后,可以使用所述图像编码装置12对所述已编码的码流进行解码处理从而得到所述图像,进而所述终端 设备可以对所述图像进行进一步的处理或者在自身的显示器上显示所述图像。本实施例中,进行传输的所述图像的已编码的码流,由于所述图像的已编码的码流的数据量相较于所述图像的数据量更少,因此能够降低传输带宽的损耗,同时也有利于提高传输效率。In another exemplary embodiment, when the image decoding device and the image encoding device are computer chips or integrated circuits, the image decoding device and the image encoding device are set in different devices as an example for description : The image decoding device 13 and the image encoding device 12 can be applied to the image transmission system as shown in FIG. 2 , and the image transmission system includes an image transmitter 21 and an image receiver 31 ; wherein, the image transmission system The image encoder 21 is installed with the image encoding device 12, the image receiver 31 is installed with the image decoding device 13; the image transmitter 21 can be installed on a movable platform 20 (such as an unmanned aerial vehicle), so The image receiver 31 can be installed on the terminal device 30 (eg, a remote controller). Before sending the image, the image transmitter 21 can use the image encoding device 12 to compress and encode the image, generate an encoded code stream of the image, and send it to the image receiver 31. After receiving the encoded code stream of the image, the receiver 31 can use the image encoding device 12 to decode the encoded code stream to obtain the image, and then the terminal device can decode the image. The image is further processed or displayed on its own display. In this embodiment, for the encoded code stream of the image to be transmitted, since the data amount of the encoded code stream of the image is smaller than that of the image, the loss of transmission bandwidth can be reduced. , but also help to improve the transmission efficiency.
接下来对本申请实施例提供的图像编码方法进行说明:请参阅图3,图3为本申请实施例提供的一种图像编码方法的流程示意图,所述图像编码方法应用于图像编码装置上,所述方法包括:Next, the image encoding method provided by the embodiment of the present application will be described: please refer to FIG. 3 , which is a schematic flowchart of an image encoding method provided by the embodiment of the present application. The image encoding method is applied to an image encoding device. The methods described include:
在步骤S101中,获取待编码图像块的多个频率系数。In step S101, a plurality of frequency coefficients of the image block to be encoded are acquired.
在步骤S102中,根据关于所述多个频率系数的位平面,获得一个或多个系数块;所述系数块包括至少一个频率系数的二进制比特位。In step S102, one or more coefficient blocks are obtained according to the bit planes about the plurality of frequency coefficients; the coefficient blocks include binary bits of at least one frequency coefficient.
在步骤S103中,确定各个所述系数块中首个非零位平面的位置信息。In step S103, the position information of the first non-zero bit plane in each of the coefficient blocks is determined.
在步骤S104中,对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息;以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息。In step S104, the position information of the first non-zero bit plane of each of the coefficient blocks is encoded to generate first encoding information; and, for each of the coefficient blocks starting from the first non-zero bit plane The bits on the plane are encoded to generate second encoded information.
在步骤S105中,根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编码的码流。In step S105, an encoded code stream for the to-be-encoded image block is generated according to the first encoding information and the second encoding information.
其中,所述待编码图像块可以是待编码的图像的其中部分或者全部;例如,以所述待编码图像块为待编码的图像的一部分为例,所述图像编码装置在获取所述待编码的图像之后,为了可以减少行缓存(linebuffer)的开销,可以将所述待编码的图像划分为多个待编码图像块,然后分别对各个待编码图像块进行编码。另外,在对多个待编码图像块分别进行编码得到所述待编码图像块的已编码的码流之后,在实际使用过程中,可以根据实际情况获取其中一个图像块的已编码的码流进行解码,而不需要解码整个图像的所有图像块对应的所有已编码的码流,从而可以保持随机访问的颗粒度。The to-be-coded image block may be part or all of the to-be-coded image; for example, taking the to-be-coded image block as a part of the to-be-coded image as an example, the image coding apparatus obtains the to-be-coded image After the image is generated, in order to reduce the overhead of a line buffer, the image to be encoded may be divided into a plurality of image blocks to be encoded, and then each image block to be encoded is encoded separately. In addition, after encoding a plurality of image blocks to be encoded to obtain an encoded code stream of the image block to be encoded, in the actual use process, the encoded code stream of one of the image blocks may be obtained according to the actual situation to perform encoding. It is not necessary to decode all encoded code streams corresponding to all image blocks of the entire image, so that the granularity of random access can be maintained.
可以理解的是,本申请对于所述待编码图像块的大小以及数量不做任何限制,可依据实际应用场景进行具体设置。在一个例子中,可以将一张图像划分成为64x4、64x2或者32x1等尺寸的图像块,但不限于此。It can be understood that the present application does not impose any restrictions on the size and quantity of the image blocks to be encoded, and specific settings may be made according to actual application scenarios. In an example, an image may be divided into image blocks with sizes such as 64x4, 64x2, or 32x1, but not limited thereto.
在对所述待编码图像块进行编码时,所述图像编码装置首先将所述待编码图像块从时域变换至频域,从而获取所述待编码图像块的多个频率系数。When encoding the image block to be encoded, the image encoding apparatus first transforms the image block to be encoded from the time domain to the frequency domain, so as to obtain a plurality of frequency coefficients of the image block to be encoded.
在一些实施例中,可以将所述待编码图像进行小波变换,以产生所述多个频率系数。可以理解的是,本实施例对于所述小波变换算法不做任何限制,可依据实际应用场景进行具体选择,比如所述小波变换算法可以是5/3小波变换或者Haar小波变换等,但不限于此。In some embodiments, the image to be encoded may be wavelet transformed to generate the plurality of frequency coefficients. It can be understood that this embodiment does not impose any restrictions on the wavelet transform algorithm, and can be specifically selected according to actual application scenarios. For example, the wavelet transform algorithm may be 5/3 wavelet transform or Haar wavelet transform, etc., but not limited to. this.
此处简要地介绍小波变换。在对所述待编码图像块的小波变换中,如图4中所示,将所述待编码图像块分割到具有高频谱频率的高频区域和具有低频谱频率的低频区域。通过将具有低频谱频率的带的数据分割到较小区域,执行高效的压缩编码。“L”和“H”分别表示低频区域和高频区域。“L”和“H”之前的数字表示每个区域的分割等级。例如图4所示的待编码图像块的分割等级为4,即经过了4次的分割及变换处理。Wavelet transform is briefly introduced here. In the wavelet transform of the image block to be encoded, as shown in FIG. 4 , the image block to be encoded is divided into a high frequency region with high spectral frequency and a low frequency region with low spectral frequency. Efficient compression coding is performed by dividing the data of bands with low spectral frequencies into smaller regions. "L" and "H" represent the low frequency region and the high frequency region, respectively. The numbers before "L" and "H" indicate the division level of each area. For example, the division level of the to-be-coded image block shown in FIG. 4 is 4, that is, it has undergone division and transformation processing four times.
如图4所示,对于尺寸为64x2的待编码图像块,在第一次变换和分割过程中,对所述待编码图像块在竖直方向上执行变换和分割处理,将所述待编码图像块分割变换成2个区域(即2个子频带(简称子带)),大小为32x2,分别为“1L”子带(具有最多低频组分)和“1H”子带(具有最多高频组分),接着在水平方向上执行分割处理,将所述待编码图像分割成4个区域,大小为32x1,分别为“1LL、1LH、1HL和1HH”,其中,所述“1HH”子带具有最多的高频组分,所述“1LL”子带具有最多的低频组分。As shown in FIG. 4 , for an image block to be encoded with a size of 64×2, in the first transformation and segmentation process, transformation and segmentation processing is performed on the image block to be encoded in the vertical direction, and the image to be encoded The block partition is transformed into 2 regions (that is, 2 sub-bands (sub-bands for short)) with a size of 32x2, which are the "1L" sub-band (with the most low-frequency components) and the "1H" sub-band (with the most high-frequency components) ), and then perform division processing in the horizontal direction to divide the to-be-encoded image into 4 regions with a size of 32×1, which are “1LL, 1LH, 1HL and 1HH” respectively, wherein the “1HH” subband has the most of high frequency components, the "1LL" subband has the most low frequency components.
因为所述待编码图像块的图像信息主要集中在低频组分上,因此继续在低频组分在进行变换和分割,执行高效的压缩编码。如图4所示,在第二次变换和分割过程中,对“1LL”子带在竖直方向上继续进行变换和分割,获得“2L”子带和“2H”子带,大小为16x1,其中,在第二次变换和分割之后,“2L”子带具有最多的低频组分。在第三次变换和分割过程中,对“2L”子带在竖直方向上继续进行变换和分割,获得“3L”子带和“3H”子带,大小为8x1,其中,在第三次变换和分割之后,“3L”子带具有最多的低频组分。在第四次变换和分割过程中,对“3L”子带在竖直方向上继续进行变换和分割,获得“4L”子带和“4H”子带,大小为4x1,其中,在第四次变换和分割之后,“4L”子带具有最多的低频组分。在经过4次变换和分割之后,一共产生7个子带。Because the image information of the to-be-coded image block is mainly concentrated on the low-frequency components, the low-frequency components are continuously transformed and segmented, and efficient compression coding is performed. As shown in Figure 4, in the second transformation and segmentation process, the "1LL" subband is continuously transformed and segmented in the vertical direction to obtain the "2L" subband and the "2H" subband, with a size of 16x1, Among them, the "2L" subband has the most low frequency components after the second transformation and division. In the third transformation and division process, the "2L" sub-band is continuously transformed and divided in the vertical direction, and the "3L" sub-band and the "3H" sub-band are obtained, and the size is 8x1. After transformation and segmentation, the "3L" subband has the most low frequency components. In the fourth transformation and division process, the "3L" sub-band is continuously transformed and divided in the vertical direction, and the "4L" sub-band and the "4H" sub-band are obtained, and the size is 4x1. After transformation and segmentation, the "4L" subband has the most low frequency components. After 4 transformations and divisions, a total of 7 subbands are generated.
可以理解的是,在其他实施方式中,本申请对于分割等级和分割方向不做任何限制,在每一次的变换和分割过程中,可以选择在竖直方向和/或水平方向上进行变换和分割,可依据实际应用场景进行具体设置。It can be understood that, in other implementation manners, the present application does not impose any restrictions on the division level and division direction, and in each transformation and division process, the transformation and division can be selected in the vertical direction and/or the horizontal direction. , which can be set according to the actual application scenario.
可以使用包含高频滤波器和低频滤波器的滤波器组对所述待处理图像块进行小波变换,例如,将所述待编码图像块临时存储在缓冲区上,包含高频滤波器和低频滤波器的滤波器组从缓冲区读取待编码图像块,对读取的待编码图像块执行滤波处理,以便产生低频区域和高频区域的频率系数,然后将所述频率系数存储在缓冲区上。包含高频滤波器和低频滤波器的滤波器组从缓冲区读取所述频率系数,并且使用分析滤波器对读取的所述频率系数进行滤波处理,从而产生高频区域和低频区域的进一步的频 率系数,然后将产生的进一步的频率系数再次存储在缓冲区上。重复上述处理过程,当分割等级达到预定等级时,获取所述缓冲区上的多个频率系数以进行后续的处理过程。The image block to be processed may be wavelet transformed using a filter bank including high frequency filters and low frequency filters, for example, the image block to be encoded is temporarily stored in a buffer, including high frequency filters and low frequency filters. The filter bank of the filter reads the image block to be encoded from the buffer, performs filtering processing on the read image block to be encoded, so as to generate frequency coefficients in the low-frequency region and high-frequency region, and then stores the frequency coefficients in the buffer. . A filter bank including a high-frequency filter and a low-frequency filter reads the frequency coefficients from the buffer, and uses an analysis filter to filter the read frequency coefficients, thereby generating further The resulting frequency coefficients are then stored on the buffer again. The above process is repeated, and when the division level reaches a predetermined level, a plurality of frequency coefficients on the buffer are acquired for subsequent processing.
在一种实现方式中,可以使用5/3小波变换算法或者Haar小波变换算法对所述待编码图像块进行变换处理,在对所述待编码图像块的各个像素进行变换过程中,由于各个像素需要依赖于左右两边的邻域像素,而处于边界的像素会缺少一部分的邻域像素,使得边界的像素在进行小波变换时,无法满足滤波器的宽度需求,因此,为了处理边界像素,需要在边界填充像素,在一种实现方式中,如图5所示,每一个格子表示一个像素,假设有n个像素,n为不小于0的自然数,从0开始计数,第一个像素的编号为0,最后一个像素的编号为n-1,在处理边界像素A以及边界像素U的时候,可以采用镜面对称的填充方式,从而实现对边界像素A以及边界像素U的准确处理,图5所示的灰色部分为填充后的像素。In an implementation manner, the 5/3 wavelet transform algorithm or the Haar wavelet transform algorithm may be used to transform the image block to be encoded. During the transformation process of each pixel of the image block to be encoded, each pixel It needs to rely on the neighboring pixels on the left and right sides, and the pixels at the border will lack a part of the neighboring pixels, so that the pixels on the border cannot meet the width requirements of the filter when the wavelet transform is performed. Therefore, in order to process the border pixels, it is necessary to The border is filled with pixels. In one implementation, as shown in Figure 5, each grid represents a pixel. Assuming that there are n pixels, n is a natural number not less than 0, counting from 0, and the number of the first pixel is 0, the number of the last pixel is n-1. When processing the boundary pixel A and the boundary pixel U, a mirror-symmetric filling method can be used to achieve accurate processing of the boundary pixel A and the boundary pixel U, as shown in Figure 5 The gray part of is the filled pixel.
在一实施例中,考虑到小波变换过程中,会丢掉一部分系数,如图4所示,通常低频系数位于左侧,高频系数位于右侧,一般丢弃的都是右侧的高频系数,从而导致逆变换后得到的像素会存在误差。进一步地,考虑到在某些压缩编码过程中,为了减少块效应,会使用自适应滤波器进行去方块滤波处理,而去方块滤波处理的过程会使用前一个图像块的后侧像素来对当前图像块进行滤波,而前一个图像块的后侧像素又因为在小波变换过程中丢掉过部分系数,存在误差,去方块滤波处理的过程使得这个误差被使用并放大,导致图像处理效果不佳。因此,本实施例在进行小波变换之前,对所述待编码图像块进行前后翻转,如图6所示,按照从左到右的顺序,待编码图像块中包括有像素A、B、C、D和E,将其进行前后翻转后,获得像素E、D、C、B和A;然后使用前后翻转后的待编码图像进行小波变换,进而在后续的去方块滤波处理的过程中,由于进行了前后翻转,使得丢掉的部分系数的像素在前侧而不是在后侧,在进行去方块滤波处理是,获取到的后侧的像素不再是丢掉过系数的像素,使得误差损失小的像素能够被去方块参考,有利于提高图像处理质量。In one embodiment, considering that a part of the coefficients will be lost during the wavelet transform process, as shown in FIG. 4 , the low-frequency coefficients are usually located on the left side, and the high-frequency coefficients are located on the right side, and the high-frequency coefficients on the right side are generally discarded. As a result, there will be errors in the pixels obtained after inverse transformation. Further, considering that in some compression coding processes, in order to reduce the blocking effect, an adaptive filter will be used to perform deblocking filtering, and the deblocking filtering process will use the rear pixels of the previous image block to correct the current image block. The image block is filtered, and the rear pixels of the previous image block have errors because some coefficients are lost in the wavelet transform process. The process of de-blocking filtering makes this error used and amplified, resulting in poor image processing. Therefore, in this embodiment, before the wavelet transform is performed, the to-be-coded image block is flipped back and forth. As shown in FIG. 6 , in the order from left to right, the to-be-coded image block includes pixels A, B, C, After D and E are flipped back and forth, pixels E, D, C, B and A are obtained; then the wavelet transform is performed on the image to be encoded after flipping back and forth, and then in the subsequent deblocking filtering process, due to the The front and back are reversed, so that the pixels of the lost part of the coefficients are on the front side instead of the back side. During the de-blocking filtering process, the acquired pixels on the back side are no longer the pixels whose coefficients have been lost, making the pixels with small error loss. It can be referenced by de-blocking, which is beneficial to improve the quality of image processing.
为了实现对前后翻转后的待编码图像进行小波变换,请参阅图5,设所述待编码图像块有n个像素,n为不小于0的自然数,从0开始计数,第一个像素的编号为0,最后一个像素的编号为n-1,所述图像编码装置在对待编码图像块进行小波变换时,不是从第0个图像开始进行小波变换,而是从第n-1个像素开始进行小波变换,从而实现对前后翻转后的待编码图像进行小波变换。In order to implement wavelet transform on the image to be encoded after the front and rear flips, please refer to FIG. 5 , suppose that the image block to be encoded has n pixels, n is a natural number not less than 0, counting from 0, the number of the first pixel is 0, the number of the last pixel is n-1, when the image coding apparatus performs wavelet transform on the image block to be coded, it does not start from the 0th image, but starts from the n-1th pixel. Wavelet transform is used to implement wavelet transform on the image to be encoded after being flipped back and forth.
在对所述待编码图像块从时域变换至频率以产生所述多个频率系数之后,所述图 像编码装置根据所述多个频率系数进行压缩编码,在步骤S102中,所述图像编码装置首先确定关于所述多个频率系数的位平面,例如可以将所述多个频率系数展开到位平面上,例如请参阅图7,图7为将10个以十六进制表示的频率系数展开到位平面的结果,将多个频率系数展开到位平面后,纵坐标表示位深(其中,MSB表示最高有效位,LSB表示最低有效位),每一列表示其中一个频率系数的二进制比特位。接着,所述图像编码装置可以根据关于所述多个频率系数的位平面,获得一个或多个系数块,所述系数块包括至少一个频率系数的二进制比特位;即是说,按照每n(n为大于0的整数)个频率系数的二进制比特位划分所述位平面,从而在所述位平面上获取一个或多个系数块,例如请参阅图7,可以将每8个频率系数的二进制比特位作为一个系数块。After transforming the image block to be encoded from the time domain to the frequency to generate the plurality of frequency coefficients, the image encoding device performs compression encoding according to the plurality of frequency coefficients. In step S102, the image encoding device First determine the bit plane of the plurality of frequency coefficients, for example, the plurality of frequency coefficients can be expanded on the bit plane, for example, please refer to Fig. 7, Fig. 7 is to expand the 10 frequency coefficients expressed in hexadecimal into place The result of the plane, after expanding multiple frequency coefficients to the bit plane, the ordinate represents the bit depth (where MSB represents the most significant bit, LSB represents the least significant bit), and each column represents the binary bits of one of the frequency coefficients. Next, the image encoding apparatus may obtain one or more coefficient blocks including binary bits of at least one frequency coefficient according to the bit planes with respect to the plurality of frequency coefficients; that is, according to every n( n is an integer greater than 0) the binary bits of the frequency coefficients divide the bit plane, so as to obtain one or more coefficient blocks on the bit plane, for example, please refer to FIG. 7, the binary bits of every 8 frequency coefficients can be divided into bits as a block of coefficients.
然后,在步骤S103中,所述图像编码装置确定每个所述系数块中首个非零位平面的位置信息,其中,零位平面指的是全部为0的位平面,则非零位平面指的是不全为0(即有部分比特位为1)的位平面;所述图像编码装置可以沿位深逐渐增加的方向,请参阅图7,即从位深0到位深12的方向(或者说从最高有效位的位平面到最低有效位的位平面的方向),确定每个所述系数块中首个非零位平面的位置信息,例如在图8中,图8为将尺寸61x1的待编码图像块经过4次小波变换后得到,其被划分为尺寸为4x1的4L和4H区域,尺寸为8x1的3H区域,尺寸为16x1的2H区域和尺寸为31x1的1H区域,假设在图8所示的位平面上,每个系数块包括8个系数,4L和4H的区域为4x1,因此4L和4H区域作为1个系数块,3H区域为1个系数块,2H区域包括2个系数块,1H区域包括4个系数块,其中,纵坐标表示位深,横坐标表示在各个系数块中首个非零位平面的位置信息,可以看到,包含4L和4H区域的系数块中,其首个非零位平面的位置为位深4。Then, in step S103, the image coding apparatus determines the position information of the first non-zero bit plane in each of the coefficient blocks, wherein the zero bit plane refers to the bit planes that are all 0, then the non-zero bit plane Refers to the bit plane that is not all 0 (that is, some bits are 1); the image encoding device can be along the direction of gradually increasing bit depth, please refer to FIG. 7, that is, the direction from bit depth 0 to bit depth 12 (or Say the direction from the bit plane of the most significant bit to the bit plane of the least significant bit), determine the position information of the first non-zero bit plane in each of the coefficient blocks, for example, in Figure 8, Figure 8 shows the size of 61x1 The image block to be encoded is obtained after 4 wavelet transforms, and it is divided into 4L and 4H regions of size 4x1, 3H region of size 8x1, 2H region of size 16x1 and 1H region of size 31x1, assuming that in Figure 8 On the bit plane shown, each coefficient block includes 8 coefficients, and the area of 4L and 4H is 4x1, so the 4L and 4H areas are used as 1 coefficient block, the 3H area is 1 coefficient block, and the 2H area includes 2 coefficient blocks. , the 1H region includes 4 coefficient blocks, where the ordinate represents the bit depth, and the abscissa represents the position information of the first non-zero bit plane in each coefficient block. It can be seen that in the coefficient blocks including the 4L and 4H regions, the The location of the first non-zero bit plane is bit depth 4.
在确定每个所述系数块中首个非零位平面的位置信息之后,所述图像编码装置可以不对各个系数块中的零位平面进行编码,而是用所述首个非零位平面的位置信息来代替所述零位平面,对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息;以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息;最后根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编码的码流。本实施例中,将对于零位平面的编码转换为对首个非零位平面的位置信息的编码,从而无需对各个系数块中的所有零位平面进行编码,相较而言,各个系数块的首个非零位平面的位置信息的数据量通常少于各个系数块所有的零位平面的数据量,则对各个系数块的首个非零位平面的位置信息编码后产生的第一编码信息的数据量更少,从而实现对待编码图像块的高效压缩, 也提升对所述待编码图像块的压缩效率。After determining the position information of the first non-zero bit plane in each of the coefficient blocks, the image encoding apparatus may not encode the zero bit plane in each coefficient block, but use the position information of the first non-zero bit plane The position information is used to replace the zero bit plane, and the position information of the first non-zero bit plane of each of the coefficient blocks is encoded to generate the first encoding information; The bits on each bit plane starting from the plane are encoded to generate second encoding information; finally, an encoded code stream about the to-be-encoded image block is generated according to the first encoding information and the second encoding information. In this embodiment, the encoding of the zero bit plane is converted into the encoding of the position information of the first non-zero bit plane, so that it is not necessary to encode all the zero bit planes in each coefficient block. The data amount of the position information of the first non-zero bit plane of each coefficient block is usually less than the data amount of all the zero bit planes of each coefficient block, then the first code generated after encoding the position information of the first non-zero bit plane of each coefficient block The data amount of the information is less, thereby realizing efficient compression of the image block to be encoded, and also improving the compression efficiency of the image block to be encoded.
在一些实施例中,所述频率系数包括有符号和绝对值两个部分。在一种实现方式中,所述位平面只包括有关于所述频率系数的绝对值的位平面,例如,在获取所述多个频率系数之后,所述图像编码装置将所述多个频率系数分解为关于所述多个频率系数的符号和关于所述多个频率系数的绝对值,然后根据所述多个频率系数的绝对值,确定关于所述多个频率系数的位平面。而对于所述关于多个频率系数的符号,所述图像编码装置以所述系数块为单位,对所述多个频率系数的符号进行编码,生成第三编码信息。在一个例子中,一个系数块包括有8个频率系数的绝对值的二进制比特位,则可以以系数块为单块,将该系数块所包括的8个频率系数的符号作为一个整体进行编码,生成所述第三编码信息,进而可以根据所述第一编码信息、所述第二编码信息以及所述第三编码信息生成所述待编码图像块的已编码的码流。In some embodiments, the frequency coefficients include both signed and absolute value components. In an implementation manner, the bit plane only includes a bit plane related to the absolute value of the frequency coefficients, for example, after acquiring the plurality of frequency coefficients, the image coding apparatus converts the plurality of frequency coefficients It is decomposed into a sign with respect to the plurality of frequency coefficients and an absolute value with respect to the plurality of frequency coefficients, and then a bit plane with respect to the plurality of frequency coefficients is determined according to the absolute values of the plurality of frequency coefficients. On the other hand, regarding the signs of the plurality of frequency coefficients, the image encoding apparatus encodes the signs of the plurality of frequency coefficients in units of the coefficient blocks, and generates third encoding information. In an example, a coefficient block includes binary bits of absolute values of 8 frequency coefficients, then the coefficient block can be used as a single block, and the symbols of the 8 frequency coefficients included in the coefficient block can be encoded as a whole, The third encoding information is generated, and then an encoded code stream of the image block to be encoded may be generated according to the first encoding information, the second encoding information and the third encoding information.
进一步地,对于频率系数为0的这部分,考虑到符号的正负情况并不影响其表示的含义,因此为了提高压缩效果,可以不对频率系数为0的这部分的符号进行编码,而是只对各个系数块中不为0的频率系数的符号进行编码,生成所述第三编码信息,实现对所述频率系数的符号的高效压缩。Further, for the part with the frequency coefficient of 0, considering that the positive and negative conditions of the symbol do not affect the meaning of its representation, in order to improve the compression effect, the symbol of the part with the frequency coefficient of 0 may not be encoded, but only The signs of the frequency coefficients that are not 0 in each coefficient block are encoded to generate the third encoding information, so as to realize efficient compression of the signs of the frequency coefficients.
在编码所述频率系数的符号时,可以将符号为负号的编码为1,将符号为正号的编码为0;或者,可以将符号为负号的编码为0,将符号为正号的编码为1;但不限于上述编码方式。When encoding the sign of the frequency coefficient, the negative sign may be encoded as 1, and the positive sign may be encoded as 0; or, the negative sign may be encoded as 0, and the positive sign may be encoded as 0. The encoding is 1; but not limited to the above encoding.
在一些实施例中,在编码所述各个所述系数块的首个非零位平面的位置信息时,所述图像编码装置从至少两种第一编码模式中选择目标编码模式,并使用所述目标编码模式对各个所述系数块的首个非零位平面的位置信息进行编码。其中,在选择所述目标编码模式时,所述图像编码装置可以基于所述至少两种第一编码模式中的每种第一编码模式分别对各个所述系数块的首个非零位平面的位置信息进行编码,获得至少两个编码结果,然后将所述至少两个编码结果中最优的编码结果对应的第一编码模式确定为所述目标编码模式;所述最优的编码结果可以是所述至少两个编码结果的编码长度最小者,则所述目标编码模式为所述至少两种第一编码模式中最优的一个,使得所述图像编码装置在使用所述目标编码模式对各个所述系数块的首个非零位平面的位置信息进行编码时,生成的第一编码信息的具有较优的压缩效果。In some embodiments, when encoding the position information of the first non-zero bit plane of each of the coefficient blocks, the image encoding device selects a target encoding mode from at least two first encoding modes, and uses the The target encoding mode encodes the position information of the first non-zero bit plane of each of the coefficient blocks. Wherein, when selecting the target encoding mode, the image encoding apparatus may, based on each first encoding mode in the at least two first encoding modes, respectively adjust the first non-zero bit plane of each of the coefficient blocks. The location information is encoded to obtain at least two encoding results, and then the first encoding mode corresponding to the optimal encoding result among the at least two encoding results is determined as the target encoding mode; the optimal encoding result may be If the encoding length of the at least two encoding results is the smallest, the target encoding mode is the optimal one of the at least two first encoding modes, so that the image encoding device uses the target encoding mode to When the position information of the first non-zero bit plane of the coefficient block is encoded, the generated first encoded information has a better compression effect.
在确定所述目标编码模式之后,为了保证图像解码装置能够准确解码所述第一编码信息,还需对所述目标编码模式进行编码,即所述待编码图像块的已编码的码流中包括有所述目标编码模式的编码信息,从而使得所述图像解码装置能够根据所述目标 编码模式对所述第一编码信息进行正确的解码。After the target encoding mode is determined, in order to ensure that the image decoding apparatus can accurately decode the first encoding information, the target encoding mode needs to be encoded, that is, the encoded code stream of the to-be-encoded image block includes There is encoding information of the target encoding mode, so that the image decoding apparatus can correctly decode the first encoding information according to the target encoding mode.
所述至少两种第一编码模式包括至少一种使用码表编码的模式和/或至少一种预测编码模式。可以理解的是,本实施例对于所述预测编码模式的具体实现方式不做任何限制,可依据实际应用场景进行具体选择,例如所述预测编码模式可以是DCMP(差分预测编码调制)。The at least two first encoding modes include at least one encoding mode using a code table and/or at least one predictive encoding mode. It can be understood that this embodiment does not impose any limitations on the specific implementation of the predictive coding mode, which may be specifically selected according to actual application scenarios. For example, the predictive coding mode may be DCMP (Differential Predictive Coding Modulation).
其中,所述至少两种第一编码模式可以是可变长编码(VLC,Variable Length Coding)模式;在所述使用码表编码的模式中,所述码表可以是VLC码表;在所述预测编码模式中,可以将获取的残差数据进行VLC编码。我们知道,编码的目的是为了减少待编码图像块的数据量,在变长编码过程中,为了达到最优的编码效果,其编码的思想通常是将概率大的信息符号编以短的码字,而概率小的信息符号编以长的码字,使得平均码字长度最短,即最终得到的第一编码信息的编码长度最短。Wherein, the at least two first encoding modes may be variable length coding (VLC, Variable Length Coding) modes; in the mode of encoding using a code table, the code table may be a VLC code table; in the In the predictive coding mode, the obtained residual data can be subjected to VLC coding. We know that the purpose of encoding is to reduce the amount of data of the image block to be encoded. In the process of variable-length encoding, in order to achieve the optimal encoding effect, the idea of encoding is usually to encode information symbols with high probability into short code words , while the information symbols with small probability are encoded with long code words, so that the average code word length is the shortest, that is, the encoded length of the finally obtained first encoded information is the shortest.
考虑到在不同的采集场景下获得的图像或者图像块所包含的图像信息(所述图像信息包括但不限于图像梯度信息、信噪比、局部方差或者均方误差等)并不相同,即是说,在不同采集场景下,图像或者图像块中各种图像信息的出现概率并不相同,如果采用统一的码表对其进行编码,可能得不到较好的压缩编码效果,压缩率不高。因此,为了获得更优的压缩编码结果,可以预先估计待编码的图像或者图像块可能的采集场景,然后根据该采集场景确定适应于该场景的码表;比如可以获取该采集场景下的一些参考图像或者参考图像块,统计出这些参考图像或者参考图像块的图像信息的分布特征,然后可以根据这些参考图像或者参考图像块的图像信息的分布特征确定适应于该采集场景的码表;或者,可以根据这些参考图像或者参考图像块在频域上获得频率分布特征,例如所述频率分布特征可以是根据这些参考图像或者参考图像块得到的各个系数块中首个非零位平面的位置信息的分布特征,进而基于这些参考图像或者参考图像块得到的各个系数块中首个非零位平面的位置信息的分布特征确定适应于该采集场景的码表。Considering that the image information (the image information includes but not limited to image gradient information, signal-to-noise ratio, local variance or mean square error, etc.) contained in images or image blocks obtained under different acquisition scenarios is not the same, that is It is said that in different acquisition scenarios, the occurrence probability of various image information in the image or image block is not the same. If a unified code table is used to encode it, it may not get a better compression encoding effect, and the compression rate is not high. . Therefore, in order to obtain better compression coding results, it is possible to pre-estimate the possible acquisition scenarios of the image or image block to be coded, and then determine a code table suitable for the scenario according to the acquisition scenario; for example, some reference data in the capture scenario can be obtained Images or reference image blocks, the distribution characteristics of the image information of these reference images or reference image blocks are counted, and then a code table suitable for the collection scene can be determined according to the distribution characteristics of the image information of these reference images or reference image blocks; or, The frequency distribution features can be obtained in the frequency domain according to these reference images or reference image blocks. For example, the frequency distribution features can be obtained according to these reference images or reference image blocks. The position information of the first non-zero bit plane in each coefficient block. distribution characteristics, and then determine a code table suitable for the acquisition scene based on the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block obtained from these reference images or reference image blocks.
即是说,所述码表可以根据所述待编码图像块的估计的采集场景所确定。进一步说,可以获得与所述估计的采集场景相关的参考图像块,比如所述参考图像块是在所述估计的采集场景下采集的,从而所述码表可以根据所述参考图像块的图像信息的分布特征所确定;或者,可以根据所述参考图像块的频率系数得到各个系数块中首个非零位平面的位置信息,从而可以根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定该采集场景下的码表。其中,采集场景不同,所述参考图像块的图像信息的分布特征也不同,进一步地,所述参考图像块对应的各个系数 块中首个非零位平面的位置信息的分布特征也是不同的,则对应的码表也不同,从而可以使得所述待编码图像块对应的各个系数块中首个非零位平面的位置信息可以基于适合的码表进行编码,得到编码长度较短的第一编码信息,提高压缩率。本实施例中,可以预先估计待编码图像块可能的采集场景,进而根据该估计的采集场景确定合适的码表对所述待编码图像块对应的各个系数块中首个非零位平面的位置信息进行编码,有利于获得编码长度较短的第一编码信息,实现高效压缩过程,有利于提高压缩率。That is, the code table may be determined according to the estimated acquisition scene of the image block to be encoded. Further, a reference image block related to the estimated acquisition scene can be obtained, for example, the reference image block is acquired under the estimated acquisition scene, so that the code table can be based on the image of the reference image block Or, the position information of the first non-zero bit plane in each coefficient block can be obtained according to the frequency coefficient of the reference image block, so that the first non-zero bit plane in each coefficient block corresponding to the reference image block can be obtained according to the reference image block. The distribution feature of the position information of the non-zero bit plane determines the code table in the acquisition scene. Wherein, the distribution characteristics of the image information of the reference image block are also different depending on the acquisition scene. Further, the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block are also different. Then the corresponding code tables are also different, so that the position information of the first non-zero bit plane in each coefficient block corresponding to the image block to be encoded can be encoded based on a suitable code table to obtain a first code with a shorter encoding length. information to improve the compression ratio. In this embodiment, the possible acquisition scenarios of the image block to be encoded may be estimated in advance, and then the position of the first non-zero bit plane in each coefficient block corresponding to the image block to be encoded by an appropriate code table may be determined according to the estimated acquisition scenario. The encoding of the information is beneficial to obtain the first encoded information with a shorter encoding length, to realize an efficient compression process, and to improve the compression rate.
在一示例性的实施例中,可以根据采集场景的复杂程度确定简单场景、一般场景以及复杂场景,示例性,所述复杂程度可以通过采集场景中所包含的采集对象的种类数量来确定,比如在一张天空图像中,如果只包含蓝天和白云,可以确定其属于简单场景;如果该天空图像包含了蓝天、白云、太阳以及鸟类,可以确定其属于一般场景;如果该天空图像包含了蓝天、白云、太阳、鸟类、飞机以及山脉等等,可以确定其属于复杂场景。当然,所述复杂程度也可以通过其他因素来衡量,比如还可以根据图像信息的多少来确定复杂程度,图像信息越多,图像越复杂。本实施例可以预先估计将要进行编码的图像或者图像块的所有可能的采集场景,然后将这些采集场景分成简单场景、一般场景以及复杂场景。可以根据简单场景、一般场景以及复杂场景分别的特性来确定适合的码表;进一步说,可以根据在简单场景、一般场景以及复杂场景下分别获取的参考图像的图像信息的分布特征确定适合于相应场景的码表;或者,根据在简单场景、一般场景以及复杂场景下分别获取的参考图像的图像信息对应的各个系数块中首个非零位平面的位置信息的分布特征确定适合于相应场景的码表。则所述第一编码模式中的使用码表编码的模式可以包括有使用简单场景下的码表进行编码的模式、使用一般场景下的码表进行编码的模式以及使用复杂场景下的码表进行编码的模式,从而在编码所述待编码图像块对应的各个系数块中首个非零位平面的位置信息时,可以基于适合的码表进行编码,得到编码长度较短的第一编码信息,实现高效压缩过程,有利于提高压缩率。In an exemplary embodiment, a simple scene, a general scene, and a complex scene may be determined according to the complexity of the acquisition scene. Exemplarily, the complexity may be determined by the number of types of acquisition objects included in the acquisition scene, such as In a sky image, if it only contains blue sky and white clouds, it can be determined to be a simple scene; if the sky image contains blue sky, white clouds, the sun and birds, it can be determined to belong to a general scene; if the sky image contains blue sky , white clouds, sun, birds, airplanes, mountains, etc., can be determined to belong to complex scenes. Of course, the degree of complexity can also be measured by other factors, for example, the degree of complexity can also be determined according to the amount of image information, the more image information, the more complex the image. In this embodiment, all possible acquisition scenarios of the image or image block to be encoded can be estimated in advance, and then these acquisition scenarios can be divided into simple scenarios, general scenarios and complex scenarios. The suitable code table can be determined according to the characteristics of the simple scene, the general scene and the complex scene respectively; further, it can be determined according to the distribution characteristics of the image information of the reference image obtained under the simple scene, the general scene and the complex scene. The code table of the scene; or, according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the image information of the reference image obtained under the simple scene, the general scene and the complex scene respectively, determine the corresponding scene. stopwatch. Then the mode of using the code table encoding in the first encoding mode can include the mode of using the code table under the simple scene to encode, the mode of using the code table under the general scene to encode, and the code table under the complex scene. encoding mode, so that when encoding the position information of the first non-zero bit plane in each coefficient block corresponding to the image block to be encoded, encoding can be performed based on a suitable code table to obtain first encoding information with a shorter encoding length, To achieve an efficient compression process, it is beneficial to improve the compression rate.
考虑到同一图像或者图像块的不同色彩分量的图像信息的分布特征也有所不同,即是说,在不同色彩分量下,图像或者图像块中各种图像信息的出现概率并不相同,如果采用统一的码表对其进行编码,可能得不到较好的压缩编码效果。因此,为了进一步提高压缩编码效果,对于根据各个色彩分量的频率系数获取的各个色彩分量对应的各个所述系数块中首个非零位平面的位置信息,本实施例根据不同色彩分量独立进行编码,从而有利于提高压缩率。具体来说,所述图像编码装置获取所述待编码图像块不同色彩分量分别对应的频率系数,然后按照不同的色彩分量,将对应的频率系数 分解到位平面,则所述位平面的数量有多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述至少两种第一编码模式。Considering that the distribution characteristics of the image information of different color components of the same image or image block are also different, that is to say, under different color components, the appearance probabilities of various image information in the image or image block are not the same. If the code table is used to encode it, it may not get a better compression encoding effect. Therefore, in order to further improve the compression coding effect, for the position information of the first non-zero bit plane in each of the coefficient blocks corresponding to each color component obtained according to the frequency coefficients of each color component, this embodiment independently performs coding according to different color components , which helps to improve the compression ratio. Specifically, the image encoding device obtains the frequency coefficients corresponding to different color components of the to-be-coded image block, and then decomposes the corresponding frequency coefficients into bit planes according to different color components. Each of the plurality of bit planes includes a plurality of bit planes corresponding to different color components; wherein, at least one of the plurality of bit planes corresponding to the different color components corresponds to the at least two first encoding modes.
可以理解的是,所述色彩分量可以是YUV三种色彩分量,也可以RGB三种色彩分量,即多个所述不同颜色分量对应的位平面包括Y分量的位平面、U分量的位平面和V分量的位平面;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。It can be understood that the color components can be three color components of YUV, or three color components of RGB, that is, the bit planes corresponding to the plurality of different color components include the bit plane of the Y component, the bit plane of the U component, and the bit plane of the U component. A bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include a bit plane of the R component, a bit plane of the G component, and a bit plane of the B component.
这里以YUV三种色彩分量进行举例说明,所述图像编码装置可以得到所述待编码图像的Y分量的多个频率系数、U分量的多个频率系数和V分量的多个频率系数,对于每种色彩分量的多个频率系数,根据关于该种色彩分量的多个频率系数的位平面得到该种色彩分量的一个或多个系数块,确定各个所述系数块中首个非零位平面的位置信息;其中,Y分量、U分量和V分量分别均对应有至少两种第一编码模式,所述至少两种第一编码模式包括至少一种使用码表编码的模式和/或至少一种预测编码模式,所述码表根据所述待编码图像块估计的采集场景所确定,在同一采集场景或者不同采集场景中,不同色彩分量对应的码表也可能不同。然后所述图像编码装置从每种色彩分量对应的至少两种第一编码模式中选择该种色彩分量的目标编码模式,并使用该种色彩分量的目标编码模式对该种色彩分量的各个所述系数块的首个非零位平面的位置信息进行编码,从而生成Y分量的第一编码信息、U分量的第一编码信息以及V分量的第一编码信息;本实施例确定适合于不同色彩分量的码表,以提高待编码图像块的压缩率。Taking three color components of YUV as an example here, the image encoding device can obtain multiple frequency coefficients of the Y component, multiple frequency coefficients of the U component and multiple frequency coefficients of the V component of the to-be-coded image. a plurality of frequency coefficients of a color component, obtain one or more coefficient blocks of the color component according to the bit planes of the frequency coefficients of the color component, and determine the first non-zero bit plane in each of the coefficient blocks. Position information; wherein, the Y component, the U component and the V component respectively correspond to at least two first encoding modes, and the at least two first encoding modes include at least one mode encoded using a code table and/or at least one In the predictive coding mode, the code table is determined according to the estimated acquisition scene of the image block to be encoded. In the same acquisition scene or in different acquisition scenes, the code table corresponding to different color components may also be different. Then, the image encoding device selects the target encoding mode of this color component from the at least two first encoding modes corresponding to each color component, and uses the target encoding mode of this color component to describe each of the color components The position information of the first non-zero bit plane of the coefficient block is encoded, thereby generating the first encoding information of the Y component, the first encoding information of the U component, and the first encoding information of the V component; this embodiment determines that it is suitable for different color components. to improve the compression rate of the image block to be encoded.
进一步地,所述多个频率系数为将所述待编码图像块从时域变换至频域后产生的,在变换过程中,所述待编码图像块会被分割到多个不同的子带上,在不同的子带上,其频率系数的分布特征也并不同,或者说,不同的子带上可能会一个或多个系数块,在不同的子带上,所述系数块的首个非零位平面的位置信息的分布特征也不相同。因此,为了获取更优的编码压缩效果,可以设置每个子带对应有不同的所述至少两种第一编码模式,以适应于不同的子带。换句话说,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带;例如,所述第一频率系数属于第一频段的系数,所述第二频率系数属于第二频段的系数,第一频段、第二频段为高频或低频中的一者;所述第一频率系数和所述第二频率系数均对应有所述至少两种第一编码模式。在所述使用码表编码的模式中,不同的子带对应有不同的码表。本实施例通过设置适合于不同子带的码表,以提高待 编码图像块的压缩率。Further, the plurality of frequency coefficients are generated by transforming the image block to be encoded from the time domain to the frequency domain, and during the transformation process, the image block to be encoded will be divided into a plurality of different subbands , in different subbands, the distribution characteristics of its frequency coefficients are also different, or in other words, there may be one or more coefficient blocks in different subbands, and in different subbands, the first non-linear coefficient of the coefficient block The distribution characteristics of the position information of the zero plane are also different. Therefore, in order to obtain a better encoding and compression effect, each subband may be set to correspond to the at least two different first encoding modes, so as to be suitable for different subbands. In other words, the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient respectively belong to different subbands in the frequency domain; for example, the The first frequency coefficient belongs to the coefficient of the first frequency band, the second frequency coefficient belongs to the coefficient of the second frequency band, and the first frequency band and the second frequency band are one of high frequency or low frequency; the first frequency coefficient and the Each of the second frequency coefficients corresponds to the at least two first coding modes. In the encoding mode using the code table, different sub-bands correspond to different code tables. This embodiment improves the compression rate of the image block to be encoded by setting code tables suitable for different subbands.
所述图像编码装置将所述待编码图像从时域变换至频域,获取属于不同子带的多个频率系数,其中,不同的子带均对应有所述至少两种第一编码模式,所述至少两种第一编码模式包括至少一种使用码表编码的模式和/或至少一种预测编码模式,所述码表根据所述待编码图像块估计的采集场景所确定,在同一采集场景或者不同采集场景中,不同子带对应的码表也可能不同;然后所述图像编码装置根据关于多个频率系数的位平面得到一个或多个系数块,确定各个所述系数块中首个非零位平面的位置信息;其中,所述系数块包括至少一个频率系数的二进制比特位,所述图像编码装置可以根据所述系数块所包括的频率系数所对应的子带,确定对应的至少两种第一编码模式,从所述至少两种第一编码模式中选择目标编码模式,并使用目标编码模式对所述系数块的首个非零位平面的位置信息进行编码。本实施例中考虑到不同子带中频率系数的分布特征不同,确定适应于不同子带的码表有利于优化压缩编码效果,进一步提高压缩率。The image encoding device transforms the to-be-encoded image from the time domain to the frequency domain, and obtains multiple frequency coefficients belonging to different subbands, wherein the different subbands all correspond to the at least two first encoding modes, so the The at least two first encoding modes include at least one encoding mode using a code table and/or at least one predictive encoding mode, the code table is determined according to the estimated acquisition scene of the image block to be encoded, and in the same acquisition scene Or in different acquisition scenarios, the code tables corresponding to different sub-bands may also be different; then the image encoding device obtains one or more coefficient blocks according to the bit planes related to multiple frequency coefficients, and determines the first non-linear coefficient in each of the coefficient blocks. The position information of the zero bit plane; wherein, the coefficient block includes binary bits of at least one frequency coefficient, and the image coding device can determine the corresponding at least two corresponding subbands according to the frequency coefficient included in the coefficient block. A first encoding mode, a target encoding mode is selected from the at least two first encoding modes, and the position information of the first non-zero bit plane of the coefficient block is encoded using the target encoding mode. In this embodiment, considering that the distribution characteristics of frequency coefficients in different subbands are different, determining a code table suitable for different subbands is conducive to optimizing the compression coding effect and further improving the compression rate.
在一示例性的实施例中,假设按照简单场景、一般场景和复杂场景设置3种类型的码表,所述待编码图像块包括有YUV3个色彩分量,YUV3个色彩分量分别有简单场景、一般场景和复杂场景3种类型的码表,进一步地,对于每个色彩分量的多个频率系数,属于不同的子带,每个子带分别对应有简单场景、一般场景和复杂场景3种类型的码表。以YUV444格式(每一个Y分量对应一组UV分量)进行说明,Y分量的频率系数属于4个不同的子带,每个子带有3个码表(分别对应简单场景、一般场景和复杂场景),则有12个码表,同理U分量的频率系数属于4个不同的子带,每个子带有3个码表,也有12个码表,同理V分量也有12个码表,总共有36个码表,可根据实际应用场景选择适合的码表进行编码以获取编码长度最短的第一编码信息,以达到最优的编码效果,实现最大的压缩率。In an exemplary embodiment, it is assumed that three types of code tables are set according to a simple scene, a general scene and a complex scene. There are three types of code tables for scene and complex scene. Further, for the multiple frequency coefficients of each color component, they belong to different subbands, and each subband corresponds to three types of codes: simple scene, general scene and complex scene. surface. It is described in YUV444 format (each Y component corresponds to a set of UV components). The frequency coefficients of the Y component belong to 4 different subbands, and each subband has 3 code tables (corresponding to simple scenes, general scenes and complex scenes respectively) , then there are 12 code tables. Similarly, the frequency coefficients of the U component belong to 4 different sub-bands. Each sub-band has 3 code tables and 12 code tables. Similarly, the V component also has 12 code tables. There are 36 code tables, and a suitable code table can be selected for encoding according to the actual application scenario to obtain the first encoding information with the shortest encoding length, so as to achieve the optimal encoding effect and achieve the maximum compression rate.
除了获取第一编码信息之外,所述图像编码装置还对所述各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码以生成第二编码信息,在进行编码时,所述图像编码装置将所述系数块中从非零位平面开始的同一个位平面的所有比特位作为一个编码单元进行编码。作为例子,请参阅图9,所述系数块中非零位平面为位深0所在的平面,则所述系数块中位深0所在的位平面的所有比特位作为一个编码单元,所述系数块中位深1所在的位平面的所有比特位作为一个编码单元,依次类推,则所述系数块一共有13个编码单元。In addition to acquiring the first encoding information, the image encoding apparatus further encodes the bits on the respective bit planes starting from the first non-zero bit plane in the respective coefficient blocks to generate the second encoding information, where During encoding, the image encoding apparatus encodes all bits of the same bit plane starting from a non-zero bit plane in the coefficient block as one encoding unit. As an example, please refer to FIG. 9, the non-zero bit plane in the coefficient block is the plane where the bit depth 0 is located, then all the bits of the bit plane where the bit depth 0 is located in the coefficient block is used as a coding unit, the coefficient All bits of the bit plane where the bit depth 1 is located in the block is regarded as a coding unit, and so on, the coefficient block has a total of 13 coding units.
所述待编码图像块的已编码的码流的大小是由码率决定的,而且码流的大于与码 率成正比,因此,可以根据实际需要确定所述待编码图像块对应的码率,比如可以选择按照无损编码方式来配置码率,也可以按照有损编码方式来配置码率,根据实际应用场景进行具体配置。所述图像编码装置在编码所述系数块中的编码单元时,首先可以根据预定的码率所指示的目标编码长度,按照预定的扫描顺序从所述编码单元中确定目标编码单元;所述目标编码单元指示所述编码单元中需要被编码的对象,然后所述图像编码装置对所述目标编码单元进行编码,生成所述第二编码信息。The size of the encoded code stream of the image block to be encoded is determined by the code rate, and the size of the code stream is proportional to the code rate. Therefore, the code rate corresponding to the image block to be encoded can be determined according to actual needs, For example, you can choose to configure the bit rate according to the lossless encoding method, or you can configure the bit rate according to the lossy encoding method, and perform specific configuration according to the actual application scenario. When the image coding apparatus encodes the coding units in the coefficient block, firstly, according to the target coding length indicated by the predetermined code rate, the target coding unit may be determined from the coding units according to a predetermined scanning order; The encoding unit indicates the object to be encoded in the encoding unit, and then the image encoding apparatus encodes the target encoding unit to generate the second encoding information.
其中,在确定所述目标编码单元时,所述图像编码装置可以按照预定的扫描顺序依次确定所述编码单元的编码长度,然后根据所述目标编码长度以及所述编码单元的编码长度,从所述编码单元中确定目标编码单元的数量,即所述图像编码装置可以按照预定的扫描按顺序依次扫描每个编码单元并累计当前扫描的所有编码单元的总编码长度,当所述总编码长度达到所述预定的码率所指示的目标编码长度时,停止扫描剩下的编码单元,确定已扫描过的编码单元为目标编码单元,并记录最后一个目标编码单元的位置,最后一个目标编码单元的位置即为截断位置,所述图像编码装置也需要对最后一个目标编码单元的位置信息进行编码,以便在所述图像解码装置进行解码时,所述图像解码装置能够根据所述最后一个目标编码单元的位置信息从已编码的码流中获取所述第二编码信息,从而对所述第二编码信息进行正确解码。Wherein, when determining the target coding unit, the image coding apparatus may sequentially determine the coding length of the coding unit according to a predetermined scanning order, and then according to the target coding length and the coding length of the coding unit, from the The number of target coding units is determined in the coding unit, that is, the image coding device can scan each coding unit in sequence according to a predetermined scan and accumulate the total coding length of all coding units currently scanned. When the total coding length reaches During the target coding length indicated by the predetermined code rate, stop scanning the remaining coding units, determine that the scanned coding unit is the target coding unit, and record the position of the last target coding unit, the last target coding unit The position is the truncation position, and the image encoding apparatus also needs to encode the position information of the last target coding unit, so that when the image decoding apparatus performs decoding, the image decoding apparatus can The second encoding information is obtained from the encoded code stream according to the location information, so as to correctly decode the second encoding information.
其中,可以理解的是,本实施例对于具体的扫描顺序不做任何限制,可依据实际应用场景进行具体设置,请参阅图10,请参阅图10中的箭头方向(表示扫描顺序),例如所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。Among them, it can be understood that this embodiment does not impose any restrictions on the specific scanning order, and specific settings can be made according to actual application scenarios, please refer to FIG. 10 , please refer to the direction of the arrow in FIG. The predetermined scanning order includes at least the order from low frequency to high frequency and/or the order from the most significant bit bit plane to the least significant bit bit plane.
在一实施例中,所述图像编码装置获取所述待编码图像块的不同色彩分量的频率系数,然后将各个色彩分量的频率系数展开到位平面,即是说,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面,接着在各个不同色彩分量对应的位平面上获得各个色彩分量的一个或多个系数块,进而获取不同色彩分量分别对应的各个系数块中的编码单元;为了基于预定的码率实现对所述待编码图像块进行精细的码率控制,所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合扫描的顺序,从而实现不同的色彩分量联合精细地进行码率控制。In one embodiment, the image encoding device acquires the frequency coefficients of different color components of the to-be-coded image block, and then expands the frequency coefficients of each color component to a bit plane, that is, the number of the bit planes is large. A plurality of the bit planes include a plurality of bit planes corresponding to different color components, and then one or more coefficient blocks of each color component are obtained on the bit planes corresponding to each different color component, and then the corresponding coefficient blocks of the different color components are obtained. Coding units in each coefficient block; in order to implement fine rate control on the to-be-coded image block based on a predetermined code rate, the predetermined scan order instructs to mix a plurality of coding units corresponding to the different color components The order of scanning, so that different color components can be combined for fine rate control.
在一个例子中,以YUV为例进行说明,比如Y分量对应有2个编码单元a1、a2,U分量对应有2个编码单元b1、b2,V分量对应有2个编码单元c1、c2;所述预定的扫描顺序可能是a1→b1→c1→a2→b2→c2,实现YUV分量的混合扫描,从而保证获取的YUV的编码单元的均匀性,使得解压后的图像块的画质清晰自然。在另一个例 子中,请参阅图11,以YUV422(表示每2个Y分量对应1组UV分量)为例进行说明,图中YUV分量的位平面(或者称之为比特平面)中,每个空格表示一个编码单元,每个编码单元上的数字表示其扫描顺序,本实施例实现将YUV分量的编码单元进行混合扫描,从而实现不同的色彩分量联合精细地进行码率控制,从而保证获取的YUV的编码单元的均匀性,使得解压后的图像块的画质清晰自然,可以理解的是,图11所示的扫描顺序仅为示例,但不限于此,图中的灰色部分为无需进行编码的部分。In an example, taking YUV as an example to illustrate, for example, the Y component corresponds to 2 coding units a1, a2, the U component corresponds to 2 coding units b1, b2, and the V component corresponds to 2 coding units c1, c2; The predetermined scanning sequence may be a1→b1→c1→a2→b2→c2, which realizes the mixed scanning of YUV components, thereby ensuring the uniformity of the obtained YUV coding units, and making the image quality of the decompressed image blocks clear and natural. In another example, please refer to FIG. 11, taking YUV422 (meaning that every 2 Y components corresponds to 1 set of UV components) as an example, in the bit plane (or called bit plane) of the YUV components in the figure, each The space represents a coding unit, and the number on each coding unit represents its scanning order. In this embodiment, the coding units of the YUV components are mixed and scanned, so as to realize the joint and fine rate control of different color components, so as to ensure the obtained The uniformity of the coding unit of YUV makes the image quality of the decompressed image block clear and natural. It can be understood that the scanning sequence shown in FIG. 11 is only an example, but not limited to this. The gray part in the figure does not require coding. part.
在对所述目标编码单元进行编码以生成第二编码信息时,所述图像编码装置可以根据所述目标编码单元对应的第二编码模式对该目标编码单元进行编码。所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。所述变长编码模式包括但不限于哈夫曼编码模式或者香农编码模式等。When coding the target coding unit to generate the second coding information, the image coding apparatus may code the target coding unit according to a second coding mode corresponding to the target coding unit. The second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes. The variable-length coding mode includes, but is not limited to, Huffman coding mode or Shannon coding mode.
其中,所述目标编码单元对应的第二编码模式可以根据所述目标编码单元的分布特征确定;或者,所述目标编码单元对应的第二编码模式可以根据所述目标编码单元所处的位置所确定。所述目标编码单元所处的位置至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。本实施例中,通过所述目标单元的分布特征或者其所处的位置确定适合的第二编码模式,有助于优化第二编码信息的编码效果,提高压缩率。The second coding mode corresponding to the target coding unit may be determined according to the distribution characteristics of the target coding unit; or, the second coding mode corresponding to the target coding unit may be determined according to the location of the target coding unit. Sure. The position where the target coding unit is located includes at least one of the following: the bit depth of the bit plane corresponding to the target coding unit or the subband to which the target coding unit belongs. In this embodiment, determining a suitable second encoding mode according to the distribution characteristics of the target unit or its location helps to optimize the encoding effect of the second encoding information and improve the compression rate.
在一种实现方式中,所述目标编码的不同分布特征,表明不同目标编码单元中各种信息符号出现的概率可能不同,因此,为了达到更好的编码效果,所述图像编码装置可以预先估计所述待编码图像块可能的采集场景,然后获取与所述采集场景相关的参考图像及其在压缩编码过程中使用的第二编码模式,确定所述参考图像的目标编码单元,然后根据所述参考图像的目标编码单元的分布特征及其使用的第二编码模式,获取分布特征与第二编码模式的映射关系。则在编码所述待编码图形块的过程中,所述目标编码单元对应的第二编码模式可以根据该目标编码单元的分布特征从预存的分布特征与第二编码模式的映射关系中查找得到。In an implementation manner, the different distribution characteristics of the target coding indicate that the probabilities of various information symbols appearing in different target coding units may be different. Therefore, in order to achieve a better coding effect, the image coding apparatus may estimate in advance A possible collection scene of the image block to be encoded, then obtain a reference image related to the collection scene and the second encoding mode used in the compression encoding process, determine the target encoding unit of the reference image, and then according to the The distribution feature of the target coding unit of the image and the second coding mode used by it are referred to, and the mapping relationship between the distribution feature and the second coding mode is obtained. Then, in the process of encoding the graphic block to be encoded, the second encoding mode corresponding to the target encoding unit can be obtained from the mapping relationship between the pre-stored distribution characteristic and the second encoding mode according to the distribution characteristic of the target encoding unit.
进一步地,为了便于图像解码装置的解码过程,可以对所述目标编码单元对应的第二编码模式也进行编码,生成所述已编码的码流;或者所述图像解码装置已预先确定了所述目标编码单元对应的第二编码模式,则无需编码所述目标编码单元对应的第二编码模式。Further, in order to facilitate the decoding process of the image decoding apparatus, the second encoding mode corresponding to the target coding unit may also be encoded to generate the encoded code stream; or the image decoding apparatus has pre-determined the the second coding mode corresponding to the target coding unit, it is not necessary to encode the second coding mode corresponding to the target coding unit.
作为例子,可以通过机器学习方式获取所述分布特征与第二编码模式的映射关系,可以将所述参考图像的目标编码单元的分布特征及其使用的第二编码模式作为训练样本,将所述参考图像的目标编码单元的分布特征输入预设的模型中,得到预测结果, 然后根据所述预测结果与所述参考图像使用的第二编码模式的差异,调整所述预设的模型的参数,进而通过调整后的模型获取分布特征与第二编码模式的映射关系。As an example, the mapping relationship between the distribution feature and the second encoding mode can be obtained through machine learning, the distribution feature of the target encoding unit of the reference image and the second encoding mode used in the reference image can be used as training samples, and the The distribution feature of the target coding unit of the reference image is input into a preset model to obtain a prediction result, and then the parameters of the preset model are adjusted according to the difference between the prediction result and the second encoding mode used by the reference image, Further, the mapping relationship between the distribution feature and the second encoding mode is obtained through the adjusted model.
作为例子,可以获取大量的参考图像的目标编码单元的分布特征及其使用的第二编码模式,然后通过聚类方式进行统计分析,从而获取所述分布特征与第二编码模式的映射关系。As an example, the distribution characteristics of target coding units of a large number of reference images and the second coding mode used therefor may be obtained, and then statistical analysis is performed in a clustering manner to obtain the mapping relationship between the distribution characteristics and the second coding mode.
在另一种实现方式,考虑到目标编码单元所处的位置不同时,所述目标编码的分布特征不同,使得不同目标编码单元中各种信息符号出现的概率可能不同,因此,为了达到更好的编码效果,可以预先估计所述待编码图像块可能的采集场景,然后获取与所述采集场景相关的参考图像及其在压缩编码过程中使用的第二编码模式,确定所述参考图像的目标编码单元,然后根据所述参考图像的目标编码单元所处的位置及其使用的第二编码模式,获取目标编码单元所处的位置与第二编码模式的映射关系。则在编码所述待编码图形块的过程中,所述目标编码单元对应的第二编码模式可以根据该目标编码单元所处的位置从预存的目标编码单元所处的位置与第二编码模式的映射关系中查找得到。其中,所述目标编码单元所处的位置至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。In another implementation manner, considering that the target coding units are located at different positions, the distribution characteristics of the target coding are different, so that the probabilities of various information symbols in different target coding units may be different. Therefore, in order to achieve better It is possible to pre-estimate the possible acquisition scene of the image block to be encoded, and then acquire the reference image related to the acquisition scene and the second encoding mode used in the compression encoding process, and determine the target of the reference image. The coding unit then obtains the mapping relationship between the position of the target coding unit and the second coding mode according to the position of the target coding unit of the reference image and the second coding mode used. Then in the process of encoding the to-be-encoded graphic block, the second encoding mode corresponding to the target encoding unit may be based on the position of the target encoding unit from the position of the pre-stored target encoding unit and the second encoding mode. Find it in the mapping relationship. Wherein, the position where the target coding unit is located includes at least any one of the following: the bit depth of the bit plane corresponding to the target coding unit or the subband to which the target coding unit belongs.
进一步地,为了便于图像解码装置的解码过程,可以对所述目标编码单元对应的第二编码模式也进行编码,生成所述已编码的码流;或者所述图像解码装置已预先确定了所述目标编码单元对应的第二编码模式,则无需编码所述目标编码单元对应的第二编码模式。Further, in order to facilitate the decoding process of the image decoding apparatus, the second encoding mode corresponding to the target coding unit may also be encoded to generate the encoded code stream; or the image decoding apparatus has pre-determined the the second coding mode corresponding to the target coding unit, it is not necessary to encode the second coding mode corresponding to the target coding unit.
作为例子,可以通过机器学习方式获取所述目标编码单元所处的位置与第二编码模式的映射关系,可以将所述参考图像的目标编码单元所处的位置及其使用的第二编码模式作为训练样本,将所述参考图像的目标编码单元所处的位置输入预设的模型中,得到预测结果,然后根据所述预测结果与所述参考图像使用的第二编码模式的差异,调整所述预设的模型的参数,进而通过调整后的模型获取目标编码单元所处的位置与第二编码模式的映射关系。As an example, the mapping relationship between the position of the target coding unit and the second coding mode may be obtained through machine learning, and the position of the target coding unit of the reference image and the second coding mode used may be used as training samples, input the position of the target coding unit of the reference image into a preset model, obtain a prediction result, and then adjust the parameters of the preset model, and then obtain the mapping relationship between the position of the target coding unit and the second coding mode through the adjusted model.
作为例子,可以获取大量的参考图像的目标编码单元所处的位置及其使用的第二编码模式,然后通过聚类方式进行统计分析,从而获取所述目标编码单元所处的位置与第二编码模式的映射关系。As an example, the position of the target coding unit in a large number of reference images and the second coding mode used by it may be obtained, and then statistical analysis is performed through a clustering method, so as to obtain the position of the target coding unit and the second coding mode. Schema mapping relationship.
示例性地,请参阅图12,比如可以预先估计所述待编码图像块可能的采集场景,然后获取与所述采集场景相关的多个参考图像的目标编码单元,然后根据所述目标编码单元的分布特征确定至少三种第二编码模式,所述第二编码模式至少包括定长编码 模式和/或至少两种变长编码模式,即所述目标编码单元不同的分布特征对应不同的第二编码模式,比如可以将所述目标编码单元的分布特征划分为3类,比如所述目标编码单元的分布特征被划分为第一类分布特征、第二类分布特征和第三类分布特征,分别在位平面的第一区域、第二区域和第三区域,假设预先设置第一区域(即第一类分布特征)对应的第二编码模式为第一变长编码模式,第二区域(即第二类分布特征)对应的第二编码模式为第二变长编码模式,第三区域(第三类分布)对应的第二编码模式为定长编码模式;在对所述目标编码单元进行编码时,确定所述目标编码单元所处的位置,基于所述目标编码单元所处的位置的所属区域,确定所述目标编码单元对应的第二编码模式,并根据所述目标编码单元对应的第二编码模式对该目标编码单元进行编码。本实施例中,根据目标编码单元的分布特征确定适合的码表,有利于获取编码长度更短的第二编码信息,提高压缩率。Exemplarily, referring to FIG. 12 , for example, a possible acquisition scene of the image block to be encoded may be estimated in advance, and then the target coding units of multiple reference images related to the acquisition scene may be acquired, and then according to the target coding unit of the target coding unit The distribution characteristics determine at least three second encoding modes, and the second encoding modes include at least fixed-length encoding modes and/or at least two variable-length encoding modes, that is, different distribution characteristics of the target coding unit correspond to different second encoding modes mode, for example, the distribution characteristics of the target coding unit can be divided into three types, for example, the distribution characteristics of the target coding unit are divided into the first type of distribution characteristics, the second type of distribution characteristics and the third type of distribution characteristics, respectively in For the first area, second area and third area of the bit plane, it is assumed that the second encoding mode corresponding to the first area (ie, the first type of distribution feature) is preset as the first variable-length encoding mode, and the second area (ie, the second The second encoding mode corresponding to the class distribution feature) is the second variable-length encoding mode, and the second encoding mode corresponding to the third region (the third class distribution) is the fixed-length encoding mode; when encoding the target coding unit, Determine the position where the target coding unit is located, determine the second coding mode corresponding to the target coding unit based on the region to which the target coding unit is located, and determine the second coding mode corresponding to the target coding unit according to the second coding unit corresponding to the target coding unit. mode encodes the target coding unit. In this embodiment, determining a suitable code table according to the distribution characteristics of the target coding unit is beneficial to obtain the second coding information with a shorter coding length and improve the compression rate.
所述至少两种变长编码模式中的每一种均包括有码表,考虑到编码单元的数据量越大,在使用一个码表对其进行编码时,需要搜索的码表的表项越多,编码效率低,为了进一步优化编码效果,提高编码效率,所述至少两种变长编码模式中的每一种均包括至少两个码表,当所述目标编码单元对应的第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述目标编码单元的不同比特位进行编码,从而有利于加快编码速度和编码效率,同时也有利于优化编码效果,提高压缩率。比如所述目标编码单元为8比特的字符串,如果设置成一个码表对其进行编码,所述码表可能要设置2
8=256个表项,对码表进行搜索需要花费较长的时间,因此本实施例可以将其分成两个4比特的字符串,相应设置有2个码表,用其中一个码表编码其中4比特的字符,并用另外一个码表编码另外4比特的字符,则每个码表可能只需设置2
4=16个表项,对码表进行搜索的时间显著减少了,从而有利于加快编码速度和编码效率,同时也有利于优化编码效果,提高压缩率。
Each of the at least two variable-length encoding modes includes a code table. Considering that the data volume of the coding unit is larger, when a code table is used to encode it, the more the table entries of the code table to be searched are. many, the coding efficiency is low, in order to further optimize the coding effect and improve the coding efficiency, each of the at least two variable-length coding modes includes at least two code tables, when the second coding mode corresponding to the target coding unit In the case of the variable-length encoding mode, the at least two code tables are used to encode different bits of the target encoding unit respectively, thereby helping to speed up the encoding speed and encoding efficiency, as well as optimizing the encoding effect and improving the compression rate. . For example, the target coding unit is an 8-bit character string. If it is set as a code table to encode it, the code table may be set with 2 8 =256 entries, and it takes a long time to search the code table. , so in this embodiment, it can be divided into two 4-bit character strings, correspondingly set with 2 code tables, use one of the code tables to encode the 4-bit characters, and use the other code table to encode the other 4-bit characters, then Each code table may only need to set 2 4 =16 entries, and the time for searching the code table is significantly reduced, which is conducive to speeding up the encoding speed and encoding efficiency, and is also conducive to optimizing the encoding effect and improving the compression rate.
可以理解的是,本申请对于所述变长编码模式中码表的设置数量不做任何限制,可依据所述编码单元的数据量所确定,比如设置每4比特对应一个码表,所述码表可以根据所述编码单元的分布特征或者所处的位置所确定。It can be understood that this application does not impose any restrictions on the number of code tables in the variable-length encoding mode, which can be determined according to the data volume of the encoding unit, such as setting a code table corresponding to every 4 bits, and the code The table may be determined according to distribution characteristics or locations of the coding units.
在一实施例中,若所述目标编码单元的剩余比特被编码后的长度无法满足所述预定的码率指示的编码长度,则根据所述目标编码单元的编码长度添加预设数据,从而保证最终所述待编码图像块的已编码的码流的编码长度能够符合预定的码率所指示的编码长度,进而使得所述图像解码装置能够进行正确解码。在一个例子中,比如所述目标编码单元的剩余比特被编码后的长度为5比特,而目前可能还需要10比特才能满 足所述预定的码率指示的编码长度,则需要根据所述目标编码单元的剩余比特被编码后的长度确定需要添加5(5=10-5)比特的预设数据,从满足预定的码率指示的编码长度要求,进而使得所述图像解码装置能够进行正确解码。In one embodiment, if the encoded length of the remaining bits of the target coding unit cannot meet the coding length indicated by the predetermined code rate, then preset data is added according to the coding length of the target coding unit, thereby ensuring that Finally, the encoding length of the encoded code stream of the image block to be encoded can conform to the encoding length indicated by the predetermined code rate, thereby enabling the image decoding apparatus to perform correct decoding. In an example, for example, the length of the remaining bits of the target coding unit after being coded is 5 bits, and currently 10 bits may be required to meet the coding length indicated by the predetermined code rate, then the target coding unit needs to be coded according to the target coding length. The encoded length of the remaining bits of the unit needs to be determined by adding 5 (5=10-5) bits of preset data to satisfy the encoding length requirement indicated by the predetermined code rate, thereby enabling the image decoding apparatus to perform correct decoding.
其中,如果需要添加的预设数据的数据长度(或者说数据量)大于预设长度(或者说预设数据量),则使用所述至少两种变长编码方式进行编码的最后一个目标编码单元改用定长编码方式进行编码,在编码完成之后再重新确定需要添加的预设数据的数据长度,从而有利于降低硬件实现复杂度。其中,所述预设长度可以为一个编码单元的长度。Wherein, if the data length (or the data amount) of the preset data to be added is greater than the preset length (or the preset data amount), the last target coding unit for encoding using the at least two variable-length encoding methods The fixed-length encoding method is used instead for encoding, and after the encoding is completed, the data length of the preset data to be added is re-determined, thereby helping to reduce the complexity of hardware implementation. The preset length may be the length of one coding unit.
为了加快解码速度,所述图像解码装置通常能够同步从两端进行解码,则为了支持所述图像解码装置的解码过程,在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息位于所述已编码的码流中的第二位置,所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。In order to speed up the decoding speed, the image decoding apparatus can usually perform decoding from two ends synchronously. In order to support the decoding process of the image decoding apparatus, in the encoded code stream about the image block to be encoded, all The first encoding information is located at a first position in the encoded code stream, the second encoding information is located at a second position in the encoded code stream, the first position and the second position for enabling the decoding end to synchronously decode the encoded code stream from the first position and the second position.
前面提到,所述多个频率系数被分解成符号和绝对值以分别进行编码,除了第一编码信息和第二编码信息之后,还包括对符号进行编码得到的第三编码信息,则在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息以及所述第三编码信息位于所述已编码的码流中的第二位置,所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。As mentioned above, the plurality of frequency coefficients are decomposed into symbols and absolute values for encoding respectively, in addition to the first encoding information and the second encoding information, the third encoding information obtained by encoding the symbols is also included. In the encoded code stream about the image block to be encoded, the first encoding information is located in a first position in the encoded code stream, and the second encoding information and the third encoding information are located in the second position in the encoded code stream, the first position and the second position are used to enable the decoding end to synchronously decode the encoded code stream from the first position and the second position .
其中,所述第一位置和所述第二位置中的一者为所述已编码的码流的头部位置,另一者为所述已编码的码流的尾部位置。Wherein, one of the first position and the second position is the head position of the encoded code stream, and the other is the tail position of the encoded code stream.
除了第一编码信息、第二编码信息以及第三编码信息之外,还对所述目标编码模式以及最后一个目标编码单元的位置信息进行编码,这些编码后的信息可以放在所述已编码的码流的第三位置,例如所述第三位置为所述已编码的码流的头部位置,所述第一位置和所述第二位置中的一者为所述第三位置之后的位置,另一者为所述已编码的码流的尾部位置。In addition to the first encoding information, the second encoding information and the third encoding information, the target encoding mode and the position information of the last target encoding unit are also encoded, and these encoded information can be placed in the encoded The third position of the code stream, for example, the third position is the head position of the encoded code stream, and one of the first position and the second position is the position after the third position , and the other is the tail position of the encoded code stream.
相应的,请参阅图13,本申请实施例还提供了一种图像解码方法,所述方法包括:Correspondingly, referring to FIG. 13 , an embodiment of the present application further provides an image decoding method, and the method includes:
在步骤S201中,获取已编码的码流,所述已编码的码流包括第一编码信息以及第二编码信息。In step S201, an encoded code stream is obtained, where the encoded code stream includes first encoding information and second encoding information.
在步骤S202中,对所述第一编码信息进行解码,获取各个系数块的首个非零位平 面的位置信息;以及,对所述第二编码信息进行解码,获取各个所述系数块中从首个非零位平面开始的各个位平面上的比特位。In step S202, the first encoding information is decoded to obtain the position information of the first non-zero bit plane of each coefficient block; and the second encoding information is decoded to obtain the Bits on each bit plane starting with the first non-zero bit plane.
在步骤S203中,根据各个系数块的首个非零位平面的位置信息以及各个所述系数块中从首个非零位平面开始的各个位平面上的比特位,在位平面上获取多个频率系数。In step S203, according to the position information of the first non-zero bit plane of each coefficient block and the bits on each bit plane starting from the first non-zero bit plane in each coefficient block, obtain multiple frequency factor.
在步骤S204中,通过所述多个频率系数获取解码后的图像块。In step S204, a decoded image block is obtained through the plurality of frequency coefficients.
在一实施例中,所述已编码的码流包括有生成所述第一编码信息对应的目标编码模式。In an embodiment, the encoded code stream includes a target encoding mode corresponding to the generation of the first encoding information.
所述对所述第一编码信息进行解码,包括:根据所述目标编码模式对所述第一编码信息进行解码。The decoding the first encoding information includes: decoding the first encoding information according to the target encoding mode.
在一实施例中,所述目标编码模式为以下其中一种:至少一种使用码表编码的模式和/或至少一种预测编码模式。In an embodiment, the target encoding mode is one of the following: at least one mode using code table encoding and/or at least one predictive encoding mode.
在一实施例中,在所述使用码表编码的模式中,所述码表根据所述解码后的图像块的估计的采集场景所确定;或者,所述码表根据与所述估计的采集场景相关的参考图像块的图像信息的分布特征所确定;或者,所述码表根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定。In an embodiment, in the mode of encoding using a code table, the code table is determined according to an estimated acquisition scene of the decoded image block; or the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
在一实施例中,不同采集场景对应的码表不同,或者,所述参考图像块的图像信息的不同分布特征对应的码表不同;或者,所述参考图像块对应的各个系数块中首个非零位平面的位置信息的不同分布特征对应的码表不同。In one embodiment, the code tables corresponding to different acquisition scenarios are different, or, the code tables corresponding to different distribution characteristics of the image information of the reference image block are different; or, the first one of the coefficient blocks corresponding to the reference image block is The code tables corresponding to different distribution characteristics of the position information of the non-zero bit plane are different.
在一实施例中,所述多个频率系数为将所述待编码图像块从时域变换至频域后产生的;其中,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带。In an embodiment, the plurality of frequency coefficients are generated after transforming the image block to be encoded from the time domain to the frequency domain; wherein the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, And the first frequency coefficient and the second frequency coefficient respectively belong to different subbands in the frequency domain.
所述第一频率系数和所述第二频率系数均对应有所述目标编码模式;或者说,不同子带中的每一个均对应有所述目标编码模式。Both the first frequency coefficient and the second frequency coefficient correspond to the target coding mode; in other words, each of the different subbands corresponds to the target coding mode.
在一实施例中,如果所述目标编码模式为所述使用码表编码的模式,不同的子带对应有不同的码表。In one embodiment, if the target encoding mode is the mode using the code table encoding, different subbands correspond to different code tables.
在一实施例中,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述目标编码模式。In an embodiment, the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, at least one of the multiple bit planes corresponding to the different color components Corresponding to the target encoding mode.
在一实施例中,多个所述不同颜色分量对应的位平面包括Y分量的位平面、U分量的位平面和V分量的位平面;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。In an embodiment, a plurality of bit planes corresponding to the different color components include a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include: The bit plane of the R component, the bit plane of the G component, and the bit plane of the B component.
在一实施例中,在编码过程中,在所述系数块中,从首个非零位平面开始,将所述系数块中同一个位平面的所有比特位作为一个编码单元。In an embodiment, in the encoding process, in the coefficient block, starting from the first non-zero bit plane, all bits of the same bit plane in the coefficient block are taken as one coding unit.
所述已编码的码流还包括有最后一个目标编码单元的位置信息;所述目标编码单元指示所述编码单元中需要被编码的对象。The encoded code stream further includes position information of the last target coding unit; the target coding unit indicates the object to be encoded in the coding unit.
在所述对所述第二编码信息进行解码之前,包括:根据所述最后一个目标编码单元的位置信息从所述已编码的码流中确定获取所述第二编码信息。可以说,所述最后一个目标编码单元的位置信息起到定位作用,从而可以从所述已编码的码流中确定所述第二编码信息。Before the decoding the second encoding information, the method includes: determining and acquiring the second encoding information from the encoded code stream according to the position information of the last target coding unit. It can be said that the position information of the last target coding unit plays a role in positioning, so that the second coding information can be determined from the coded code stream.
在一实施例中,所述目标编码单元由编码端按照预定的扫描顺序对所述编码单元进行扫描后确定。In an embodiment, the target coding unit is determined by the coding end after scanning the coding unit according to a predetermined scanning order.
在一实施例中,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合编码的顺序。In an embodiment, the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components; The order in which coding units are mixed-encoded.
在一实施例中,所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。In one embodiment, the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit-plane to the least significant bit-plane.
在一实施例中,所述对所述第二编码信息进行解码,还包括:根据所述第二编码信息对应的第二编码模式对所述第二编码信息进行解码,获得目标编码单元。In an embodiment, the decoding the second encoding information further includes: decoding the second encoding information according to a second encoding mode corresponding to the second encoding information to obtain a target encoding unit.
其中,所述已编码的码流中包括有所述第二编码信息对应的第二编码模式;或者,所述图像解码装置以预先获取到所述第二编码信息对应的第二编码模式。Wherein, the encoded code stream includes the second encoding mode corresponding to the second encoding information; or, the image decoding apparatus obtains the second encoding mode corresponding to the second encoding information in advance.
在一实施例中,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征确定;或者,所述第二编码模式根据所述目标编码单元所处的位置所确定。In an embodiment, during the encoding process, the second encoding mode is determined according to the distribution characteristics of the target coding unit; or, the second encoding mode is determined according to the position where the target coding unit is located.
在一实施例中,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征以及预存的分布特征与第二编码模式的映射关系所确定。In one embodiment, during the encoding process, the second encoding mode is determined according to the distribution characteristics of the target coding unit and the mapping relationship between the pre-stored distribution characteristics and the second encoding mode.
或者,所述第二编码模式根据所述目标编码单元所处的位置以及预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系所确定。Alternatively, the second coding mode is determined according to the location of the target coding unit and a pre-stored mapping relationship between the location of the target coding unit and the second coding mode.
在一实施例中,所述目标编码单元所处的位置至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。In an embodiment, the location where the target coding unit is located includes at least one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subband to which the target coding unit belongs.
在一实施例中,所述预存的分布特征与第二编码模式的映射关系或者所述预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系基于机器学习而得到。In an embodiment, the pre-stored mapping relationship between the distribution feature and the second encoding mode or the pre-stored mapping relationship between the location of the target coding unit and the second encoding mode is obtained based on machine learning.
在一实施例中,所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。In an embodiment, the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
在一实施例中,所述变长编码模式包括至少两个码表。In one embodiment, the variable length coding mode includes at least two code tables.
所述对所述第二编码信息进行解码,还包括:当所述第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述第二编码信息中的不同码字进行解码。The decoding of the second encoding information further includes: when the second encoding mode is a variable-length encoding mode, using the at least two code tables to respectively decode different code words in the second encoding information to decode.
在一实施例中,所述已编码的码流还包括第三编码信息。In an embodiment, the encoded code stream further includes third encoding information.
所述方法还包括:对所述第三编码信息进行解码,获取所述频率系数的符号。The method further includes: decoding the third encoded information to obtain the sign of the frequency coefficient.
在一实施例中,所述方法还包括:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息。In an embodiment, the method further includes: acquiring the first encoding information from a first position of the encoded code stream, and acquiring the second encoding information from a second position of the encoded code stream encoding information.
所述对第一编码信息进行解码以及所述对第二编码信息进行解码,包括:对所述第一编码信息和所述第二编码信息进行同步解码。The decoding of the first encoded information and the decoding of the second encoded information include: synchronously decoding the first encoded information and the second encoded information.
在一实施例中,所述方法还包括:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息或第三码流。In an embodiment, the method further includes: acquiring the first encoding information from a first position of the encoded code stream, and acquiring the second encoding information from a second position of the encoded code stream Encoded information or third stream.
所述对第一编码信息进行解码以及所述对第二编码信息进行解码,包括:对所述第一编码信息和所述第二编码信息进行同步解码;或者,The decoding of the first encoded information and the decoding of the second encoded information include: synchronously decoding the first encoded information and the second encoded information; or,
所述对第一编码信息进行解码以及所述对第三编码信息进行解码,包括:对所述第一编码信息和所述第三编码信息进行同步解码。The decoding of the first encoded information and the decoding of the third encoded information include: synchronous decoding of the first encoded information and the third encoded information.
在一实施例中,所述第一位置和所述第二位置中的一者为所述已编码的码流的头部位置,另一者为所述已编码的码流的尾部位置。In one embodiment, one of the first position and the second position is the head position of the encoded code stream, and the other is the tail position of the encoded code stream.
在一实施例中,所述解码后的图像基于对所述多个频率系数进行逆小波变换后得到。In one embodiment, the decoded image is obtained by performing inverse wavelet transform on the plurality of frequency coefficients.
在一实施例中,所述解码后的图像基于对所述多个频率系数进行逆小波变换后,再进行前后翻转得到。In one embodiment, the decoded image is obtained by performing inverse wavelet transform on the plurality of frequency coefficients, and then performing front-to-back inversion.
相应的,请参阅图14,本申请实施例还提供了一种图像编码装置12,包括:Correspondingly, referring to FIG. 14 , an embodiment of the present application further provides an image encoding apparatus 12, including:
处理器121; processor 121;
用于存储处理器121可执行指令的存储器122; memory 122 for storing instructions executable by processor 121;
其中,所述处理器调用所述可执行指令,当可执行指令被执行时,用于执行:Wherein, the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
获取待编码图像块的多个频率系数;Obtain multiple frequency coefficients of the image block to be encoded;
根据关于所述多个频率系数的位平面,获得一个或多个系数块;所述系数块包括至少一个频率系数的二进制比特位;obtaining one or more blocks of coefficients from the bit planes for the plurality of frequency coefficients; the blocks of coefficients comprising binary bits of at least one frequency coefficient;
确定各个所述系数块中首个非零位平面的位置信息;determining the position information of the first non-zero bit plane in each of the coefficient blocks;
对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息; 以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息;encoding the position information of the first non-zero bit plane of each of the coefficient blocks, to generate first encoding information; encoding to generate second encoding information;
根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编码的码流。According to the first encoding information and the second encoding information, an encoded code stream of the image block to be encoded is generated.
这里描述的各种实施方式可以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施。对于软件实施,诸如过程或功能的实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以由以任何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器中并且由控制器执行。The various embodiments described herein can be implemented using computer readable media such as computer software, hardware, or any combination thereof. For hardware implementation, the embodiments described herein can be implemented using application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays ( FPGA), processors, controllers, microcontrollers, microprocessors, electronic units designed to perform the functions described herein are implemented. For software implementation, embodiments such as procedures or functions may be implemented with separate software modules that allow the performance of at least one function or operation. The software codes may be implemented by a software application (or program) written in any suitable programming language, which may be stored in memory and executed by a controller.
本领域技术人员可以理解,图14仅仅是图像编码装置12的示例,并不构成对图像编码装置12的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如设备还可以包括输入输出设备、网络接入设备、总线等。Those skilled in the art can understand that FIG. 14 is only an example of the image coding apparatus 12, and does not constitute a limitation to the image coding apparatus 12, and may include more or less components than the one shown, or combine some components, or different Components, such as devices, may also include input and output devices, network access devices, buses, and the like.
在一实施例中,所述处理器121还用于:从至少两种第一编码模式中选择目标编码模式,并使用所述目标编码模式对各个所述系数块的首个非零位平面的位置信息进行编码;以及,所述生成关于所述待编码图像块的已编码的码流,还包括:对所述目标编码模式进行编码。In one embodiment, the processor 121 is further configured to: select a target encoding mode from at least two first encoding modes, and use the target encoding mode to perform a calculation on the first non-zero bit plane of each of the coefficient blocks. encoding the position information; and, the generating an encoded code stream for the image block to be encoded further includes: encoding the target encoding mode.
在一实施例中,所述至少两种第一编码模式包括至少一种使用码表编码的模式和/或至少一种预测编码模式。In one embodiment, the at least two first encoding modes include at least one encoding mode using a code table and/or at least one predictive encoding mode.
在一实施例中,所述码表根据所述待编码图像块的估计的采集场景所确定;或者,所述码表根据与所述估计的采集场景相关的参考图像块的图像信息的分布特征所确定;或者,所述码表根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定。In one embodiment, the code table is determined according to the estimated acquisition scene of the image block to be encoded; or, the code table is determined according to the distribution characteristics of the image information of the reference image block related to the estimated acquisition scene or, the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
在一实施例中,不同采集场景对应的码表不同,或者,所述参考图像块的图像信息的不同分布特征对应的码表不同;或者,所述参考图像块对应的各个系数块中首个非零位平面的位置信息的不同分布特征对应的码表不同。In one embodiment, the code tables corresponding to different acquisition scenarios are different, or, the code tables corresponding to different distribution characteristics of the image information of the reference image block are different; or, the first one of the coefficient blocks corresponding to the reference image block is The code tables corresponding to different distribution characteristics of the position information of the non-zero bit plane are different.
在一实施例中,所述多个频率系数为将所述待编码图像块从时域变换至频域后产生的;其中,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带;所述第一频率系数和所述 第二频率系数均对应有所述至少两种第一编码模式。In an embodiment, the plurality of frequency coefficients are generated after transforming the image block to be encoded from the time domain to the frequency domain; wherein the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain respectively; the first frequency coefficient and the second frequency coefficient both correspond to the at least two first coding modes .
在一实施例中,在所述使用码表编码的模式中,不同的子带对应有不同的码表。In one embodiment, in the encoding mode using the code table, different sub-bands correspond to different code tables.
在一实施例中,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述至少两种第一编码模式。In an embodiment, the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, at least one of the multiple bit planes corresponding to the different color components The at least two first encoding modes correspond to each other.
在一实施例中,多个所述不同颜色分量对应的位平面包括Y分量的位平面、U分量的位平面和V分量的位平面;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。In an embodiment, a plurality of bit planes corresponding to the different color components include a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include: The bit plane of the R component, the bit plane of the G component, and the bit plane of the B component.
在一实施例中,所述处理器121还用于:基于所述至少两种第一编码模式中的每种第一编码模式分别对各个所述系数块的首个非零位平面的位置信息进行编码,获得至少两个编码结果;将所述至少两个编码结果中最优的编码结果对应的第一编码模式确定为所述目标编码模式In an embodiment, the processor 121 is further configured to: based on each of the at least two first encoding modes, respectively, for the position information of the first non-zero bit plane of each of the coefficient blocks Encoding is performed to obtain at least two encoding results; the first encoding mode corresponding to the optimal encoding result in the at least two encoding results is determined as the target encoding mode
在一实施例中,在所述系数块中,从首个非零位平面开始,将所述系数块中同一个位平面的所有比特位作为一个编码单元。In an embodiment, in the coefficient block, starting from the first non-zero bit plane, all bits of the same bit plane in the coefficient block are regarded as one coding unit.
所述处理器121还用于:根据预定码率所指示的目标编码长度,按照预定的扫描顺序从所述编码单元中确定目标编码单元;所述目标编码单元指示所述编码单元中需要被编码的对象;对所述目标编码单元进行编码,生成所述第二编码信息;对最后一个目标编码单元的位置信息进行编码。The processor 121 is further configured to: determine a target coding unit from the coding units according to a predetermined scanning order according to a target coding length indicated by a predetermined code rate; the target coding unit indicates that the coding unit needs to be coded encoding the target coding unit to generate the second coding information; and coding the position information of the last target coding unit.
在一实施例中,所述处理器121还用于:按照预定的扫描顺序依次确定所述编码单元的编码长度;根据所述目标编码长度以及所述编码单元的编码长度,从所述编码单元中确定目标编码单元的数量。In one embodiment, the processor 121 is further configured to: sequentially determine the encoding length of the encoding unit according to a predetermined scanning order; Determines the number of target coding units in .
在一实施例中,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合扫描的顺序。In an embodiment, the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components; The order in which the coding units are scanned for blending.
在一实施例中,所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。In one embodiment, the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit-plane to the least significant bit-plane.
在一实施例中,所述处理器121还用于:根据所述目标编码单元对应的第二编码模式对该目标编码单元进行编码。In an embodiment, the processor 121 is further configured to: encode the target coding unit according to the second coding mode corresponding to the target coding unit.
在一实施例中,所述目标编码单元对应的第二编码模式根据所述目标编码单元的分布特征确定;或者,所述目标编码单元对应的第二编码模式根据所述目标编码单元所处的位置所确定。In one embodiment, the second coding mode corresponding to the target coding unit is determined according to the distribution characteristics of the target coding unit; or, the second coding mode corresponding to the target coding unit is determined according to the location of the target coding unit. determined by the location.
在一实施例中,所述目标编码单元对应的第二编码模式根据该目标编码单元的分布特征以及预存的分布特征与第二编码模式的映射关系所确定;或者,所述目标编码单元对应的第二编码模式根据所述目标编码单元所处的位置以及预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系所确定。In one embodiment, the second coding mode corresponding to the target coding unit is determined according to the distribution feature of the target coding unit and the mapping relationship between the pre-stored distribution feature and the second coding mode; The second encoding mode is determined according to the location of the target encoding unit and the pre-stored mapping relationship between the location of the target encoding unit and the second encoding mode.
在一实施例中,所述目标编码单元所处的位置至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。In an embodiment, the location where the target coding unit is located includes at least one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subband to which the target coding unit belongs.
在一实施例中,所述预存的分布特征与第二编码模式的映射关系或者所述预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系基于机器学习而得到。In an embodiment, the pre-stored mapping relationship between the distribution feature and the second encoding mode or the pre-stored mapping relationship between the location of the target coding unit and the second encoding mode is obtained based on machine learning.
在一实施例中,所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。In an embodiment, the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
在一实施例中,所述至少两种变长编码模式中的每一种均包括至少两个码表;所述处理器121还用于:当所述目标编码单元对应的第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述目标编码单元的不同比特位进行编码。In an embodiment, each of the at least two variable-length encoding modes includes at least two code tables; the processor 121 is further configured to: when the second encoding mode corresponding to the target encoding unit is: In the variable-length coding mode, the at least two code tables are used to encode different bits of the target coding unit respectively.
在一实施例中,所述处理器121还用于:若所述目标编码单元的剩余比特被编码后的长度无法满足所述预定的码率指示的编码长度,则根据所述目标编码单元的编码长度添加预设数据。In an embodiment, the processor 121 is further configured to: if the encoded length of the remaining bits of the target coding unit cannot meet the coding length indicated by the predetermined code rate, then according to the encoding length of the target coding unit Preset data is added to the encoding length.
在一实施例中,所述处理器121还用于:将所述多个频率系数分解为关于所述多个频率系数的符号和关于所述多个频率系数的绝对值;In an embodiment, the processor 121 is further configured to: decompose the plurality of frequency coefficients into signs of the plurality of frequency coefficients and absolute values of the plurality of frequency coefficients;
根据所述多个频率系数的绝对值,确定关于所述多个频率系数的位平面;determining a bit plane with respect to the plurality of frequency coefficients according to the absolute values of the plurality of frequency coefficients;
以所述系数块为单位,对所述多个频率系数的符号进行编码,生成第三编码信息。Using the coefficient block as a unit, the symbols of the plurality of frequency coefficients are encoded to generate third encoded information.
在一实施例中,所述处理器121还用于:对不为0的频率系数的符号进行编码。In an embodiment, the processor 121 is further configured to: encode the sign of the frequency coefficient that is not 0.
在一实施例中,在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息位于所述已编码的码流中的第二位置。In an embodiment, in the encoded code stream about the image block to be encoded, the first encoding information is located at a first position in the encoded code stream, and the second encoding information is located at a first position in the encoded code stream. at a second position in the encoded codestream.
所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。The first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
在一实施例中,在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息以及所述第三编码信息位于所述已编码的码流中的第二位置。In an embodiment, in the encoded code stream about the image block to be encoded, the first encoding information is located at a first position in the encoded code stream, and the second encoding information is located at a first position in the encoded code stream. and the third encoding information is located at a second position in the encoded code stream.
所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。The first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
在一实施例中,所述多个频率系数基于对所述待编码图像块进行小波变换之后产生。In an embodiment, the plurality of frequency coefficients are generated based on wavelet transform of the image block to be encoded.
在一实施例中,所述多个频率系数基于对前后翻转后的待编码图像进行小波变换之后产生。In an embodiment, the plurality of frequency coefficients are generated based on wavelet transform of the image to be encoded after being flipped back and forth.
相应的,本申请实施例还提供了一种图像解码装置,包括:Correspondingly, the embodiments of the present application also provide an image decoding apparatus, including:
处理器;processor;
用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
其中,所述处理器调用所述可执行指令,当可执行指令被执行时,用于执行:Wherein, the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:
获取已编码的码流,所述已编码的码流包括第一编码信息以及第二编码信息;obtaining an encoded code stream, where the encoded code stream includes first encoding information and second encoding information;
对所述第一编码信息进行解码,获取各个系数块的首个非零位平面的位置信息;以及,对所述第二编码信息进行解码,获取各个所述系数块中从首个非零位平面开始的各个位平面上的比特位;Decoding the first encoding information to obtain the position information of the first non-zero bit plane of each coefficient block; and decoding the second encoding information to obtain the first non-zero bit plane from the coefficient block in each coefficient block Bits on each bit plane at the beginning of the plane;
根据各个系数块的首个非零位平面的位置信息以及各个所述系数块中从首个非零位平面开始的各个位平面上的比特位,在位平面上获取多个频率系数;According to the position information of the first non-zero bit plane of each coefficient block and the bits on each bit plane starting from the first non-zero bit plane in each of the coefficient blocks, obtain a plurality of frequency coefficients on the bit plane;
通过所述多个频率系数获取解码后的图像块。The decoded image block is obtained by using the plurality of frequency coefficients.
在一实施例中,所述已编码的码流包括有生成所述第一编码信息对应的目标编码模式。In an embodiment, the encoded code stream includes a target encoding mode corresponding to the generation of the first encoding information.
所述处理器还用于:根据所述目标编码模式对所述第一编码信息进行解码。The processor is further configured to: decode the first encoding information according to the target encoding mode.
在一实施例中,所述目标编码模式为以下其中一种:至少一种使用码表编码的模式和/或至少一种预测编码模式。In an embodiment, the target encoding mode is one of the following: at least one mode using code table encoding and/or at least one predictive encoding mode.
在一实施例中,在所述使用码表编码的模式中,所述码表根据所述解码后的图像块的估计的采集场景所确定;或者,所述码表根据与所述估计的采集场景相关的参考图像块的图像信息的分布特征所确定;或者,所述码表根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定。In an embodiment, in the mode of encoding using a code table, the code table is determined according to an estimated acquisition scene of the decoded image block; or the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
在一实施例中,不同采集场景对应的码表不同,或者,所述参考图像块的图像信息的不同分布特征对应的码表不同;或者,所述参考图像块对应的各个系数块中首个非零位平面的位置信息的不同分布特征对应的码表不同。In one embodiment, the code tables corresponding to different acquisition scenarios are different, or, the code tables corresponding to different distribution characteristics of the image information of the reference image block are different; or, the first one of the coefficient blocks corresponding to the reference image block is The code tables corresponding to different distribution characteristics of the position information of the non-zero bit plane are different.
在一实施例中,所述多个频率系数为将所述待编码图像块从时域变换至频域后产生的;其中,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带;所述第一频率系数和所述 第二频率系数均对应有所述目标编码模式。In an embodiment, the plurality of frequency coefficients are generated after transforming the image block to be encoded from the time domain to the frequency domain; wherein the plurality of frequency coefficients include a first frequency coefficient and a second frequency coefficient, In addition, the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain, respectively; the first frequency coefficient and the second frequency coefficient both correspond to the target coding mode.
在一实施例中,如果所述目标编码模式为所述使用码表编码的模式,不同的子带对应有不同的码表。In one embodiment, if the target encoding mode is the mode using the code table encoding, different subbands correspond to different code tables.
在一实施例中,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述目标编码模式。In an embodiment, the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, at least one of the multiple bit planes corresponding to the different color components Corresponding to the target encoding mode.
在一实施例中,多个所述不同颜色分量对应的位平面包括Y分量的位平面、U分量的位平面和V分量的位平面;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。In an embodiment, a plurality of bit planes corresponding to the different color components include a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component; or, the plurality of bit planes corresponding to the different color components include: The bit plane of the R component, the bit plane of the G component, and the bit plane of the B component.
在一实施例中,在编码过程中,在所述系数块中,从首个非零位平面开始,将所述系数块中同一个位平面的所有比特位作为一个编码单元。In an embodiment, in the encoding process, in the coefficient block, starting from the first non-zero bit plane, all bits of the same bit plane in the coefficient block are taken as one coding unit.
所述已编码的码流还包括有最后一个目标编码单元的位置信息;所述目标编码单元指示所述编码单元中需要被编码的对象。The encoded code stream further includes position information of the last target coding unit; the target coding unit indicates the object to be encoded in the coding unit.
所述处理器还用于:根据所述最后一个目标编码单元的位置信息从所述已编码的码流中获取所述第二编码信息。The processor is further configured to: obtain the second encoding information from the encoded code stream according to the position information of the last target encoding unit.
在一实施例中,所述目标编码单元由编码端按照预定的扫描顺序对所述编码单元进行扫描后确定。In an embodiment, the target coding unit is determined by the coding end after scanning the coding unit according to a predetermined scanning order.
在一实施例中,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合扫描的顺序。In an embodiment, the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components; The order in which the coding units are scanned for blending.
在一实施例中,所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。In one embodiment, the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit-plane to the least significant bit-plane.
在一实施例中,所述处理器还用于:根据所述第二编码信息对应的第二编码模式对所述第二编码信息进行解码,获得目标编码单元。In an embodiment, the processor is further configured to: decode the second encoding information according to a second encoding mode corresponding to the second encoding information to obtain a target encoding unit.
在一实施例中,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征确定;或者,所述第二编码模式根据所述目标编码单元所处的位置所确定。In an embodiment, during the encoding process, the second encoding mode is determined according to the distribution characteristics of the target coding unit; or, the second encoding mode is determined according to the position where the target coding unit is located.
在一实施例中,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征以及预存的分布特征与第二编码模式的映射关系所确定;或者,所述第二编码模式根据所述目标编码单元所处的位置以及预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系所确定。In one embodiment, during the encoding process, the second encoding mode is determined according to the distribution characteristics of the target coding unit and the mapping relationship between the pre-stored distribution characteristics and the second encoding mode; or, the second encoding mode It is determined according to the position of the target coding unit and the pre-stored mapping relationship between the position of the target coding unit and the second coding mode.
在一实施例中,所述目标编码单元所处的位置至少包括以下任一:所述目标编码 单元对应的位平面的位深或者所述目标编码单元所属子带。In an embodiment, the position where the target coding unit is located includes at least any one of the following: the bit depth of the bit plane corresponding to the target coding unit or the subband to which the target coding unit belongs.
在一实施例中,所述预存的分布特征与第二编码模式的映射关系或者所述预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系基于机器学习而得到。In an embodiment, the pre-stored mapping relationship between the distribution feature and the second encoding mode or the pre-stored mapping relationship between the location of the target coding unit and the second encoding mode is obtained based on machine learning.
在一实施例中,所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。In an embodiment, the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
在一实施例中,所述变长编码模式包括至少两个码表。In one embodiment, the variable length coding mode includes at least two code tables.
所述处理器还用于:当所述第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述第二编码信息中的不同码字进行解码。The processor is further configured to: when the second encoding mode is a variable-length encoding mode, use the at least two code tables to respectively decode different code words in the second encoding information.
在一实施例中,所述已编码的码流还包括第三编码信息。In an embodiment, the encoded code stream further includes third encoding information.
所述处理器还用于:对所述第三编码信息进行解码,获取所述频率系数的符号。The processor is further configured to: decode the third encoded information to obtain the sign of the frequency coefficient.
在一实施例中,所述处理器还用于:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息;对所述第一编码信息和所述第二编码信息进行同步解码。In an embodiment, the processor is further configured to: obtain the first encoding information from a first position of the encoded code stream, and obtain the first encoding information from a second position of the encoded code stream second encoding information; synchronously decoding the first encoding information and the second encoding information.
在一实施例中,所述处理器还用于:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息或第三码流;In an embodiment, the processor is further configured to: obtain the first encoding information from a first position of the encoded code stream, and obtain the first encoding information from a second position of the encoded code stream the second encoded information or the third code stream;
对所述第一编码信息和所述第二编码信息进行同步解码;或者,对所述第一编码信息和所述第三编码信息进行同步解码。Perform synchronous decoding on the first encoded information and the second encoded information; or perform synchronous decoding on the first encoded information and the third encoded information.
在一实施例中,所述第一位置和所述第二位置中的一者为所述已编码的码流的头部位置,另一者为所述已编码的码流的尾部位置。In one embodiment, one of the first position and the second position is the head position of the encoded code stream, and the other is the tail position of the encoded code stream.
相应的,请参阅图1,本申请实施例还提供了一种图像处理系统,包括图像处理模块、上述提到的图像编码装置、上述提到的图像解码装置以及存储器;Correspondingly, referring to FIG. 1 , an embodiment of the present application further provides an image processing system, including an image processing module, the above-mentioned image encoding apparatus, the above-mentioned image decoding apparatus, and a memory;
所述图像处理模块用于对图像进行处理,并将处理后的图像传输给所述图像编码装置;The image processing module is used to process the image, and transmit the processed image to the image encoding device;
所述图像编码装置用于将所述处理后的图像划分成多个待编码图像块之后,对所述待编码图像块进行压缩编码处理,生成已编码的码流;The image encoding device is configured to, after dividing the processed image into a plurality of image blocks to be encoded, perform compression encoding processing on the image blocks to be encoded to generate an encoded code stream;
所述存储器用于存储所述已编码的码流;the memory is used for storing the encoded code stream;
所述图像解码装置用于对所述已编码的码流进行解码,并将解码后的结果传输给所述图像处理模块。The image decoding device is configured to decode the encoded code stream, and transmit the decoded result to the image processing module.
相应的,本申请实施例还提供了一种可移动平台,包括上述的图像编码装置;或者,包括上述的图像处理系统。Correspondingly, an embodiment of the present application further provides a movable platform, including the above-mentioned image encoding apparatus; or, including the above-mentioned image processing system.
其中,所述可移动平台至少包括无人飞行器、无人驾驶车辆或者移动机器人。Wherein, the movable platform includes at least an unmanned aerial vehicle, an unmanned vehicle or a mobile robot.
相应的,请参阅图2,本申请实施例还提供了一种图传系统,包括图像发射器以及图像接收器;其中,所述图像发射器包括上述的图像编码装置,所述图像接收器包括上述的图像解码装置;Correspondingly, referring to FIG. 2 , an embodiment of the present application further provides an image transmission system, including an image transmitter and an image receiver; wherein the image transmitter includes the above-mentioned image encoding apparatus, and the image receiver includes The above-mentioned image decoding device;
所述图像发射器用于将所述图像编码装置编码后产生的已编码的码流发送给所述图像接收器;The image transmitter is configured to send the encoded code stream generated after encoding by the image encoding device to the image receiver;
所述图像接收器用于在接收所述已编码的码流之后,使用所述图像解码装置对所述已编码的码流进行解码。The image receiver is configured to use the image decoding device to decode the encoded code stream after receiving the encoded code stream.
上述各个模块的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For details of the implementation process of the functions and functions of the above-mentioned modules, please refer to the implementation process of the corresponding steps in the above method, which will not be repeated here.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器,上述指令可由装置的处理器执行以完成上述方法。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as a memory including instructions, executable by a processor of an apparatus to perform the above-described method. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
一种非临时性计算机可读存储介质,其上存储有计算机指令,当存储介质中的指令由图像编码装置的处理器执行时,能够执行上述图像编码方法;或者,当存储介质中的指令由图像解码装置的处理器执行时,能够执行上述图像解码方法。A non-transitory computer-readable storage medium on which computer instructions are stored, when the instructions in the storage medium are executed by a processor of an image encoding device, the above-mentioned image encoding method can be executed; or, when the instructions in the storage medium are executed by When executed by the processor of the image decoding apparatus, the above-described image decoding method can be executed.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. The terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion such that a process, method, article or device comprising a list of elements includes not only those elements, but also other not expressly listed elements, or also include elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
以上对本申请实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The methods and devices provided by the embodiments of the present application have been introduced in detail above, and specific examples are used to illustrate the principles and implementations of the present application. At the same time, for those of ordinary skill in the art, according to the idea of the application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as a limitation to the application. .
Claims (112)
- 一种图像编码方法,其特征在于,包括:An image coding method, comprising:获取待编码图像块的多个频率系数;Obtain multiple frequency coefficients of the image block to be encoded;根据关于所述多个频率系数的位平面,获得一个或多个系数块;所述系数块包括至少一个频率系数的二进制比特位;obtaining one or more blocks of coefficients from the bit planes for the plurality of frequency coefficients; the blocks of coefficients comprising binary bits of at least one frequency coefficient;确定各个所述系数块中首个非零位平面的位置信息;determining the position information of the first non-zero bit plane in each of the coefficient blocks;对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息;以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息;encoding the position information of the first non-zero bit plane of each of the coefficient blocks, to generate first encoding information; encoding to generate second encoding information;根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编码的码流。According to the first encoding information and the second encoding information, an encoded code stream of the image block to be encoded is generated.
- 根据权利要求1所述的方法,其特征在于,所述对各个所述系数块的首个非零位平面的位置信息进行编码,包括:The method according to claim 1, wherein the encoding the position information of the first non-zero bit plane of each of the coefficient blocks comprises:从至少两种第一编码模式中选择目标编码模式,并使用所述目标编码模式对各个所述系数块的首个非零位平面的位置信息进行编码;以及,selecting a target encoding mode from at least two first encoding modes, and encoding the position information of the first non-zero bit plane of each of the coefficient blocks using the target encoding mode; and,所述生成关于所述待编码图像块的已编码的码流,还包括:对所述目标编码模式进行编码。The generating an encoded code stream for the image block to be encoded further includes: encoding the target encoding mode.
- 根据权利要求2所述的方法,其特征在于,所述至少两种第一编码模式包括至少一种使用码表编码的模式和/或至少一种预测编码模式。The method according to claim 2, wherein the at least two first encoding modes include at least one mode using code table encoding and/or at least one predictive encoding mode.
- 根据权利要求3所述的方法,其特征在于,所述码表根据所述待编码图像块的估计的采集场景所确定;或者,所述码表根据与所述估计的采集场景相关的参考图像块的图像信息的分布特征所确定;或者,所述码表根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定。The method according to claim 3, wherein the code table is determined according to an estimated acquisition scene of the image block to be encoded; or, the code table is determined according to a reference image related to the estimated acquisition scene or the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
- 根据权利要求4所述的方法,其特征在于,不同采集场景对应的码表不同,或者,所述参考图像块的图像信息的不同分布特征对应的码表不同;或者,所述参考图像块对应的各个系数块中首个非零位平面的位置信息的不同分布特征对应的码表不同。The method according to claim 4, wherein the code tables corresponding to different collection scenarios are different, or the code tables corresponding to different distribution characteristics of the image information of the reference image blocks are different; or, the reference image blocks correspond to The code tables corresponding to the different distribution characteristics of the position information of the first non-zero bit plane in each coefficient block of , are different.
- 根据权利要求3所述的方法,其特征在于,所述多个频率系数为将所述待编码图像块从时域变换至频域后产生的;其中,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带;The method according to claim 3, wherein the plurality of frequency coefficients are generated after transforming the to-be-coded image block from the time domain to the frequency domain; wherein the plurality of frequency coefficients comprise a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain respectively;所述第一频率系数和所述第二频率系数均对应有所述至少两种第一编码模式。Both the first frequency coefficient and the second frequency coefficient correspond to the at least two first coding modes.
- 根据权利要求6所述的方法,其特征在于,在所述使用码表编码的模式中,不同的子带对应有不同的码表。The method according to claim 6, characterized in that, in the encoding mode using a code table, different sub-bands correspond to different code tables.
- 根据权利要求2所述的方法,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述至少两种第一编码模式。The method according to claim 2, wherein the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, the multiple different color components correspond to At least one of the bit planes corresponds to the at least two first coding modes.
- 根据权利要求8所述的方法,其特征在于,多个所述不同颜色分量对应的位平面包括Y分量的位平面、U分量的位平面和V分量的位平面;The method according to claim 8, wherein the plurality of bit planes corresponding to the different color components comprise a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。Alternatively, the plurality of bit planes corresponding to the different color components include a bit plane of the R component, a bit plane of the G component, and a bit plane of the B component.
- 根据权利要求2所述的方法,其特征在于,所述从至少两种第一编码模式中选择目标编码模式,包括:The method according to claim 2, wherein the selecting a target encoding mode from at least two first encoding modes comprises:基于所述至少两种第一编码模式中的每种第一编码模式分别对各个所述系数块的首个非零位平面的位置信息进行编码,获得至少两个编码结果;encoding the position information of the first non-zero bit plane of each of the coefficient blocks based on each of the at least two first encoding modes, to obtain at least two encoding results;将所述至少两个编码结果中最优的编码结果对应的第一编码模式确定为所述目标编码模式。A first encoding mode corresponding to an optimal encoding result among the at least two encoding results is determined as the target encoding mode.
- 根据权利要求1所述的方法,其特征在于,在所述系数块中,从首个非零位平面开始,将所述系数块中同一个位平面的所有比特位作为一个编码单元;The method according to claim 1, wherein, in the coefficient block, starting from the first non-zero bit plane, all bits of the same bit plane in the coefficient block are used as a coding unit;所述对各个所述系数块中从首个非零位平面开始的各个位平面进行编码,包括:The encoding of each bit plane starting from the first non-zero bit plane in each of the coefficient blocks includes:根据预定码率所指示的目标编码长度,按照预定的扫描顺序从所述编码单元中确定目标编码单元;所述目标编码单元指示所述编码单元中需要被编码的对象;According to the target coding length indicated by the predetermined code rate, a target coding unit is determined from the coding units according to a predetermined scanning order; the target coding unit indicates the object to be coded in the coding unit;对所述目标编码单元进行编码,生成所述第二编码信息;encoding the target encoding unit to generate the second encoding information;所述生成关于所述待编码图像块的已编码的码流,还包括:对最后一个目标编码单元的位置信息进行编码。The generating an encoded code stream about the to-be-encoded image block further includes: encoding the position information of the last target coding unit.
- 根据权利要求11所述的方法,其特征在于,所述根据预定码率所指示的目标编码长度,按照预定的扫描顺序从所述编码单元中确定目标编码单元,包括:The method according to claim 11, wherein the determining a target coding unit from the coding units according to a predetermined scanning order according to a target coding length indicated by a predetermined code rate comprises:按照预定的扫描顺序依次确定所述编码单元的编码长度;Determine the coding length of the coding unit sequentially according to a predetermined scanning order;根据所述目标编码长度以及所述编码单元的编码长度,从所述编码单元中确定目标编码单元的数量。The number of target coding units is determined from the coding units according to the target coding length and the coding length of the coding units.
- 根据权利要求11所述的方法,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;The method according to claim 11, wherein the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components;所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合扫描 的顺序。The predetermined scanning order indicates an order in which the plurality of coding units corresponding to the different color components are mixed and scanned.
- 根据权利要求11所述的方法,所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。The method of claim 11, wherein the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit-plane to the least significant bit-plane.
- 根据权利要求11所述的方法,其特征在于,所述对所述目标编码单元进行编码,包括:The method according to claim 11, wherein the encoding the target coding unit comprises:根据所述目标编码单元对应的第二编码模式对该目标编码单元进行编码。The target coding unit is coded according to the second coding mode corresponding to the target coding unit.
- 根据权利要求15所述的方法,其特征在于,所述目标编码单元对应的第二编码模式根据所述目标编码单元的分布特征确定;The method according to claim 15, wherein the second coding mode corresponding to the target coding unit is determined according to distribution characteristics of the target coding unit;或者,所述目标编码单元对应的第二编码模式根据所述目标编码单元所处的位置所确定。Or, the second coding mode corresponding to the target coding unit is determined according to the position where the target coding unit is located.
- 根据权利要求16所述的方法,其特征在于,所述目标编码单元对应的第二编码模式根据该目标编码单元的分布特征以及预存的分布特征与第二编码模式的映射关系所确定;The method according to claim 16, wherein the second coding mode corresponding to the target coding unit is determined according to the distribution feature of the target coding unit and the mapping relationship between the pre-stored distribution feature and the second coding mode;或者,所述目标编码单元对应的第二编码模式根据所述目标编码单元所处的位置以及预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系所确定。Alternatively, the second encoding mode corresponding to the target coding unit is determined according to the position of the target coding unit and a pre-stored mapping relationship between the position of the target coding unit and the second encoding mode.
- 根据权利要求16或17所述的方法,其特征在于,所述目标编码单元所处的位置至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。The method according to claim 16 or 17, wherein the position where the target coding unit is located includes at least any one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subclass to which the target coding unit belongs. bring.
- 根据权利要求17所述的方法,其特征在于,所述预存的分布特征与第二编码模式的映射关系或者所述预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系基于机器学习而得到。The method according to claim 17, wherein the pre-stored mapping relationship between the distribution feature and the second coding mode or the pre-stored mapping relationship between the location of the target coding unit and the second coding mode based on machine learning.
- 根据权利要求15所述的方法,其特征在于,所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。The method according to claim 15, wherein the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- 根据权利要求20所述的方法,其特征在于,所述至少两种变长编码模式中的每一种均包括至少两个码表;The method of claim 20, wherein each of the at least two variable-length encoding modes includes at least two code tables;所述根据所述目标编码单元对应的第二编码模式对该目标编码单元进行编码,包括:The encoding of the target encoding unit according to the second encoding mode corresponding to the target encoding unit includes:当所述目标编码单元对应的第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述目标编码单元的不同比特位进行编码。When the second coding mode corresponding to the target coding unit is a variable-length coding mode, the at least two code tables are used to respectively encode different bits of the target coding unit.
- 根据权利要求11所述的方法,其特征在于,还包括:The method of claim 11, further comprising:若所述目标编码单元的剩余比特被编码后的长度无法满足所述预定的码率指示的 编码长度,则根据所述目标编码单元的编码长度添加预设数据。If the coded length of the remaining bits of the target coding unit cannot meet the coding length indicated by the predetermined code rate, preset data is added according to the coding length of the target coding unit.
- 根据权利要求1所述的方法,其特征在于,所述关于所述多个频率系数的位平面通过以下方式确定:The method according to claim 1, wherein the bit plane with respect to the plurality of frequency coefficients is determined in the following manner:将所述多个频率系数分解为关于所述多个频率系数的符号和关于所述多个频率系数的绝对值;decomposing the plurality of frequency coefficients into signs for the plurality of frequency coefficients and absolute values for the plurality of frequency coefficients;根据所述多个频率系数的绝对值,确定关于所述多个频率系数的位平面;determining a bit plane with respect to the plurality of frequency coefficients according to the absolute values of the plurality of frequency coefficients;所述方法还包括:以所述系数块为单位,对所述多个频率系数的符号进行编码,生成第三编码信息。The method further includes: using the coefficient block as a unit, encoding the symbols of the plurality of frequency coefficients to generate third encoding information.
- 根据权利要求23所述的方法,其特征在于,所述对所述多个频率系数的符号进行编码,还包括:The method according to claim 23, wherein the encoding the symbols of the plurality of frequency coefficients further comprises:对不为0的频率系数的符号进行编码。The signs of frequency coefficients that are not zero are encoded.
- 根据权利要求1所述的方法,其特征在于,在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息位于所述已编码的码流中的第二位置;The method according to claim 1, wherein, in the encoded code stream about the image block to be encoded, the first encoding information is located at a first position in the encoded code stream , the second encoding information is located at a second position in the encoded code stream;所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。The first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
- 根据权利要求23所述的方法,其特征在于,在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息以及所述第三编码信息位于所述已编码的码流中的第二位置;The method according to claim 23, wherein, in the encoded code stream about the image block to be encoded, the first encoding information is located at a first position in the encoded code stream , the second encoding information and the third encoding information are located at the second position in the encoded code stream;所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。The first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
- 根据权利要求25或26所述的方法,其特征在于,所述第一位置和所述第二位置中的一者为所述已编码的码流的头部位置,另一者为所述已编码的码流的尾部位置。The method according to claim 25 or 26, wherein one of the first position and the second position is a header position of the encoded code stream, and the other is the encoded code stream. The tail position of the encoded bitstream.
- 根据权利要求1所述的方法,其特征在于,所述多个频率系数基于对所述待编码图像块进行小波变换之后产生。The method according to claim 1, wherein the plurality of frequency coefficients are generated after wavelet transform is performed on the image block to be encoded.
- 根据权利要求28所述的方法,其特征在于,所述多个频率系数基于对前后翻转后的待编码图像进行小波变换之后产生。The method according to claim 28, wherein the plurality of frequency coefficients are generated based on wavelet transform of the image to be encoded after the front and rear flips.
- 一种图像解码方法,其特征在于,包括:An image decoding method, comprising:获取已编码的码流,所述已编码的码流包括第一编码信息以及第二编码信息;obtaining an encoded code stream, where the encoded code stream includes first encoding information and second encoding information;对所述第一编码信息进行解码,获取各个系数块的首个非零位平面的位置信息;以及,对所述第二编码信息进行解码,获取各个所述系数块中从首个非零位平面开始的各个位平面上的比特位;Decoding the first encoding information to obtain the position information of the first non-zero bit plane of each coefficient block; and decoding the second encoding information to obtain the first non-zero bit plane from the coefficient block in each coefficient block Bits on each bit plane at the beginning of the plane;根据各个系数块的首个非零位平面的位置信息以及各个所述系数块中从首个非零位平面开始的各个位平面上的比特位,在位平面上获取多个频率系数;According to the position information of the first non-zero bit plane of each coefficient block and the bits on each bit plane starting from the first non-zero bit plane in each of the coefficient blocks, obtain a plurality of frequency coefficients on the bit plane;通过所述多个频率系数获取解码后的图像块。The decoded image block is obtained by using the plurality of frequency coefficients.
- 根据权利要求30所述的方法,其特征在于,所述已编码的码流包括有生成所述第一编码信息对应的目标编码模式;The method according to claim 30, wherein the encoded code stream includes a target encoding mode corresponding to the generation of the first encoding information;所述对所述第一编码信息进行解码,包括:根据所述目标编码模式对所述第一编码信息进行解码。The decoding the first encoding information includes: decoding the first encoding information according to the target encoding mode.
- 根据权利要求31所述的方法,其特征在于,所述目标编码模式为以下其中一种:至少一种使用码表编码的模式和/或至少一种预测编码模式。The method according to claim 31, wherein the target encoding mode is one of the following: at least one encoding mode using a code table and/or at least one predictive encoding mode.
- 根据权利要求32所述的方法,其特征在于,在所述使用码表编码的模式中,所述码表根据所述解码后的图像块的估计的采集场景所确定;或者,The method according to claim 32, wherein, in the mode of encoding using a code table, the code table is determined according to an estimated acquisition scene of the decoded image block; or,所述码表根据与所述估计的采集场景相关的参考图像块的图像信息的分布特征所确定;或者,The stop table is determined according to the distribution characteristics of the image information of the reference image blocks related to the estimated acquisition scene; or,所述码表根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定。The code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
- 根据权利要求33所述的方法,其特征在于,不同采集场景对应的码表不同,或者,所述参考图像块的图像信息的不同分布特征对应的码表不同;或者,所述参考图像块对应的各个系数块中首个非零位平面的位置信息的不同分布特征对应的码表不同。The method according to claim 33, wherein the code tables corresponding to different collection scenarios are different, or the code tables corresponding to different distribution characteristics of the image information of the reference image blocks are different; or, the reference image blocks correspond to The code tables corresponding to the different distribution characteristics of the position information of the first non-zero bit plane in each coefficient block of , are different.
- 根据权利要求31所述的方法,其特征在于,所述多个频率系数为将所述待编码图像块从时域变换至频域后产生的;其中,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带;The method according to claim 31, wherein the plurality of frequency coefficients are generated after transforming the to-be-coded image block from a time domain to a frequency domain; wherein the plurality of frequency coefficients comprise a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain respectively;所述第一频率系数和所述第二频率系数均对应有所述目标编码模式。Both the first frequency coefficient and the second frequency coefficient correspond to the target coding mode.
- 根据权利要求35所述的方法,其特征在于,如果所述目标编码模式为所述使用码表编码的模式,不同的子带对应有不同的码表。The method according to claim 35, characterized in that, if the target encoding mode is the encoding mode using a code table, different sub-bands correspond to different code tables.
- 根据权利要求31所述的方法,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述目标编码模式。The method according to claim 31, wherein the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, the multiple different color components correspond to At least one of the bit planes corresponds to the target coding mode.
- 根据权利要求37所述的方法,其特征在于,多个所述不同颜色分量对应的位平 面包括Y分量的位平面、U分量的位平面和V分量的位平面;method according to claim 37, is characterized in that, the bit plane corresponding to a plurality of described different color components comprises the bit plane of Y component, the bit plane of U component and the bit plane of V component;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。Alternatively, the plurality of bit planes corresponding to the different color components include a bit plane of the R component, a bit plane of the G component, and a bit plane of the B component.
- 根据权利要求30所述的方法,其特征在于,在编码过程中,在所述系数块中,从首个非零位平面开始,将所述系数块中同一个位平面的所有比特位作为一个编码单元;The method according to claim 30, wherein in the coding process, in the coefficient block, starting from the first non-zero bit plane, all bits of the same bit plane in the coefficient block are taken as one coding unit;所述已编码的码流还包括有最后一个目标编码单元的位置信息;所述目标编码单元指示所述编码单元中需要被编码的对象;The coded code stream also includes the position information of the last target coding unit; the target coding unit indicates the object to be coded in the coding unit;在所述对所述第二编码信息进行解码之前,包括:Before the decoding of the second encoded information, the method includes:根据所述最后一个目标编码单元的位置信息从所述已编码的码流中获取所述第二编码信息。The second encoding information is acquired from the encoded code stream according to the position information of the last target encoding unit.
- 根据权利要求39所述的方法,其特征在于,所述目标编码单元由编码端按照预定的扫描顺序对所述编码单元进行扫描后确定。The method according to claim 39, wherein the target coding unit is determined by the coding end after scanning the coding unit according to a predetermined scanning order.
- 根据权利要求40所述的方法,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;The method of claim 40, wherein the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components;所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合扫描的顺序。The predetermined scanning order indicates an order in which a plurality of coding units corresponding to the different color components are mixedly scanned.
- 根据权利要求40所述的方法,其特征在于,所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。The method according to claim 40, wherein the predetermined scanning order comprises at least an order from low frequency to high frequency and/or an order from the most significant bit bit plane to the least significant bit bit plane.
- 根据权利要求39所述的方法,其特征在于,所述对所述第二编码信息进行解码,还包括:The method according to claim 39, wherein the decoding the second encoded information further comprises:根据所述第二编码信息对应的第二编码模式对所述第二编码信息进行解码,获得目标编码单元。Decode the second encoding information according to the second encoding mode corresponding to the second encoding information to obtain a target coding unit.
- 根据权利要求43所述的方法,其特征在于,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征确定;或者,所述第二编码模式根据所述目标编码单元所处的位置所确定。The method according to claim 43, wherein, in the encoding process, the second encoding mode is determined according to the distribution characteristics of the target encoding unit; or, the second encoding mode is determined according to the target encoding unit. determined by the location.
- 根据权利要求44所述的方法,其特征在于,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征以及预存的分布特征与第二编码模式的映射关系所确定;The method according to claim 44, wherein, in the encoding process, the second encoding mode is determined according to the distribution characteristics of the target coding unit and the mapping relationship between the pre-stored distribution characteristics and the second encoding mode;或者,所述第二编码模式根据所述目标编码单元所处的位置以及预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系所确定。Alternatively, the second coding mode is determined according to the location of the target coding unit and a pre-stored mapping relationship between the location of the target coding unit and the second coding mode.
- 根据权利要求44或45所述的方法,其特征在于,所述目标编码单元所处的位置 至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。The method according to claim 44 or 45, wherein the position where the target coding unit is located includes at least any one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subclass to which the target coding unit belongs. bring.
- 根据权利要求45所述的方法,其特征在于,所述预存的分布特征与第二编码模式的映射关系或者所述预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系基于机器学习而得到。The method according to claim 45, wherein the pre-stored mapping relationship between the distribution feature and the second coding mode or the pre-stored mapping relationship between the location of the target coding unit and the second coding mode based on machine learning.
- 根据权利要求43所述的方法,其特征在于,所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。The method according to claim 43, wherein the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- 根据权利要求48所述的方法,其特征在于,所述变长编码模式包括至少两个码表;The method of claim 48, wherein the variable-length coding mode includes at least two code tables;所述对所述第二编码信息进行解码,还包括:The decoding of the second encoded information further includes:当所述第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述第二编码信息中的不同码字进行解码。When the second encoding mode is a variable-length encoding mode, the at least two code tables are used to decode different code words in the second encoding information respectively.
- 根据权利要求30所述的方法,其特征在于,所述已编码的码流还包括第三编码信息;The method according to claim 30, wherein the encoded code stream further includes third encoding information;所述方法还包括:对所述第三编码信息进行解码,获取所述频率系数的符号。The method further includes: decoding the third encoded information to obtain the sign of the frequency coefficient.
- 根据权利要求30所述的方法,其特征在于,所述方法还包括:The method of claim 30, wherein the method further comprises:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息;Obtaining the first encoding information from a first position of the encoded code stream, and obtaining the second encoding information from a second position of the encoded code stream;所述对第一编码信息进行解码以及所述对第二编码信息进行解码,包括:对所述第一编码信息和所述第二编码信息进行同步解码。The decoding of the first encoded information and the decoding of the second encoded information include: synchronously decoding the first encoded information and the second encoded information.
- 根据权利要求50所述的方法,其特征在于,所述方法还包括:The method of claim 50, wherein the method further comprises:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息或第三码流;Obtain the first encoding information from the first position of the encoded code stream, and obtain the second encoding information or the third code stream from the second position of the encoded code stream;所述对第一编码信息进行解码以及所述对第二编码信息进行解码,包括:对所述第一编码信息和所述第二编码信息进行同步解码;或者,The decoding of the first encoded information and the decoding of the second encoded information include: synchronously decoding the first encoded information and the second encoded information; or,所述对第一编码信息进行解码以及所述对第三编码信息进行解码,包括:对所述第一编码信息和所述第三编码信息进行同步解码。The decoding of the first encoded information and the decoding of the third encoded information include: synchronous decoding of the first encoded information and the third encoded information.
- 根据权利要求51或52所述的方法,其特征在于,所述第一位置和所述第二位置中的一者为所述已编码的码流的头部位置,另一者为所述已编码的码流的尾部位置。The method according to claim 51 or 52, wherein one of the first position and the second position is a header position of the encoded code stream, and the other is the encoded code stream. The tail position of the encoded bitstream.
- 根据权利要求30所述的方法,其特征在于,所述解码后的图像基于对所述多个频率系数进行逆小波变换后得到。The method according to claim 30, wherein the decoded image is obtained by performing inverse wavelet transform on the plurality of frequency coefficients.
- 根据权利要求54所述的方法,其特征在于,所述解码后的图像基于对所述多个频率系数进行逆小波变换后,再进行前后翻转得到。The method according to claim 54, wherein the decoded image is obtained by performing inverse wavelet transform on the plurality of frequency coefficients, and then performing front and rear inversion.
- 一种图像编码装置,其特征在于,包括:An image encoding device, comprising:处理器;processor;用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;其中,所述处理器调用所述可执行指令,当可执行指令被执行时,用于执行:Wherein, the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:获取待编码图像块的多个频率系数;Obtain multiple frequency coefficients of the image block to be encoded;根据关于所述多个频率系数的位平面,获得一个或多个系数块;所述系数块包括至少一个频率系数的二进制比特位;obtaining one or more blocks of coefficients from the bit planes for the plurality of frequency coefficients; the blocks of coefficients comprising binary bits of at least one frequency coefficient;确定各个所述系数块中首个非零位平面的位置信息;determining the position information of the first non-zero bit plane in each of the coefficient blocks;对各个所述系数块的首个非零位平面的位置信息进行编码,生成第一编码信息;以及,对各个所述系数块中从首个非零位平面开始的各个位平面上的比特位进行编码,生成第二编码信息;encoding the position information of the first non-zero bit plane of each of the coefficient blocks, to generate first encoding information; encoding to generate second encoding information;根据所述第一编码信息和所述第二编码信息,生成关于所述待编码图像块的已编码的码流。According to the first encoding information and the second encoding information, an encoded code stream of the image block to be encoded is generated.
- 根据权利要求56所述的装置,其特征在于,所述处理器还用于:从至少两种第一编码模式中选择目标编码模式,并使用所述目标编码模式对各个所述系数块的首个非零位平面的位置信息进行编码;以及,The apparatus according to claim 56, wherein the processor is further configured to: select a target encoding mode from at least two first encoding modes, and use the target encoding mode to perform a encoding the position information of the non-zero bit planes; and,所述生成关于所述待编码图像块的已编码的码流,还包括:对所述目标编码模式进行编码。The generating an encoded code stream for the image block to be encoded further includes: encoding the target encoding mode.
- 根据权利要求57所述的装置,其特征在于,所述至少两种第一编码模式包括至少一种使用码表编码的模式和/或至少一种预测编码模式。The apparatus of claim 57, wherein the at least two first encoding modes include at least one mode using code table encoding and/or at least one predictive encoding mode.
- 根据权利要求58所述的装置,其特征在于,所述码表根据所述待编码图像块的估计的采集场景所确定;或者,所述码表根据与所述估计的采集场景相关的参考图像块的图像信息的分布特征所确定;或者,所述码表根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定。The apparatus according to claim 58, wherein the code table is determined according to an estimated acquisition scene of the image block to be encoded; or, the code table is determined according to a reference image related to the estimated acquisition scene or the code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
- 根据权利要求59所述的装置,其特征在于,不同采集场景对应的码表不同,或者,所述参考图像块的图像信息的不同分布特征对应的码表不同;或者,所述参考图像块对应的各个系数块中首个非零位平面的位置信息的不同分布特征对应的码表不同。The device according to claim 59, wherein the code tables corresponding to different collection scenarios are different, or the code tables corresponding to different distribution characteristics of the image information of the reference image blocks are different; or, the reference image blocks correspond to The code tables corresponding to the different distribution characteristics of the position information of the first non-zero bit plane in each coefficient block of , are different.
- 根据权利要求58所述的装置,其特征在于,所述多个频率系数为将所述待编码 图像块从时域变换至频域后产生的;其中,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带;The apparatus according to claim 58, wherein the plurality of frequency coefficients are generated after transforming the to-be-coded image block from the time domain to the frequency domain; wherein the plurality of frequency coefficients comprise a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain respectively;所述第一频率系数和所述第二频率系数均对应有所述至少两种第一编码模式。Both the first frequency coefficient and the second frequency coefficient correspond to the at least two first coding modes.
- 根据权利要求61所述的装置,其特征在于,在所述使用码表编码的模式中,不同的子带对应有不同的码表。The apparatus according to claim 61, wherein in the mode of encoding using a code table, different sub-bands correspond to different code tables.
- 根据权利要求57所述的装置,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述至少两种第一编码模式。The apparatus according to claim 57, wherein the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, the multiple different color components correspond to At least one of the bit planes corresponds to the at least two first coding modes.
- 根据权利要求63所述的装置,其特征在于,多个所述不同颜色分量对应的位平面包括Y分量的位平面、U分量的位平面和V分量的位平面;The device according to claim 63, wherein the plurality of bit planes corresponding to the different color components comprise a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。Alternatively, the plurality of bit planes corresponding to the different color components include a bit plane of the R component, a bit plane of the G component, and a bit plane of the B component.
- 根据权利要求57所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 57, wherein the processor is further configured to:基于所述至少两种第一编码模式中的每种第一编码模式分别对各个所述系数块的首个非零位平面的位置信息进行编码,获得至少两个编码结果;encoding the position information of the first non-zero bit plane of each of the coefficient blocks based on each of the at least two first encoding modes, to obtain at least two encoding results;将所述至少两个编码结果中最优的编码结果对应的第一编码模式确定为所述目标编码模式。A first encoding mode corresponding to an optimal encoding result among the at least two encoding results is determined as the target encoding mode.
- 根据权利要求56所述的装置,其特征在于,在所述系数块中,从首个非零位平面开始,将所述系数块中同一个位平面的所有比特位作为一个编码单元;The apparatus according to claim 56, wherein, in the coefficient block, starting from the first non-zero bit plane, all bits of the same bit plane in the coefficient block are used as a coding unit;所述处理器还用于:根据预定码率所指示的目标编码长度,按照预定的扫描顺序从所述编码单元中确定目标编码单元;所述目标编码单元指示所述编码单元中需要被编码的对象;The processor is further configured to: determine a target encoding unit from the encoding units according to a predetermined scanning order according to a target encoding length indicated by a predetermined code rate; the target encoding unit indicates the encoding unit that needs to be encoded. object;对所述目标编码单元进行编码,生成所述第二编码信息;encoding the target encoding unit to generate the second encoding information;对最后一个目标编码单元的位置信息进行编码。Encode the location information of the last target coding unit.
- 根据权利要求66所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 66, wherein the processor is further configured to:按照预定的扫描顺序依次确定所述编码单元的编码长度;Determine the coding length of the coding unit sequentially according to a predetermined scanning order;根据所述目标编码长度以及所述编码单元的编码长度,从所述编码单元中确定目标编码单元的数量。The number of target coding units is determined from the coding units according to the target coding length and the coding length of the coding units.
- 根据权利要求66所述的装置,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;The device according to claim 66, wherein the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components;所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合扫描的顺序。The predetermined scanning order indicates an order in which a plurality of coding units corresponding to the different color components are mixedly scanned.
- 根据权利要求66所述的装置,其特征在于,所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。66. The apparatus of claim 66, wherein the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit bit plane to the least significant bit bit plane.
- 根据权利要求66所述的装置,其特征在于,所述处理器还用于:根据所述目标编码单元对应的第二编码模式对该目标编码单元进行编码。The apparatus according to claim 66, wherein the processor is further configured to: encode the target coding unit according to a second coding mode corresponding to the target coding unit.
- 根据权利要求70所述的装置,其特征在于,所述目标编码单元对应的第二编码模式根据所述目标编码单元的分布特征确定;The device according to claim 70, wherein the second coding mode corresponding to the target coding unit is determined according to the distribution characteristics of the target coding unit;或者,所述目标编码单元对应的第二编码模式根据所述目标编码单元所处的位置所确定。Or, the second coding mode corresponding to the target coding unit is determined according to the position where the target coding unit is located.
- 根据权利要求71所述的装置,其特征在于,所述目标编码单元对应的第二编码模式根据该目标编码单元的分布特征以及预存的分布特征与第二编码模式的映射关系所确定;The device according to claim 71, wherein the second coding mode corresponding to the target coding unit is determined according to the distribution feature of the target coding unit and the mapping relationship between the pre-stored distribution feature and the second coding mode;或者,所述目标编码单元对应的第二编码模式根据所述目标编码单元所处的位置以及预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系所确定。Alternatively, the second encoding mode corresponding to the target coding unit is determined according to the position of the target coding unit and a pre-stored mapping relationship between the position of the target coding unit and the second encoding mode.
- 根据权利要求71或72所述的装置,其特征在于,所述目标编码单元所处的位置至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。The apparatus according to claim 71 or 72, wherein the position where the target coding unit is located includes at least any one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subclass to which the target coding unit belongs. bring.
- 根据权利要求72所述的装置,其特征在于,所述预存的分布特征与第二编码模式的映射关系或者所述预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系基于机器学习而得到。The apparatus according to claim 72, wherein the pre-stored mapping relationship between the distribution feature and the second coding mode or the pre-stored mapping relationship between the location of the target coding unit and the second coding mode based on machine learning.
- 根据权利要求70所述的装置,其特征在于,所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。The apparatus according to claim 70, wherein the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- 根据权利要求75所述的装置,其特征在于,所述至少两种变长编码模式中的每一种均包括至少两个码表;The apparatus of claim 75, wherein each of the at least two variable-length encoding modes includes at least two code tables;所述处理器还用于:当所述目标编码单元对应的第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述目标编码单元的不同比特位进行编码。The processor is further configured to use the at least two code tables to encode different bits of the target coding unit respectively when the second coding mode corresponding to the target coding unit is a variable-length coding mode.
- 根据权利要求65所述的装置,其特征在于,所述处理器还用于:若所述目标编码单元的剩余比特被编码后的长度无法满足所述预定的码率指示的编码长度,则根据所述目标编码单元的编码长度添加预设数据。The apparatus according to claim 65, wherein the processor is further configured to: if the encoded length of the remaining bits of the target coding unit cannot meet the encoding length indicated by the predetermined code rate, according to Preset data is added to the coding length of the target coding unit.
- 根据权利要求56所述的装置,其特征在于,所述处理器还用于:将所述多个 频率系数分解为关于所述多个频率系数的符号和关于所述多个频率系数的绝对值;The apparatus of claim 56, wherein the processor is further configured to: decompose the plurality of frequency coefficients into signs with respect to the plurality of frequency coefficients and absolute values with respect to the plurality of frequency coefficients ;根据所述多个频率系数的绝对值,确定关于所述多个频率系数的位平面;determining a bit plane with respect to the plurality of frequency coefficients according to the absolute values of the plurality of frequency coefficients;以所述系数块为单位,对所述多个频率系数的符号进行编码,生成第三编码信息。Using the coefficient block as a unit, the symbols of the plurality of frequency coefficients are encoded to generate third encoded information.
- 根据权利要求78所述的装置,其特征在于,所述处理器还用于:对不为0的频率系数的符号进行编码。The apparatus of claim 78, wherein the processor is further configured to: encode the sign of the frequency coefficient that is not zero.
- 根据权利要求56所述的装置,其特征在于,在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息位于所述已编码的码流中的第二位置;The apparatus according to claim 56, wherein, in the encoded code stream about the image block to be encoded, the first encoding information is located at a first position in the encoded code stream , the second encoding information is located at a second position in the encoded code stream;所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。The first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
- 根据权利要求78所述的装置,其特征在于,在所述关于所述待编码图像块的已编码的码流中,所述第一编码信息位于所述已编码的码流中的第一位置,所述第二编码信息以及所述第三编码信息位于所述已编码的码流中的第二位置;The apparatus according to claim 78, wherein, in the encoded code stream about the image block to be encoded, the first encoding information is located at a first position in the encoded code stream , the second encoding information and the third encoding information are located at the second position in the encoded code stream;所述第一位置与所述第二位置用于使解码端从所述第一位置和所述第二位置同步解码所述已编码的码流。The first position and the second position are used for the decoding end to synchronously decode the encoded code stream from the first position and the second position.
- 根据权利要求56所述的装置,其特征在于,所述多个频率系数基于对所述待编码图像块进行小波变换之后产生。The apparatus according to claim 56, wherein the plurality of frequency coefficients are generated after wavelet transform is performed on the image block to be encoded.
- 根据权利要求82所述的装置,其特征在于,所述多个频率系数基于对前后翻转后的待编码图像进行小波变换之后产生。The apparatus according to claim 82, wherein the plurality of frequency coefficients are generated based on wavelet transform of the image to be encoded after being flipped back and forth.
- 一种图像解码装置,其特征在于,包括:An image decoding device, comprising:处理器;processor;用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;其中,所述处理器调用所述可执行指令,当可执行指令被执行时,用于执行:Wherein, the processor invokes the executable instruction, and when the executable instruction is executed, is used to execute:获取已编码的码流,所述已编码的码流包括第一编码信息以及第二编码信息;obtaining an encoded code stream, where the encoded code stream includes first encoding information and second encoding information;对所述第一编码信息进行解码,获取各个系数块的首个非零位平面的位置信息;以及,对所述第二编码信息进行解码,获取各个所述系数块中从首个非零位平面开始的各个位平面上的比特位;Decoding the first encoding information to obtain the position information of the first non-zero bit plane of each coefficient block; and decoding the second encoding information to obtain the first non-zero bit plane from the coefficient block in each coefficient block Bits on each bit plane at the beginning of the plane;根据各个系数块的首个非零位平面的位置信息以及各个所述系数块中从首个非零位平面开始的各个位平面上的比特位,在位平面上获取多个频率系数;According to the position information of the first non-zero bit plane of each coefficient block and the bits on each bit plane starting from the first non-zero bit plane in each of the coefficient blocks, obtain a plurality of frequency coefficients on the bit plane;通过所述多个频率系数获取解码后的图像块。The decoded image block is obtained by using the plurality of frequency coefficients.
- 根据权利要求84所述的装置,其特征在于,所述已编码的码流包括有生成所述第一编码信息对应的目标编码模式;The apparatus according to claim 84, wherein the encoded code stream includes a target encoding mode corresponding to generating the first encoding information;所述处理器还用于:根据所述目标编码模式对所述第一编码信息进行解码。The processor is further configured to: decode the first encoding information according to the target encoding mode.
- 根据权利要求85所述的装置,其特征在于,所述目标编码模式为以下其中一种:至少一种使用码表编码的模式和/或至少一种预测编码模式。The apparatus according to claim 85, wherein the target encoding mode is one of the following: at least one encoding mode using a code table and/or at least one predictive encoding mode.
- 根据权利要求86所述的装置,其特征在于,在所述使用码表编码的模式中,所述码表根据所述解码后的图像块的估计的采集场景所确定;或者,The apparatus according to claim 86, wherein, in the mode of encoding using a code table, the code table is determined according to an estimated acquisition scene of the decoded image block; or,所述码表根据与所述估计的采集场景相关的参考图像块的图像信息的分布特征所确定;或者,The stop table is determined according to the distribution characteristics of the image information of the reference image blocks related to the estimated acquisition scene; or,所述码表根据所述参考图像块对应的各个系数块中首个非零位平面的位置信息的分布特征确定。The code table is determined according to the distribution characteristics of the position information of the first non-zero bit plane in each coefficient block corresponding to the reference image block.
- 根据权利要求87所述的装置,其特征在于,不同采集场景对应的码表不同,或者,所述参考图像块的图像信息的不同分布特征对应的码表不同;或者,所述参考图像块对应的各个系数块中首个非零位平面的位置信息的不同分布特征对应的码表不同。The apparatus according to claim 87, wherein the code tables corresponding to different collection scenarios are different, or the code tables corresponding to different distribution characteristics of the image information of the reference image blocks are different; or, the reference image blocks correspond to The code tables corresponding to the different distribution characteristics of the position information of the first non-zero bit plane in each coefficient block of , are different.
- 根据权利要求85所述的装置,其特征在于,所述多个频率系数为将所述待编码图像块从时域变换至频域后产生的;其中,所述多个频率系数包括第一频率系数和第二频率系数,并且所述第一频率系数和所述第二频率系数分别属于频域上的不同的子带;The apparatus according to claim 85, wherein the plurality of frequency coefficients are generated after transforming the to-be-coded image block from the time domain to the frequency domain; wherein the plurality of frequency coefficients comprise a first frequency coefficient and a second frequency coefficient, and the first frequency coefficient and the second frequency coefficient belong to different subbands in the frequency domain respectively;所述第一频率系数和所述第二频率系数均对应有所述目标编码模式。Both the first frequency coefficient and the second frequency coefficient correspond to the target coding mode.
- 根据权利要求89所述的装置,其特征在于,如果所述目标编码模式为所述使用码表编码的模式,不同的子带对应有不同的码表。The apparatus according to claim 89, wherein, if the target encoding mode is the mode using the code table encoding, different subbands correspond to different code tables.
- 根据权利要求85所述的装置,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;其中,多个所述不同颜色分量对应的位平面中的至少一个对应有所述目标编码模式。The apparatus according to claim 85, wherein the number of the bit planes is multiple, and the multiple bit planes include multiple bit planes corresponding to different color components; wherein, the multiple different color components correspond to At least one of the bit planes corresponds to the target coding mode.
- 根据权利要求91所述的装置,其特征在于,多个所述不同颜色分量对应的位平面包括Y分量的位平面、U分量的位平面和V分量的位平面;The device according to claim 91, wherein the plurality of bit planes corresponding to the different color components comprise a bit plane of the Y component, a bit plane of the U component, and a bit plane of the V component;或者,多个所述不同颜色分量对应的位平面包括R分量的位平面、G分量的位平面和B分量的位平面。Alternatively, the plurality of bit planes corresponding to the different color components include a bit plane of the R component, a bit plane of the G component, and a bit plane of the B component.
- 根据权利要求84所述的装置,其特征在于,在编码过程中,在所述系数块中,从首个非零位平面开始,将所述系数块中同一个位平面的所有比特位作为一个编码单 元;The apparatus according to claim 84, wherein in the coding process, in the coefficient block, starting from the first non-zero bit plane, all bits of the same bit plane in the coefficient block are taken as one coding unit;所述已编码的码流还包括有最后一个目标编码单元的位置信息;所述目标编码单元指示所述编码单元中需要被编码的对象;The coded code stream also includes the position information of the last target coding unit; the target coding unit indicates the object to be coded in the coding unit;所述处理器还用于:根据所述最后一个目标编码单元的位置信息从所述已编码的码流中获取所述第二编码信息。The processor is further configured to: obtain the second encoding information from the encoded code stream according to the position information of the last target encoding unit.
- 根据权利要求93所述的装置,其特征在于,所述目标编码单元由编码端按照预定的扫描顺序对所述编码单元进行扫描后确定。The apparatus according to claim 93, wherein the target coding unit is determined by the coding end after scanning the coding unit according to a predetermined scanning order.
- 根据权利要求94所述的装置,其特征在于,所述位平面的数量为多个,多个所述位平面包括多个不同色彩分量对应的位平面;The device according to claim 94, wherein the number of the bit planes is multiple, and the multiple bit planes include a plurality of bit planes corresponding to different color components;所述预定的扫描顺序指示将多个所述不同色彩分量对应的编码单元进行混合扫描的顺序。The predetermined scanning order indicates an order in which a plurality of coding units corresponding to the different color components are mixedly scanned.
- 根据权利要求94所述的装置,其特征在于,所述预定的扫描顺序至少包括从低频到高频的顺序和/或从最高有效位的位平面到最低有效位的位平面的顺序。The apparatus of claim 94, wherein the predetermined scanning order includes at least an order from low frequency to high frequency and/or an order from the most significant bit bit plane to the least significant bit bit plane.
- 根据权利要求93所述的装置,其特征在于,所述处理器还用于:根据所述第二编码信息对应的第二编码模式对所述第二编码信息进行解码,获得目标编码单元。The apparatus according to claim 93, wherein the processor is further configured to: decode the second encoding information according to the second encoding mode corresponding to the second encoding information to obtain the target encoding unit.
- 根据权利要求97所述的装置,其特征在于,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征确定;或者,所述第二编码模式根据所述目标编码单元所处的位置所确定。The apparatus according to claim 97, wherein in the encoding process, the second encoding mode is determined according to the distribution characteristics of the target encoding unit; or, the second encoding mode is determined according to the target encoding unit. determined by the location.
- 根据权利要求98所述的装置,其特征在于,在编码过程中,所述第二编码模式根据所述目标编码单元的分布特征以及预存的分布特征与第二编码模式的映射关系所确定;The device according to claim 98, wherein in the encoding process, the second encoding mode is determined according to the distribution characteristics of the target coding unit and the mapping relationship between the pre-stored distribution characteristics and the second encoding mode;或者,所述第二编码模式根据所述目标编码单元所处的位置以及预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系所确定。Alternatively, the second coding mode is determined according to the location of the target coding unit and a pre-stored mapping relationship between the location of the target coding unit and the second coding mode.
- 根据权利要求98或99所述的装置,其特征在于,所述目标编码单元所处的位置至少包括以下任一:所述目标编码单元对应的位平面的位深或者所述目标编码单元所属子带。The apparatus according to claim 98 or 99, wherein the position where the target coding unit is located includes at least any one of the following: a bit depth of a bit plane corresponding to the target coding unit or a subclass to which the target coding unit belongs. bring.
- 根据权利要求99所述的装置,其特征在于,所述预存的分布特征与第二编码模式的映射关系或者所述预存的关于所述目标编码单元所处的位置与第二编码模式的映射关系基于机器学习而得到。The apparatus according to claim 99, wherein the pre-stored mapping relationship between the distribution feature and the second coding mode or the pre-stored mapping relationship between the location of the target coding unit and the second coding mode based on machine learning.
- 根据权利要求97所述的装置,其特征在于,所述第二编码模式至少包括定长编码模式和/或至少两种变长编码模式。The apparatus according to claim 97, wherein the second encoding mode includes at least a fixed-length encoding mode and/or at least two variable-length encoding modes.
- 根据权利要求102所述的装置,其特征在于,所述变长编码模式包括至少两个码表;The apparatus of claim 102, wherein the variable-length coding mode includes at least two code tables;所述处理器还用于:当所述第二编码模式为变长编码模式时,使用所述至少两个码表分别对所述第二编码信息中的不同码字进行解码。The processor is further configured to: when the second encoding mode is a variable-length encoding mode, use the at least two code tables to respectively decode different code words in the second encoding information.
- 根据权利要求84所述的装置,其特征在于,所述已编码的码流还包括第三编码信息;The apparatus according to claim 84, wherein the encoded code stream further includes third encoding information;所述处理器还用于:对所述第三编码信息进行解码,获取所述频率系数的符号。The processor is further configured to: decode the third encoded information to obtain the sign of the frequency coefficient.
- 根据权利要求84所述的装置,其特征在于,所述处理器还用于:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息;对所述第一编码信息和所述第二编码信息进行同步解码。The apparatus according to claim 84, wherein the processor is further configured to: obtain the first encoding information from a first position of the encoded code stream, and obtain the first encoding information from the encoded code stream The second encoding information is obtained from the second location of the device; and the first encoding information and the second encoding information are synchronously decoded.
- 根据权利要求103所述的装置,其特征在于,所述处理器还用于:从所述已编码的码流的第一位置获取所述第一编码信息,以及从所述已编码的码流的第二位置获取所述第二编码信息或第三码流;The apparatus according to claim 103, wherein the processor is further configured to: obtain the first encoding information from a first position of the encoded code stream, and obtain the first encoding information from the encoded code stream obtain the second encoding information or the third code stream from the second position;对所述第一编码信息和所述第二编码信息进行同步解码;或者,对所述第一编码信息和所述第三编码信息进行同步解码。Perform synchronous decoding on the first encoded information and the second encoded information; or perform synchronous decoding on the first encoded information and the third encoded information.
- 根据权利要求105或106所述的装置,其特征在于,所述第一位置和所述第二位置中的一者为所述已编码的码流的头部位置,另一者为所述已编码的码流的尾部位置。The device according to claim 105 or 106, wherein one of the first position and the second position is a header position of the encoded code stream, and the other is the encoded code stream. The tail position of the encoded bitstream.
- 一种图像处理系统,其特征在于,包括图像处理模块、如权利要求56至83任意一项所述的图像编码装置、如权利要求84至107任意一项所述的图像解码装置以及存储器;An image processing system, characterized in that it comprises an image processing module, the image encoding device as claimed in any one of claims 56 to 83, the image decoding device as claimed in any one of claims 84 to 107, and a memory;所述图像处理模块用于对图像进行处理,并将处理后的图像传输给所述图像编码装置;The image processing module is used to process the image, and transmit the processed image to the image encoding device;所述图像编码装置用于将所述处理后的图像划分成多个待编码图像块之后,对所述待编码图像块进行压缩编码处理,生成已编码的码流;The image encoding device is configured to, after dividing the processed image into a plurality of image blocks to be encoded, perform compression encoding processing on the image blocks to be encoded to generate an encoded code stream;所述存储器用于存储所述已编码的码流;the memory is used for storing the encoded code stream;所述图像解码装置用于对所述已编码的码流进行解码,并将解码后的结果传输给所述图像处理模块。The image decoding device is configured to decode the encoded code stream, and transmit the decoded result to the image processing module.
- 一种可移动平台,其特征在于,包括如权利要求56至83任意一项所述的图像编码装置;或者,包括如权利要求108所述的图像处理系统。A movable platform, characterized in that it includes the image encoding device as claimed in any one of claims 56 to 83 ; or, includes the image processing system as claimed in claim 108 .
- 根据权利要求109所述的可移动平台,其特征在于,所述可移动平台包括无人飞行器、无人驾驶车辆或者移动机器人。The movable platform of claim 109, wherein the movable platform comprises an unmanned aerial vehicle, an unmanned vehicle, or a mobile robot.
- 一种图传系统,其特征在于,包括图像发射器以及图像接收器;其中,所述图像发射器包括如权利要求56至83任意一项所述的图像编码装置,所述图像接收器包括如权利要求84至107任意一项所述的图像解码装置;An image transmission system, characterized in that it includes an image transmitter and an image receiver; wherein the image transmitter includes the image encoding device according to any one of claims 56 to 83, and the image receiver includes The image decoding apparatus according to any one of claims 84 to 107;所述图像发射器用于将所述图像编码装置编码后产生的已编码的码流发送给所述图像接收器;The image transmitter is configured to send the encoded code stream generated after encoding by the image encoding device to the image receiver;所述图像接收器用于在接收所述已编码的码流之后,使用所述图像解码装置对所述已编码的码流进行解码。The image receiver is configured to use the image decoding device to decode the encoded code stream after receiving the encoded code stream.
- 一种计算机可读存储介质,其特征在于,其上存储有计算机指令,该指令被处理器执行时实现权利要求1至29任意一项或者权利要求30至55任意一项所述的方法。A computer-readable storage medium, characterized in that computer instructions are stored thereon, and when the instructions are executed by a processor, implement the method described in any one of claims 1 to 29 or any one of claims 30 to 55.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/131718 WO2022109916A1 (en) | 2020-11-26 | 2020-11-26 | Image encoding method and device, image decoding method and device, image processing system, mobile platform, image transmission system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/131718 WO2022109916A1 (en) | 2020-11-26 | 2020-11-26 | Image encoding method and device, image decoding method and device, image processing system, mobile platform, image transmission system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022109916A1 true WO2022109916A1 (en) | 2022-06-02 |
Family
ID=81755052
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/131718 WO2022109916A1 (en) | 2020-11-26 | 2020-11-26 | Image encoding method and device, image decoding method and device, image processing system, mobile platform, image transmission system and storage medium |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2022109916A1 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030142874A1 (en) * | 1994-09-21 | 2003-07-31 | Schwartz Edward L. | Context generation |
EP1624675A1 (en) * | 2004-08-03 | 2006-02-08 | Microsoft Corporation | A system and process for compressing and decompressing multiple, layered, video streams employing spatial and temporal encoding |
US20140314146A1 (en) * | 2010-09-06 | 2014-10-23 | Sony Corporation | Image processing apparatus and method |
US20160119647A1 (en) * | 2014-10-28 | 2016-04-28 | Sony Corporation | Image processing system with binary adaptive golomb coding and method of operation thereof |
CN107431823A (en) * | 2015-03-05 | 2017-12-01 | 诺基亚技术有限公司 | Method and apparatus for being coded and decoded to image |
-
2020
- 2020-11-26 WO PCT/CN2020/131718 patent/WO2022109916A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030142874A1 (en) * | 1994-09-21 | 2003-07-31 | Schwartz Edward L. | Context generation |
EP1624675A1 (en) * | 2004-08-03 | 2006-02-08 | Microsoft Corporation | A system and process for compressing and decompressing multiple, layered, video streams employing spatial and temporal encoding |
US20140314146A1 (en) * | 2010-09-06 | 2014-10-23 | Sony Corporation | Image processing apparatus and method |
US20160119647A1 (en) * | 2014-10-28 | 2016-04-28 | Sony Corporation | Image processing system with binary adaptive golomb coding and method of operation thereof |
CN107431823A (en) * | 2015-03-05 | 2017-12-01 | 诺基亚技术有限公司 | Method and apparatus for being coded and decoded to image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6847735B2 (en) | Image processing system, image processing apparatus, image input apparatus, image output apparatus and method, and storage medium | |
CN109842803B (en) | Method and device for image compression | |
US7139434B2 (en) | Decoding with storage of less bits for less important data | |
CN102263950B (en) | Encoding device, encoding method, decoding device, and decoding method | |
US8098947B2 (en) | Method and apparatus for processing image data by rearranging wavelet transform data | |
US20250159259A1 (en) | Non-transform coding | |
CN113170140B (en) | Method for encoding data element, method for decoding data stream, device and medium | |
JP2001231042A (en) | Image processing apparatus and method, and storage medium | |
US8170334B2 (en) | Image processing systems employing image compression and accelerated image decompression | |
JP2002010216A (en) | Decoding device, control method thereof, and storage medium | |
US8805107B2 (en) | Image data coding apparatus, method of controlling operation of same, and program therefor | |
CN112369025A (en) | Context-based binary arithmetic coding and decoding | |
US8170333B2 (en) | Image processing systems employing image compression | |
US7120306B2 (en) | Image processing method and image coding apparatus utilizing the image processing method | |
CN107431823A (en) | Method and apparatus for being coded and decoded to image | |
US20110091123A1 (en) | Coding apparatus and coding method | |
US7590298B2 (en) | Decompression with reduced ringing artifacts | |
CN113473139B (en) | Image processing method and image processing device | |
US9819957B2 (en) | Method and apparatus for decoding a progressive JPEG image | |
US8170335B2 (en) | Image processing systems employing image compression and accelerated decompression | |
WO2022109916A1 (en) | Image encoding method and device, image decoding method and device, image processing system, mobile platform, image transmission system and storage medium | |
CN115733990A (en) | Point cloud coding and decoding method, device and storage medium | |
CN107945108A (en) | Method for processing video frequency and device | |
US20090074059A1 (en) | Encoding method and device for image data | |
US20250061609A1 (en) | Progressive image compression and syncing |
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: 20962807 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: 20962807 Country of ref document: EP Kind code of ref document: A1 |