CN111541901A - Picture decoding method and device - Google Patents

Picture decoding method and device Download PDF

Info

Publication number
CN111541901A
CN111541901A CN202010393078.XA CN202010393078A CN111541901A CN 111541901 A CN111541901 A CN 111541901A CN 202010393078 A CN202010393078 A CN 202010393078A CN 111541901 A CN111541901 A CN 111541901A
Authority
CN
China
Prior art keywords
decoding
decoded
preset
picture file
data
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.)
Granted
Application number
CN202010393078.XA
Other languages
Chinese (zh)
Other versions
CN111541901B (en
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010393078.XA priority Critical patent/CN111541901B/en
Publication of CN111541901A publication Critical patent/CN111541901A/en
Application granted granted Critical
Publication of CN111541901B publication Critical patent/CN111541901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation

Abstract

The invention discloses a method and a device for decoding pictures. Wherein, the method comprises the following steps: acquiring a picture file to be decoded; analyzing and processing a picture file to be decoded based on a central processing unit to obtain palette data and multi-frame image data; and decoding the palette data and the multi-frame image data based on the graphics processor to obtain a decoded picture file. The invention solves the technical problem of low system operation efficiency caused by the fact that the central processing unit decodes the picture in the prior art.

Description

Picture decoding method and device
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for picture decoding.
Background
Currently, in some client games, for example, 2D client games, the drawing of the graphical interface thereof usually employs TCP pictures. The TCP picture is a picture in a lossy sequence frame picture compression format based on a palette and run length coding method. When the game runs, the game engine needs to perform dynamic decoding operation on the TCP picture when drawing each frame of animation, so that the TCP picture can be converted into data in a frame buffer area and displayed on a display.
The run-length coding mode adopted by the TCP picture is a line-based run-length coding compression method, namely, an index value of one or more continuous pixels in a line in a palette is recorded through a control character and a plurality of data characters. Therefore, TCP pictures have dependency on data between lines in a row, and a decoder or decoding method needs to decode the previous data and then the following data in the coding order. For example, fig. 1 shows a coding format of a TCP picture, and as can be seen from fig. 1, the coding format of the TCP picture includes a file header, a palette, and frame data; fig. 2 is an alternative frame data format, and as can be seen from fig. 2, the frame data format includes frame information and information of each line, wherein one frame data is divided into a plurality of lines (e.g., line 1, line n in fig. 2), there is no decoding dependency between lines, and one line can be divided into a plurality of lines, there is decoding dependency between lines, such as lines of different gray levels in the second line in fig. 2.
In the prior art, a method of decoding a picture in real time and then drawing the picture by using a hardware rendering interface (a hardware rendering interface) based on a Central Processing Unit (CPU) is adopted to decode the picture and render the picture. As shown in the picture decoding and rendering process of fig. 3, for one frame of the TCP picture (e.g. the single frame of TCP data in fig. 3), it needs to be decoded pixel by pixel in the CPU, and then the decoded result (i.e. bitmap data) is temporarily stored in the memory. In a single frame of game picture, after all TCP pictures of a game window need to be decoded, the memory data of the frame is transmitted to a GPU (Graphics Processing Unit) through a hardware rendering interface, and finally the GPU interface is called to draw and display a frame of picture.
However, the existing solutions mainly have the following disadvantages:
(1) image decoding using the CPU is serial. The CPU needs to perform pixel-by-pixel decoding operation on each TCP picture, and the pixel-by-pixel decoding will increase the operation burden of the CPU.
(2) In the client game, the memory and the video memory are heterogeneous, so for one frame of game picture, the decoded data needs to be transmitted from the memory to the video memory and then to be rendered by the GPU, but the transmission mode needs a certain time, which is likely to cause delay or jamming.
(3) In the game, the CPU needs to be responsible for operations including script logic, resource loading, network communication and the like, so that the CPU is easy to be stuck.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a picture decoding method and device, which at least solve the technical problem of low system operation efficiency caused by decoding a picture by a central processing unit in the prior art.
According to an aspect of the embodiments of the present invention, there is provided a method for decoding a picture, including: acquiring a picture file to be decoded; analyzing and processing a picture file to be decoded based on a central processing unit to obtain palette data and multi-frame image data; and decoding the palette data and the multi-frame image data based on the graphics processor to obtain a decoded picture file.
Further, the method for picture decoding further includes: mapping the palette data and the multi-frame image data based on the graphic processor to obtain a preset object; determining the number of lines corresponding to the current frame of the picture file to be decoded; acquiring kernel functions corresponding to the line numbers, wherein the frame data of each line corresponds to one kernel function, and the kernel functions are used for decoding the frame data of the corresponding line; and decoding the preset object corresponding to the kernel function to obtain a decoded picture file.
Further, the method for picture decoding further includes: before acquiring the kernel function corresponding to the line number, acquiring a pointer and the line number of a preset object corresponding to a current frame and offset data corresponding to the current line; and inputting the pointer and the row number of the preset object and the offset data corresponding to the current row into the kernel function.
Further, the method for picture decoding further includes: obtaining a pointer corresponding to a row to be decoded according to the row number and offset data corresponding to the current row; determining subscripts of the preset objects according to the number of rows and the number of columns corresponding to the preset objects; determining a control bit according to the subscript and the pointer; acquiring a corresponding line decoding function from a preset pointer array based on the control bit; and decoding the preset object based on the line decoding function to obtain a decoded picture file.
Further, the method for picture decoding further includes: determining a pixel type of a preset object, wherein the pixel type at least comprises: repeating the translucent pixels, the single translucent pixel, the continuous opaque pixels, the repeating opaque pixels, and the repeating clear pixels; determining a preset digit of a control bit corresponding to the pixel type; determining the repetition number, the transparency and the color value index of the repeated pixels according to the preset digit; acquiring color data from the palette data according to the color value index; and obtaining the decoded picture file based on the color data and the transparency.
Further, the method for picture decoding further includes: after the palette data and the multi-frame image data are decoded by the graphics processor to obtain a decoded picture file, the decoded picture file is stored in a preset buffer area.
Further, the method for picture decoding further includes: after acquiring a picture file to be decoded, creating a texture object; mapping the texture object to a preset buffer area; and performing association processing on the preset buffer area and the preset running environment.
Further, the method for picture decoding further includes: after the palette data and the multi-frame image data are decoded based on the graphics processor to obtain a decoded picture file, canceling the association processing of a preset buffer area and a preset operating environment; associating the preset buffer area with a preset graphic library interface to obtain an association relation; and rendering the texture object based on the association relation.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for decoding a picture, including: the acquisition module is used for acquiring a picture file to be decoded; the analysis module is used for analyzing the picture file to be decoded based on the central processing unit to obtain palette data and multi-frame image data; and the decoding module is used for decoding the palette data and the multi-frame image data based on the graphics processor to obtain a decoded picture file.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the above-mentioned picture decoding method.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes the method for decoding a picture as described above.
In the embodiment of the invention, a picture to be decoded is obtained by adopting a mode of decoding pictures by a graphic processor, the picture to be decoded is analyzed and processed based on a central processing unit to obtain palette data and multi-frame image data, and then the palette data and the multi-frame image data are decoded based on the graphic processor to obtain the decoded picture file.
In the picture decoding process, the picture file to be decoded is decoded by the graphic processor, and the picture file to be decoded is only simply analyzed by the central processing unit and is not decoded, so that the operation burden of the central processing unit in picture decoding processing is reduced, the data transmission between the central processing unit and the graphic processor is further reduced, and the operation efficiency of the system is improved.
Therefore, the scheme provided by the application achieves the purpose of decoding the picture file to be decoded, so that the technical effect of improving the system operation efficiency is achieved, and the technical problem of low system operation efficiency caused by the fact that the central processing unit decodes the picture in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic diagram of an encoding format of a TCP picture according to the prior art;
FIG. 2 is a schematic diagram of a format of frame data according to the prior art;
FIG. 3 is a schematic diagram of a picture decoding and rendering flow according to the prior art;
FIG. 4 is a flowchart of a method for decoding a picture according to an embodiment of the present invention; and
fig. 5 is a schematic diagram of an apparatus for decoding a picture according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present invention, there is provided a method embodiment of picture decoding, it is noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
In addition, it should be noted that a computing device (e.g., a computer) may be used as the execution subject of the embodiment, wherein the computing device at least includes a central processing unit CPU and a graphics processing unit GPU. Optionally, the central processing unit CPU is used as an operation and control core of the computer system, and is a final execution unit for information processing and program operation; the graphics processor GPU is a microprocessor that can perform image and image-related arithmetic operations.
In an alternative embodiment, fig. 4 is a flowchart of a method for decoding a picture according to an embodiment of the present invention, and as shown in fig. 4, the method includes the following steps:
step S402, obtaining the picture file to be decoded.
In step S402, the picture file to be decoded is a TCP file, where the TCP file is a picture file in a run-length coding compression format based on line compression.
In an optional embodiment, when a game developer needs to decode a TCP file, the game developer inputs a picture file to be decoded into a computing device, and the computing device implements decoding of the picture file to be decoded by executing the picture decoding method provided in this embodiment.
Step S404, analyzing the picture file to be decoded based on the central processing unit to obtain palette data and multi-frame image data.
In step S404, the palette is a given finite color array in computer graphics, with indexing of color values being achieved by array indices. Optionally, the palette data includes, but is not limited to, a color value of each color and a subscript corresponding to the color value.
It should be noted that, in this embodiment, the central processing unit only performs parsing processing on the picture file to be decoded, and does not perform decoding processing, so as to reduce the operation load of the central processing unit.
Step S406, decoding the palette data and the multi-frame image data based on the graphics processor to obtain a decoded picture file.
It should be noted that one TCP file (i.e., a picture file to be decoded) may include multiple frames of image data, each frame of image data has multiple lines of data, and each line of data includes multiple lines. After parsing the picture file to be decoded to obtain the palette data and the multi-frame image data in step S404, the graphics processor decodes the palette data and the multi-frame image data in row units to obtain the decoded picture file. It is easy to note that there is no dependency relationship between the lines of the TCP file, so the data between the lines can be decoded in parallel, and the decoding efficiency of the picture file to be decoded is further improved by using the graphics processor to decode the TCP file in parallel.
Based on the schemes defined in steps S402 to S406, it can be known that, in a manner that the graphics processor decodes the picture, after the picture file to be decoded is obtained, the picture file to be decoded is analyzed based on the central processing unit to obtain the palette data and the multi-frame image data, and then the picture file after decoding is obtained by decoding the palette data and the multi-frame image data based on the graphics processor.
It is easy to note that, in the above-mentioned picture decoding process, the graphics processor decodes the picture file to be decoded, and the central processing unit only performs a simple parsing operation on the picture file to be decoded, and does not perform a decoding operation, thereby reducing the operation burden when the central processing unit processes the picture decoding, further reducing the data transmission between the central processing unit and the graphics processor, and improving the operation efficiency of the system.
Therefore, the scheme provided by the application achieves the purpose of decoding the picture file to be decoded, so that the technical effect of improving the system operation efficiency is achieved, and the technical problem of low system operation efficiency caused by the fact that the central processing unit decodes the picture in the prior art is solved.
In an optional embodiment, after obtaining the picture file to be decoded, the computing device performs decoding processing on the palette data and the multi-frame image data based on the graphics processor to obtain a decoded picture file. Specifically, the computing device performs mapping processing on palette data and multi-frame image data based on a graphics processor to obtain a preset object, determines a line number corresponding to a current frame of a picture file to be decoded, then obtains a kernel function corresponding to the line number, and finally performs decoding processing on the preset object corresponding to the kernel function to obtain a decoded picture file. The frame data of each line corresponds to a kernel function, and the kernel function is used for decoding the frame data of the corresponding line.
In the above process, the preset object may be, but is not limited to, a CUDA (computer Unified device architecture) object, where the CUDA is a computing platform having a parallel computing architecture, and the architecture enables the CPU to solve a complex computing problem, so as to avoid a stuck phenomenon caused by the CPU processing the complex computing problem.
It should be noted that, in this embodiment, the CUDA serves as a programming interface of the GPU, and can implement decoding of the picture file. In addition, the Kernel function may be a Kernel, and in this embodiment, the execution of the CUDA takes the Kernel as a basic unit, and each Kernel is allocated to one or more CUDA cores to be executed. Since the decoding order between lines in single frame TCP data has no obvious dependence, the decoding operation is performed by allocating one Kernel to the frame data of each line, so that the decoding can be performed in parallel in line units, and GPU resources can be utilized to the maximum extent.
Optionally, before obtaining the kernel function corresponding to the line number, the graphics processor further obtains a pointer and a line number of a preset object corresponding to the current frame and offset data corresponding to the current line, and then inputs the pointer and the line number of the preset object and the offset data corresponding to the current line into the kernel function. That is, for a TCP file, the CPU first performs simple parsing to extract palette data and multi-frame image data, uploads the palette data and multi-frame image data to the video memory of the GPU, and maps the palette data and multi-frame image data to a CUDA object (i.e., the preset object). Then, the GPU transmits a number of kernels according to the number of lines of the TCP current frame and transmits a pointer of the CUDA object (including the palette data and the multi-frame image data) into the kernels, while transmitting the number of lines and the offset data.
Further, after the kernel function corresponding to the number of lines is obtained, the graphics processor performs decoding processing on the preset object corresponding to the kernel function to obtain a decoded picture file. Specifically, the graphic processor first obtains a pointer corresponding to a row to be decoded according to the number of rows and offset data corresponding to a current row, determines a subscript of a preset object according to the number of rows and the number of columns corresponding to the preset object, then determines a control bit according to the subscript and the pointer, obtains a corresponding line decoding function from the preset pointer array based on the control bit, and finally decodes the preset object based on the line decoding function to obtain a decoded picture file.
Optionally, the graphics processor puts the given 5 line decoding functions into a function pointer array (i.e., preset pointer data) of the Kernel, acquires pointers of the line data to be decoded from the specified line number of the transmitted Kernel function, calculates and outputs subscripts of a preset object according to the line number and the column number of the transmitted Kernel function, takes the read bytes as control bits, and calls different line decoding functions according to the control bits. Repeating the above steps until the read character is a line end character. Therefore, the decoding process of the picture file to be decoded is realized.
It should be noted that the above-mentioned 5 line decoding functions include a line decoding function based on repeated translucent pixels, a line decoding function based on a single translucent pixel, a line decoding function based on continuous opaque pixels, a line decoding function based on repeated opaque pixels, and a line decoding function based on repeated blank pixels.
In an optional embodiment, after obtaining the corresponding line decoding function from the preset pointer array based on the control bit, the graphics processor decodes the preset object based on the line decoding function, and obtains a decoded picture file. Specifically, the graphics processor determines a pixel type of a preset object, determines a preset digit of a control bit corresponding to the pixel type, determines a repetition number, a transparency and a color value index of a repeated pixel according to the preset digit, acquires color data from palette data according to the color value index, and finally obtains a decoded picture file based on the color data and the transparency.
It should be noted that the pixel types at least include: repeating translucent pixels, single translucent pixels, consecutive opaque pixels, repeating opaque pixels, and repeating blank pixels.
The description will be given by taking a repetitive semitransparent pixel as an example. Firstly, the graphics processor reads out the repeated number of repeated semitransparent pixels from the last 5 bits (namely preset bits) of the control bits, and reads out the first byte behind the control bits as the Alpha value (namely transparency) of the repeated semitransparent pixels; reading the second byte after the control bit as the color value index of the repeated semitransparent pixel, then obtaining corresponding R, G, B component color data from the palette data according to the index value, and finally writing the obtained R, G, B and Alpha value into the buffer of the currently bound texture object CUDA.
Further, after the palette data and the multi-frame image data are decoded by the graphics processor to obtain a decoded picture file, the graphics processor stores the decoded picture file in a preset buffer, where the preset buffer may be the CUDA buffer.
In an optional embodiment, after obtaining the picture file to be decoded, the computing device further creates a texture object, maps the texture object to a preset buffer, and then performs association processing on the preset buffer and a preset running environment.
Optionally, the computing device creates a texture object using OpenGL, and invokes an interface provided by the CUDA to map the texture object to a CUDA buffer, and reads and compiles a Kernel (i.e., a Kernel function) required for decoding, and at the same time, binds the CUDA buffer of the texture object to the current CUDA environment.
Further, after the palette data and the multi-frame image data are decoded based on the graphics processor to obtain a decoded picture file, the computing device cancels association processing of the preset buffer area and the preset operating environment, associates the preset buffer area with the preset graphics library interface to obtain an association relation, and finally renders the texture object based on the association relation. Namely, the computing device cancels the binding of the CUDA buffer area, binds the CUDA buffer area as a texture object to OpenGL, then calls an OpenGL interface to draw a screen rectangle, and samples the texture object of the previous step.
In the above process, OpenGL (Open Graphics Library) can be used as a Graphics rendering interface, which is a cross-language, cross-platform application programming interface for rendering 2D, 3D vector Graphics.
Based on the above content, the run-length coding picture decoding and real-time rendering method based on the GPU provided by the application shifts the picture decoding operation originally belonging to the CPU processing to the GPU for realization, and renders the decoded picture in the GPU at the same time, thereby reducing the data transmission between the CPU and the GPU and further improving the operation efficiency.
Example 2
According to an embodiment of the present invention, an embodiment of an apparatus for picture decoding is further provided, where fig. 5 is a schematic diagram of an apparatus for picture decoding according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes: an acquisition module 501, a parsing module 503, and a decoding module 505.
The acquiring module 501 is configured to acquire a picture file to be decoded; the parsing module 503 is configured to parse the picture file to be decoded based on the central processing unit to obtain palette data and multi-frame image data; and a decoding module 505, configured to perform decoding processing on the palette data and the multi-frame image data based on the graphics processor, to obtain a decoded picture file.
It should be noted here that the acquiring module 501, the parsing module 503 and the decoding module 505 correspond to steps S402 to S406 of the above embodiment, and the three modules are the same as the corresponding steps in the implementation example and application scenarios, but are not limited to the disclosure of the above embodiment.
In an alternative embodiment, the decoding module comprises: the device comprises a first mapping module, a first determining module, a first obtaining module and a first decoding module. The first mapping module is used for mapping the palette data and the multi-frame image data based on the graphics processor to obtain a preset object; the first determining module is used for determining the number of lines corresponding to the current frame of the picture file to be decoded; the device comprises a first acquisition module, a second acquisition module and a first decoding module, wherein the first acquisition module is used for acquiring kernel functions corresponding to line numbers, frame data of each line corresponds to one kernel function, and the kernel functions are used for decoding the frame data of the corresponding line; and the first decoding module is used for decoding the preset object corresponding to the kernel function to obtain a decoded picture file.
In an optional embodiment, the apparatus for picture decoding further includes: a second acquisition module and an input module. The second obtaining module is configured to obtain a pointer and a line number of a preset object corresponding to a current frame and offset data corresponding to the current line before obtaining a kernel function corresponding to the line number; and the input module is used for inputting the pointer and the line number of the preset object and the offset data corresponding to the current line into the kernel function.
In an alternative embodiment, the first decoding module comprises: the device comprises a first processing module, a second determining module, a third obtaining module and a second decoding module. The first processing module is used for obtaining a pointer corresponding to a row to be decoded according to the row number and offset data corresponding to a current row; the second determining module is used for determining the subscript of the preset object according to the number of the rows and the number of the columns corresponding to the preset object; the third determining module is used for determining a control bit according to the subscript and the pointer; the third acquisition module is used for acquiring a corresponding line decoding function from a preset pointer array based on the control bit; and the second decoding module is used for decoding the preset object based on the line decoding function to obtain a decoded picture file.
In an alternative embodiment, the second decoding module comprises: the device comprises a fourth determining module, a fifth determining module, a sixth determining module, a fourth acquiring module and a second processing module. The fourth determining module is configured to determine a pixel type of the preset object, where the pixel type at least includes: repeating the translucent pixels, the single translucent pixel, the continuous opaque pixels, the repeating opaque pixels, and the repeating clear pixels; a fifth determining module, configured to determine a preset number of bits of the control bits corresponding to the pixel type; the sixth determining module is used for determining the repetition number, the transparency and the color value index of the repeated pixels according to the preset digit; the fourth obtaining module is used for obtaining color data from the palette data according to the color value index; and the second processing module is used for obtaining the decoded picture file based on the color data and the transparency.
In an optional embodiment, the apparatus for picture decoding further includes: and the storage module is used for storing the decoded picture file in a preset buffer area after the palette data and the multi-frame image data are decoded based on the graphics processor to obtain the decoded picture file.
In an optional embodiment, the apparatus for picture decoding further includes: the device comprises a creating module, a second mapping module and a first association module. The device comprises a creating module, a decoding module and a processing module, wherein the creating module is used for creating a texture object after acquiring a picture file to be decoded; the second mapping module is used for mapping the texture object into a preset buffer area; the first association module is used for associating the preset buffer area with the preset running environment.
In an optional embodiment, the apparatus for picture decoding further includes: a third processing module, a second association module, and a rendering module. The third processing module is used for canceling the association processing of the preset buffer area and the preset running environment after the palette data and the multi-frame image data are decoded based on the graphics processor to obtain a decoded picture file; the second correlation module is used for correlating the preset buffer area with the preset graphic library interface to obtain a correlation relation; and the rendering module is used for rendering the texture object based on the association relation.
Example 3
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein when the program runs, a device in which the storage medium is located is controlled to execute the method for decoding the picture in embodiment 1.
Example 4
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes the method for decoding the picture in embodiment 1.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. A method for picture decoding, comprising:
acquiring a picture file to be decoded;
analyzing the picture file to be decoded based on a central processing unit to obtain palette data and multi-frame image data;
and decoding the palette data and the multi-frame image data based on an image processor to obtain a decoded picture file.
2. The method of claim 1, wherein decoding the palette data and the plurality of frames of image data based on a graphics processor to obtain a decoded picture file comprises:
mapping the palette data and the multi-frame image data based on the graphics processor to obtain a preset object;
determining the number of lines corresponding to the current frame of the picture file to be decoded;
acquiring kernel functions corresponding to the line numbers, wherein frame data of each line corresponds to one kernel function, and the kernel functions are used for decoding the frame data of the corresponding line;
and decoding the preset object corresponding to the kernel function to obtain the decoded picture file.
3. The method of claim 2, wherein prior to obtaining the kernel function corresponding to the number of rows, the method further comprises:
acquiring a pointer of a preset object corresponding to the current frame, the line number and offset data corresponding to the current line;
and inputting the pointer of the preset object, the line number and the offset data corresponding to the current line into the kernel function.
4. The method according to claim 3, wherein decoding the preset object corresponding to the kernel function to obtain the decoded picture file comprises:
obtaining a pointer corresponding to a row to be decoded according to the row number and offset data corresponding to the current row;
determining subscripts of the preset objects according to the row numbers and the column numbers corresponding to the preset objects;
determining a control bit according to the subscript and the pointer;
acquiring a corresponding line decoding function from a preset pointer array based on the control bit;
and decoding the preset object based on the line decoding function to obtain the decoded picture file.
5. The method of claim 4, wherein decoding the preset object based on the line decoding function to obtain the decoded picture file comprises:
determining a pixel type of the preset object, wherein the pixel type at least comprises: repeating the translucent pixels, the single translucent pixel, the continuous opaque pixels, the repeating opaque pixels, and the repeating clear pixels;
determining a preset digit of a control bit corresponding to the pixel type;
determining the repetition number, the transparency and the color value index of the repeated pixels according to the preset digit;
acquiring color data from the palette data according to the color value index;
and obtaining the decoded picture file based on the color data and the transparency.
6. The method of claim 5, wherein after the palette data and the plurality of frames of image data are decoded based on a graphics processor to obtain a decoded picture file, the method further comprises:
and storing the decoded picture file in a preset buffer area.
7. The method of claim 6, wherein after obtaining the picture file to be decoded, the method further comprises:
creating a texture object;
mapping the texture object into the preset buffer area;
and performing association processing on the preset buffer area and the preset operating environment.
8. The method of claim 7, wherein after performing a decoding process on the palette data and the plurality of frames of image data based on a graphics processor to obtain a decoded picture file, the method further comprises:
canceling the association processing of the preset buffer area and the preset running environment;
associating the preset buffer area with a preset graphic library interface to obtain an association relation;
rendering the texture object based on the association relationship.
9. An apparatus for picture decoding, comprising:
the acquisition module is used for acquiring a picture file to be decoded;
the analysis module is used for analyzing the picture file to be decoded based on a central processing unit to obtain palette data and multi-frame image data;
and the decoding module is used for decoding the palette data and the multi-frame image data based on the graphics processor to obtain a decoded picture file.
10. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the method for decoding the picture according to any one of claims 1 to 7.
11. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to perform the method for decoding a picture according to any one of claims 1 to 7 when the program is run.
CN202010393078.XA 2020-05-11 2020-05-11 Picture decoding method and device Active CN111541901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010393078.XA CN111541901B (en) 2020-05-11 2020-05-11 Picture decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010393078.XA CN111541901B (en) 2020-05-11 2020-05-11 Picture decoding method and device

Publications (2)

Publication Number Publication Date
CN111541901A true CN111541901A (en) 2020-08-14
CN111541901B CN111541901B (en) 2022-05-27

Family

ID=71975620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010393078.XA Active CN111541901B (en) 2020-05-11 2020-05-11 Picture decoding method and device

Country Status (1)

Country Link
CN (1) CN111541901B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6778181B1 (en) * 2000-12-07 2004-08-17 Nvidia Corporation Graphics processing system having a virtual texturing array
JP2006333330A (en) * 2005-05-30 2006-12-07 Sony Corp Data processing method, and apparatus and program
CN104125466A (en) * 2014-07-10 2014-10-29 中山大学 GPU (Graphics Processing Unit)-based HEVC (High Efficiency Video Coding) parallel decoding method
CN104268021A (en) * 2014-09-15 2015-01-07 西安电子科技大学 Graphic processor based RS (Reed-Solomon) decoding method
CN106254865A (en) * 2015-06-08 2016-12-21 同济大学 A kind of picture coding and coding/decoding method, image processing equipment
US20170339421A1 (en) * 2016-05-23 2017-11-23 Qualcomm Incorporated End of sequence and end of bitstream nal units in separate file tracks
CN108366288A (en) * 2018-03-01 2018-08-03 厦门普杰信息科技有限公司 A kind of efficient decoding and playback method and system for HD video
CN109964204A (en) * 2017-10-19 2019-07-02 腾讯科技(深圳)有限公司 For handling the method and system of figure
US20190313080A1 (en) * 2018-04-06 2019-10-10 Disney Enterprises, Inc. Depth codec for real-time, high-quality light field reconstruction
WO2019239396A1 (en) * 2018-06-12 2019-12-19 Kliots Shapira Ela Method and system for automatic real-time frame segmentation of high resolution video streams into constituent features and modifications of features in each frame to simultaneously create multiple different linear views from same video source

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6778181B1 (en) * 2000-12-07 2004-08-17 Nvidia Corporation Graphics processing system having a virtual texturing array
JP2006333330A (en) * 2005-05-30 2006-12-07 Sony Corp Data processing method, and apparatus and program
CN104125466A (en) * 2014-07-10 2014-10-29 中山大学 GPU (Graphics Processing Unit)-based HEVC (High Efficiency Video Coding) parallel decoding method
CN104268021A (en) * 2014-09-15 2015-01-07 西安电子科技大学 Graphic processor based RS (Reed-Solomon) decoding method
CN106254865A (en) * 2015-06-08 2016-12-21 同济大学 A kind of picture coding and coding/decoding method, image processing equipment
US20170339421A1 (en) * 2016-05-23 2017-11-23 Qualcomm Incorporated End of sequence and end of bitstream nal units in separate file tracks
CN109964204A (en) * 2017-10-19 2019-07-02 腾讯科技(深圳)有限公司 For handling the method and system of figure
CN108366288A (en) * 2018-03-01 2018-08-03 厦门普杰信息科技有限公司 A kind of efficient decoding and playback method and system for HD video
US20190313080A1 (en) * 2018-04-06 2019-10-10 Disney Enterprises, Inc. Depth codec for real-time, high-quality light field reconstruction
WO2019239396A1 (en) * 2018-06-12 2019-12-19 Kliots Shapira Ela Method and system for automatic real-time frame segmentation of high resolution video streams into constituent features and modifications of features in each frame to simultaneously create multiple different linear views from same video source

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘寿生: "虚拟现实仿真平台异构并行计算关键技术研究", 《博士论文电子期刊》 *

Also Published As

Publication number Publication date
CN111541901B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
CN101438319B (en) Advanced anti-aliasing with multiple graphics processing units
US9165399B2 (en) System, method, and computer program product for inputting modified coverage data into a pixel shader
US7532222B2 (en) Anti-aliasing content using opacity blending
CN111080780B (en) Edge processing method and device for virtual character model
US20100064209A1 (en) Method for transforming web page objects
CN110113617A (en) A kind of method and device of compression of images and decompression
CN111541901B (en) Picture decoding method and device
WO2021248706A1 (en) Depth anti-aliasing data reading method and device, computer program and readable medium
US6693644B1 (en) Graphic accelerator reducing and processing graphics data
US10269168B2 (en) Graphics processing systems
US8818092B1 (en) Multi-threaded text rendering
US10424084B2 (en) Digital content rendering that supports alpha is shape (AIS) as part of knockout groups
CN115965737A (en) Image rendering method and device, terminal equipment and storage medium
CN113052748B (en) Graphics processor and video decoding display method
CN110930480B (en) Method for directly rendering startup animation video of liquid crystal instrument
US10049425B2 (en) Merging filters for a graphic processing unit
CN113546409B (en) Method for playing GIF format resource by Laya engine and storage medium
US9536281B2 (en) Image scaling for images including low resolution text
KR20180037837A (en) Method and apparatus for determining the number of bits assigned a channel based on a variation of the channel
CN109146766A (en) Object selection method and device
CN117235403A (en) Image decoding method, electronic device, and computer storage medium
CN112995745B (en) Image storage method and circuit system
CA2969778A1 (en) Glyph management in texture atlases
CN116883228B (en) GPU pixel filling rate measuring method
CN114187408B (en) Three-dimensional face model reconstruction method and device, 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
GR01 Patent grant
GR01 Patent grant