CN116708800A - Image coding and decoding method, device and system - Google Patents

Image coding and decoding method, device and system Download PDF

Info

Publication number
CN116708800A
CN116708800A CN202310954385.4A CN202310954385A CN116708800A CN 116708800 A CN116708800 A CN 116708800A CN 202310954385 A CN202310954385 A CN 202310954385A CN 116708800 A CN116708800 A CN 116708800A
Authority
CN
China
Prior art keywords
image
complexity
compression
compression algorithm
blocks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310954385.4A
Other languages
Chinese (zh)
Inventor
张作宸
卢伟
郭庆峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd
Original Assignee
Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd filed Critical Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd
Priority to CN202310954385.4A priority Critical patent/CN116708800A/en
Publication of CN116708800A publication Critical patent/CN116708800A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/17Methods 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/176Methods 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 block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/08Protocols specially adapted for terminal emulation, e.g. Telnet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides an image coding and decoding method, device and system, which divide an image of a cloud desktop into a plurality of image blocks and determine the complexity of each image block, then perform lossless compression coding on the image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals, and send image data obtained by correspondingly coding the plurality of image blocks to a client; after receiving the image data, the client decodes the image data by adopting a decompression algorithm corresponding to a compression algorithm adopted by each image block. The method and the device can improve the compression speed and compression ratio of the cloud desktop image, and simultaneously meet the flexibility requirements of compression of different image contents, so that the experience of a user on using the cloud desktop is improved.

Description

Image coding and decoding method, device and system
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method, an apparatus, and a system for encoding and decoding an image.
Background
The cloud desktop technology is a virtualization technology based on a cloud computing technology, and can enable a user to remotely access computing resources of a cloud through a local computer. For example, a user may remotely acquire an image of the cloud desktop through the client, and because the image content of the cloud desktop is often complex and the data volume is relatively large, the image of the cloud desktop is usually required to be compressed and then transmitted to the client to reduce the transmitted data volume, thereby realizing the effect of reducing the flow. In the existing image compression technology, the partial compression algorithm has a relatively low compression rate although the compression rate is relatively high. In addition, in the use process of the cloud desktop, some scenes (such as images of the cloud desktop which are required to be acquired by a user and contain a large amount of characters) cannot use a lossy compression algorithm, and only a lossless compression algorithm can be used, but the existing lossless compression algorithm is low in compression, unstable in compression time (namely, a simple image is fast in compression speed and a complex image is slow in compression speed), single in compression mode, and difficult to meet the flexibility requirement of compression of different image contents.
Disclosure of Invention
Accordingly, the present invention is directed to an image encoding and decoding method, apparatus, and system, so as to improve the compression speed and compression ratio of the cloud desktop image, and meet the flexibility requirement of compressing different image contents, thereby improving the experience of using the cloud desktop by the user.
In a first aspect, an embodiment of the present invention provides an image encoding method, including: dividing an image of the cloud desktop into a plurality of image blocks, and determining the complexity of each image block; according to the complexity of each image block and a plurality of preset complexity intervals, performing lossless compression coding on the image blocks with the complexity in the different complexity intervals by adopting different compression algorithms; and sending the image data obtained after the corresponding encoding of the plurality of image blocks to a client.
In a second aspect, an embodiment of the present invention further provides an image decoding method, including: receiving image data obtained after corresponding encoding of a plurality of image blocks divided by an image of a cloud desktop; the image data is obtained by carrying out lossless compression encoding on image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals; and decoding the image data by adopting a decompression algorithm corresponding to the compression algorithm adopted by each image block.
In a third aspect, an embodiment of the present invention further provides an image encoding apparatus, including: the determining module is used for dividing the image of the cloud desktop into a plurality of image blocks and determining the complexity of each image block; the coding module is used for carrying out lossless compression coding on the image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals; and the transmission module is used for transmitting the image data obtained after the corresponding encoding of the plurality of image blocks to the client.
In a fourth aspect, an embodiment of the present invention further provides an image decoding apparatus, including: the receiving module is used for receiving image data obtained after corresponding encoding of a plurality of image blocks divided by the image of the cloud desktop; the image data is obtained by carrying out lossless compression encoding on image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals; and the decoding module is used for decoding the image data by adopting a decompression algorithm corresponding to the compression algorithm adopted by each image block.
In a fifth aspect, an embodiment of the present invention further provides an image encoding and decoding system, where the system includes the image encoding device and the image decoding device.
The image of the cloud desktop is divided into a plurality of image blocks, the complexity of each image block is determined, then the image blocks with the complexity in different complexity intervals are subjected to lossless compression coding by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals, and image data obtained by corresponding coding of the image blocks is sent to a client; after receiving the image data, the client decodes the image data by adopting a decompression algorithm corresponding to a compression algorithm adopted by each image block. By adopting the technology, as the image blocks with the complexity in different complexity intervals are subjected to lossless compression coding by adopting different compression algorithms, the compression speed and the compression ratio of the cloud desktop image can be improved, and meanwhile, the flexibility requirement of compression of different image contents can be met; and after the client decodes the received image data by adopting a decompression algorithm corresponding to the compression algorithm adopted by each image block, the image of the cloud desktop can be completely restored, so that the experience of using the cloud desktop by a user is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an image encoding method according to an embodiment of the present invention;
FIG. 2 is a flowchart of an image decoding method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an image encoding apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an image decoding apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an image encoding and decoding system according to an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described in conjunction with the embodiments, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
At present, in the existing image compression technology, although the compression speed of a partial compression algorithm is high, the compression ratio is low. In addition, in the use process of the cloud desktop, some scenes (such as images of the cloud desktop which are required to be acquired by a user and contain a large amount of characters) cannot use a lossy compression algorithm, and only a lossless compression algorithm can be used, but the existing lossless compression algorithm is low in compression, unstable in compression time (namely, a simple image is fast in compression speed and a complex image is slow in compression speed), single in compression mode, and difficult to meet the flexibility requirement of compression of different image contents.
Based on the method, the device and the system for encoding and decoding the image, provided by the embodiment of the invention, the compression speed and the compression ratio of the cloud desktop image can be improved, and meanwhile, the flexibility requirement of compression of different image contents is met, so that the experience of using the cloud desktop by a user is improved.
For the sake of understanding the present embodiment, first, an image encoding method disclosed in the present embodiment will be described in detail, with reference to a flowchart of an image encoding method shown in fig. 1, where the method may include the following steps:
step S102, dividing the image of the cloud desktop into a plurality of image blocks, and determining the complexity of each image block.
The image of the cloud desktop may generally refer to an image stored alone or a frame of video image in a stored video frame sequence, which is not limited in this regard.
The image content of the cloud desktop may include relatively complex objects (e.g., complex patterns with more detail, etc.) and/or relatively simple objects (e.g., simple lines with less detail, etc.), none of which are limiting.
After dividing the image of the cloud desktop into a plurality of image blocks, the complexity of the content contained in each image block may be characterized by complexity.
The size of the image block can be set according to the actual requirement, and the size is not limited.
Step S104, according to the complexity of each image block and a plurality of preset complexity intervals, performing lossless compression coding on the image blocks with the complexity in the different complexity intervals by adopting different compression algorithms.
The upper limit, the lower limit and the number of the complexity interval can be customized according to the actual requirement, and the complexity interval is not limited.
And step S106, the image data obtained after the corresponding encoding of the plurality of image blocks is sent to the client.
Illustratively, each image block divided by the image of the cloud desktop is subjected to lossless compression encoding to obtain corresponding encoded image data, and because each image block has corresponding position coordinates in the original image (i.e., the image of the cloud desktop), each image block still retains the corresponding position coordinates in the original image after lossless compression encoding. After the encoded image data corresponding to each image block is obtained, the encoded image data corresponding to the plurality of image blocks can be combined according to the position coordinates of each image block corresponding to the original image, so that combined image data is obtained, and then the combined image is sent to the client.
According to the image coding method provided by the embodiment of the invention, the image of the cloud desktop is divided into a plurality of image blocks, the complexity of each image block is determined, then the image blocks with the complexity in different complexity intervals are subjected to lossless compression coding by adopting different compression algorithms according to the complexity of each image block and the preset multiple complexity intervals, and image data obtained by corresponding coding of the plurality of image blocks is sent to the client. Because the image blocks with the complexity in different complexity intervals are subjected to lossless compression coding by adopting different compression algorithms, the compression speed and the compression ratio of the cloud desktop image can be improved, and meanwhile, the flexibility requirement of compression of different image contents can be met; and the client can completely recover the image of the cloud desktop after decoding the received image data, thereby improving the experience of using the cloud desktop by the user.
Since the image may be a single-channel image or a multi-channel image, the dividing the image of the cloud desktop into the plurality of image blocks in the step S102 may adopt one of the following two operation modes:
operation mode 1: if the image is a single-channel image, the image is directly divided into a plurality of image blocks with the same size. For example, the image is image data of a certain channel, and the image data of the channel may be directly divided into a plurality of image blocks with a size of 64×64.
Operation mode 2: if the image is a multi-channel image, channel separation is performed on the image to obtain first images of all channels of the image, and the first images of each channel of the image are divided into a plurality of image blocks with the same size. For example, the image is a three-channel image, the three-channel image may be subjected to channel separation to obtain image data of each of the three channels, and then the image data of each of the three channels is divided into a plurality of image blocks with a size of 64×64.
As a possible implementation manner, determining the complexity of each image block in the step S102 may include: for each image block, counting the total number of pixels of the image block and the number of pixels of each pixel value in the image block, and calculating the ratio between the number of pixels of the first pixel value with the largest number of pixels in the image block and the total number of pixels of the image block, and then determining the ratio as the complexity of the image block.
Continuing the previous example, for a certain 64×64 image block divided by the image of the cloud desktop, counting the total number of pixels contained in the image block as 4096, counting the distribution of the number of pixels of each pixel value in the image block, determining the pixel value with the largest number of pixels in the image block as a first pixel value, extracting the number of pixels of the first pixel value, calculating the ratio between the number of pixels of the first pixel value and the total number of pixels contained in the image block, and determining the ratio as the complexity of the image block.
As a possible implementation manner, the plurality of complexity intervals may include: a first interval having a complexity greater than a first complexity threshold, a second interval having a complexity greater than a second complexity threshold and not greater than the first complexity threshold, and a third interval having a complexity less than the second complexity threshold. Based on this, the step S104 (i.e. performing lossless compression encoding on the image blocks with the complexity in the different complexity intervals by using different compression algorithms according to the complexity of each image block and the preset multiple complexity intervals) may include: and carrying out lossless compression encoding on the image blocks with the complexity in the first interval by adopting a first compression algorithm, carrying out lossless compression encoding on the image blocks with the complexity in the second interval by adopting a second compression algorithm, and carrying out lossless compression encoding on the image blocks with the complexity in the third interval by adopting a third compression algorithm.
Wherein the first compression algorithm, the second compression algorithm, and the third compression algorithm are three different compression algorithms. For example, the first compression algorithm is a run-length (RLE) compression algorithm, the second compression algorithm is a finite state entropy (Finite State Entropy, FSE) compression algorithm, and the third compression algorithm is a Huffman compression algorithm. For another example, the first compression algorithm is a Zstandard (ZSTD) compression algorithm, the second compression algorithm is an RLE compression algorithm, and the third compression algorithm is a Huffman compression algorithm. The first compression algorithm, the second compression algorithm, and the third compression algorithm may each be other specific compression algorithms, and are not limited thereto.
In the practical application process, before the step S104, a plurality of image blocks with the same complexity range and adjacent positions corresponding to the images may be combined into a rectangular block.
Continuing the previous example, after obtaining a plurality of 64×64 image blocks divided by the image data of each channel and calculating the complexity of each image block of each channel, obtaining channel information (such as channel name, etc.), complexity and position information (i.e. the position coordinates of the image blocks corresponding to the original image) of each image block, combining a plurality of image blocks with identical channel information and complexity interval and adjacent positions into a rectangular block, thereby obtaining an uncombined image block and/or a rectangular block combined by a plurality of image blocks, and performing lossless compression encoding on the image blocks and/or rectangular blocks with identical channel information and complexity interval by using different compression algorithms by using different encoders in a thread pool mode. By adopting the operation mode, the overall compression efficiency of the image can be improved, and the redundant calculation in the image compression process is reduced.
For ease of understanding, the above image compression method is described herein as follows in a specific application:
for a certain RGB three-channel image of the cloud desktop, converting the RGB three-channel image into a YUV three-channel image, then carrying out channel separation on the YUV three-channel image to obtain image data of each of the Y, U, V three channels, and then dividing the image data of each of the Y, U, V three channels into a plurality of image blocks with the size of 64 multiplied by 64, so as to obtain a plurality of image blocks, wherein each image block has a respective channel name and position coordinates; counting the total number of pixels of each image block and the number of pixels of each pixel value in each image block, calculating the ratio of the number of pixels with the maximum pixel value in each image block to the total number of pixels, and determining the ratio calculated by each image block as the complexity of the image block so as to obtain the complexity of each divided image block, wherein each image block has the respective channel name, position coordinates and complexity; determining the complexity interval of each image block according to the complexity, so as to obtain the complexity interval of each image block, wherein each image block has the respective channel name, position coordinates, complexity and the complexity interval; then extracting the position coordinates of the image blocks with the same channel names and the same complexity interval to calculate the distance between the image blocks with the same channel names and the same complexity interval, merging a plurality of image blocks with the same channel names and the same complexity interval and within a certain range into a rectangular block, and carrying out lossless compression coding on the image blocks and/or rectangular blocks with the same channel names and the same complexity interval by using different compression algorithms through different encoders in a thread pool mode;
as an example, the above-mentioned lossless compression encoding of image blocks and/or rectangular blocks with the same channel name and complexity interval using different compression algorithms by using different encoders may be performed in the following manner: image blocks and/or rectangular blocks with a complexity of more than 50% are RLE compression encoded with a first encoder, image blocks and/or rectangular blocks with a complexity of more than 10% and not more than 50% are FSE compression encoded with a second encoder, and image blocks and/or rectangular blocks with a complexity of less than 10% are Huffman compression encoded with a second encoder.
As another example, the above-mentioned lossless compression encoding of image blocks and/or rectangular blocks with the same channel name and complexity interval using different compression algorithms by using different encoders may be performed in the following manner: image blocks and/or rectangular blocks with a complexity of more than 80% are RLE compression encoded with a fourth encoder, image blocks and/or rectangular blocks with a complexity of more than 30% and not more than 80% are FSE compression encoded with a fifth encoder, and image blocks and/or rectangular blocks with a complexity of less than 30% are Huffman compression encoded with a sixth encoder.
As other examples, the above-mentioned lossless compression encoding of image blocks and/or rectangular blocks with the same channel name and complexity interval by using different compression algorithms by using different encoders may be performed in the following manner: image blocks and/or rectangular blocks with a complexity of more than 70% are RLE compression encoded with a seventh encoder, image blocks and/or rectangular blocks with a complexity of more than 30% and not more than 70% are FSE compression encoded with an eighth encoder, and image blocks and/or rectangular blocks with a complexity of less than 30% are Huffman compression encoded with a ninth encoder.
As another example, the above-mentioned lossless compression encoding of image blocks and/or rectangular blocks with the same channel name and complexity interval using different compression algorithms by using different encoders may be performed in the following manner: ZSTD compression encoding is performed on image blocks and/or rectangular blocks with the complexity of more than 80% by using a tenth encoder, RLE compression encoding is performed on image blocks and/or rectangular blocks with the complexity of more than 20% and not more than 80% by using an eleventh encoder, and Huffman compression encoding is performed on image blocks and/or rectangular blocks with the complexity of less than 20% by using a second encoder.
According to the image coding method, the image compression mode is adopted, the image blocks are divided by the channels, the lossless compression coding of the image is performed by adopting different compression algorithms in a self-adaptive mode aiming at different complexity, the compression speed and the compression ratio of the image of the cloud desktop can be improved under the condition that the image content of the cloud desktop is complex, the image compression mode has strong flexibility, and a new compression coding mode can be automatically added.
Further, for a detailed description of an image decoding method disclosed in the embodiments of the present invention, referring to a flowchart of an image decoding method shown in fig. 2, the method may include the following steps:
step S202, receiving image data obtained after corresponding encoding of a plurality of image blocks divided by an image of a cloud desktop.
The image data may be obtained by performing lossless compression encoding on the image blocks with the complexity in the different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals.
And step S204, decoding the image data by adopting a decompression algorithm corresponding to the compression algorithm adopted by each image block.
According to the image decoding method provided by the embodiment of the invention, after receiving image data obtained by corresponding encoding of a plurality of image blocks divided by an image of a cloud desktop, a client decodes the image data by adopting a decompression algorithm corresponding to a compression algorithm adopted by each image block. Because the image blocks with the complexity in different complexity intervals are subjected to lossless compression coding by adopting different compression algorithms, the compression speed and the compression ratio of the cloud desktop image can be improved, and meanwhile, the flexibility requirement of compression of different image contents can be met; and after the client decodes the received image data by adopting a decompression algorithm corresponding to the compression algorithm adopted by each image block, the image of the cloud desktop can be completely restored, so that the experience of using the cloud desktop by a user is improved.
Since the image may be a single-channel image or a multi-channel image, the step S202 (i.e. receiving image data obtained by correspondingly encoding a plurality of image blocks divided by the image of the cloud desktop) may adopt one of the following two operation modes:
operation mode 1: if the image is a single channel image, a plurality of image blocks of the same size, which are directly divided by the image, are received.
Operation mode 2: if the image is a multi-channel image, receiving a plurality of image blocks with the same size of corresponding channels divided by a first image of each channel of the image; the first image of each channel of the image is obtained by carrying out channel separation on the image.
For a brief description, reference may be made to the corresponding contents of the foregoing image encoding method, where there is no mention in the foregoing image decoding method.
Further, for a detailed description of an image encoding device disclosed in an embodiment of the present invention, referring to a schematic structural diagram of an image encoding device shown in fig. 3, the image encoding device 300 may include the following modules:
a determining module 302, configured to divide an image of the cloud desktop into a plurality of image blocks, and determine a complexity of each image block.
The encoding module 304 is configured to perform lossless compression encoding on image blocks with complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals.
And the transmission module 306 is configured to send the image data obtained by correspondingly encoding the plurality of image blocks to a client.
The determination module 302 may also be configured to: if the image is a single-channel image, the image is directly divided into a plurality of image blocks with the same size; if the image is a multi-channel image, channel separation is performed on the image to obtain first images of all channels of the image, and the first images of each channel of the image are divided into a plurality of image blocks with the same size.
The determination module 302 may also be configured to: for each image block, counting the total number of pixels of the image block and the number of pixels of each pixel value in the image block, and calculating the ratio between the number of pixels of the first pixel value with the largest number of pixels in the image block and the total number of pixels of the image block, and then determining the ratio as the complexity of the image block.
The plurality of complexity intervals may include: a first interval having a complexity greater than a first complexity threshold, a second interval having a complexity greater than a second complexity threshold and not greater than the first complexity threshold, and a third interval having a complexity less than the second complexity threshold. Based on this, the above-described encoding module 304 may also be used to: performing lossless compression coding on the image blocks with the complexity in the first interval by adopting a first compression algorithm, performing lossless compression coding on the image blocks with the complexity in the second interval by adopting a second compression algorithm, and performing lossless compression coding on the image blocks with the complexity in the third interval by adopting a third compression algorithm; wherein the first compression algorithm, the second compression algorithm, and the third compression algorithm are three different compression algorithms.
The image coding device provided by the embodiment of the present invention has the same implementation principle and technical effects as those of the embodiment of the image coding method, and for the sake of brevity, reference may be made to the corresponding contents of the embodiment of the image coding method.
Further, for a detailed description of an image decoding apparatus disclosed in an embodiment of the present invention, referring to a schematic structure of an image decoding apparatus shown in fig. 4, the image decoding apparatus 400 may include the following modules:
a receiving module 402, configured to receive image data obtained after corresponding encoding of a plurality of image blocks divided by an image of a cloud desktop; the image data is obtained by performing lossless compression encoding on the image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals.
And the decoding module 404 is configured to decode the image data by using a decompression algorithm corresponding to the compression algorithm used by each image block.
The receiving module 402 may also be configured to: if the image is a single-channel image, receiving a plurality of image blocks with the same size, which are directly divided by the image; if the image is a multi-channel image, receiving a plurality of image blocks with the same size of corresponding channels divided by a first image of each channel of the image; the first image of each channel of the image is obtained by carrying out channel separation on the image.
The image decoding device provided by the embodiment of the present invention has the same implementation principle and technical effects as those of the embodiment of the image decoding method, and for the sake of brevity, reference may be made to the corresponding contents of the embodiment of the image decoding method.
Further, for a detailed description of an image encoding and decoding system according to an embodiment of the present invention, referring to a schematic structure of an image encoding and decoding system shown in fig. 5, the image encoding and decoding system 500 may include the image encoding apparatus 300 and the image decoding apparatus 400.
For a brief description, reference should be made to the corresponding contents of the foregoing image encoding apparatus embodiments and image decoding apparatus embodiments, where the foregoing description of the embodiment of the image encoding and decoding system is omitted.
The relative steps, numerical expressions and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An image encoding method, the method comprising:
dividing an image of the cloud desktop into a plurality of image blocks, and determining the complexity of each image block;
according to the complexity of each image block and a plurality of preset complexity intervals, performing lossless compression coding on the image blocks with the complexity in the different complexity intervals by adopting different compression algorithms;
and sending the image data obtained after the corresponding encoding of the plurality of image blocks to a client.
2. The image encoding method according to claim 1, wherein dividing the image of the cloud desktop into a plurality of image blocks includes:
if the image is a single-channel image, the image is directly divided into a plurality of image blocks with the same size;
if the image is a multi-channel image, channel separation is performed on the image to obtain first images of all channels of the image, and the first images of each channel of the image are divided into a plurality of image blocks with the same size.
3. The image encoding method according to claim 2, wherein determining the complexity of each image block comprises:
for each image block, counting the total number of pixels of the image block and the number of pixels of each pixel value in the image block, and calculating the ratio between the number of pixels of the first pixel value with the largest number of pixels in the image block and the total number of pixels of the image block, and then determining the ratio as the complexity of the image block.
4. The image encoding method according to claim 2, wherein the plurality of complexity intervals includes: a first interval having a complexity greater than a first complexity threshold, a second interval having a complexity greater than a second complexity threshold and not greater than the first complexity threshold, and a third interval having a complexity less than the second complexity threshold;
according to the complexity of each image block and a plurality of preset complexity intervals, performing lossless compression encoding on the image blocks with the complexity in the different complexity intervals by adopting different compression algorithms, wherein the lossless compression encoding comprises the following steps:
performing lossless compression coding on the image blocks with the complexity in the first interval by adopting a first compression algorithm, performing lossless compression coding on the image blocks with the complexity in the second interval by adopting a second compression algorithm, and performing lossless compression coding on the image blocks with the complexity in the third interval by adopting a third compression algorithm; wherein the first compression algorithm, the second compression algorithm, and the third compression algorithm are three different compression algorithms;
the first compression algorithm is a run-length compression algorithm, the second compression algorithm is a finite state entropy compression algorithm, and the third compression algorithm is a Huffman compression algorithm; alternatively, the first compression algorithm is a Zstandard compression algorithm, the second compression algorithm is a run-length compression algorithm, and the third compression algorithm is a huffman compression algorithm.
5. An image decoding method, the method comprising:
receiving image data obtained after corresponding encoding of a plurality of image blocks divided by an image of a cloud desktop; the image data is obtained by carrying out lossless compression encoding on image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals;
and decoding the image data by adopting a decompression algorithm corresponding to the compression algorithm adopted by each image block.
6. The image decoding method according to claim 5, wherein receiving image data obtained by corresponding encoding of a plurality of image blocks divided by an image of a cloud desktop, comprises:
if the image is a single-channel image, receiving a plurality of image blocks with the same size, which are directly divided by the image;
if the image is a multi-channel image, receiving a plurality of image blocks with the same size of corresponding channels divided by a first image of each channel of the image; the first image of each channel of the image is obtained by carrying out channel separation on the image.
7. The image decoding method of claim 6, wherein the plurality of complexity intervals comprises: a first interval having a complexity greater than a first complexity threshold, a second interval having a complexity greater than a second complexity threshold and not greater than the first complexity threshold, and a third interval having a complexity less than the second complexity threshold;
according to the complexity of each image block and a plurality of preset complexity intervals, performing lossless compression encoding on the image blocks with the complexity in the different complexity intervals by adopting different compression algorithms, wherein the lossless compression encoding comprises the following steps:
performing lossless compression coding on the image blocks with the complexity in the first interval by adopting a first compression algorithm, performing lossless compression coding on the image blocks with the complexity in the second interval by adopting a second compression algorithm, and performing lossless compression coding on the image blocks with the complexity in the third interval by adopting a third compression algorithm; wherein the first compression algorithm, the second compression algorithm, and the third compression algorithm are three different compression algorithms;
the first compression algorithm is a run-length compression algorithm, the second compression algorithm is a finite state entropy compression algorithm, and the third compression algorithm is a Huffman compression algorithm; alternatively, the first compression algorithm is a Zstandard compression algorithm, the second compression algorithm is a run-length compression algorithm, and the third compression algorithm is a huffman compression algorithm.
8. An image encoding apparatus, the apparatus comprising:
the determining module is used for dividing the image of the cloud desktop into a plurality of image blocks and determining the complexity of each image block;
the coding module is used for carrying out lossless compression coding on the image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals;
and the transmission module is used for transmitting the image data obtained after the corresponding encoding of the plurality of image blocks to the client.
9. An image decoding apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving image data obtained after corresponding encoding of a plurality of image blocks divided by the image of the cloud desktop; the image data is obtained by carrying out lossless compression encoding on image blocks with the complexity in different complexity intervals by adopting different compression algorithms according to the complexity of each image block and a plurality of preset complexity intervals;
and the decoding module is used for decoding the image data by adopting a decompression algorithm corresponding to the compression algorithm adopted by each image block.
10. An image encoding and decoding system, characterized in that the system comprises an image encoding device according to claim 8 and an image decoding device according to claim 9.
CN202310954385.4A 2023-08-01 2023-08-01 Image coding and decoding method, device and system Pending CN116708800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310954385.4A CN116708800A (en) 2023-08-01 2023-08-01 Image coding and decoding method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310954385.4A CN116708800A (en) 2023-08-01 2023-08-01 Image coding and decoding method, device and system

Publications (1)

Publication Number Publication Date
CN116708800A true CN116708800A (en) 2023-09-05

Family

ID=87829571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310954385.4A Pending CN116708800A (en) 2023-08-01 2023-08-01 Image coding and decoding method, device and system

Country Status (1)

Country Link
CN (1) CN116708800A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1630371A (en) * 2003-12-19 2005-06-22 联想(北京)有限公司 A method of lossless image compression applied to real time transmission
CN103402091A (en) * 2013-07-31 2013-11-20 上海通途半导体科技有限公司 Cloud desktop image classifying and encoding method
WO2018103568A1 (en) * 2016-12-08 2018-06-14 中兴通讯股份有限公司 Methods of encoding and decoding cloud desktop content, device, and system
CN116095318A (en) * 2022-05-31 2023-05-09 杭州海康威视数字技术股份有限公司 Video decoding method, device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1630371A (en) * 2003-12-19 2005-06-22 联想(北京)有限公司 A method of lossless image compression applied to real time transmission
CN103402091A (en) * 2013-07-31 2013-11-20 上海通途半导体科技有限公司 Cloud desktop image classifying and encoding method
WO2018103568A1 (en) * 2016-12-08 2018-06-14 中兴通讯股份有限公司 Methods of encoding and decoding cloud desktop content, device, and system
CN116095318A (en) * 2022-05-31 2023-05-09 杭州海康威视数字技术股份有限公司 Video decoding method, device and storage medium

Similar Documents

Publication Publication Date Title
US11936884B2 (en) Coded-block-flag coding and derivation
US9124900B2 (en) Encoding or decoding method and apparatus
CN109842803B (en) Image compression method and device
KR101781776B1 (en) Encoder and decoder
KR20130018413A (en) An image compression method with random access capability
KR20210134992A (en) Distinct encoding and decoding of stable information and transient/stochastic information
CN108650460A (en) Server, panoramic video store and transmit method and computer storage media
KR101805550B1 (en) Image data encoding method for presentation virtualization and server therefor
CN111131828B (en) Image compression method and device, electronic equipment and storage medium
WO2024078066A1 (en) Video decoding method and apparatus, video encoding method and apparatus, storage medium, and device
CN111464812B (en) Method, system, device, storage medium and processor for encoding and decoding
CN111246208B (en) Video processing method and device and electronic equipment
CN102577412B (en) Image coding method and device
CN109413445B (en) Video transmission method and device
CN116708800A (en) Image coding and decoding method, device and system
EP3989566A1 (en) Motion information list construction method in video encoding and decoding, device, and apparatus
CN116248895B (en) Video cloud transcoding method and system for virtual reality panorama roaming
CN115499664A (en) Video encoding method, video decoding method, and encoding end or/and decoding end
WO2024051299A1 (en) Encoding method and apparatus, and decoding method and apparatus
CN115426519A (en) Method and system for playing H265 video in browser
CN117676146A (en) Encoding and decoding method and device
CN115412727A (en) Encoding method, decoding method and device thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination