CN117221740A - Picture processing method and related equipment - Google Patents

Picture processing method and related equipment Download PDF

Info

Publication number
CN117221740A
CN117221740A CN202210596528.4A CN202210596528A CN117221740A CN 117221740 A CN117221740 A CN 117221740A CN 202210596528 A CN202210596528 A CN 202210596528A CN 117221740 A CN117221740 A CN 117221740A
Authority
CN
China
Prior art keywords
picture file
format
current coefficient
direct current
alternating current
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
CN202210596528.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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210596528.4A priority Critical patent/CN117221740A/en
Priority to PCT/CN2023/092770 priority patent/WO2023231710A1/en
Publication of CN117221740A publication Critical patent/CN117221740A/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/18Methods 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 a set of transform coefficients
    • 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/186Methods 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 a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/20Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding
    • H04N19/21Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding with binary alpha-plane coding for video objects, e.g. context-based arithmetic encoding [CAE]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/94Vector quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/85Camera processing pipelines; Components thereof for processing colour signals for matrixing

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

The embodiment of the application discloses a picture processing method and computer equipment, which can be applied to the field of computer file management, in particular to a decoding scene and an encoding scene of a picture file, and comprises the following steps: acquiring a first picture file; performing arithmetic decoding or asymmetric digital system decoding on the first picture file to obtain a first direct current coefficient and a first alternating current coefficient; performing inverse quantization and inverse discrete cosine transform on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in YUV format; and converting the YUV format picture file into an RGB format picture file. The method simplifies the decoding process of the picture file, so that the processing process of the picture file is more flexible, and the complexity and the resource expense of the system are reduced.

Description

Picture processing method and related equipment
Technical Field
The present application relates to the field of computers, and in particular, to a method and related apparatus for processing a picture.
Background
With the popularity of terminals represented by smart phones, the occupancy ratio of media files (especially pictures) in the existing smart phones and cloud storage is generally higher, and with the increasing of camera pixels, the resolution of the pictures is higher and higher, and the storage space occupied by each photo is larger and larger. At present, the insufficient storage space becomes one of the main factors of mobile phone replacement of users, the storage space required by pictures is reduced, the use efficiency of the storage space is improved, and the user experience and viscosity can be greatly improved.
JPEG (joint photographic experts group, JPEG) is the most widely used picture standard (picture format) at present, and for the existing standard JPEG, there have been standard decoders to realize various techniques from decoding to display of JPEG. With the development of technology, in order to improve the utilization efficiency of storage space, a picture file in a JPEG format may be encoded into a picture file with smaller storage space, so as to achieve a lower space occupation rate.
However, in the prior art, the process of decoding the picture file obtained after encoding the picture file in the JPEG format and using the decoded picture file in the scenes such as display is relatively dead and complicated, the complexity of the system is relatively high, and the resource overhead is relatively high.
Disclosure of Invention
Aiming at the technical problems, the embodiment of the application provides a picture processing method and computer equipment, which simplify the process of encoding or decoding a picture file in the prior art, so that the picture file processing process is more flexible, and the system complexity and resource expense are reduced.
Based on the above, the embodiment of the application provides the following technical scheme:
in a first aspect, an embodiment of the present application provides a picture processing method (decoding process) for decoding an encoded picture file into an RBG format picture file, and for displaying the picture file. The method can be applied to processing the picture at the end side and also can be applied to processing the picture at the cloud side, and comprises the following steps: acquiring a first picture file; performing arithmetic decoding or asymmetric digital system decoding on the first picture file to obtain a first direct current coefficient and a first alternating current coefficient; performing inverse quantization and inverse discrete cosine transform on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in YUV format; and converting the YUV format picture file into an RGB format picture file.
The above-described picture processing method simplifies the process of secondary decoding (i.e., simplifies the process of decoding the first picture file into a picture file of JPEG or the like) and simplifies the process of primary decoding (i.e., simplifies the process of decoding a picture file of JPEG or the like into a picture file of RGB format). That is, in the process of decoding the picture file in RGB format from the first picture file, the step of generating the picture file in JPEG or the like is skipped, thereby avoiding unnecessary Huffman encoding and decoding operations. By simplifying the decoding process from the first picture file to the picture file in RGB format, the processing process of the picture file is more flexible, and the complexity and the resource cost of the system are reduced.
In a possible implementation manner of the first aspect, the first picture file is obtained by encoding a second picture file, a format of the first picture file is different from a format of the second picture file, and a picture format of the second picture file is any one of a JPEG format, a PNG format or a GIF format.
In a possible implementation manner of the first aspect, the first picture file is stored in a memory. The first picture file may be stored in a local memory, or may be stored in a memory of a cloud or other electronic device.
In a possible implementation manner of the first aspect, the obtaining the first picture file is specifically receiving the first picture file from a cloud or other electronic devices.
In a possible implementation manner of the first aspect, the RGB format picture file is used for displaying. It will be appreciated that the above method may be applied in other scenarios than display where a picture file in RGB format is required. For other scenes requiring the JPEG format picture files for editing, transmitting and the like, the first picture file can be decoded into the JPEG format picture file by adopting a complete second decoding process.
Aiming at different application scenes, different decoding methods are adopted, so that the complexity of the system can be reduced on the basis of ensuring the realization of the functions, the performance of the system is improved, and the utilization efficiency of resources is reduced.
In a possible implementation manner of the first aspect, the process of performing inverse quantization and inverse discrete cosine transform on the first dc coefficient and the first ac coefficient to obtain a picture file in YUV format does not include: carrying out Huffman coding on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in a JPEG format; carrying out Huffman decoding on the JPEG-format picture file to obtain a second direct current coefficient and a second alternating current coefficient; and performing inverse quantization and inverse discrete cosine transformation on the second direct current coefficient and the second alternating current coefficient to obtain a picture file in YUV format.
In a second aspect, an embodiment of the present application provides a picture processing method (encoding process) for encoding a picture file in an RGB format into a picture format requiring less storage space, and for storing the picture file. The method can be applied to the end-side equipment and the cloud-side equipment, and comprises the following steps: acquiring an RGB format picture file; converting the RGB format picture file into a YUV format picture file; performing discrete cosine transform and quantization on the YUV-format picture file to obtain a third direct current coefficient and a third alternating current coefficient; and carrying out arithmetic coding or asymmetric digital system coding on the third direct current coefficient and the third alternating current coefficient to obtain a third picture file, wherein the third picture file is used for being stored in a memory.
The above-mentioned picture processing method simplifies the primary encoding process (i.e., simplifies the process of encoding the picture files in RGB format into the picture files in JPEG format, etc.), and simplifies the secondary encoding process (i.e., simplifies the process of encoding the picture files in JPEG format into the picture files requiring less storage space). That is, in the process of encoding a picture file having a smaller required storage space from a picture file in an RGB format, a step of generating a picture file in a JPEG format or the like is skipped, thereby avoiding unnecessary Huffman encoding and decoding operations. By simplifying the decoding process from the picture files in RGB format to the picture files with smaller required storage space, the processing process of the picture files is more flexible, and the complexity and the resource cost of the system are reduced.
In a possible implementation manner of the second aspect, the method further includes: performing arithmetic decoding or asymmetric decoding on the third picture file to obtain a third direct current coefficient or a third alternating current coefficient; performing inverse quantization and inverse discrete cosine transform on the third direct current coefficient or the third alternating current coefficient to obtain a picture file in YUV format; and converting the YUV format picture file into an RGB format picture file. This step may be used in a scene where the third picture file needs to be decoded to obtain a picture file in RGB format, for example, a scene such as display.
In a possible implementation manner of the second aspect, the method further includes: performing arithmetic decoding or asymmetric decoding on the third picture file to obtain the third direct current coefficient or the third alternating current coefficient; and carrying out Huffman coding on the third direct current coefficient or the third alternating current coefficient to obtain a picture file in a JPEG format. This step may be used in a scene where the third picture file needs to be decoded to obtain a picture file in a format such as JPEG, for example, a scene such as editing, transmitting, etc.
Aiming at the requirements of different application scenes, different decoding methods are adopted for the picture files, so that the complexity of the system can be reduced, the performance of the system can be improved, and the resource utilization efficiency can be reduced on the basis of ensuring the realization of functions.
In a possible implementation manner of the second aspect, the third picture file may be used to be stored in a memory. The third picture file may be stored in a local memory, or may be stored in a cloud or other electronic device memory, for example. In a scenario in which the third picture file is stored in a cloud or memory of another electronic device, the method further includes: and sending the third picture file to a cloud or other electronic equipment for storage.
In a possible implementation manner of the second aspect, arithmetic coding or asymmetric coding is performed on the third dc coefficient and the third ac coefficient to obtain a third picture file, which does not include: carrying out Huffman coding on the third direct current coefficient and the third alternating current coefficient to obtain a picture file in a JPEG format; carrying out Huffman decoding on the JPEG-format picture file to obtain a fourth direct current coefficient and a fourth alternating current coefficient; and carrying out arithmetic coding or asymmetric coding on the fourth direct current coefficient and the fourth alternating current coefficient to obtain a third picture file.
A third aspect of the embodiments of the present application provides a computer device having a function to implement the method of the first aspect, the second aspect, any one of the possible implementations of the first aspect, or any one of the possible implementations of the second aspect. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
A fourth aspect of the embodiments of the present application provides a computer device, which may include a memory, a processor, and a bus system, where the memory is configured to store a program, and the processor is configured to call the program stored in the memory to perform the method of the first aspect or any one of the possible implementation manners of the first aspect of the embodiments of the present application.
A fourth aspect of the embodiments of the present application provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the above-described first aspect, second aspect, any one of the possible implementations of the first aspect, or a method of any one of the possible implementations of the second aspect.
A fifth aspect of embodiments of the present application provides a computer program which, when run on a computer, causes the computer to perform the method of the first aspect, the second aspect, any one of the possible implementations of the first aspect, or any one of the possible implementations of the second aspect.
A sixth aspect of the embodiments of the present application provides a chip (e.g. a CPU) comprising at least one processor and at least one interface circuit coupled to the processor, the at least one interface circuit for performing a transceiving function and sending instructions to the at least one processor, the at least one processor for running a computer program or instructions having the functionality to implement the method of the first aspect, the second aspect, any one of the possible implementations of the first aspect, or any one of the possible implementations of the second aspect, the functionality being implemented in hardware, or in software, or in a combination of hardware and software, the hardware or software comprising one or more modules corresponding to the functionality described above. In addition, the interface circuit is used for communicating with other modules outside the chip, for example, the interface circuit can send the pseudo file and the second picture file obtained by the on-chip processor to the other side device for storage.
The second to sixth aspects of the embodiments of the present application can achieve the advantages as described in the first aspect, and in order to avoid repetition, details are not repeated here.
Drawings
FIG. 1 is a schematic diagram of a memory system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a picture processing method according to an embodiment of the present application;
fig. 3 is another flow chart of a picture processing method according to an embodiment of the present application;
fig. 4 is another flow chart of a picture processing method according to an embodiment of the present application;
fig. 5 is another flow chart of a picture processing method according to an embodiment of the present application;
fig. 6 is another flow chart of a picture processing method according to an embodiment of the present application;
fig. 7 is another flow chart of a picture processing method according to an embodiment of the present application;
fig. 8 is another flow chart of a picture processing method according to an embodiment of the present application;
fig. 9 is another flow chart of a picture processing method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a computer device according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a computer device according to an embodiment of the present application;
Fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. In the following description, reference is made to the accompanying drawings that show, by way of illustration, specific aspects of embodiments in which the application may be practiced. It is to be understood that embodiments of the application may be used in other aspects and may include structural or logical changes not depicted in the drawings. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present application is defined by the appended claims. For example, it should be understood that the disclosure in connection with the described methods may be equally applicable to a corresponding apparatus or system for performing the methods, and vice versa. For example, if one or more specific method steps are described, the corresponding apparatus may comprise one or more units, such as functional units, to perform the one or more described method steps (e.g., one unit performing one or more steps, or multiple units each performing one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the figures. On the other hand, if a specific apparatus is described based on one or more units such as a functional unit, for example, the corresponding method may include one step to perform the functionality of the one or more units (e.g., one step to perform the functionality of the one or more units, or multiple steps each to perform the functionality of one or more units, even if such one or more steps are not explicitly described or illustrated in the figures). Further, it is to be understood that features of the various exemplary embodiments and/or aspects described herein may be combined with each other, unless explicitly stated otherwise.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
The terminology used in the description of the embodiments of the application herein is for the purpose of describing particular embodiments of the application only and is not intended to be limiting of the application.
First, an application scenario related to the picture processing method provided by the embodiment of the application is introduced. In one possible implementation manner, the image processing method provided by the embodiment of the application can be executed at the end side. The terminal device may obtain the first picture file from its own memory or cloud, and decode the first picture file by the terminal processor and perform other processing operations, to finally obtain the picture file in RGB format for display. In a possible implementation manner, the image processing method provided by the embodiment of the application can be executed on the cloud side. The cloud side device may obtain the first picture file from its own memory, decode the first picture file by the cloud side processor, and perform other processing operations, to finally obtain an RGB format picture file, and send the RGB format picture to the end side for display. In a possible implementation manner, the image processing method provided by the embodiment of the application can be cooperatively executed through the end cloud. The cloud side device may acquire the first picture file from its own memory, perform a certain process, send the result of a certain intermediate process to the end side device, perform a subsequent process by the end side device, and finally generate a picture file in RGB format for display. In a possible implementation manner, the image processing method provided by the embodiment of the present application may be applied to a scene of home storage, where the home storage may correspond to the cloud side storage, and the method is similar and will not be described in detail.
Next, referring to fig. 1, fig. 1 is a schematic diagram of a storage system architecture according to an embodiment of the present application. As shown in fig. 1, the storage system includes a computing node 11, a storage node 12, and a storage medium 13. The computing node 11 and the storage node 12 may be physical servers, or may be virtual entities based on general hardware resource abstraction, such as virtual machines, containers, and the like. The storage medium 13 is, for example, a storage medium such as a Solid State Disk (SSD), a Hard Disk Drive (HDD), or a storage class memory (Storage class memory, SCM), and the storage medium 13 may be a storage medium local to a storage node or a distributed storage medium connected to the storage node.
The compute node 11 may have data access to the storage node 12, e.g., write data, read data, etc. Specifically, the computing node 11 may send a write request to the storage node 12 to write data, where the data to be written in the write request may be various types of data, such as pictures, databases, text, and the like. After receiving the write request, the storage node 12 may process the file related to the write request through the encoding module 121, the decoding module 121, the processing module 123, and the like. The encoding module 121, the dummy file generating module 123, and the decoding module 122 may be in the form of software, hardware, or firmware.
For convenience of understanding, the terms involved in the embodiments of the present application are simply introduced, and since the following encoding processes are all common in the industry, detailed description of the embodiments of the present application is omitted.
1. One-time encoding
The primary encoding in the embodiment of the present application refers to a process of encoding a picture file in RGB format into a picture file in JPEG format, PNG (Portable Network Graphics, PNG) format, GIF (Graphics Interchange Format, GIF) format, or the like, and the primary encoding process may also be referred to as primary compression, and mainly includes YUV encoding, discrete cosine transform (Discrete Cosine Transform, DCT), quantization, huffman encoding (Huffman), and the like, and each transform process will be described in detail below. In the embodiment of the present application, the picture file in RGB format is encoded into a picture file in JPEG format, and the process of encoding once is described by taking the example of encoding a picture file in RGB format into a picture file in JPEG format.
2. Secondary coding
The primary encoding in the embodiment of the application refers to a process of encoding a picture file in a format such as a JPEG format, a PNG format or a GIF format into a picture file in a format requiring smaller storage space. The embodiment of the application is not limited to the format of the picture file after the secondary encoding, and the picture format can be the same as or different from the format of the picture file after the primary encoding, but the required storage space is smaller than that of the picture file after the primary encoding. In the embodiment of the application, taking the secondary encoding of the JPEG-format picture file as an example, the secondary encoding process is described.
3.RGB
RGB color mode is a color standard in industry, which is to obtain various colors by changing three color channels of Red (R, red), green (G, green), blue (B, blue) and overlapping them with each other, and RGB is a color representing three channels of Red, green, and Blue, and this standard includes almost all colors perceived by human eyesight, and is one of the most widely used color systems. The picture files for display in a display scene are typically RGB format picture files.
4.YUV
YUV is a color coding method. Are often used in individual video processing components. YUV allows for reduced bandwidth of chroma in encoding video or light, taking into account human perceptibility. YUV is a kind of compiling true-color space (color space), and proper nouns such as Y' UV, YUV, YCbCr, YPbPr may be called YUV, which overlap each other. "Y" represents brightness (Luminance or Luma), i.e., gray scale values, "U" and "V" represent Chrominance (Chroma) to describe the image color and saturation for a given pixel color. YUV decoding is the inverse process corresponding to YUV encoding.
Since JPEG only supports the data structure of YUV color mode and not RGB image data structure, YUV encoding (data conversion of color mode) is required before the picture file in RGB format is encoded later.
5.DCT
The DCT transform is a process of transforming an image signal in a frequency domain to separate high-frequency and low-frequency information. And then compressing the high-frequency part of the image (namely image details) so as to achieve the purpose of compressing the image data. The image is first divided into a plurality of 8 x 8 matrices. And then DCT transformation is carried out on each matrix, and a frequency coefficient matrix is obtained after the transformation, wherein the frequency coefficients in the frequency coefficient matrix are all floating point numbers. Inverse DCT is an inverse process corresponding to DCT transformation.
6. Quantization
Quantization since the codebooks used in the subsequent encoding processes are integers, it is necessary to quantize the transformed frequency coefficients and convert them into integers. Inverse quantization is the inverse process corresponding to quantization.
7. Huffman coding
Huffman coding is a type of variable word length coding, and the method constructs the codeword with the shortest average length of the heteronym header, which is also called optimal coding or Huffman coding, completely according to the occurrence probability of characters. Huffman decoding is the inverse process corresponding to huffman encoding.
8. Arithmetic coding
Arithmetic coding is a lossless data compression method and also an entropy coding method. Other entropy coding methods are different from other entropy coding methods in that they generally divide an input message into symbols and then code each symbol, while arithmetic coding is to directly code the entire input message into a number, a fraction n satisfying (0.0. Ltoreq.n < 1.0). Given a set of symbols and a probability of a symbol, arithmetic coding can give a near optimal coding result. Compression algorithms using arithmetic coding typically estimate the probability of an input symbol before encoding. The more accurate this estimate, the closer the encoding result is to the optimal result. Arithmetic decoding is an inverse process corresponding to arithmetic encoding.
9. Asymmetric digital system (Asymmetric Numeral Systems, ANS) coding
ANS encoding is a lossless compression algorithm with both the compression rate of the AC algorithm and the compression rate of the Huffman algorithm.
With the popularity of terminals represented by smart phones, the occupancy ratio of media files (especially pictures) in the existing smart phones and cloud storage is generally higher, and with the increasing of camera pixels, the resolution of the pictures is higher and higher, and the storage space occupied by each photo is larger and larger. At present, the insufficient storage space becomes one of the main factors of mobile phone replacement of users, the storage space required by pictures is reduced, the use efficiency of the storage space is improved, and the user experience and viscosity can be greatly improved. JPEG (joint photographic experts group, JPEG) is currently the most widely used picture standard (picture format), however, the storage space required for a picture file in the JPEG format is large, and storing a large number of pictures in the JPEG format easily causes a problem that the storage space of a terminal or a cloud is insufficient.
In the current popular prior art, the image file in the JPEG format is mainly encoded into the image file with smaller required storage space, so that the effect of saving the storage space of the system is achieved. For the existing standard JPEG, various technologies from decoding to display of JPEG are realized by a standard decoder, but a picture file obtained by further encoding a picture file in a JPEG format is usually decoded into a picture file in a JPEG format, and then the picture file in the JPEG format is decoded by the existing standard decoder and is used in scenes such as display. The whole process is dead and tedious, the system complexity is high, and the resource cost is high.
Specifically, referring to fig. 2, fig. 2 is a schematic flow chart of processing a picture file in the prior art. In the prior art, as shown by the left arrow in fig. 2, after an original RGB format picture file is obtained by means of camera shooting or social software receiving, the RGB format picture file is converted into a YUV format picture file through YUV coding, DCT conversion and quantization are performed on the YUV format picture file, the YUV format picture file is converted into a direct current coefficient and an alternating current coefficient, and finally, the direct current coefficient and the alternating current coefficient are converted into a JPEG format picture file through Huffman coding. The above-described process is a one-time encoding process (which may be referred to herein as a complete one-time encoding process) of converting an RGB picture file into a picture file in JPEG format.
Then, in order to save the storage space, the picture file in the JPEG format is secondarily encoded to obtain a secondarily encoded picture file (in the figure, a picture file in the X format, the X format represents any possible picture format). Specifically, first, huffman decoding is performed on a picture file in a JPEG format to obtain tributary coefficients and ac coefficients, and then, encoding is performed on the dc coefficients and ac coefficients to obtain a picture file after secondary encoding. The above process can be referred to as a complete secondary encoding process. Finally, the picture files after secondary encoding are stored in the storage space, but the original picture files in RGB format and the picture files in JPEG format after primary encoding are not stored, so that the use efficiency of the storage space is greatly improved.
When a picture file is required for display, it needs to be restored to a picture file in RGB format by the procedure shown by the right arrow in fig. 2. Specifically, it is necessary to decode the picture file obtained after the secondary encoding to obtain a picture file in JPEG format, and then decode the picture file in JPEG format to obtain a picture file in RGB format.
Specifically, in the process of decoding the picture file obtained after the secondary encoding to obtain a picture file in a JPEG format, firstly, decoding the picture file obtained after the secondary encoding to obtain a direct current coefficient and an alternating current coefficient, and then, performing Huffman encoding on the direct current coefficient and the alternating current coefficient to obtain the picture file in the JPEG format. The above process may be referred to as a complete secondary decoding process. In the process of decoding a picture file in a JPEG format to obtain a picture file in an RGB format, firstly, huffman decoding is carried out on the picture file in the JPEG format to obtain a direct current coefficient and an alternating current coefficient, then, inverse quantization and inverse DCT transformation are carried out on the direct current coefficient and the alternating current coefficient to obtain a picture file in a YUV format, and finally, YUV decoding is carried out on the picture file in the YUV format to obtain the picture file in the RGB format. The above-described process may be referred to as a complete one-time decoding process. The picture file in RGB format is available for display.
In the prior art, in the process of encoding an RGB picture to obtain a picture file after secondary encoding, in order to obtain a JPEG format picture file, a direct current coefficient and an alternating current coefficient are subjected to one-time Huffman encoding, and in order to obtain a direct current coefficient and an alternating current coefficient, a direct current coefficient and an alternating current coefficient are subjected to one-time Huffman decoding. In practice, in a scene where the picture file in the JPEG format is not required to be output as the middle, the step of generating the picture file in the JPEG format may be skipped, and the picture file in the X format may be directly encoded by the picture file in the RGB format.
Specifically, referring to fig. 3, fig. 3 is a flow chart illustrating a simplified picture processing procedure. As shown in fig. 3, in the process of encoding the RGB format picture file, YUV encoding is performed on the RGB format picture file to obtain a YUV format picture file, then DCT transformation and quantization are performed on the YUV format picture file to obtain a direct current coefficient and an alternating current coefficient, and finally the direct current coefficient and the alternating current coefficient are directly decoded to obtain an X format picture file. The system can store the picture files in the X format to improve the utilization efficiency of the storage space. Correspondingly, in the process of decoding the picture file in the X format, firstly, decoding the picture file in the X format to obtain a direct current coefficient and an alternating current coefficient, then, performing inverse quantization and inverse DCT (discrete cosine transform) on the direct current coefficient and the alternating current coefficient to obtain the picture file in the YUV format, and finally, performing YUV decoding on the picture file in the YUV format to obtain the picture file in the RGB format, wherein the picture file in the RGB format can be used for display.
The picture processing flow shown in fig. 3 eliminates redundant Huffman coding and Huffman decoding processes in the prior art, and simplifies primary coding process, secondary coding process, primary decoding process and secondary decoding process. By simplifying the decoding and encoding processes, redundant operations can be avoided, resource overhead is reduced to a certain extent, and system complexity is reduced.
Based on the above background and the inventive concept, a detailed description will be given of a picture processing method provided in an embodiment of the present application, which corresponds to the right-side step in fig. 3, that is, a process of decoding a file obtained by the secondary encoding to obtain a picture file in RGB format for display. The image processing method can be used in the various application scenarios described above, only the end side is used as the execution subject to describe the detailed description of the scheme, and it should be understood that other application scenarios can be used, and the method is basically the same. Referring to fig. 4, fig. 4 is a schematic flow chart of a picture processing method according to an embodiment of the present application, which may specifically include the following steps:
401. and acquiring a first picture file.
The first picture file here corresponds to the picture file in the X format in fig. 3, i.e., the stored picture file, and the first picture file may be stored in the memory. The embodiment of the application does not limit the format of the first picture file, and can be a private format or a standard format.
The first picture file may be obtained in step 401 by a variety of possible implementations. In one possible implementation, the first picture file may be stored in a local memory, at which time the first picture file may be retrieved from the local memory. In another possible implementation manner, the first picture file may be stored in a memory of the cloud end, and at this time, the first picture file may be received from the cloud end. In another possible implementation, the first picture file may be stored in another electronic device (e.g., a separate memory or other terminal device), at which point the first picture file may be received from the other electronic device.
The first picture file may have a plurality of sources. In one possible implementation manner, the first picture file may be obtained through a process shown by a left arrow in fig. 2, that is, the first picture file is obtained by performing a complete primary encoding on a picture file in an RGB format to obtain a picture file in a format of JPEG or the like, and performing a complete secondary encoding on a picture file in a format of JPEG or the like. In another possible implementation manner, the first picture file may be obtained by processing a procedure shown by an arrow on the left side of fig. 3, that is, the first picture file is obtained by performing simplified primary encoding on a picture file in an RGB format to obtain a picture file in a format of JPEG or the like, and performing simplified secondary encoding on a picture file in a format of JPEG or the like. In another possible implementation manner, the first picture file may be obtained by encoding a picture file in a format such as JPEG, and in the embodiment of the present application, the method for obtaining the picture file in a format such as JPEG is not limited, and, by way of example, the picture file in a format such as JPEG may be obtained by social software or the like, or may be obtained from the cloud.
It should be understood that the above-mentioned picture file in the format of JPEG or the like is not limited to the JPEG format, but may be a common picture format in which secondary encoding is possible, such as PNG format or GIF format. The embodiment of the application only takes the JPEG-format picture file as an example to describe the picture processing method in detail.
402. An arithmetic decoding or an asymmetric digital system (ANS) decoding is performed on the first picture file to obtain a first dc coefficient and a first ac coefficient.
403. And performing inverse quantization and inverse discrete cosine transformation on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in YUV format.
It should be noted that, in step 403, the first dc coefficient and the first ac coefficient obtained in step 402 are directly subjected to inverse quantization and inverse discrete cosine transform to obtain a picture file in YUV format. Specifically, in the prior art, huffman coding is required to be performed on the first dc coefficient and the first ac coefficient obtained in step 402 to obtain a JPEG format picture file, then Huffman decoding is performed on the JPEG format picture file to obtain a second dc coefficient and a second ac coefficient, and then inverse quantization and inverse discrete cosine transformation are performed on the second dc coefficient and the second ac coefficient to obtain a YUV format picture file. Step 403 is different from the scheme in the prior art, skip the Huffman coding and Huffman decoding steps, and directly perform inverse quantization and inverse discrete cosine transform on the first dc coefficient and the first ac coefficient obtained in step 402 to obtain a picture file in YUV format.
404. And converting the YUV format picture file into an RGB format picture file.
Step 404 may be implemented through a YUV decoding process, and the resulting RGB format picture file may be used for display or for browsing by a user.
The picture processing method simplifies the redundant steps in the decoding process, so that the decoding process is more flexible, the complexity and resource expenditure of the system are reduced, and the efficiency of decoding the picture file is improved to a certain extent.
Along with the diversified development of terminal functions, a user has various possible use modes for the picture files, so that different modes can be adopted for processing the picture files according to different use modes, and the processing efficiency of the system is improved to the greatest extent. Referring to fig. 5, fig. 5 starts with a first picture file. In one possible implementation, the user may wish to use the first picture file for a scene such as a display, requiring the first picture file to be converted to a picture file in RGB format. At this time, the first picture file may be converted into a picture file in RGB format through a simplified secondary decoding process and a simplified primary decoding process using a picture processing method as shown in fig. 4. In another possible implementation, the user may wish to edit the first picture file, or send the first picture file through a social application such as a micro-letter, a micro-blog, or the like, and the first picture file needs to be converted into a picture file in a format such as JPEG. At this time, a complete secondary decoding process may be adopted to convert the first picture file into a picture file in a format such as JPEG.
It should be appreciated that the above application scenarios are merely exemplary, and that other application scenarios are also possible. For application scenes needing picture files in JPEG format and the like, a complete secondary decoding process can be adopted to process the first picture file, and for factor scenes needing picture files in RGB format, a simplified secondary decoding process and a simplified primary decoding process can be adopted to process the first picture file.
According to different purposes, different processing modes are adopted for the picture files, so that the management of the picture files by the system is more flexible, the system efficiency is further improved, the system complexity is reduced, and the utilization rate of resources is improved on the premise of ensuring the function realization.
Based on the above background and the inventive concept, another picture processing method provided by the embodiment of the present application will be described in detail, where the picture processing method corresponds to the left step in fig. 3, that is, a process of encoding a picture file in RGB format to obtain a file obtained by secondary encoding for storage. The image processing method can be used in the various application scenarios described above, only the end side is used as the execution subject to describe the detailed description of the scheme, and it should be understood that other application scenarios can be used, and the method is basically the same. Referring to fig. 6, fig. 6 is a schematic flow chart of a picture processing method according to an embodiment of the present application, which may specifically include the following steps:
601. And acquiring a picture file in an RGB format.
The method for acquiring the RGB-format picture files is not limited, and the RGB-format picture files can be acquired by photographing and other acquisition modes, or can be received from a cloud or other electronic equipment.
602. And converting the picture file in the RGB format into a picture file in the YUV format.
Step 602 may be implemented by a YUV encoding process.
603. And performing discrete cosine transform and quantization on the YUV-format picture file to obtain a third direct current coefficient and a third alternating current coefficient.
604. And carrying out arithmetic coding or asymmetric digital system coding on the third tributary coefficient and the third alternating coefficient to obtain a third picture file, wherein the third picture file is used for storage and storage.
After the third picture file is obtained, the third picture file may be stored, in one possible implementation, the third picture file may be stored in a local memory, in another possible implementation, the third picture file may be sent to a cloud memory for storage, and in another possible implementation, the third picture file may be sent to other electronic devices for storage.
It should be noted that in step 604, the third dc coefficient and the third ac coefficient obtained in step 603 are directly subjected to arithmetic coding or asymmetric digital system coding to obtain a third picture file. Specifically, in the prior art, huffman coding is required to be performed on the third dc coefficient and the third ac coefficient obtained in step 603 to obtain a JPEG format picture file, then Huffman decoding is performed on the JPEG format picture file to obtain a fourth dc coefficient and a fourth ac coefficient, and then arithmetic coding or asymmetric digital system coding is performed on the fourth dc coefficient and the fourth ac coefficient to obtain a third picture file. Step 604, unlike the prior art scheme, skips Huffman coding and Huffman decoding steps, and directly performs arithmetic coding or asymmetric digital system coding on the third dc coefficient and the third ac coefficient obtained in step 603 to obtain a third picture file.
Referring to fig. 7, in one possible implementation manner, when the third picture needs to be converted into a picture file in RGB format, the above picture processing method further includes the following steps:
605. and carrying out arithmetic decoding or asymmetric digital system decoding on the third picture file to obtain a third direct current coefficient and a third alternating current coefficient.
606. And performing inverse quantization and inverse discrete cosine transformation on the third direct current coefficient and the third alternating current coefficient to obtain a picture file in YUV format.
607. And converting the YUV format picture file into an RGB format picture file.
Steps 605-607 are optional, and the specific implementation of steps 605-607 is substantially the same as the implementation of steps 402-403, and will not be repeated here.
For example, the scene of the third picture file that needs to be converted into the picture file in RGB format or the like includes display and the like, and other scenes that need to use the picture file in RGB format or the like are also possible.
Referring to fig. 8, in one possible implementation manner, when the third picture needs to be converted into a picture file in JPEG format, the above picture processing method further includes the following steps:
608. and carrying out arithmetic decoding or asymmetric digital system decoding on the third picture file to obtain a third direct current coefficient and a third alternating current coefficient.
609. And performing Huffman coding on the third direct current coefficient and the third alternating current coefficient to obtain a picture file in a JPEG format.
Steps 608 and 609 are optional. The specific implementation of step 608 is substantially the same as that of step 402, and step 609 may be implemented by a scheme in the prior art, so that a detailed description is omitted here for avoiding repetition.
For example, the scene of the third picture file to be converted into the picture file in the format of JPEG or the like includes editing, sending through a social application such as a micro letter or a micro blog, and other scenes of the picture file in the format of JPEG or the like are possible.
The picture processing method simplifies the redundant steps in the coding process, so that the coding process is more flexible, the complexity and resource expenditure of the system are reduced, and the coding efficiency of the picture file is improved to a certain extent.
Along with the diversified development of terminal functions, a user has various possible use modes for the picture files, so that different modes can be adopted for processing the picture files according to different use modes, and the processing efficiency of the system is improved to the greatest extent. Referring to fig. 9, fig. 9 starts with a picture file in RGB format. In one possible implementation, the user may wish to store the picture file, at which point, to save storage space, the RGB format picture file needs to be encoded into an X format picture file that requires less storage space. At this time, the picture file in RGB format may be converted into the picture file in X format through a simplified primary encoding process and a simplified secondary encoding process using a picture processing method as shown in fig. 6. In another possible implementation, the user may wish to edit the RGB format picture file or send the picture file through a social application such as a micro-letter or a micro-blog, where the RGB format picture file needs to be converted into a JPEG format picture file. At this point, a complete one-time encoding process may be employed.
According to different purposes, different processing modes are adopted for the picture files, so that the management of the picture files by the system is more flexible, the system efficiency is further improved, the system complexity is reduced, and the utilization rate of resources is improved on the premise of ensuring the function realization.
In order to better implement the above-described aspects of the embodiments of the present application on the basis of the above-described corresponding embodiments, a computer device for implementing the above-described aspects is also provided below. The computer device may include a handheld terminal device, such as a mobile phone, a computer, an iPad, etc., and may also include an intelligent wearable device, such as an intelligent bracelet, an intelligent watch, an intelligent heart rate meter, etc.; the application is not limited to the product form of the computer device, and the electronic device which can be used for realizing the picture processing method of the application can be called as the computer device.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application, where the computer device 1000 includes: the device comprises an acquisition module 1003, a decoding module 1002 and a processing module 1002, wherein the acquisition module 1001 is used for acquiring a first picture file; a decoding module 1002, configured to perform arithmetic decoding or ANS decoding on the first picture file to obtain a first dc coefficient and a first ac coefficient; a processing module 1003, configured to perform inverse quantization and inverse discrete cosine transform on the first dc coefficient and the first ac coefficient to obtain a picture file in YUV format; the processing module is also used for converting the YUV format picture file into an RGB format picture file.
In one possible design, the first picture file is obtained by encoding a second picture file, where the format of the first picture file is different from the format of the second picture file, and the format of the second picture file is any one of the following:
JPEG format, PNG format or GIF format.
In one possible design, the first picture file is stored in memory.
In one possible design, the RGB format picture file is used for display
In one possible design, the obtaining module 1001 is specifically configured to receive the first picture file from a cloud or other electronic device.
In one possible design, the processing module is not used to: carrying out Huffman coding on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in a JPEG format; carrying out Huffman decoding on the JPEG-format picture file to obtain a second direct current coefficient and a second alternating current coefficient; and performing inverse quantization and inverse discrete cosine transformation on the second direct current coefficient and the second alternating current coefficient to obtain a picture file in YUV format.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application, and the computer device 1100 includes: the device comprises an acquisition module 1101, an encoding/decoding module 1102 and a processing module 1103, wherein the acquisition module 1101 is used for acquiring a picture file in an RGB format; a processing module 1103, configured to convert the RGB format picture file into a YUV format picture file; the processing module 1103 is further configured to perform discrete cosine transform and quantization on the YUV format picture file to obtain a third direct current coefficient and a third alternating current coefficient; the encoding/decoding module 1102 is configured to perform arithmetic encoding or asymmetric digital system encoding on the third dc coefficient and the third ac coefficient to obtain a third picture file, where the third picture file is used for being stored in a memory.
In one possible design, the encoding/decoding module 1102 is further configured to perform arithmetic decoding or asymmetric decoding on the third picture file to obtain the third dc coefficient or the third ac coefficient; the processing module 1103 is further configured to perform inverse quantization and inverse discrete cosine transform on the third dc coefficient or the third ac coefficient to obtain a picture file in the YUV format; the processing module 1103 is further configured to convert the YUV format picture file into an RGB format picture file.
In one possible design, the encoding/decoding module 1102 is further configured to arithmetically decode or asymmetrically decode the third picture file to obtain the third dc coefficient or the third ac coefficient; the encoding/decoding module 1102 is further configured to perform huffman encoding on the third dc coefficient or the third ac coefficient to obtain a JPEG format picture file.
In one possible design, the computer device 1100 further includes a sending module 1104 for sending the picture file to a cloud or other electronic device for storage.
In one possible design, the encoding/decoding module 1102 is not configured to perform huffman encoding on the third dc coefficient and the third ac coefficient to obtain a JPEG-format picture file; carrying out Huffman decoding on the JPEG-format picture file to obtain a fourth direct current coefficient and a fourth alternating current coefficient; and carrying out arithmetic coding or asymmetric coding on the fourth direct current coefficient and the fourth alternating current coefficient to obtain a third picture file.
The embodiment of the present application further provides a computer device, please refer to fig. 12, fig. 12 is a schematic structural diagram of the computer device provided in the embodiment of the present application, and for convenience of explanation, only the portion related to the embodiment of the present application is shown, and specific technical details are not disclosed, please refer to the method portion of the embodiment of the present application. The computer device 1200 may have disposed thereon the modules described in the embodiments corresponding to fig. 10 and 11, for implementing the functions of the computer device 1000 in the embodiment corresponding to fig. 10 and the functions of the computer device 1100 in the embodiment corresponding to fig. 11. In particular, the computer device 1200 is implemented by one or more servers, and the computer device 1200 may vary considerably in configuration or performance, and may include one or more central processing units (central processing units, CPU) 1222 and memory 1232, one or more storage media 1230 (e.g., one or more mass storage devices) storing applications 1242 or data 1244. Wherein memory 1232 and storage medium 1230 can be transitory or persistent. The program stored on the storage medium 1230 may include one or more modules (not shown), each of which may include a series of instruction operations in the computer device 1200. Still further, the central processor 1222 may be configured to communicate with a storage medium 1230, executing a series of instruction operations in the storage medium 1230 on the computer device 1200.
The computer device 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input/output interfaces 1258, and/or one or more operating systems 1241, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
In the embodiment of the present application, the central processor 1222 is configured to execute the processing method of the picture in the corresponding embodiment of fig. 4 and fig. 6. For example, the central processor 1222 may be configured to: acquiring a first picture file; performing arithmetic decoding or asymmetric digital system decoding on the first picture file to obtain a first direct current coefficient and a first alternating current coefficient; performing inverse quantization and inverse discrete cosine transform on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in YUV format; and converting the YUV format picture file into an RGB format picture file. For another example, the central processor 1222 may also be configured to: acquiring an RGB format picture file; converting the RGB format picture file into a YUV format picture file; performing discrete cosine transform and quantization on the YUV-format picture file to obtain a third direct current coefficient and a third alternating current coefficient; and carrying out arithmetic coding or asymmetric digital system coding on the third direct current coefficient and the third alternating current coefficient to obtain a third picture file, wherein the third picture file is used for being stored in a memory.
It should be noted that, the cpu 1222 may also be used to perform any step in the method embodiments corresponding to fig. 4 and 6, and the specific content may be referred to the description in the foregoing method embodiments of the present application, which is not repeated herein.
The image processing device provided by the embodiment of the application can be a chip, and the chip comprises: a processing unit, which may be, for example, a processor, and a communication unit, which may be, for example, an input/output interface, pins or circuitry, etc. The processing unit may execute the computer-executable instructions stored in the storage unit, so that the chip performs the method described in the embodiments shown in fig. 4 and 6. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc., and the storage unit may also be a storage unit in the wireless access device side located outside the chip, such as a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a random access memory (random access memory, RAM), etc.
Embodiments of the present application also provide a computer-readable storage medium having stored therein a program for performing signal processing, which when run on a computer, causes the computer to perform the steps performed by the computer device as described in the foregoing embodiment.
It should be further noted that the above-described apparatus embodiments are merely illustrative, and that the units described as separate units may or may not be physically separate, and that units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the application, the connection relation between the modules represents that the modules have communication connection, and can be specifically implemented as one or more communication buses or signal lines.
From the above description of the embodiments, it will be apparent to those skilled in the art that the present application may be implemented by means of software plus necessary general purpose hardware, or of course by means of special purpose hardware including application specific integrated circuits, special purpose CPUs, special purpose memories, special purpose components, etc. Generally, functions performed by computer programs can be easily implemented by corresponding hardware, and specific hardware structures for implementing the same functions can be varied, such as analog circuits, digital circuits, or dedicated circuits. However, a software program implementation is a preferred embodiment for many more of the cases of the present application. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a readable storage medium, such as a floppy disk, a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk or an optical disk of a computer, etc., comprising instructions for causing a computer device (which may be a personal computer, a training device, a network device, etc.) to execute the method according to the embodiments of the present application.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device, a data center, or the like that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a high-density digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.

Claims (23)

1. A picture processing method, comprising:
acquiring a first picture file;
performing arithmetic decoding or asymmetric digital system decoding on the first picture file to obtain a first direct current coefficient and a first alternating current coefficient;
performing inverse quantization and inverse discrete cosine transform on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in YUV format;
and converting the YUV format picture file into an RGB format picture file.
2. The method according to claim 1, wherein the first picture file is obtained by encoding a second picture file, the format of the first picture file is different from the format of the second picture file, and the picture format of the second picture file is any one of the following:
JPEG format, PNG format or GIF format.
3. The method according to claim 1 or 2, wherein the first picture file is stored in a memory.
4. A method according to any one of claims 1-3, wherein the RGB format picture file is for display.
5. The method according to any one of claims 1-4, wherein the obtaining a first picture file comprises:
The first picture file is received from a cloud or other electronic device.
6. The method according to any one of claims 1-5, wherein said dequantizing and inverse discrete cosine transforming the first dc coefficient and the first ac coefficient to obtain a picture file in YUV format does not include:
carrying out Huffman coding on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in a JPEG format;
carrying out Huffman decoding on the JPEG-format picture file to obtain a second direct current coefficient and a second alternating current coefficient;
and performing inverse quantization and inverse discrete cosine transformation on the second direct current coefficient and the second alternating current coefficient to obtain a picture file in YUV format.
7. A picture processing method, comprising:
acquiring an RGB format picture file;
converting the RGB format picture file into a YUV format picture file;
performing discrete cosine transform and quantization on the YUV-format picture file to obtain a third direct current coefficient and a third alternating current coefficient;
and carrying out arithmetic coding or asymmetric digital system coding on the third direct current coefficient and the third alternating current coefficient to obtain a third picture file, wherein the third picture file is used for being stored in a memory.
8. The method of claim 7, wherein the method further comprises:
performing arithmetic decoding or asymmetric decoding on the third picture file to obtain the third direct current coefficient or the third alternating current coefficient;
performing inverse quantization and inverse discrete cosine transform on the third direct current coefficient or the third alternating current coefficient to obtain a picture file in the YUV format;
and converting the YUV format picture file into an RGB format picture file.
9. The method of claim 7, wherein the method further comprises:
performing arithmetic decoding or asymmetric decoding on the third picture file to obtain the third direct current coefficient or the third alternating current coefficient;
and carrying out Huffman coding on the third direct current coefficient or the third alternating current coefficient to obtain a picture file in a JPEG format.
10. The method according to any one of claims 7-9, further comprising:
and sending the third picture file to a cloud or other electronic equipment for storage.
11. The method according to any one of claims 7-10, wherein said arithmetic coding or asymmetric coding of said third dc coefficient and said third ac coefficient to obtain a third picture file does not comprise:
Carrying out Huffman coding on the third direct current coefficient and the third alternating current coefficient to obtain a picture file in a JPEG format;
carrying out Huffman decoding on the JPEG-format picture file to obtain a fourth direct current coefficient and a fourth alternating current coefficient;
and carrying out arithmetic coding or asymmetric coding on the fourth direct current coefficient and the fourth alternating current coefficient to obtain a third picture file.
12. A computer device, comprising:
the acquisition module is used for acquiring a first picture file;
the decoding module is used for carrying out arithmetic decoding or asymmetric digital system decoding on the first picture file to obtain a first direct current coefficient and a first alternating current coefficient;
the processing module is used for carrying out inverse quantization and inverse discrete cosine transformation on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in a YUV format;
the processing module is further configured to convert the YUV format picture file into an RGB format picture file.
13. The apparatus of claim 12, wherein the first picture file is encoded with a second picture file, the first picture file having a format different from a format of the second picture file, the second picture file having a format that is any of:
JPEG format, PNG format or GIF format.
14. The apparatus of claim 12 or 13, wherein the first picture file is stored in a memory.
15. The apparatus according to any one of claims 12-13, characterized in that: the picture file in the RGB format is used for displaying.
16. The apparatus of any one of claims 12-15, wherein the processing module is not to:
carrying out Huffman coding on the first direct current coefficient and the first alternating current coefficient to obtain a picture file in a JPEG format;
carrying out Huffman decoding on the JPEG-format picture file to obtain a second direct current coefficient and a second alternating current coefficient;
and performing inverse quantization and inverse discrete cosine transformation on the second direct current coefficient and the second alternating current coefficient to obtain a picture file in YUV format.
17. A computer device, comprising:
the acquisition module is used for acquiring the RGB format picture file;
the processing module is used for converting the RGB format picture file into a YUV format picture file;
the processing module is further configured to perform discrete cosine transform and quantization on the YUV format picture file to obtain a third direct current coefficient and a third alternating current coefficient;
And the encoding module is used for carrying out arithmetic encoding or asymmetric digital system encoding on the third direct current coefficient and the third alternating current coefficient so as to obtain a third picture file, and the third picture file is used for being stored in a memory.
18. The device of claim 17, wherein the computing device further comprises:
the decoding module is used for carrying out arithmetic decoding or asymmetric decoding on the third picture file to obtain the third direct current coefficient or the third alternating current coefficient;
the processing module is further configured to perform inverse quantization and inverse discrete cosine transform on the third direct current coefficient or the third alternating current coefficient to obtain a picture file in the YUV format;
the processing module is further configured to convert the YUV format picture file into an RGB format picture file.
19. The device of claim 17, wherein the computing device further comprises:
the decoding module is used for carrying out arithmetic decoding or asymmetric decoding on the third picture file to obtain the third direct current coefficient or the third alternating current coefficient;
the encoding module is further configured to perform huffman encoding on the third direct current coefficient or the third alternating current coefficient to obtain a JPEG format picture file.
20. The apparatus of any one of claims 17-19, wherein the encoding module is not to:
carrying out Huffman coding on the third direct current coefficient and the third alternating current coefficient to obtain a picture file in a JPEG format;
carrying out Huffman decoding on the JPEG-format picture file to obtain a fourth direct current coefficient and a fourth alternating current coefficient;
and carrying out arithmetic coding or asymmetric coding on the fourth direct current coefficient and the fourth alternating current coefficient to obtain a third picture file.
21. A computer device comprising a processor and a memory, the processor being coupled to the memory, characterized in that,
the memory is used for storing programs;
the processor for executing the program in the memory, causing the computer device to perform the method of any one of claims 1-6 or 7-11.
22. A computer readable storage medium comprising a program which, when run on a computer, causes the computer to perform the method of any of claims 1-6 or 7-11.
23. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any of claims 1-6 or 7-11.
CN202210596528.4A 2022-05-30 2022-05-30 Picture processing method and related equipment Pending CN117221740A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210596528.4A CN117221740A (en) 2022-05-30 2022-05-30 Picture processing method and related equipment
PCT/CN2023/092770 WO2023231710A1 (en) 2022-05-30 2023-05-08 Picture processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210596528.4A CN117221740A (en) 2022-05-30 2022-05-30 Picture processing method and related equipment

Publications (1)

Publication Number Publication Date
CN117221740A true CN117221740A (en) 2023-12-12

Family

ID=89026895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210596528.4A Pending CN117221740A (en) 2022-05-30 2022-05-30 Picture processing method and related equipment

Country Status (2)

Country Link
CN (1) CN117221740A (en)
WO (1) WO2023231710A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100425053C (en) * 2005-12-22 2008-10-08 海信集团有限公司 MPEG format picture display method for set-top box
KR101666927B1 (en) * 2009-10-08 2016-10-24 엘지전자 주식회사 Method and apparatus for generating a compressed file, and terminal having the apparatus
CN108111858B (en) * 2016-11-24 2020-06-05 腾讯科技(深圳)有限公司 Picture compression method and device
CN113365016A (en) * 2020-03-05 2021-09-07 阿里巴巴集团控股有限公司 Real-time map image data acquisition system and method
CN113079379A (en) * 2021-03-26 2021-07-06 山东英信计算机技术有限公司 Video compression method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
WO2023231710A1 (en) 2023-12-07

Similar Documents

Publication Publication Date Title
US10264271B2 (en) Coded-block-flag coding and derivation
US7158679B2 (en) Image compression with tile alignment
US20060147122A1 (en) Method and apparatus for processing a compressed image in an order other than the order in which it was compressed
WO2018184464A1 (en) Picture file processing method and device, and storage medium
CN111492656B (en) Method, apparatus, and medium for two-stage decoding of images
JP2009239779A (en) Image encoding device, image decoding device, and integrated circuit device
JP2004032698A (en) Differential image compressing method and apparatus
CN117221740A (en) Picture processing method and related equipment
JP2016208356A (en) Image compression device, image compression method, image decompression device and image decompression method
KR20160082521A (en) Chroma down-conversion and up-conversion processing
US11968406B2 (en) Enhanced image compression with clustering and lookup procedures
CN111526366B (en) Image processing method, image processing apparatus, image capturing device, and storage medium
WO2021217428A1 (en) Image processing method and apparatus, photographic device and storage medium
CN108933945B (en) GIF picture compression method, device and storage medium
CN109076224B (en) Video decoder, data processing circuit, system, and method
JP4241517B2 (en) Image encoding apparatus and image decoding apparatus
CN114125456A (en) Data processing method and system and electronic equipment
CN113450293A (en) Video information processing method, device and system, electronic equipment and storage medium
CN104780390A (en) Video processing method and device
TW200421203A (en) Run length encoded digital image
CN116347089B (en) JPEG image processing method and device, electronic equipment and storage medium
US9154800B2 (en) Method and apparatus for a memory efficient approach for decoding progressive joint photographic experts group (JPEG) images
US20070192393A1 (en) Method and system for hardware and software shareable DCT/IDCT control interface
CN115988258B (en) Video communication method, storage medium and system based on internet of things (IoT) device
CN112261443B (en) Image processing method and device and image processing system

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