WO2023040600A1 - 图像编码方法、图像解码方法、装置、电子设备及介质 - Google Patents
图像编码方法、图像解码方法、装置、电子设备及介质 Download PDFInfo
- Publication number
- WO2023040600A1 WO2023040600A1 PCT/CN2022/114080 CN2022114080W WO2023040600A1 WO 2023040600 A1 WO2023040600 A1 WO 2023040600A1 CN 2022114080 W CN2022114080 W CN 2022114080W WO 2023040600 A1 WO2023040600 A1 WO 2023040600A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- data
- encoding
- image
- quantization
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 130
- 238000012545 processing Methods 0.000 claims abstract description 150
- 238000013139 quantization Methods 0.000 claims abstract description 119
- 230000008569 process Effects 0.000 claims description 43
- 238000004590 computer program Methods 0.000 claims description 8
- 238000013507 mapping Methods 0.000 claims description 5
- 238000005457 optimization Methods 0.000 claims description 2
- 238000007906 compression Methods 0.000 description 25
- 230000006835 compression Effects 0.000 description 24
- 238000010586 diagram Methods 0.000 description 9
- 230000009466 transformation Effects 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 238000012805 post-processing Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000002699 waste material Substances 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/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/172—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
-
- 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/124—Quantisation
-
- 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/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- 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/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- 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/44—Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
Definitions
- the present disclosure relates to the technical field of image encoding, for example, to an image encoding method, an image decoding method, a device, electronic equipment, and a medium.
- Image coding technology is a method of compressing image data in order to minimize the bandwidth required to transmit image data.
- the number of images transmitted on the Internet has begun to increase sharply, and the size of images is also increasing, which poses new challenges to image coding technology.
- the current image coding scheme has reached a certain level of optimization, and it is difficult to achieve further improvement in compression performance; or there is a situation of high encoding and decoding processing complexity and a lot of redundant information. Therefore, it is necessary to provide an image coding method to solve the above problems.
- Embodiments of the present disclosure provide an image encoding method, an image decoding method, an apparatus, electronic equipment, and a medium, so as to reduce the complexity of image encoding and decoding processing on the premise of taking image compression performance into consideration.
- a first aspect of the present disclosure provides an image coding method, the method comprising:
- the preset coding standard is based on intra-frame predictive coding and includes target block division processing and target quantization processing
- the target block division processing is Image block division processing based on preset rules
- the target quantization processing includes data quantization processing based on trellis coding quantization.
- the second aspect of the present disclosure also provides an image decoding method, including:
- the target encoded data is data obtained after encoding an original image using a preset encoding standard
- the preset encoding standard is based on intra-frame predictive encoding
- the target block division processing is image block division processing based on preset rules
- the target quantization processing includes data quantization processing based on trellis coding quantization
- Decoding the target coded data by using a preset decoding standard corresponding to the preset coding standard to obtain a reconstructed image corresponding to the original image.
- a third aspect of the present disclosure further provides an image encoding device, including:
- the original image acquisition module is configured to acquire the original image to be encoded
- An encoding module configured to encode the original image using a preset encoding standard to obtain target encoded data, wherein the preset encoding standard is based on intra-frame predictive encoding and includes target block division processing and target quantization processing, the The target block division process is image block division process based on preset rules, and the target quantization process includes data quantization process based on trellis coding quantization.
- an image decoding device including:
- An encoded data acquisition module configured to acquire target encoded data to be analyzed, wherein the target encoded data is data obtained after encoding an original image using a preset encoding standard, the preset encoding standard is based on intra-frame predictive encoding, And including target block division processing and target quantization processing, the target block division processing is image block division processing based on preset rules, and the target quantization processing includes data quantization processing based on trellis coding quantization;
- the decoding module is configured to use a decoding standard corresponding to the preset coding standard to decode the target coded data to obtain a reconstructed image corresponding to the original image.
- an electronic device including:
- a memory configured to store executable instructions
- a processor configured to operate the electronic device to execute the method according to the first aspect or the second aspect of the present disclosure under the control of the executable instructions.
- a computer-readable storage medium stores a computer program that can be read and executed by a computer, and the computer program is configured to be read by the computer When running, execute the method according to the first aspect or the second aspect of the present disclosure.
- FIG. 1 is a schematic flowchart of an image encoding method provided by an embodiment of the present disclosure.
- Fig. 2 is a schematic diagram of an application scenario of image encoding and decoding processing provided by an embodiment of the present disclosure.
- Fig. 3 is a schematic flowchart of an image decoding method provided by an embodiment of the present disclosure.
- Fig. 4 is a functional block diagram of an image encoding device provided by an embodiment of the present disclosure.
- Fig. 5 is a functional block diagram of an image decoding device provided by an embodiment of the present disclosure.
- Fig. 6 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present disclosure.
- the commonly used image coding methods generally include: 1. JPEG (Joint Photographic Experts Group) image lossy coding method, which is a compression method applied to photo image content, which realizes image compression at the cost of losing part of the information. compression encoding. 2. PNG (Portable Network Graphics) image lossless encoding method, this method is a compression method based on lossless encoding, which can retain all the information of the image, supports transparent (Alpha) channel and also supports gamma correction of brightness, and can get better Good color reconstruction effect. 3. WebP encoding method, which is derived from the video encoding standard VP8, supports lossless and lossy encoding, and has a compression rate improvement of more than 20% compared with method 1 and method 2. 4. The coding method based on the H.264/H.265 video coding standard. H.264/H.265 is an international video coding standard formulated by the MPEG organization. Both adopt a hybrid coding framework to achieve efficient coding and compression.
- JPEG Joint Photograph
- Method 1 can generally only achieve better reconstruction quality for smooth areas of the image, and the reconstruction effect for complex texture areas such as lines and text is often poor.
- Method 2 is a lossless encoding method, so its compression efficiency is not high, and it is difficult to achieve a large image compression
- method 3 can improve the image compression rate, but because it is based on the VP8 architecture, the division mode supported when dividing the image block Less, for example, the lack of detailed judgment of block modes such as 8*8, and the complexity of its encoding and decoding processing has increased significantly, for example, the encoding complexity has increased by 10 times compared to method 1, and the decoding complexity has increased by 1.5 compared to method 1 times, therefore, this method has relatively high hardware requirements for electronic equipment; the codec complexity of method 4 is relatively lower than that of method 3, and its compression efficiency is also higher than that of method 1 and method 2, but the video coding used by method 3 Standards are usually used to encode and decode video data. Therefore, the encoded
- FIG. 1 is a schematic flowchart of the image encoding method provided by an embodiment of the present disclosure.
- the method can be implemented by an electronic device, and the electronic device can be a terminal device, for example, a mobile phone, a tablet computer, etc.; or, the electronic device can also be a server, for example, a blade server, a rack server, etc., here There are no special restrictions.
- the method of this embodiment may include the following steps S1100-S1200, which will be described in detail below.
- Step S1100 acquiring an original image to be encoded.
- the original image refers to an image to be volume-compressed for transmission in the network, where the original image may be a static image or a dynamic image, and there is no special limitation here.
- the original image may be an image in the terminal device to be sent to the network for transmission.
- Step S1200 encode the original image using a preset coding standard to obtain target coded data
- the preset coding standard is based on intra-frame prediction coding and includes target block division processing and target quantization processing
- the division processing is image block division processing based on preset rules
- the target quantization processing includes data quantization processing based on trellis coding quantization.
- the preset coding standard is a coding standard based on intra-frame predictive coding.
- the coding standard can support 4 pixels*4 pixels, 8 pixels*8 pixels 1. Any one of 16 pixels*16 pixels is used as a unit image block to divide the original image into a target image block division process, and for each block division mode, it supports the corresponding intra-frame predictive coding and transform coding processing;
- the preset coding standard also introduces quantization based on trellis coding, for example, data quantization processing optimized by trellis quantization, wherein trellis quantization refers to the evaluation of the initial quantization coefficient obtained in the quantization process , to determine which quantization coefficient can be used as much as possible while ensuring that the image quality is basically unchanged when using the initial quantization coefficient for subsequent encoding processing, or using the quantization coefficient after the initial quantization coefficient -1 for subsequent encoding processing.
- the electronic device such as the server, generally caches the original image in the memory in RGB format after obtaining the original image, and considering that the RGB format expresses color through the R channel,
- the combination of the G channel and the B channel independently represents the color of the pixel, which makes it necessary to transmit the data of the three channels at the same time when transmitting the image in the RGB format, resulting in more bandwidth occupation; while the YUV format expresses the color.
- the method before obtaining the original image and preparing to encode the original image, the method further includes: obtaining the color format of the original image; if the color format is a non-YUV format, converting the original The image is in the YUV format, so that the original image converted to the YUV format is encoded by using a preset encoding standard to obtain target encoded data with a higher compression rate.
- image data in YUV format usually contains more redundant information than image data in RGB format. Therefore, after the original image is acquired, the current color format of the original image can be judged first, and if the color format is not YUV format, the color format of the original image can be converted to effectively remove the image data during encoding.
- the redundant information in the image can improve the image compression rate.
- the following formula can be used to convert the data of each color channel of the pixel in the original image to obtain the original image in YUV format:
- the encoding the original image using the preset encoding standard to obtain the target encoding data includes: splitting the original image according to the preset rule to obtain a plurality of image blocks ; Obtain a plurality of data to be quantized respectively corresponding to the plurality of image blocks by performing intra-frame predictive encoding processing and transform encoding processing on the plurality of image blocks, wherein the intra-frame predictive encoding processing is used for spatially Redundant data in the plurality of image blocks is removed in the domain, and the transform coding process is used to transform the plurality of image blocks from which the redundant data is removed from the spatial domain to the frequency domain, so as to obtain the plurality of The data to be quantized; respectively performing the target quantization processing on the multiple data to be quantized to obtain multiple quantization coefficients; and obtaining the target encoded data according to the multiple quantization coefficients.
- the preset coding standard provided by the embodiments of the present disclosure, that is, the hpic coding standard can use the intra-frame prediction coding method in H.264/H.265 as a reference, and remove the inter-frame prediction coding to obtain a more suitable Coding standard for image compression scenarios.
- the method provided by the embodiments of the present disclosure may at least include target block division processing, intra-frame prediction coding processing, transform coding processing, and target quantization processing when coding a target image converted into a YUV format.
- the target block dividing process may be, for example, dividing the image according to preset rules according to attribute information and size of the image to be encoded, so as to obtain multiple image blocks.
- the image to be coded may be split according to any one of 4 pixels*4 pixels, 8 pixels*8 pixels, 16 pixels*16 pixels, etc. as a unit image block to obtain multiple image blocks.
- the method provided by the embodiment of the present disclosure can increase the block division mode of 8 pixels*8 pixels, which can guarantee With the same image quality, the image compression performance is improved to achieve more detailed image encoding.
- the intra-frame predictive coding process is based on the correlation and similarity of the pixel values of multiple adjacent image blocks in the spatial domain, that is, the pixel domain, for multiple image blocks obtained by splitting the original image in units of a single frame image , through the reference block and a set of prediction coefficients, predict the change of pixels in adjacent blocks, and remove part of the redundant data through the difference between the actual value of the pixel and the predicted value, so that the dynamic range of the pixel value in the image data becomes smaller, thereby reducing The number of bits used to represent these numerical, compressed image data.
- Transform coding (transform coding) processing is to transform the image data obtained after the original image is processed by intra-frame prediction coding from the spatial domain to the frequency domain, so as to transform the image data from a series of dynamic and continuous values to a discrete one with less correlation. Numerical processing.
- the transform coding process may be DCT transform coding process, for example, so as to increase the encoding speed of the image coding process and the decoding speed during subsequent decoding.
- the target quantization process is the process of quantizing a series of discrete values with low correlation obtained after transform coding processing, that is, for several values after transform coding processing, the values in the same quantization range are quantized into the same quantization coefficient , to compress the values. For example, for the values (a1, a2, a3, ..., an), the values (a1, a2) in the same quantization range can be quantized into quantization coefficients b1, and the values (a6, a7) in another quantization range can be quantized Quantized to quantization coefficient b2.
- performing the target quantization processing on the plurality of data to be quantized respectively to obtain a plurality of quantization coefficients includes: obtaining the first data to be quantized corresponding to the first data to be quantized according to the preset mapping data. Determining a quantization parameter, wherein the first data to be quantized is any data in the plurality of quantized data, and the preset mapping data is used to reflect the correspondence between the data to be quantized and the quantization parameter; according to the The first quantization parameter to be determined is based on trellis coding quantization to perform rate-distortion optimized selection (Rate Distortion Optimized, RDO) on the first data to be quantized to obtain a first target quantization parameter; according to the first target quantization parameter, to Performing quantization processing on the first data to be quantized to obtain a first quantization coefficient; and obtaining the plurality of quantization coefficients according to the first quantization coefficient.
- RDO Rate Distortion Optimized
- the image compression rate can be further improved while ensuring the image quality
- trellis-coded quantization can be introduced in the quantization process.
- the trellis quantization process is used to select quantized coefficients that are more suitable for subsequent processing, such as subsequent entropy coding, by performing RDO selection on the data to be quantized.
- the obtaining the target encoded data according to the plurality of quantization coefficients includes: obtaining the target encoding data by performing entropy encoding (entropy encoding) processing on the plurality of quantization coefficients respectively. data.
- the entropy coding processing may be processing based on coding algorithms such as Shannon coding, Huffman coding and arithmetic coding, and the detailed processing process thereof will not be repeated here.
- the obtaining the target coded data by respectively performing entropy coding processing on the plurality of quantization coefficients includes: obtaining the first Encoding data; obtaining a second encoding according to the attribute information of the original image, the target quantization coefficients corresponding to the plurality of quantization data in the target quantization process, and the image block division rule used in the target block division process data, wherein the second encoded data is used to indicate the encoding format of the first encoded data, and the attribute information includes the height and width of the original image; according to the first encoded data and the second encoded data to obtain the target encoding data.
- the first coded data is a binary code stream obtained after coding and compressing the image data, for example, the original image or the image data contained in the target image corresponding to the original image, that is, the main data code stream in the hpic coding format.
- the second encoded data is a binary code stream used to indicate the encoding format of the first encoded data, that is, the header data stream in the hpic encoding format,
- the hpic encoding standard when encoding image data using the preset encoding standard provided by the embodiments of the present disclosure, that is, the hpic encoding standard, after obtaining the main stream data, pre-allocate memory and select an appropriate decoding method for decoding processing.
- tool when encoding the original image or the target image, it can also record and encode the image data, such as the attribute information of the original image, and the encoding tool information used during encoding.
- the attribute information may be the height and width of the original image.
- Table 1 is the second encoded data provided by the embodiment of the present disclosure, that is, a schematic representation of the grammatical constraints of the encoding format of the header information:
- the frame_width and frame_height fields can be used to represent the width and height of the original image, and each field is represented by 2 bytes to facilitate pre-decoding processing in the decoding stage; b_transform_8x8 is used to represent the encoding Whether the 8x8 DCT transformation is used; slice_qp_delta is used to record the information of the quantization parameters used in encoding; the last 4 bytes can be used as an extension field; in addition, in the descriptor definition, u(n) is used to represent n It is an unsigned integer and is directly transmitted without encoding.
- u(16) indicates that the image width is transmitted with a length of 16 bits
- ue(v) indicates an unsigned integer type syntax element v encoded by Golomb encoding
- se(w) indicates A signed integer syntax element w encoded in Golomb encoding
- the encoding of the header information may also include other fields, for example, the encoding standard used in the encoding process may also include version, so that the decoding end can select the decoding standard corresponding to the encoding standard for decoding processing.
- the target encoding data corresponding to the original image can be obtained, so that when the original image needs to be transmitted in the network, the target encoding data can be transmitted to reduce bandwidth consumption while ensuring image quality. Improve transmission efficiency.
- the target coded data can be decoded by the following image decoding method to obtain a decoded image corresponding to the original image: obtain the target coded data to be parsed; use the preset The preset decoding standard corresponding to the encoding standard performs decoding processing on the target encoded data to obtain a reconstructed image corresponding to the original image.
- the image decoding process may include: header information decoding, that is, second encoded data decoding processing, entropy decoding processing, inverse quantization processing, inverse transform decoding processing, intra prediction reconstruction processing, and post-processing filtering processing etc.
- the entropy decoding process is used to analyze the binary code stream corresponding to the first encoded data included in the target encoded data into a plurality of quantization coefficients; The coefficients are restored to transform coefficients in the frequency domain; the inverse transform decoding process is used to restore the transform coefficients obtained in the inverse quantization process, and perform corresponding inverse transforms according to the size of each decoded coefficient block to map back to the spatial domain, that is, the pixel domain Residual coefficients; intra-frame prediction and reconstruction processing is used to construct reference pixels according to the prediction mode obtained by analysis and add them to residual coefficients to obtain reconstructed pixels; post-processing filtering processing is used to filter reconstructed pixels to eliminate block-level coding processing caused by block effects.
- the image decoding process may also include pre-decoding processing, which may be: perform pre-decoding processing on the target encoded data to obtain the attribute information ; According to the attribute information, setting a cache space for caching the reconstructed image.
- pre-decoding processing can be performed first, so as to obtain the attributes of the original image, such as width and height, from the second coded data of the target coded data, and then according to the width and Height, allocate memory space for the reconstructed image in advance to ensure that there is enough space to store the reconstructed image without wasting memory space.
- the color format inverse conversion process can also be performed on the reconstructed image in YUV format to obtain RGB format
- the reconstructed image of wherein, the inverse transformation process can be realized by the following formula:
- FIG. 2 is a schematic diagram of an application scenario of the image encoding and decoding process provided by the embodiment of the present disclosure.
- the YUV format conversion process can be performed first to obtain the original image in the YUV format.
- the second encoded data may be obtained by encoding using the grammatical constraints that predefine the encoding format of the second encoded data, that is, the header information.
- main coding processing may be performed on the pixel data in the image, that is, target block division processing, intra prediction coding processing, transform coding processing, target quantization processing, entropy coding processing and other processing to obtain the first coded data.
- the target encoded data corresponding to the original image is obtained and stored in the cloud server.
- the server in the cloud can generate a corresponding URL identification link for the target encoded data, so as to facilitate downloading by the decoding end.
- the server in the cloud receives the download request from the decoder, it can first judge whether it needs to transcode in the Content Delivery Network (CDN) according to the preset transcoding strategy.
- CDN Content Delivery Network
- the URL identification link corresponding to the target coded data can be directly provided to the decoding end.
- the decoding end obtains the target coded data according to the received URL identification link, and performs pre-decoding processing and body decoding processing, that is, header information decoding, that is, second coded data decoding processing, entropy decoding processing, inverse quantization processing, and inverse transformation Decoding processing, intra-frame prediction reconstruction processing, post-processing filtering processing and other processing to obtain reconstructed images. Afterwards, by performing color format inverse conversion processing, a reconstructed image in RGB format corresponding to the original image can be obtained and displayed on a display device corresponding to the decoding end.
- the original image is encoded by using a preset encoding standard based on intra-frame prediction encoding and including target block division processing and target quantization processing , so that the electronic device can flexibly select an appropriate block division mode to split the original image, so as to improve the image compression rate while keeping the image quality unchanged.
- the effect of quantization processing can also be improved, so as to further improve the image compression rate without increasing the complexity of encoding and decoding.
- Experimental data shows that the image coding method of the present application can improve the compression rate by 14% compared with the webp coding method in the related art, reduce the coding complexity by 16%, save 12% of the download time, and achieve high quality and low complexity Image compression processing.
- this embodiment also provides an image decoding method, which can be applied to electronic devices, for example, can be used in servers or terminal devices.
- FIG. 3 is a schematic flowchart of an image decoding method provided by an embodiment of the present disclosure. As shown in Fig. 3, the method includes the following steps S3100-S3200, which will be described in detail below.
- Step S3100 acquire the target encoded data to be analyzed, wherein the target encoded data is the data obtained after encoding the original image using a preset encoding standard, the preset encoding standard is based on intra-frame predictive encoding, and includes the target block Division processing and target quantization processing, the target block division processing is image block division processing based on preset rules, and the target quantization processing includes data quantization processing based on trellis coding quantization.
- the target encoded data is the data obtained after encoding the original image using a preset encoding standard
- the preset encoding standard is based on intra-frame predictive encoding
- the target block division processing is image block division processing based on preset rules
- the target quantization processing includes data quantization processing based on trellis coding quantization.
- Step S3200 using a preset decoding standard corresponding to the preset coding standard to decode the target coded data to obtain a reconstructed image corresponding to the original image.
- the target encoded data includes attribute information of the original image; the method further includes: performing pre-decoding processing on the target encoded data to obtain the attribute information; according to the attribute information, setting A cache space for caching the reconstructed image.
- an image encoding device is also provided.
- the device 4000 may include an original image acquisition module 4100 and an encoding module 4200 .
- the original image acquisition module 4100 is configured to acquire an original image to be encoded; the encoding module 4200 is configured to encode the original image using a preset encoding standard to obtain target encoded data, wherein the preset encoding standard is based on Intra-frame predictive coding, and includes target block division processing and target quantization processing, the target block division processing is image block division processing based on preset rules, and the target quantization processing includes data quantization processing based on trellis coding quantization.
- the preset encoding standard is based on Intra-frame predictive coding, and includes target block division processing and target quantization processing, the target block division processing is image block division processing based on preset rules, and the target quantization processing includes data quantization processing based on trellis coding quantization.
- an image decoding device is also provided.
- the device 5000 may include an encoded data acquisition module 5100 and a decoding module 5200 .
- the encoded data acquisition module 5100 is configured to acquire target encoded data to be analyzed, wherein the target encoded data is data obtained after encoding an original image using a preset encoding standard, and the preset encoding standard is based on intra-frame prediction Encoding, and includes target block division processing and target quantization processing, the target block division processing is image block division processing based on preset rules, and the target quantization processing includes data quantization processing based on trellis coding quantization; the decoding module 5200 , set to use a decoding standard corresponding to the preset coding standard to perform decoding processing on the target coded data to obtain a reconstructed image corresponding to the original image.
- an electronic device is also provided.
- the electronic device 6000 may also include a processor 6200 and a memory 6100, the memory 6100 is configured to store executable instructions; the processor 6200 is configured to Operating the electronic device according to the control of the instructions to perform the method according to any embodiment of the present disclosure.
- the electronic device 6000 may be a terminal device, or may also be a server, which is not limited here.
- a computer-readable storage medium is further provided, and the computer-readable storage medium stores a computer program that can be read and run by a computer, The computer program is configured to, when read and executed by the computer, execute the method described in any of the above embodiments of the present disclosure.
- the computer readable storage medium may be a non-transitory computer readable storage medium.
- each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions.
- the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by means of hardware, implementation by means of software, and implementation by a combination of software and hardware are all equivalent.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本申请公开了一种图像编码方法、图像解码方法、装置、电子设备及介质,该方法包括:获取待编码的原始图像;使用预设编码标准对所述原始图像进行编码,获得目标编码数据,其中,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
Description
本申请要求在2021年9月14日提交中国专利局、申请号为202111076563.5的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
本公开涉及图像编码技术领域,例如涉及一种图像编码方法、图像解码方法、装置、电子设备及介质。
图像编码技术是为了尽量减少传输图像数据所需要的带宽而对图像数据采取的压缩方法。近年来,随着智能终端技术的不断发展,互联网上传播的图像数量开始急剧增加,并且图像的体积也在不断增大,这就对图像编码技术提出了新的挑战。
目前的图像编码方案或是已经达到一定能的优化极致,难以实现进一步的压缩性能的提升;或是存在编解码处理复杂度高、冗余信息多的情况。因此,有必要提供一种图像编码方法,以解决上述问题。
发明内容
本公开实施例提供了一种图像编码方法、图像解码方法、装置、电子设备及介质,以在兼顾图像压缩性能的前提下,降低图像编解码处理的复杂度。
本公开的第一方面,提供了一种图像编码方法,该方法包括:
获取待编码的原始图像;
使用预设编码标准对所述原始图像进行编码,获得目标编码数据,其中,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
本公开的第二方面,还提供了一种图像解码方法,包括:
获取待解析的目标编码数据,其中,所述目标编码数据为使用预设编码标准对原始图像进行编码后获得的数据,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理;
使用与所述预设编码标准对应的预设解码标准对所述目标编码数据进行解码处理,获得与所述原始图像对应的重建图像。
本公开的第三方面,还提供了一种图像编码装置,包括:
原始图像获取模块,设置为获取待编码的原始图像;
编码模块,设置为使用预设编码标准对所述原始图像进行编码,获得目标编码数据,其中,所述预设编码标准基于帧内预测编码,并且包括目标块 划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
本公开的第四方面,还提供了一种图像解码装置,包括:
编码数据获取模块,设置为获取待解析的目标编码数据,其中,所述目标编码数据为使用预设编码标准对原始图像进行编码后获得的数据,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理;
解码模块,设置为使用与所述预设编码标准对应的解码标准对所述目标编码数据进行解码处理,获得与所述原始图像对应的重建图像。
根据本公开的第五方面,还提供了一种电子设备,包括:
存储器,设置为存储可执行的指令;
处理器,设置为根据所述可执行的指令的控制,运行所述电子设备执行根据本公开的第一方面或第二方面所述的方法。
根据本公开的第六方面,还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有可被计算机读取执行的计算机程序,所述计算机程序设置为在被所述计算机读取运行时,执行根据本公开的第一方面或第二方面所述的方法。
被结合在说明书中并构成说明书的一部分的附图示出了本公开的实施例,并且连同其说明一起用于解释本公开的原理。
图1是本公开实施例提供的图像编码方法的流程示意图。
图2是本公开实施例提供的一种图像编解码处理的应用场景示意图。
图3是本公开实施例提供的图像解码方法的流程示意图。
图4是本公开实施例提供的图像编码装置的原理框图。
图5是本公开实施例提供的图像解码装置的原理框图。
图6是本公开实施例提供的电子设备的硬件结构示意图。
现在将参照附图来详细描述本公开的多种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本公开的范围。
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本公开及其应用或使用的任何限制。
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。
在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其他例子可以具有不同的值。
本公开的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。
目前,通常使用的图像编码方法一般可以有:1、JPEG(Joint Photographic Experts Group)图像有损编码方法,该方法是一种应用于相片影像内容的压缩方法,其以损失部分信息为代价实现图像的压缩编码。2、PNG(Portable Network Graphics)图像无损编码方法,该方法是一种基于无损编码的压缩方法,其能够保留图像的所有信息,支持透明(Alpha)通道以及还支持亮度的gamma校正,能够得到较好的色彩重建效果。3、WebP编码方法,该方法基于视频编码标准VP8衍生而来,支持无损和有损编码,相较于方法1和方法2有20%以上的压缩率提升。4、基于H.264/H.265视频编码标准的编码方法,H.264/H.265是由MPEG组织制定的国际视频编码标准,均采用混合编码框架,能够实现高效的编码压缩。
以上方案虽然都能在一定程度上实现对图像数据的压缩,但是,方法1一般仅能够针对图像的平滑区域实现较好的重建质量,而对线条、文字等纹理复杂区域的重建效果往往较差;方法2由于为无损编码方式,所以其压缩效率不高,难以实现大幅度的图像压缩;方法3虽然可以提升图像压缩率,但是由于其基于VP8架构,所以在图像块划分时支持的划分模式较少,例如,缺少8*8等块模式的细致判断,并且其编解码处理的复杂度大幅增加,例如,编码复杂度相较方法1增加了10倍,解码复杂度相较方法1增加1.5倍,因此,该方法对电子设备的硬件要求相对较高;方法4的编解码复杂度相对低于方法3,且其压缩效率也高于方法1和方法2,但是方法3所使用的视频编码标准通常应用于对视频数据进行编解码,因此,其编码码流中包含有冗余的视频头部信息,这就造成了一定的编码字节浪费,因此,通常较少应用在图像编码场景中。
根据以上分析可知,相关技术中的图像编码方法存在无法兼顾图像压缩性能和编解码复杂度的情况。本公开实施例提供一种图像编码方法,请参看图1,其是本公开实施例提供的图像编码方法的流程示意图。该方法可以由电子设备实施,该电子设备可以为终端设备,例如,可以为手机、平板电脑等;或者,该电子设备也可以为服务器,例如,可以为刀片服务器、机架式服务器等,此处不做特殊限定。
如图1所示,本实施例的方法可以包括如下步骤S1100-S1200,以下予以详细说明。
步骤S1100,获取待编码的原始图像。
原始图像,是指待进行体积压缩以在网络中传输的图像,其中,原始图像可以为静态图像,也可以为动态图像,此处不做特殊限定。例如,原始图 像可以为终端设备中待发送到网络中传输的图像。
步骤S1200,使用预设编码标准对所述原始图像进行编码,获得目标编码数据,其中,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
在本实施例中,预设编码标准,简称hpic标准,是基于帧内预测编码的编码标准,该编码标准在针对图像数据进行编码时,可以支持以4像素*4像素、8像素*8像素、16像素*16像素中的任意一项作为单元图像块对原始图像进行块划分的目标图像块划分处理,并且针对每一项块划分模式,均支持对应的帧内预测编码、变换编码处理;此外,为了提升图像压缩率,该预设编码标准还同时引入基于网格编码量化,例如,trellis量化优化的数据量化处理,其中,trellis量化,是指针对量化处理中获得的初始量化系数进行评估,以确定在使用该初始量化系数进行后续编码处理,或者使用该初始量化系数-1后的量化系数进行后续编码处理时,哪一量化系数可以在保证图像质量基本不变的情况下,尽可能地提升图像压缩率。以下针对如何使用该预设编码标准对原始图像编码进行详细说明。通常,针对待编码的原始图像,电子设备,例如服务器在获取到原始图像后,一般会将原始图像以RGB格式缓存在内存中,而考虑到RGB格式在表示色彩时,是分别通过R通道、G通道以及B通道的组合来独立表示像素的色彩,这就使得在传输RGB格式的图像时,需要同时传输该三个通道的数据,从而导致带宽占用较多;而YUV格式在表示色彩时,其Y通道和UV通道可以分离单独表示颜色,且可以不必同时传输该两个通道的数据,并且由于YUV格式的数据包中还同时包含较多冗余信息。因此,在一个实施例中,在获取到原始图像,并在准备对原始图像进行编码之前,该方法还包括:获取原始图像的色彩格式;在该色彩格式为非YUV格式的情况下,转换原始图像为YUV格式,以通过使用预设编码标准对转换为YUV格式的原始图像进行编码,获得压缩率较高的目标编码数据。
即,在一实施例中,考虑到YUV格式的图像数据中包含的冗余信息往往会多于使用RGB格式的图像数据。因此,在获取到原始图像之后,可以先判断原始图像当前的色彩格式,并在该色彩格式非YUV格式的情况下,对原始图像的色彩格式进行转换,以在编码时,能够有效去除图像数据中的冗余信息,提升图像压缩率。
以原始图像为RGB格式为例,在对RGB格式的原始图像进行色彩格式转换时,例如可以使用以下公式对原始图像中像素的每个颜色通道数据进行转换,以获得YUV格式的原始图像:
在一个实施例中,所述使用所述预设编码标准对所述原始图像进行编码,获得所述目标编码数据,包括:按照所述预设规则拆分所述原始图像,获得 多个图像块;通过对所述多个图像块进行帧内预测编码处理和变换编码处理,获得与所述多个图像块分别对应的多个待量化数据,其中,所述帧内预测编码处理用于从空间域上去除所述多个图像块中的冗余数据,所述变换编码处理用于将去除所述冗余数据的所述多个图像块从空间域变换到频域,以获得所述多个待量化数据;对所述多个待量化数据分别进行所述目标量化处理,获得多个量化系数;根据所述多个量化系数,获得所述目标编码数据。
考虑到H.264/H.265视频编码标准可以对视频数据实现低复杂度和高压缩率的编码。因此,本公开实施例提供的预设编码标准,即hpic编码标准可以以H.264/H.265中的帧内预测编码方式为参考,通过去除其中的帧间预测编码,以获得更适用于图像压缩场景的编码标准。
例如,如上述步骤所述,本公开实施例提供的方法在对转换为YUV格式的目标图像进行编码时,至少可以包括目标块划分处理、帧内预测编码处理、变换编码处理、目标量化处理。
目标块划分处理,例如可以是根据待编码图像的属性信息以及大小,根据预设规则对图像进行划分,以获得多个图像块。例如,可以按照4像素*4像素、8像素*8像素、16像素*16像素等任意一项作为单元图像块对待编码图像进行拆分,以得到多个图像块。相较于相关技术中的编码方法可能仅支持4像素*4像素、16像素*16像素的块划分模式,本公开实施例提供的方法通过增加8像素*8像素的块划分模式,能够在保障图像质量不变的情况下,提升图像压缩性能,以实现更细致的图像编码。
帧内预测编码处理,是以单帧图像为单位,针对拆分原始图像得到的多个图像块,基于多个相邻图像块的像素值在空间域,即像素域上的相关性、相似性,通过参考块和一组预测系数,预测相邻块中像素的变化,并通过像素实际值与预测值的差,去除一部分冗余数据,使得图像数据中像素值的动态范围变小,进而减少用于表示这些数值的比特数,压缩图像数据。
变换编码(transform coding)处理,是将原始图像经由帧内预测编码处理后获得的图像数据从空间域变换到频域,以将图像数据从动态连续的一系列数值变换为相关性较小的离散数值的处理。
考虑到离散余弦变换(DCT for Discrete Cosine Transform,DCT)处理的变换速度以及性能由于DFT、WHT等其他变换处理。因此,在一个实施例中,该变换编码处理例如可以为DCT变换编码处理,以提升图像编码处理的编码速度以及后续进行解码时的解码速度。
目标量化处理,是对变换编码处理后获得的一系列相关性较小的离散数值进行量化的处理,即,针对变换编码处理后的若干数值,将处于同一量化范围内的数值量化为同一量化系数,以对该若干数值进行压缩。例如,针对数值(a1,a2,a3,…,an),可以将处于同一量化范围内的数值(a1,a2)量化为量化系数b1,将处于另一量化范围内的数值(a6,a7)量化为量化系数b2。
在一个实施例中,所述对所述多个待量化数据分别进行所述目标量化处 理,获得多个量化系数,包括:根据预设映射数据,获取与第一待量化数据对应的第一待确定量化参数,其中,所述第一待量化数据为所述多个量化数据中的任一数据,所述预设映射数据用于反映待量化数据与量化参数之间的对应关系;根据所述第一待确定量化参数,基于网格编码量化对所述第一待量化数据进行率失真优化选择(Rate Distortion Optimized,RDO),获得第一目标量化参数;根据所述第一目标量化参数,对所述第一待量化数据进行量化处理,获得第一量化系数;根据所述第一量化系数,获得所述多个量化系数。
例如,在本公开的实施例中,针对变换编码处理后得到的待量化数据,即,待进行编码处理的变换系数,为了提升量化结果,以在确保图像质量的情况下,进一步提升图像压缩率,可以在量化处理中引进网格编码量化。例如,trellis量化过程,以通过对待量化数据进行RDO选择,筛选出更适合后续处理,例如,后续熵编码的量化系数。
即,在一个实施例中,所述根据所述多个量化系数,获得所述目标编码数据,包括:通过分别对所述多个量化系数进行熵编码(entropy encoding)处理,获得所述目标编码数据。
其中,该熵编码处理可以为基于香农(Shannon)编码、哈夫曼(Huffman)编码和算术编码(arithmetic coding)等编码算法的处理,其详细处理过程此处不再赘述。
在一个实施例中,所述通过分别对所述多个量化系数进行熵编码处理,获得所述目标编码数据,包括:通过分别对所述多个量化系数进行所述熵编码处理,获得第一编码数据;根据所述原始图像的属性信息、所述目标量化处理过程中与所述多个量化数据对应的目标量化系数以及所述目标块划分处理中使用的图像块划分规则,获得第二编码数据,其中,所述第二编码数据用于指示所述第一编码数据的编码格式,所述属性信息包括所述原始图像的高度和宽度;根据所述第一编码数据和所述第二编码数据,获得所述目标编码数据。
第一编码数据,是针对图像数据,例如,原始图像或原始图像对应的目标图像中包含的图像数据进行编码压缩处理后获得的二进制码流,即,为hpic编码格式中的主体数据码流。
第二编码数据,是用于指示该第一编码数据的编码格式的二进制码流,即为hpic编码格式中的头部数据码流,
例如,在使用本公开实施例提供的预设编码标准,即hpic编码标准中对图像数据进行编码时,在获得主体码流数据之后,为了便于解码处理时进行内存的预分配以及选用合适的解码工具,在对原始图像或目标图像进行编码时,还可以对图像数据,例如原始图像的属性信息、以及编码时所使用的编码工具信息等进行记录和编码。其中,属性信息可以为原始图像的高度和宽度。
请参看表1,其为本公开实施例提供的第二编码数据,即,头部信息编 码格式的语法约束示意表:
语法元素名称 | 描述符 |
frame_width | u(16) |
frame_height | u(16) |
b_transform_8x8 | ue(v) |
slice_qp_delta | se(w) |
reserved_zero_4Bytes | u(32) |
其中,在第二编码数据的开端,可以用frame_width以及frame_height字段表示原始图像的宽度和高度,每一字段分别用2个字节表示,以便于在解码阶段进行预解码处理;b_transform_8x8用于表示编码时是否使用了8x8的DCT变换;slice_qp_delta用于记录编码时所采用的量化参数的信息;最后4个字节则可以作为扩展字段;另外,在描述符定义中,u(n)用于表示n位无符号整数且不经过编码直接传输,例如u(16)表示图像宽度以16比特长度进行传输,ue(v)表示以哥伦布编码方式编码的无符号整数类型语法元素v,se(w)表示以哥伦布编码方式编码的有符号整数类型语法元素w;需要说明的是,在一实施例中,该头部信息编码中也可以包括其他字段,例如,还可以包括编码处理中使用的编码标准的版本,以便于解码端选择与编码标准对应版本的解码标准进行解码处理。
经过以上编码处理,即可获得与原始图像对应的目标编码数据,这样在需要在网络中传输原始图像时,即可通过传输该目标编码数据,以在确保图像质量的情况下,减少带宽消耗、提升传输效率。另外,在图像接收端接收到该目标编码数据之后,可以通过以下图像解码方法对目标编码数据进行解码以获得与原始图像对应的解码图像:获取待解析的目标编码数据;使用与所述预设编码标准对应的预设解码标准对所述目标编码数据进行解码处理,获得与所述原始图像对应的重建图像。
例如,与图像编码过程对应,该图像解码过程可以包括:头部信息解码,即第二编码数据解码处理、熵解码处理、反量化处理、反变换解码处理、帧内预测重建处理以及后处理滤波处理等处理。
其中,熵解码处理,用于将目标编码数据中包括的第一编码数据对应的二进制码流解析为多个量化系数;反量化处理根据解析获得的量化参数信息将熵解码处理获得的多个量化系数还原成频域的变换系数;反变换解码处理用于将反量化处理中还原得到的变换系数,根据每个解码系数块的大小进行对应的逆变换,以映射回空间域,即像素域的残差系数;帧内预测重建处理用于根据解析得到的预测模式构造参考像素并与残差系数相加得到重建像素;后处理滤波处理用于对重建像素进行滤波处理,以消除块级编码处理造成的块效应情况。
在一个实施例中,在目标编码数据中包括原始图像的属性信息的情况下,图像解码处理还可以包括预解码处理,可以为:对所述目标编码数据进行预解码处理,获得所述属性信息;根据所述属性信息,设置用于缓存所述重建 图像的缓存空间。
即,在获取到目标编码数据并准备进行具体解码处理之前,可以先进行预解码处理,以从目标编码数据的第二编码数据中获取原始图像的属性,例如宽度和高度,进而根据该宽度和高度,预先为重建图像分配内存空间,以确保在不浪费内存空间的前提下保证有足够的空间存储重建图像。
需要说明的是,在经过上述处理后得到的重建图像依然为YUV格式的图像数据,因此,在一个实施例中,还可以针对该YUV格式的重建图像进行色彩格式逆变换处理,以得到RGB格式的重建图像,其中,该逆变换处理可以通过以下公式实现:
为了便于理解本公开的实施例提供的图像编码方法,请参看图2,其为本公开实施例提供的图像编解码处理的应用场景示意图。如图2所示,该编解码场景在编码端,针对待编码的原始图像,可以先进行YUV格式转换处理,以获得YUV格式的原始图像。之后,可以使用预先定义第二编码数据,即,头部信息编码格式的语法约束,编码获得第二编码数据。再之后,可以针对图像中的像素数据进行主体编码处理,即,目标块划分处理、帧内预测编码处理、变换编码处理、目标量化处理、熵编码处理等处理以获得第一编码数据。之后,通过封装第一编码数据、第二编码数据得到与原始图像对应的目标编码数据并在云端的服务器中存储。云端的服务器可以为目标编码数据生成对应的URL标识链接,以便于解码端下载。同时,在云端的服务器接收到解码端的下载请求时,可以先根据预先设置的转码策略判断是否需要到内容分发网络(Content Delivery Network,CDN)中进行转码,若存在转码需要,则到CDN中进行解码,以获得转码后的码流数据的URL;若无转码需要,则可以直接将目标编码数据对应的URL标识链接提供给解码端。解码端根据接收到的URL标识链接,获取目标编码数据,并进行预解码处理、主体解码处理,即,头部信息解码,即第二编码数据解码处理、熵解码处理、反量化处理、反变换解码处理、帧内预测重建处理以及后处理滤波处理等处理以获得重建图像。之后,通过进行色彩格式逆变换处理,即可获得与原始图像对应的、RGB格式的重建图像并在解码端对应的显示装置上进行显示。
综上所述,本公开实施例提供的图像解码方法,针对待编码的原始图像,通过使用基于帧内预测编码且包含目标块划分处理和目标量化处理的预设编码标准对该原始图像进行编码,使得电子设备可以灵活选择合适的块划分模式对原始图像进行拆分,以在保证图像质量不变的情况下,提升图像压缩率。并且,在编码的过程中,通过基于网格编码量化,还可以提升量化处理的效果,以在不增加编解码复杂度的前提下,进一步的提升图像压缩率。实验数据表明,本申请的图像编码方法能够在压缩率方面相比相关技术中的webp编码方法提升14%,编码复杂度下降16%,下载耗时节省12%,实现了高质 量、低复杂度图像压缩处理。
与上述图像编码方法实施例相对应,本实施例还提供一种图像解码方法,该方法可以应用于电子设备,例如,可以用于服务器或者终端设备中。
请参看图3,其是本公开实施例提供的图像解码方法的流程示意图。如图3所示,该方法包括如下步骤S3100-S3200,以下予以详细说明。
步骤S3100,获取待解析的目标编码数据,其中,所述目标编码数据为使用预设编码标准对原始图像进行编码后获得的数据,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
步骤S3200,使用与所述预设编码标准对应的预设解码标准对所述目标编码数据进行解码处理,获得与所述原始图像对应的重建图像。
在一个实施例中,所述目标编码数据中包括所述原始图像的属性信息;该方法还包括:对所述目标编码数据进行预解码处理,获得所述属性信息;根据所述属性信息,设置用于缓存所述重建图像的缓存空间。
与上述图像编码方法实施例相对应,在本实施例中,还提供一种图像编码装置,如图4所示,该装置4000可以包括原始图像获取模块4100和编码模块4200。
该原始图像获取模块4100,设置为获取待编码的原始图像;该编码模块4200,设置为使用预设编码标准对所述原始图像进行编码,获得目标编码数据,其中,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
与上述图像解码方法实施例相对应,在本实施例中,还提供一种图像解码装置,如图5所示,该装置5000可以包括编码数据获取模块5100和解码模块5200。
该编码数据获取模块5100,设置为获取待解析的目标编码数据,其中,所述目标编码数据为使用预设编码标准对原始图像进行编码后获得的数据,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理;该解码模块5200,设置为使用与所述预设编码标准对应的解码标准对所述目标编码数据进行解码处理,获得与所述原始图像对应的重建图像。
在本实施例中,还提供一种电子设备,如图6所示,该电子设备6000还可以包括处理器6200和存储器6100,该存储器6100设置为存储可执行的指令;该处理器6200设置为根据指令的控制运行电子设备以执行根据本公开任意实施例的方法。
该电子设备6000可以是终端设备,或者,也可以为服务器,在此不做限定。
与上述图像编码方法实施例和图像解码方法实施例对应,在本实施例中, 还提供一种计算机可读存储介质,该计算机可读存储介质存储有可被计算机读取并运行的计算机程序,所述计算机程序设置为在被所述计算机读取运行时,执行如本公开以上任意实施例所述的方法。计算机可读存储介质可以为非暂态计算机可读存储介质。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人员来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。
Claims (14)
- 一种图像编码方法,包括:获取待编码的原始图像;使用预设编码标准对所述原始图像进行编码,获得目标编码数据,其中,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
- 根据权利要求1所述的方法,在所述使用预设编码标准对所述原始图像进行编码,获得目标编码数据之前,所述方法还包括:获取所述原始图像的色彩格式;响应于确定所述色彩格式为非YUV格式,转换所述原始图像为YUV格式;所述使用预设编码标准对所述原始图像进行编码,获得目标编码数据,包括:使用所述预设编码标准对转换为YUV格式的所述原始图像进行编码,获得所述目标编码数据。
- 根据权利要求1所述的方法,其中,所述使用所述预设编码标准对所述原始图像进行编码,获得所述目标编码数据,包括:按照所述预设规则拆分所述原始图像,获得多个图像块;通过对所述多个图像块进行帧内预测编码处理和变换编码处理,获得与所述多个图像块分别对应的多个待量化数据,其中,所述帧内预测编码处理用于从空间域上去除所述多个图像块中的冗余数据,所述变换编码处理用于将去除所述冗余数据的所述多个图像块从空间域变换到频域,以获得所述多个待量化数据;对所述多个待量化数据分别进行所述目标量化处理,获得多个量化系数;根据所述多个量化系数,获得所述目标编码数据。
- 根据权利要求3所述的方法,其中,所述对所述多个待量化数据分别进行所述目标量化处理,获得多个量化系数,包括:根据预设映射数据,获取与第一待量化数据对应的第一待确定量化参数,其中,所述第一待量化数据为所述多个量化数据中的任一数据,所述预设映射数据用于反映待量化数据与量化参数之间的对应关系;根据所述第一待确定量化参数,基于网格编码量化对所述第一待量化数据进行率失真优化选择,获得第一目标量化参数;根据所述第一目标量化参数,对所述第一待量化数据进行量化处理,获得第一量化系数;根据所述第一量化系数,获得所述多个量化系数。
- 根据权利要求3所述的方法,其中,所述根据所述多个量化系数,获得所述目标编码数据,包括:通过分别对所述多个量化系数进行熵编码处理,获得所述目标编码数据。
- 根据权利要求5所述的方法,其中,所述通过分别对所述多个量化系数进行熵编码处理,获得所述目标编码数据,包括:通过分别对所述多个量化系数进行所述熵编码处理,获得第一编码数据;根据所述原始图像的属性信息、所述目标量化处理过程中使用的所述预设映射数据以及所述目标块划分处理中使用的图像块划分规则,获得第二编码数据,其中,所述第二编码数据用于指示所述第一编码数据的编码格式,所述属性信息包括所述原始图像的高度和宽度;根据所述第一编码数据和所述第二编码数据,获得所述目标编码数据。
- 根据权利要求3所述的方法,其中,所述预设规则包括按照4像素*4像素、8像素*8像素和16像素*16像素中的任意一项作为单元图像块对所述原始图像进行块划分。
- 根据权利要求3所述的方法,其中,所述变换编码处理包括离散余弦变换编码处理。
- 一种图像解码方法,包括:获取待解析的目标编码数据,其中,所述目标编码数据为使用预设编码标准对原始图像进行编码后获得的数据,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理;使用与所述预设编码标准对应的预设解码标准对所述目标编码数据进行解码处理,获得与所述原始图像对应的重建图像。
- 根据权利要求9所述的方法,其中,所述目标编码数据中包括所述原始图像的属性信息;所述方法还包括:对所述目标编码数据进行预解码处理,获得所述属性信息;根据所述属性信息,设置用于缓存所述重建图像的缓存空间。
- 一种图像编码装置,包括:原始图像获取模块,设置为获取待编码的原始图像;编码模块,设置为使用预设编码标准对所述原始图像进行编码,获得目标编码数据,其中,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理。
- 一种图像解码装置,包括:编码数据获取模块,设置为获取待解析的目标编码数据,其中,所述目标编码数据为使用预设编码标准对原始图像进行编码后获得的数据,所述预设编码标准基于帧内预测编码,并且包括目标块划分处理和目标量化处理,所述目标块划分处理为基于预设规则的图像块划分处理,所述目标量化处理包括基于网格编码量化的数据量化处理;解码模块,设置为使用与所述预设编码标准对应的解码标准对所述目标编码数据进行解码处理,获得与所述原始图像对应的重建图像。
- 一种电子设备,包括:存储器,设置为存储可执行的指令;处理器,设置为根据所述指令的控制运行所述电子设备执行如权利要求1-10任意一项所述的方法。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有可被计算机读取执行的计算机程序,所述计算机程序设置为在被所述计算机读取运行时,执行根据权利要求1-10中任意一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111076563.5 | 2021-09-14 | ||
CN202111076563.5A CN113613004A (zh) | 2021-09-14 | 2021-09-14 | 图像编码方法、装置、电子设备及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023040600A1 true WO2023040600A1 (zh) | 2023-03-23 |
Family
ID=78310496
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/114080 WO2023040600A1 (zh) | 2021-09-14 | 2022-08-23 | 图像编码方法、图像解码方法、装置、电子设备及介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113613004A (zh) |
WO (1) | WO2023040600A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118524216A (zh) * | 2024-07-04 | 2024-08-20 | 深圳市欧冶半导体有限公司 | 基于变换和量化的图像编码方法、装置和计算机设备 |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113613004A (zh) * | 2021-09-14 | 2021-11-05 | 百果园技术(新加坡)有限公司 | 图像编码方法、装置、电子设备及存储介质 |
CN114337920B (zh) * | 2021-12-23 | 2024-03-26 | 中国农业银行股份有限公司 | 编码解析方法、装置及电子设备 |
CN115361554A (zh) * | 2022-08-18 | 2022-11-18 | 视梵微电子(深圳)有限公司 | 一种图像解压的方法和装置 |
CN116527903B (zh) * | 2023-06-30 | 2023-09-12 | 鹏城实验室 | 图像浅压缩方法及解码方法 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0921685A1 (en) * | 1997-12-04 | 1999-06-09 | Matsushita Electric Industrial Co., Ltd. | Image processing method, image processing apparatus, and data storage media |
US20100172582A1 (en) * | 2009-01-07 | 2010-07-08 | Industrial Technology Research Institute | Encoder, decoder, encoding method and decoding method |
CN108293120A (zh) * | 2015-11-30 | 2018-07-17 | 英特尔公司 | 使用小波和可变尺寸变换编码的高效帧内视频/图像编码 |
CN109842803A (zh) * | 2018-09-19 | 2019-06-04 | 华为技术有限公司 | 一种图像压缩的方法及装置 |
CN111277828A (zh) * | 2018-12-04 | 2020-06-12 | 华为技术有限公司 | 视频编解码方法、视频编码器和视频解码器 |
CN113613004A (zh) * | 2021-09-14 | 2021-11-05 | 百果园技术(新加坡)有限公司 | 图像编码方法、装置、电子设备及存储介质 |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110292247A1 (en) * | 2010-05-27 | 2011-12-01 | Sony Corporation | Image compression method with random access capability |
JP2012238997A (ja) * | 2011-05-11 | 2012-12-06 | Sony Corp | 画像処理装置及び画像処理方法 |
CA3206389A1 (en) * | 2012-01-17 | 2013-07-25 | Gensquare Llc | Method of applying edge offset |
US9930363B2 (en) * | 2013-04-12 | 2018-03-27 | Nokia Technologies Oy | Harmonized inter-view and view synthesis prediction for 3D video coding |
CA2880458A1 (en) * | 2014-01-29 | 2015-07-29 | Ecole De Technologie Superieure | Method and system for rate-constrained search ordering |
EP3334164B1 (en) * | 2016-12-09 | 2019-08-21 | Nokia Technologies Oy | A method and an apparatus and a computer program product for video encoding and decoding |
US20190191168A1 (en) * | 2017-12-19 | 2019-06-20 | Google Llc | Video quality and throughput control |
US20210400276A1 (en) * | 2018-11-22 | 2021-12-23 | Interdigital Vc Holdings, Inc. | Quantization for video encoding and decoding |
-
2021
- 2021-09-14 CN CN202111076563.5A patent/CN113613004A/zh active Pending
-
2022
- 2022-08-23 WO PCT/CN2022/114080 patent/WO2023040600A1/zh unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0921685A1 (en) * | 1997-12-04 | 1999-06-09 | Matsushita Electric Industrial Co., Ltd. | Image processing method, image processing apparatus, and data storage media |
US20100172582A1 (en) * | 2009-01-07 | 2010-07-08 | Industrial Technology Research Institute | Encoder, decoder, encoding method and decoding method |
CN108293120A (zh) * | 2015-11-30 | 2018-07-17 | 英特尔公司 | 使用小波和可变尺寸变换编码的高效帧内视频/图像编码 |
CN109842803A (zh) * | 2018-09-19 | 2019-06-04 | 华为技术有限公司 | 一种图像压缩的方法及装置 |
CN111277828A (zh) * | 2018-12-04 | 2020-06-12 | 华为技术有限公司 | 视频编解码方法、视频编码器和视频解码器 |
CN113613004A (zh) * | 2021-09-14 | 2021-11-05 | 百果园技术(新加坡)有限公司 | 图像编码方法、装置、电子设备及存储介质 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118524216A (zh) * | 2024-07-04 | 2024-08-20 | 深圳市欧冶半导体有限公司 | 基于变换和量化的图像编码方法、装置和计算机设备 |
Also Published As
Publication number | Publication date |
---|---|
CN113613004A (zh) | 2021-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10200690B2 (en) | Video decoder conformance for high dynamic range (HDR) video coding using a core video standard | |
WO2023040600A1 (zh) | 图像编码方法、图像解码方法、装置、电子设备及介质 | |
JP6800896B2 (ja) | ビデオコーディングのためにハイダイナミックレンジおよび広色域ビデオデータを処理すること | |
KR102120571B1 (ko) | 넌-4:4:4 크로마 서브-샘플링의 디스플레이 스트림 압축 (dsc) 을 위한 엔트로피 코딩 기법들 | |
US11765390B2 (en) | Non-transform coding | |
JP2014520493A (ja) | 合成ビデオのためのロスレス・コード化および関連するシグナリング方法 | |
CN113497937B (zh) | 图像编码方法、图像解码方法及相关装置 | |
US11627321B2 (en) | Adaptive coding of prediction modes using probability distributions | |
JP2017531355A (ja) | マルチ区分変換のために変換構造を再使用するためのシステム及び方法 | |
US7502415B2 (en) | Range reduction | |
TW201811028A (zh) | 用於循環樣本處理之視訊寫碼工具 | |
US8891616B1 (en) | Method and apparatus for entropy encoding based on encoding cost | |
KR20220043215A (ko) | 무손실 및 거의-무손실 압축을 위한 양자화기 | |
WO2022022622A1 (zh) | 图像编码方法、图像解码方法及相关装置 | |
TWI848530B (zh) | 圖像解碼方法、圖像編碼方法及相應的裝置 | |
US11870993B2 (en) | Transforms for large video and image blocks | |
TWI829424B (zh) | 解碼方法、編碼方法及裝置 | |
TWI821013B (zh) | 視頻編解碼方法及裝置 | |
EP3606070A1 (en) | Systems, methods, and apparatuses for video processing | |
CN118556403A (zh) | 用于联合发信号通知变换系数符号的系统和方法 | |
WO2024107210A1 (en) | Dc only transform coefficient mode for image and video coding | |
CN117397237A (zh) | 变换系数符号预测和编解码的系统和方法 | |
Pereira et al. | Video Compression |
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: 22868974 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 05/07/2024) |