CN111131857A - Image compression method and device and electronic equipment - Google Patents

Image compression method and device and electronic equipment Download PDF

Info

Publication number
CN111131857A
CN111131857A CN201911422564.3A CN201911422564A CN111131857A CN 111131857 A CN111131857 A CN 111131857A CN 201911422564 A CN201911422564 A CN 201911422564A CN 111131857 A CN111131857 A CN 111131857A
Authority
CN
China
Prior art keywords
data
target image
format
standard
image
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
CN201911422564.3A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201911422564.3A priority Critical patent/CN111131857A/en
Publication of CN111131857A publication Critical patent/CN111131857A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to an image compression method and device. The method comprises the following steps: coding the target image by adopting a video coding standard to obtain coded data; and packaging the coded data according to a preset data format to obtain compressed data of the target image, wherein the data format comprises a field for expressing the type of the video coding standard. The method can effectively avoid the influence of blocking effect or ringing effect on the image quality. In addition, the size of compressed data can be effectively reduced, and the distribution cost of images is saved.

Description

Image compression method and device and electronic equipment
Technical Field
The present invention relates to the field of image compression technologies, and in particular, to an image compression method, an image decompression method, an image compression apparatus, an image decompression apparatus, an electronic device, and a computer-readable storage medium.
Background
When a server transmits an image to a user, the image typically needs to be compressed. The existing JPEG compression method is easy to generate blocking effect or ringing effect. Blocking artifacts are mainly manifested as trapezoidal noise and lattice noise. The trapezoidal noise refers to the sawtooth noise appearing at the edge of the image (the pixel set with the step change of the surrounding pixel gray level); the lattice noise means that the image has a lattice contour, and most of the image appears in a flat area. Ringing effect refers to the appearance of ringing at the edges of the image.
Therefore, a new technical solution for image compression is needed.
Disclosure of Invention
It is an object of the present invention to provide a new solution for image compression.
According to a first aspect of the present invention, there is provided an image compression method comprising:
coding the target image by adopting a video coding standard to obtain coded data;
and packaging the coded data according to a preset data format to obtain compressed data of the target image, wherein the data format comprises a field for expressing the video coding standard type.
Optionally, before encoding the target image using the video encoding standard, the method further comprises:
inputting the target image into a preset image enhancement model to obtain an updated target image;
and based on the updated target image, executing the step of encoding the target image by adopting the video encoding standard.
Optionally, the encoding the target image by using a video coding standard to obtain encoded data includes:
under the condition that the target image is in an RGB format, converting the target image from the RGB format to a YUV format;
and coding the target image in the YUV format by adopting a video coding standard to obtain the coded data.
Optionally, the encoding the target image in the YUV format by using the video encoding standard to obtain the encoded data includes:
coding a target image in a YUV format by adopting a video coding standard to obtain first coded data;
and adding first mark information in the first coded data to obtain the coded data, wherein the first mark information is used for indicating that the target image is in an RGB format.
Optionally, the encoding the target image by using a video coding standard to obtain encoded data includes:
under the condition that the target image is in an RGBA format, decomposing the target image into RGB data and alpha channel data, and converting the RGB data into YUV data;
coding the YUV data by adopting a video coding standard to obtain first coded data; encoding the alpha channel data to obtain second encoded data;
and obtaining the coded data according to the first coded data and the second coded data.
Optionally, the obtaining the encoded data according to the first encoded data and the second encoded data includes:
splicing the first coded data and the second coded data to obtain spliced data;
and adding second mark information in the splicing data to obtain the encoded data, wherein the second mark information is used for indicating that the target image is in an RGBA format.
According to a second aspect of the present invention, there is provided an image decompression method comprising:
analyzing the data format of the compressed data to obtain the encoded data of the target image and the type of the video encoding standard adopted in the encoding stage;
and decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain a target image.
Optionally, the decoding the encoded data by using a video decoding standard corresponding to the video encoding standard to obtain a target image includes:
under the condition that the target image is in an RGB format, decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain an image in a YUV format; converting the YUV format image into an RGB format to obtain the target image;
under the condition that the target image is in an RGBA format, decoding first coded data in the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain YUV data, and converting the YUV data into RGB data; decoding second coded data in the coded data to obtain alpha channel data; and obtaining the target image according to the RGB data and the alpha channel data.
According to a third aspect of the present invention, there is provided an image compression apparatus comprising:
the encoding module is used for encoding the target image by adopting a video encoding standard to obtain encoded data;
and the packaging module is used for packaging the coded data according to a preset data format to obtain compressed data of the target image, wherein the data format comprises a field for expressing the video coding standard type.
According to a fourth aspect of the present invention, there is provided an image decompression apparatus comprising:
the analysis module is used for analyzing the data format of the compressed data to obtain the encoded data of the target image and the type of the video encoding standard adopted in the encoding stage;
and the decoding module is used for decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain a target image.
According to a fifth aspect of the present invention, there is provided an electronic apparatus comprising:
a memory for storing executable commands;
a processor for executing the method of the first aspect or the second aspect of the invention under the control of the executable command.
According to a sixth aspect of the present invention, there is provided a computer readable storage medium storing executable instructions which, when executed by a processor, implement the method of the first or second aspect of the present invention.
The image compression method and the image decompression method in the embodiments of the present description use a video encoding and decoding standard to perform image compression and image decompression, and can effectively avoid the influence of a blocking effect or a ringing effect on image quality. In addition, the size of compressed data can be effectively reduced, and the distribution cost of images is saved.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1a is a schematic diagram of an image transmission system that can be used to implement an embodiment of the invention.
FIG. 1b is a schematic diagram of an electronic device that can be used to implement an embodiment of the invention.
Fig. 2 is a flowchart of an image compression method according to an embodiment of the present invention.
Fig. 3 is a flow chart of an example according to an embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< hardware configuration >
FIG. 1a shows a schematic diagram of an image transmission system that can be used to implement an embodiment of the invention.
As shown in fig. 1a, the image transmission system 1000 in the present embodiment includes a server 1100, a terminal apparatus 1200, and a network 1300.
The server 1100 is a server that provides an image transmission service. The server 1100 may be a blade server, a rack server, or the like, or may be a server cluster deployed in the cloud.
The terminal apparatus 1200 is an electronic apparatus for receiving and displaying an image. The terminal device 1200 is, for example, a mobile phone, a laptop computer, a tablet computer, a palmtop computer, a wearable device, or the like.
The server 1100 and the terminal device 1200 have, for example, the structure of the electronic device 100 shown in fig. 1 b.
Referring to fig. 1b, the electronic device 10 comprises a processor 110, a memory 120, an interface device 130, a communication device 140, an output device 150, an input device 160. The processor 110 is, for example, a central processing unit CPU, a microprocessor MCU, or the like. The memory 120 is, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, or the like. The interface device 130 is, for example, a USB interface, a headphone interface, or the like. The communication device 140 is capable of wired or wireless communication, for example. The output device 150 is, for example, a liquid crystal display, a touch panel, a speaker, or the like. The input device 160 is, for example, a touch panel, a keyboard, a mouse, a microphone, or the like.
In an embodiment of the present invention, the memory 120 of the electronic device 110 is used for storing instructions for controlling the processor 110 to execute the method provided by the embodiment of the present invention. In the above description, the skilled person will be able to design instructions in accordance with the disclosed solution. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
Although multiple devices per electronic apparatus are shown in fig. 1, the present invention may relate to only some of the devices, for example, the server 1000 relates to only the communication device 140, the memory 120, and the processor 110.
The hardware configurations shown in fig. 1a and 1b are merely illustrative and are in no way intended to limit the present invention, its application, or uses.
< method examples >
The present embodiment provides an image compression method, for example implemented by the server 1000 in fig. 1 a.
The image compression method provided by the embodiment is applied to a scene in which the cloud server distributes images, for example.
As shown in fig. 2, the method includes the following steps S1100-S1200.
In step S1100, the target image is encoded using a video encoding standard to obtain encoded data.
In this embodiment, the target image is encoded by using a video codec standard, such as the h.265 standard, the h.264 standard, the AVS2 standard, and the AV1 standard. It is easily understood that a video is composed of a plurality of image frames, and thus a video codec standard can be applied to the codec of a single image.
In the video encoding and decoding standard, the h.265 standard is preferably adopted. The h.265 standard surrounds the previous video coding standard h.264, preserving some of the original techniques, while improving some of the related techniques. The new technology uses advanced technology to improve the relationship between code stream, coding quality, time delay and algorithm complexity, so as to achieve the optimal setting. The specific content comprises the following steps: the method has the advantages of improving compression efficiency, robustness and error recovery capability, reducing real-time delay, reducing channel acquisition time and random access time delay, reducing complexity and the like. H.264 can realize standard definition (the resolution is below 1280P 720) digital image transmission at the speed lower than 1Mbps due to algorithm optimization; h.265 can realize the transmission of 720P (with the resolution of 1280 x 720) common high-definition audio and video by using the transmission speed of 1-2 Mbps.
In the embodiment, the video coding and decoding standard is applied to image coding, and corresponding processing is performed on target images in different color formats.
Under the condition that the target image is in the RGB format, firstly, the target image is converted into the YUV format from the RGB format, and then the image in the YUV format is coded by adopting a video coding standard to obtain coded data. The RGB color scheme is a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G), and blue (B) and superimposing the three color channels on each other, where RGB represents colors of the three channels of red, green, and blue, and the standard almost includes all colors that can be perceived by human vision, and is one of the most widely used color systems at present. YUV is a color coding method, often used in various video processing components. YUV allows for reduced bandwidth of chrominance in view of human perception when encoding photos or videos. "Y" represents brightness, i.e., gray scale value, and "U" and "V" represent chroma, which is used to describe the color and saturation of the image for specifying the color of the pixel.
In the case that the target image is in RGB format, the step of encoding the image in YUV format using the video encoding standard further includes: coding a target image in a YUV format by adopting a video coding standard to obtain first coded data; and adding first mark information in the first coded data to obtain coded data, wherein the first mark information is used for indicating that the target image is in an RGB format. In one example, the target image is encoded to obtain first encoded data "data 1", first flag information "signal 1" is added to the first encoded data, and the resulting encoded data is "signal 1data 1". Note that the position of the first flag information is not limited to the encoded data. For example, the first flag information may be recorded using special flag data in addition to the encoded data. In this case, the encoded data "data 1" and the flag data "signal 1" are included in the data transmitted from the server to the client. It is understood that the data splicing herein is only an example, and the present invention is not limited to the above example. The splicing mode of the data can be operated according to the actual situation, so that the coded data sent to the terminal comprises: first encoded data and first flag information. Here, the first flag information may be stored in a header of the encoded data, so that when the terminal device receives the encoded data, the terminal device determines a format of the picture according to the first flag information in the header, and performs a corresponding decoding operation.
Under the condition that the target image is in an RGBA format, firstly, the enhanced image is decomposed into RGB data and Alpha channel data, then the RGB data and the Alpha channel data are respectively coded, and finally, the final coded data is obtained according to the respectively coded result. The alpha channel refers to the transparency of a picture. For example, a bitmap stored using 16 bits per pixel, for each pixel in the graph, may have 5 bits for red, 5 bits for green, 5 bits for blue, and the last bit is alpha. In this case it either means transparent or not, because the alpha bit has only the possibility of two different representations, 0 or 1. As another example, a bitmap stored using 32 bits, each 8 bits representing a red, green, blue, and alpha channel. In this case, neither light can represent transparent or opaque, and the alpha channel can also represent 256 levels of translucency.
When the RGB data are coded, the RGB data are converted into YUV data, and then the YUV data are coded by adopting a video coding standard to obtain first coded data. When the alpha channel data is encoded, a video encoding standard may be adopted, and other encoding methods may also be adopted, so as to obtain the second encoded data.
In the case that the target image is in RGBA format, the step of obtaining the encoded data from the first encoded data and the second encoded data further comprises: splicing the first coded data and the second coded data to obtain spliced data; and adding second mark information in the splicing data to obtain coded data, wherein the second mark information is used for indicating that the target image is in an RGBA format. In one example, the first encoded data is "data 1", the second encoded data is "data 2", the first encoded data and the second encoded data are first spliced to "data 1data 2", the second flag information "signal 2" is added to the spliced data, and the finally obtained encoded data is "signal 2data1data 2". The position of the second flag information is also not limited to in the encoded data, similarly to the first flag information. It is understood that the data splicing herein is only an example, and the present invention is not limited to the above example. The splicing mode of the data can be operated according to the actual situation, so that the coded data sent to the terminal comprises: first encoded data, second encoded data, and second flag information. Here, the second flag information may be stored in a header of the encoded data, so that when the terminal device receives the encoded data, the terminal device determines a format of the picture according to the second flag information in the header, and performs a corresponding decoding operation.
In step S1200, the encoded data is encapsulated according to a preset data format, so as to obtain compressed data of the target image, where the data format includes a field indicating a video encoding standard type.
In this embodiment, the encapsulation of the encoded data is to form a specific data format from the encoded data. The data format can be preset according to actual conditions, and for example, the data format includes a file header, a video coding standard type, a coded data body, and the like.
In this embodiment, the data format includes a field indicating the type of video coding standard. As an example, a type field of "0001" indicates that the video coding standard is the h.265 standard, a type field of "0010" indicates that the video coding standard is the h.264 standard, and a type field of "0011" indicates that the video coding standard is the AVS2 standard.
In the case where the target image is in the RGBA format, the first encoded data and the second encoded data obtained in step S1200 are merged and packaged.
After the compressed data is obtained, the compressed data can be sent to the terminal device for the user to obtain.
The image compression method in the embodiment of the description adopts the video coding and decoding standard to carry out image compression, and can effectively avoid the influence of the blocking effect or the ringing effect on the image quality. In addition, the size of compressed data can be effectively reduced, and the distribution cost of images is saved.
In this embodiment, before step S1100, image enhancement processing is performed on the target image. Inputting the target image into a preset image enhancement model to obtain an updated target image; and based on the updated target image, performing the step of encoding the target image using the video encoding standard.
In this embodiment, the image enhancement model may be a deep learning model for removing image noise and improving image quality.
In one embodiment, the image enhancement model is obtained by: acquiring a sample image for training a model; adding noise into the sample image to obtain a noise image; and training the convolutional neural network model according to the sample image and the noise image to obtain an image enhancement model.
In this embodiment, the sample image is an image with high picture quality. The noise added to the sample image is, for example, gaussian noise, salt and pepper noise, or the like.
In this embodiment, an image enhancement model is generated in the form of a convolutional neural network. Convolutional Neural Networks (CNN) are a type of feed-forward Neural network that includes convolution calculations and has a deep structure, and are one of the representative algorithms of deep learning (deep learning). Convolutional neural networks have a characteristic learning ability, and can perform translation invariant classification on input information according to a hierarchical structure thereof, and are also called "translation invariant artificial neural networks".
In this embodiment, a training data set is formed from a sample image and a noise image, and a convolutional neural network is trained, in which a network output image is compared with the sample image, a difference between the network output image and the sample image is regarded as an error, and the error is minimized to perform training. And the trained convolutional neural network model is the image enhancement model.
By enhancing the target image and then encoding the target image by adopting the video encoding standard, the file size of data can be compressed under the condition of protecting the image quality, and the cost of image distribution is saved.
The present embodiment also provides an image decompression method, for example, implemented by the terminal device 1200 in fig. 1 a. The method comprises the following steps S2100-S2300.
In step S2100, the compressed data transmitted by the server 1100 is received.
In the present embodiment, the compressed data received by the terminal apparatus 1200 is obtained by the server 1100 according to the above-described image compression method.
In step S2200, the data format of the compressed data is parsed to obtain the encoded data of the target image and the type of video encoding standard used in the encoding stage.
In this embodiment, the type of the video coding standard used in the coding stage may be determined according to the value of the type field.
In this embodiment, when the target image is in the RGB format, the encoded data obtained by analyzing the compressed data is analyzed. In the case where the target image is in the RGBA format, the encoded data obtained by parsing the compressed data includes first encoded data and second encoded data.
In step S2300, the encoded data is decoded using a video decoding standard corresponding to the video encoding standard to obtain a target image.
In this embodiment, a video encoding and decoding standard is used to decode the compressed data. The video coding and decoding standard adopted during decoding is the same as the video coding and decoding standard adopted during encoding.
In the decoding stage, it may be determined that the type of the target image is the RGB format or the RGBA format from the flag information (including the first flag information and the second flag information). It is understood that the flag information may be located in the encoded data or outside the encoded data.
Under the condition that the target image is in an RGB format, firstly, the coded data is decoded by adopting a video coding and decoding standard to obtain an image in a YUV format. And secondly, converting the YUV format image into an RGB format image to obtain a target image.
Under the condition that the target image is in an RGBA format, firstly, a video coding and decoding standard is adopted to decode first coded data in the coded data to obtain YUV data, and meanwhile, a mode corresponding to a compression stage is adopted to decode second coded data in the coded data to obtain alpha channel data. And then, converting the YUV data into RGB data, and obtaining a target image according to the RGB data and alpha channel data.
An example of the implementation of the image compression method and the image decompression method in the present embodiment is provided below. Referring to fig. 3, first, the server inputs the target image into the image enhancement model, and performs image enhancement processing, i.e., performs step S101. Next, the server encodes the enhanced image using the video encoding and decoding standard to obtain encoded data, i.e. step S102 is executed. After that, the server encapsulates the encoded data to obtain compressed data, i.e., performs step S103. Finally, the server transmits the compressed data to the terminal device, i.e., performs step S104. After receiving the compressed data, the terminal device first parses the format of the compressed data to obtain the encoded data and the type of the adopted video encoding standard, i.e. step S105 is executed. Secondly, the terminal device decodes the encoded data by using the same video encoding and decoding standard as the encoding stage to obtain a YUV image, namely, step S106 is executed. Finally, the terminal device converts the YUV format into the RGB format, thereby obtaining the target image, i.e., performs step S107.
< apparatus embodiment >
The embodiment provides an image compression device which comprises an encoding module and a packaging module.
And the coding module is used for coding the target image by adopting a video coding standard to obtain coded data.
And the packaging module is used for packaging the coded data according to a preset data format to obtain compressed data of the target image, wherein the data format comprises a field for expressing the video coding standard type.
In one example, the image compression apparatus further comprises an enhancement module. The enhancement module is to: before a target image is coded by adopting a video coding standard, inputting the target image into a preset image enhancement model to obtain an updated target image; and based on the updated target image, performing the step of encoding the target image using the video encoding standard.
In one example, the encoding module is to: under the condition that the target image is in an RGB format, converting the target image from the RGB format into a YUV format; and coding the target image in the YUV format by adopting a video coding standard to obtain coded data.
In one example, the encoding module is to: coding a target image in a YUV format by adopting a video coding standard to obtain first coded data; and adding first mark information in the first coded data to obtain the coded data, wherein the first mark information is used for indicating that the target image is in an RGB format.
In one example, the encoding module is to: under the condition that the target image is in an RGBA format, decomposing the target image into RGB data and alpha channel data, and converting the RGB data into YUV data; coding the YUV data by adopting a video coding standard to obtain first coded data; encoding alpha channel data to obtain second encoded data; and obtaining the coded data according to the first coded data and the second coded data.
In one example, the encoding module is to: splicing the first coded data and the second coded data to obtain spliced data; and adding second mark information in the splicing data to obtain the encoded data, wherein the second mark information is used for indicating that the target image is in an RGBA format.
In one example, the image compression apparatus further includes a model training module. The model training module is used for: acquiring a sample image for training a model; adding noise into the sample image to obtain a noise image; and training the convolutional neural network model according to the sample image and the noise image to obtain an image enhancement model.
The embodiment also provides an image decompression device, which comprises an analysis module and a decoding module.
And the analysis module is used for analyzing the data format of the compressed data to obtain the encoded data of the target image and the type of the video encoding standard adopted in the encoding stage.
And the decoding module is used for decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain a target image.
In one example, the decoding module is to: decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain an image in a YUV format; converting the YUV format image into an RGB format to obtain a target image: decoding first coded data in the coded data by adopting a video decoding standard corresponding to a video coding standard to obtain YUV data, and converting the YUV data into RGB data; decoding second coded data in the coded data to obtain alpha channel data; and obtaining a target image according to the RGB data and the alpha channel data.
< electronic device embodiment >
The present embodiments provide an electronic device comprising a processor and a memory, the memory storing machine executable instructions capable of being executed by the processor, the processor executing the machine executable instructions to implement an image compression method or an image decompression method as described in the method embodiments of the present invention.
< machine-readable storage Medium embodiment >
The present embodiments provide a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement an image compression method or an image decompression method as described in method embodiments of the present invention.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (12)

1. An image compression method, comprising:
coding the target image by adopting a video coding standard to obtain coded data;
and packaging the coded data according to a preset data format to obtain compressed data of the target image, wherein the data format comprises a field for expressing the video coding standard type.
2. The method of claim 1, wherein prior to encoding the target image using the video encoding standard, the method further comprises:
inputting the target image into a preset image enhancement model to obtain an updated target image;
and based on the updated target image, executing the step of encoding the target image by adopting the video encoding standard.
3. The method of claim 1 or 2, wherein encoding the target image using a video encoding standard to obtain encoded data comprises:
under the condition that the target image is in an RGB format, converting the target image from the RGB format to a YUV format;
and coding the target image in the YUV format by adopting a video coding standard to obtain the coded data.
4. The method of claim 3, wherein the encoding the target image in YUV format using a video coding standard to obtain the encoded data comprises:
coding a target image in a YUV format by adopting a video coding standard to obtain first coded data;
and adding first mark information in the first coded data to obtain the coded data, wherein the first mark information is used for indicating that the target image is in an RGB format.
5. The method of claim 1 or 2, wherein encoding the target image using a video encoding standard to obtain encoded data comprises:
under the condition that the target image is in an RGBA format, decomposing the target image into RGB data and alpha channel data, and converting the RGB data into YUV data;
coding the YUV data by adopting a video coding standard to obtain first coded data; encoding the alpha channel data to obtain second encoded data;
and obtaining the coded data according to the first coded data and the second coded data.
6. The method of claim 5, wherein deriving the encoded data from the first encoded data and the second encoded data comprises:
splicing the first coded data and the second coded data to obtain spliced data;
and adding second mark information in the splicing data to obtain the encoded data, wherein the second mark information is used for indicating that the target image is in an RGBA format.
7. An image decompression method, comprising:
analyzing the data format of the compressed data to obtain the encoded data of the target image and the type of the video encoding standard adopted in the encoding stage;
and decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain a target image.
8. The method of claim 7, wherein decoding the encoded data using a video decoding standard corresponding to the video encoding standard to obtain a target image comprises:
under the condition that the target image is in an RGB format, decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain an image in a YUV format; converting the YUV format image into an RGB format to obtain the target image;
under the condition that the target image is in an RGBA format, decoding first coded data in the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain YUV data, and converting the YUV data into RGB data; decoding second coded data in the coded data to obtain alpha channel data; and obtaining the target image according to the RGB data and the alpha channel data.
9. An image compression apparatus, comprising:
the encoding module is used for encoding the target image by adopting a video encoding standard to obtain encoded data;
and the packaging module is used for packaging the coded data according to a preset data format to obtain compressed data of the target image, wherein the data format comprises a field for expressing the video coding standard type.
10. An image decompression apparatus, characterized by comprising:
the analysis module is used for analyzing the data format of the compressed data to obtain the encoded data of the target image and the type of the video encoding standard adopted in the encoding stage;
and the decoding module is used for decoding the coded data by adopting a video decoding standard corresponding to the video coding standard to obtain a target image.
11. An electronic device, comprising:
a memory for storing executable commands;
a processor for performing the method of any one of claims 1-8 under the control of the executable command.
12. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, perform the method of any of claims 1-8.
CN201911422564.3A 2019-12-31 2019-12-31 Image compression method and device and electronic equipment Pending CN111131857A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911422564.3A CN111131857A (en) 2019-12-31 2019-12-31 Image compression method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911422564.3A CN111131857A (en) 2019-12-31 2019-12-31 Image compression method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111131857A true CN111131857A (en) 2020-05-08

Family

ID=70507035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911422564.3A Pending CN111131857A (en) 2019-12-31 2019-12-31 Image compression method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111131857A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021237569A1 (en) * 2020-05-28 2021-12-02 深圳市大疆创新科技有限公司 Encoding method, decoding method, apparatus and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108777796A (en) * 2018-05-31 2018-11-09 深圳市易飞方达科技有限公司 A kind of image transfer method and device based on unmanned plane
CN109089162A (en) * 2017-04-08 2018-12-25 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
US20190116382A1 (en) * 2017-10-18 2019-04-18 Axis Ab Method and encoder for encoding a video stream in a video coding format supporting auxiliary frames
CN109803144A (en) * 2018-12-25 2019-05-24 北京凯视达科技有限公司 Video coding-decoding method, device, system and electronic equipment
CN110248177A (en) * 2019-05-29 2019-09-17 深圳英飞拓智能技术有限公司 A kind of processing method and processing device of image data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109089162A (en) * 2017-04-08 2018-12-25 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
US20190116382A1 (en) * 2017-10-18 2019-04-18 Axis Ab Method and encoder for encoding a video stream in a video coding format supporting auxiliary frames
CN108777796A (en) * 2018-05-31 2018-11-09 深圳市易飞方达科技有限公司 A kind of image transfer method and device based on unmanned plane
CN109803144A (en) * 2018-12-25 2019-05-24 北京凯视达科技有限公司 Video coding-decoding method, device, system and electronic equipment
CN110248177A (en) * 2019-05-29 2019-09-17 深圳英飞拓智能技术有限公司 A kind of processing method and processing device of image data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021237569A1 (en) * 2020-05-28 2021-12-02 深圳市大疆创新科技有限公司 Encoding method, decoding method, apparatus and system

Similar Documents

Publication Publication Date Title
US11012489B2 (en) Picture file processing method, picture file processing device, and storage medium
EP3465673B1 (en) Transitioning between video priority and graphics priority
AU2020201708B2 (en) Techniques for encoding, decoding and representing high dynamic range images
US9277196B2 (en) Systems and methods for backward compatible high dynamic range/wide color gamut video coding and rendering
US10368092B2 (en) Encoder-side decisions for block flipping and skip mode in intra block copy prediction
JP6472429B2 (en) Method, apparatus and system for determining LUMA values
JP6703032B2 (en) Backward compatibility extended image format
US9807402B2 (en) Method of color palette coding applicable to electronic device and electronic device using the same
US10715847B2 (en) Custom data indicating nominal range of samples of media content
JP2018191269A (en) Method and device of reconstructing image data from decoded image data
EP2892233A1 (en) Fitting RGB and transparency information into 24 bits of just RGB
JP2017522794A (en) Method and apparatus for signaling in a bitstream the picture / video format of an LDR picture and the picture / video format of a decoded HDR picture obtained from the LDR picture and the illumination picture
CN111131857A (en) Image compression method and device and electronic equipment
US11582464B2 (en) Using morphological operations to process frame masks in video content
US20230188743A1 (en) Embedding frame masks in a video stream
CN113450293A (en) Video information processing method, device and system, electronic equipment and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200508

RJ01 Rejection of invention patent application after publication