An image decoding apparatus, method, display apparatus, and storage medium
By using hardware circuitry to decode PNG images during code table parsing and data matching, the problems of low decoding efficiency and poor real-time performance in existing technologies are solved, thereby improving the decoding efficiency and real-time performance of mobile devices.
Patent Information
- Application Number
- CN202210725225.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-06-23
AI Technical Summary
Existing technologies for decoding PNG images have low efficiency and poor real-time performance, failing to meet the low power consumption requirements of mobile devices. In particular, when decoding boot logo images, the decoding software increases the burden on the central processing unit and is slow.
By setting the matching module to decode based on the number of codewords in the code table parsing state, the character length code table and distance code table are obtained. In the data matching state, pixel encoded data is matched, and image decoding is realized by hardware circuitry, sharing storage space and improving decoding efficiency.
It improves the real-time performance of image decoding, enhances decoding efficiency, meets the low power consumption requirements of mobile devices, and simplifies the system interface.
Smart Images

Figure CN115190315B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to an image decoding device and method, a display device, and a storage medium. BACKGROUND
[0002] Portable Network Graphics (PNG) is an open source image format that can replace Graphics Interchange Format (GIF) and Tag Image File Format (TIFF), and has the characteristics of lossless compression, high compression ratio, small code stream file size, support for color index mode, grayscale mode, true color, alpha channel, etc. In order to reduce the data volume in the process of Internet and image use, the lossless compression technology for PNG has also been widely applied, for example, storing a startup logo image in PNG format. Conversely, how to quickly and completely decompress the PNG image becomes a problem that needs attention.
[0003] In the related art, PNG images are mainly decoded by using decoding software. However, the decoding software has low decoding efficiency and poor real-time performance, which is not conducive to the low power consumption requirement of mobile devices. For example, the decoding of a startup logo image of a mobile phone has high requirements for low power consumption and decoding speed. Using decoding software increases the burden of the central processing unit and slows down the decoding speed. Therefore, how to improve the PNG image decoding efficiency has become a problem that needs to be solved urgently. SUMMARY
[0004] The embodiments of the present application provide an image decoding device, method, display device, and storage medium to improve the image decoding efficiency.
[0005] The image decoding device provided by the embodiments of the present application comprises:
[0006] The matching module is configured to, in a code table analysis state, decode each code table based on the code word quantity information of the code table, to obtain a decoded character length code table and a distance code table.
[0007] In a data matching state, the matching module is configured to match the encoding data of each pixel in the to-be-decoded image from the code stream of the to-be-decoded image based on the decoded character length code table, to obtain a matching result; and obtain the effective pixel value of each pixel based on the matching result and the decoded distance code table.
[0008] The processing module is configured to obtain the to-be-decoded image after decoding based on the effective pixel values.
[0009] In an alternative implementation, the code table to be decoded further comprises a code word length code table;
[0010] The matching module is specifically configured to:
[0011] based on the first code word quantity information of the code word length code table to be decoded, perform run-length code decoding on the code word length code table to obtain first code word length information of the code word length code table;
[0012] obtain the decoded code word length code table through a code length decoding tree constructed based on the first code word length information;
[0013] based on the code word length code table, second code word quantity information of the character length code table, and third code word quantity information of the distance code table, decode corresponding code tables to obtain the decoded character length code table and the distance code table.
[0014] In an alternative implementation, the matching module is specifically configured to:
[0015] based on the code word length code table and the second code word quantity information, match the code stream to obtain second code word length information of the character length code table, and obtain the decoded character length code table through a character length decoding tree constructed based on the second code word length information;
[0016] based on the code word length code table and the third code word quantity information, match the code stream to obtain third code word length information of the distance code table, and obtain the decoded distance code table through a distance decoding tree constructed based on the third code word length information.
[0017] In an alternative implementation, the pixel comprises a pixel to be reconstructed; and the matching module is specifically configured to:
[0018] based on the decoded character length code table, match, from the code stream, encoded data corresponding to the pixel to be reconstructed to obtain target length information of the pixel to be reconstructed;
[0019] based on the distance code table, match, from the code stream, encoded data to obtain target distance information of the pixel to be reconstructed;
[0020] based on the target length information and the target distance information, query a current lookup table to obtain corresponding pixel value information, and based on the pixel value information, obtain an effective pixel value of the pixel to be reconstructed; wherein the lookup table is dynamically updated based on the obtained effective pixel value.
[0021] In an alternative implementation, the matching module is specifically configured to:
[0022] If the pixel comprises the pixel to be reconstructed, based on the decoded character length code table, the encoding data corresponding to the pixel to be reconstructed is matched from the code stream to obtain initial length information of the pixel to be reconstructed;
[0023] The initial length information is parsed based on the length reference table to obtain the target length information;
[0024] Based on the distance code table, the encoding data is matched from the code stream to obtain initial distance information of the pixel to be reconstructed;
[0025] The initial distance information is parsed based on the distance reference table to obtain the target distance information.
[0026] In an optional implementation, the pixel further comprises a target pixel; and the matching module is further configured to:
[0027] Based on the decoded character length code table, the encoding data corresponding to the target pixel is matched from the code stream to obtain the valid pixel value of the target pixel.
[0028] In an optional implementation, the device further comprises:
[0029] A data block detection module configured to perform data block type detection on the input code stream, and trigger the code table parsing state of the matching module when a target type data block is detected;
[0030] An information analysis module configured to parse the input code stream to obtain code word quantity information of each code table to be decoded;
[0031] A code stream splitting module configured to split the input code stream according to code stream size information, obtain a split code stream, and input the split code stream into the matching module, the data block detection module and the information analysis module.
[0032] The image decoding method provided by the embodiment of the application comprises:
[0033] In the code table parsing state, each code table to be decoded is decoded based on the code word quantity information of the code table to obtain a decoded character length code table and a distance code table;
[0034] In the data matching state, the encoding data of each pixel in the image to be decoded is matched from the code stream of the image to be decoded based on the decoded character length code table to obtain a matching result; and the valid pixel value of each pixel is obtained based on the matching result and the decoded distance code table;
[0035] The image to be decoded is obtained based on the valid pixel values.
[0036] In an optional implementation, the code table to be decoded further comprises a code word length code table; the code word quantity information of each code table to be decoded is used to decode the corresponding code table to obtain the decoded character length code table and distance code table, comprising:
[0037] The first code word quantity information of the code word length code table to be decoded is used to decode the code word length code table to obtain the first code word length information of the code word length code table;
[0038] The code length decoding tree constructed based on the first code word length information is used to obtain the decoded code word length code table;
[0039] The second code word quantity information of the code word length code table, the character length code table and the third code word quantity information of the distance code table are used to decode the corresponding code table to obtain the decoded character length code table and distance code table.
[0040] In an optional implementation, the code word quantity information of each code table to be decoded is used to decode the corresponding code table to obtain the decoded character length code table and distance code table, comprising:
[0041] The code stream is matched based on the code word length code table and the second code word quantity information to obtain the second code word length information of the character length code table, and the character length decoding tree constructed based on the second code word length information is used to obtain the decoded character length code table;
[0042] The code stream is matched based on the code word length code table and the third code word quantity information to obtain the third code word length information of the distance code table, and the distance decoding tree constructed based on the third code word length information is used to obtain the decoded distance code table.
[0043] In an optional implementation, the pixel comprises a pixel to be reconstructed; the encoded data of each pixel in the image to be decoded is matched from the code stream of the image to be decoded based on the decoded character length code table to obtain a matching result; and the effective pixel value of each pixel is obtained based on the matching result and the decoded distance code table, comprising:
[0044] The encoded data corresponding to the pixel to be reconstructed is matched from the code stream based on the decoded character length code table to obtain the target length information of the pixel to be reconstructed;
[0045] matching encoded data from the code stream based on the distance code table to obtain target distance information of the pixel to be reconstructed;
[0046] querying a current lookup table based on the target length information and the target distance information to obtain corresponding pixel value information, and obtaining an effective pixel value of the pixel to be reconstructed based on the pixel value information, wherein the lookup table is dynamically updated based on the effective pixel value obtained.
[0047] In an optional implementation, the target length information and the target distance information are obtained by:
[0048] if the pixel includes the pixel to be reconstructed, matching encoded data corresponding to the pixel to be reconstructed from the code stream based on the decoded character length code table to obtain initial length information of the pixel to be reconstructed;
[0049] analyzing the initial length information based on a length reference table to obtain the target length information;
[0050] matching encoded data from the code stream based on the distance code table to obtain initial distance information of the pixel to be reconstructed;
[0051] analyzing the initial distance information based on a distance reference table to obtain the target distance information.
[0052] In an optional implementation, the pixel further includes a target pixel, and the method further includes:
[0053] matching encoded data corresponding to the target pixel from the code stream based on the decoded character length code table to obtain an effective pixel value of the target pixel.
[0054] In an optional implementation, the method further includes:
[0055] performing data block type detection on the input code stream, and triggering a code table analysis state of the matching module when a target type data block is detected;
[0056] analyzing the input code stream to obtain code word quantity information of each code table to be decoded;
[0057] splitting the input code stream according to code stream size information to obtain a split code stream.
[0058] A display device provided by an embodiment of the present application includes a display and an image decoding device;
[0059] The image decoding device is configured to, in a code table analysis state, decode each code table based on code word quantity information of each code table to be decoded, to obtain a decoded character length code table and a distance code table;
[0060] In a data matching state, based on the decoded character length code table, the encoding data of each pixel in the image to be decoded is matched from a code stream of the image to be decoded to obtain a matching result; and based on the matching result and the decoded distance code table, the effective pixel value of each pixel is obtained;
[0061] Based on each effective pixel value, a decoded image to be decoded is obtained.
[0062] The display is configured to display the decoded image to be decoded.
[0063] Embodiments of the present application provide a computer readable storage medium including a computer program, when the computer program is run on a display device, the computer program is configured to make the display device execute steps of any one of the above image decoding methods.
[0064] Embodiments of the present application provide a computer program product, the computer program product includes a computer program, the computer program is stored in a computer readable storage medium; when the display device reads the computer program from the computer readable storage medium, the display device executes the computer program, so that the display device executes steps of any one of the above image decoding methods.
[0065] The present application has the following advantages:
[0066] Embodiments of the present application provide an image decoding device, method, display device and storage medium. Since the matching module is arranged, in a code table analysis state, each code table is decoded based on code word quantity information of each code table to be decoded, to obtain a decoded character length code table and a distance code table; in a data matching state, based on the decoded character length code table, the encoding data of each pixel in the image to be decoded is matched from a code stream of the image to be decoded to obtain a matching result; finally, based on the matching result and the decoded distance code table, the effective pixel value of each pixel is obtained; according to different states, the internal model is time-multiplexed, and the storage space of other modules can be shared, without additional hardware resources; finally, based on each effective pixel value, the decoded image to be decoded is obtained by the processing module. Based on this way of image decoding, the system interface is simple, the real-time decoding is improved, and the image decoding efficiency is effectively improved.
[0067] Other features and advantages of the present application will be set forth in the description that follows, and in part will be apparent from the description, or can be learned by practice of the application. The purposes and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS
[0068] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0069] Figure 1A FIG. 1 schematically illustrates an operating scenario between a display device and a control device;
[0070] Figure 1B FIG. 2 schematically illustrates Figure 1A FIG. 3 is a configuration block diagram of the control device 100;
[0071] Figure 2 FIG. 4 schematically illustrates Figure 1A FIG. 5 is a configuration block diagram of the display device 200;
[0072] Figure 3 FIG. 6 schematically illustrates an architecture configuration block diagram of an operating system in the display device 200 memory;
[0073] Figure 4 FIG. 7 is an implementation flowchart of an image decoding method provided by an embodiment of the present application;
[0074] Figure 5 FIG. 8 is a flowchart of a code table acquisition method according to an embodiment of the present application;
[0075] Figure 6 FIG. 9 is a flowchart of another code table acquisition method according to an embodiment of the present application;
[0076] Figure 7 FIG. 10 is a processing flowchart of a code table analysis state according to an embodiment of the present application;
[0077] Figure 8 FIG. 11 is a flowchart of a pixel reconstruction method according to an embodiment of the present application;
[0078] Figure 9 FIG. 12 is a processing flowchart of a data matching state according to an embodiment of the present application;
[0079] Figure 10 FIG. 13 is a structure diagram of a processing module according to an embodiment of the present application;
[0080] Figure 11A flowchart of a PNG image decoding method in an embodiment of the present application is shown in FIG. 1.
[0081] Figure 12 A flowchart of an IDAT data block decoding method in an embodiment of the present application is shown in FIG. 2.
[0082] Figure 13 A flowchart of an information obtaining method in an embodiment of the present application is shown in FIG. 3.
[0083] Figure 14 A flowchart of a code stream processing method in an embodiment of the present application is shown in FIG. 4.
[0084] Figure 15 A structural diagram of a data block detection module in an embodiment of the present application is shown in FIG. 5.
[0085] Figure 16 A structural diagram of an information analysis module in an embodiment of the present application is shown in FIG. 6.
[0086] Figure 17 A structural diagram of a code stream splitting module in an embodiment of the present application is shown in FIG. 7.
[0087] Figure 18 A system block diagram of an image decoding method in an embodiment of the present application is shown in FIG. 8.
[0088] Figure 19 A circuit block diagram of an image decoding device in an embodiment of the present application is shown in FIG. 9.
[0089] Figure 20 A structural diagram of an image decoding device in an embodiment of the present application is shown in FIG. 10. DETAILED DESCRIPTION
[0090] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described below in connection with the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments described in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0091] Some concepts involved in the embodiments of the present application will be introduced below.
[0092] The term "and / or" in the embodiments of the present application describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that there are three cases of A alone, A and B together, and B alone. The character "three" generally means that the associated objects before and after are in an "or" relationship.
[0093] The PNG format in the embodiment of the application is constituted based on data blocks (chunks), and is divided into critical chunks and ancillary chunks. The critical chunks include four kinds of data blocks, namely, IHDR, PLTE, IDAT, and IEND, which have contained all valid information of the image. Among them, IHDR represents a file header, and contains critical information such as resolution, true color or grayscale, index mode, compression mode, and the like; PLTE represents an index mode color plate; IDAT represents an image data block, and image data is all in the IDAT; and IEND represents file end information. Data blocks other than the critical chunks can be ignored during decoding.
[0094] In the embodiment of the application, the FIFO (First Input First Output) memory is a first-in first-out dual-port buffer, that is, the first data entering the FIFO is the first data to be removed. One port is an input port of the memory, and the other port is an output port of the memory. For a single-chip FIFO, there are mainly two structures: a trigger-oriented structure and a zero-oriented transmission structure. The FIFO with the trigger-oriented transmission structure is composed of a register array, and the FIFO with the zero-oriented transmission structure is composed of a dual-port RAM with read and write address pointers. In system design, the FIFO memory is widely used for the purpose of increasing data transmission rate, processing a large amount of data flow, and matching systems with different transmission rates, thereby improving system performance.
[0095] In the embodiment of the application, Huffman Coding is a kind of variable-length coding. The method constructs code words with the shortest average length of different prefixes according to character occurrence probability. First, the frequency of each character in the original data is counted, and the frequency value obtained is used to create a Huffman tree and save the information about the tree for use during decoding. Then, the original data is encoded according to the Huffman tree obtained in the foregoing, and the encoding information is stored. Correspondingly, when decoding the image, a Huffman tree needs to be constructed according to the code table, and then Huffman decoding is performed.
[0096] The design idea of the embodiment of the application is briefly introduced as follows:
[0097] PNG is an open-source image format that can replace GIF and TIFF, and has the characteristics of lossless compression, high compression ratio, small code stream file size, support for color index mode, grayscale mode, true color, alpha channel, and the like. In order to reduce the data volume occupied in the process of Internet and image use, the lossless compression technology for PNG has also been widely applied, for example, storing a boot logo image in the PNG format. Correspondingly, how to quickly and completely decompress the PNG image has become a problem that needs to be concerned.
[0098] In related technologies, decoding software is mainly used to decode PNG images. However, decoding software for PNG images has low decoding efficiency and poor real-time performance, which is not conducive to the low power consumption requirements of mobile devices. For example, decoding the boot logo image of a television set has high requirements for both low power consumption and decoding speed. Using decoding software would increase the burden on the central processing unit and result in slow decoding speed. Therefore, how to improve the decoding efficiency of PNG images has become an urgent problem to be solved.
[0099] In view of this, embodiments of this application provide an image decoding device, method, display device, and storage medium. By setting up a matching module, in the code table parsing state, the corresponding code tables are decoded based on the number of codewords in each code table to be decoded, obtaining a decoded character length code table and a distance code table. In the data matching state, based on the decoded character length code table, the encoded data of each pixel in the image to be decoded is matched from the bitstream of the image to be decoded to obtain a matching result. Finally, based on the matching result and the decoded distance code table, the effective pixel value of each pixel is obtained. The internal model is time-division multiplexed according to different states, and the storage space of other modules can be shared without adding extra hardware resources. Finally, the decoding module obtains the decoded image to be decoded based on each effective pixel value. Image decoding based on this method is entirely implemented by hardware circuitry, the system interface is simple, the real-time performance of decoding is improved, and thus the image decoding efficiency can be effectively improved.
[0100] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0101] Figure 1A The diagram illustrates an operational scenario between a display device and a control unit. Figure 1A As shown, the control device 100 and the display device 200 can communicate via wired or wireless means.
[0102] The control device 100 is configured to control the display device 200, which can receive user inputted operation instructions and convert the operation instructions into instructions recognizable and responsive by the display device 200, thus playing the role of an intermediary between the user and the display device 200. For example, the user can operate the channel plus / minus keys on the control device 100, and the display device 200 can respond to the channel plus / minus operation. For another example, the user can operate the selection keys on the control device 100 to select a to-be-decoded image to be decoded, and the display device 200 can respond to the operation of selecting the to-be-decoded image to decode the selected to-be-decoded image. In addition, the user can also operate the selection keys on the control device 100 to control the display to be turned on or off, and the display device 200 can respond to the operation of turning on or off the display to turn on or off the display.
[0103] The control device 100 can be a remote controller 100A, which includes infrared protocol communication or Bluetooth protocol communication, and other short-distance communication modes, and controls the display device 200 through wireless or other wired modes. The user can input user instructions through the keys, voice input, control panel input, etc. on the remote controller to control the display device 200. For example, the user can input corresponding control instructions through the volume plus / minus keys, channel control keys, up / down / left / right movement keys, voice input keys, menu keys, and on / off keys on the remote controller to realize the function of controlling the display device 200.
[0104] The control device 100 can also be a smart device, such as a mobile terminal 100B, a tablet computer, a computer, a notebook computer, etc. For example, an application program running on the smart device is used to control the display device 200. The application program can provide various controls for the user through an intuitive user interface (UI) on the screen associated with the smart device through configuration.
[0105] For example, the mobile terminal 100B can install a software application on the display device 200, realize connection communication through a network communication protocol, and realize the purpose of one-to-one control operation and data communication. For example, the mobile terminal 100B can establish a control instruction protocol with the display device 200, and realize the functions of the physical keys arranged on the remote controller 100A by operating various function keys or virtual buttons provided on the user interface of the mobile terminal 100B. The audio and video content displayed on the mobile terminal 100B can also be transmitted to the display device 200 to realize the function of synchronous display.
[0106] The display device 200 can provide a network television function of broadcast receiving function and computer support function. The display device can be implemented as a digital television, a network television, an Internet Protocol Television (IPTV), etc.
[0107] The display device 200 can be a liquid crystal display, an organic light emitting display, or a projection device. The specific display device type, size, resolution, and the like are not limited.
[0108] The display device 200 also communicates data with the server 300 through various communication methods. The display device 200 can be allowed to communicate through a local area network (LAN), a wireless local area network (WLAN), and other networks. The server 300 can provide various contents and interactions to the display device 200. For example, the display device 200 can send and receive information, such as receiving electronic program guide (EPG) data, receiving software program updates, or accessing a remotely stored digital media library. The server 300 can be one or a plurality of servers, and can be one or a plurality of types of servers. The server 300 can provide video on demand and advertising services, and other network service contents.
[0109] Figure 1B An exemplary configuration block diagram of the control device 100 is shown in FIG. 1. As shown, the control device 100 includes a controller 110, a memory 120, a communicator 130, a user input interface 140, an output interface 150, and a power supply 160. Figure 1B
[0110] The controller 110 includes a random access memory (RAM) 111, a read only memory (ROM) 112, a processor 113, a communication interface, and a communication bus. The controller 110 controls the operation and operation of the control device 100, and the communication and cooperation between the internal components, the external and internal data processing functions.
[0111] For example, when detecting the interaction of the user pressing the keys arranged on the remote controller 100A or touching the touch panel arranged on the remote controller 100A, the controller 110 can control to generate a signal corresponding to the detected interaction, and send the signal to the display device 200.
[0112] The memory 120 stores various operation programs, data, and applications for driving and controlling the control device 100 under the control of the controller 110. The memory 120 can store various control signal instructions input by the user.
[0113] The communicator 130, under the control of the controller 110, implements communication of control signals and data signals with the display device 200. For example, the control device 100 sends control signals (e.g., touch signals or button signals) to the display device 200 via the communicator 130, and the control device 100 can receive signals sent by the display device 200 via the communicator 130. The communicator 130 can include an infrared signal interface 131 and a radio frequency signal interface 132. For example, in the case of the infrared signal interface, the user input instruction needs to be converted into an infrared control signal according to an infrared control protocol, and then sent to the display device 200 via an infrared sending module. For another example, in the case of the radio frequency signal interface, the user input instruction needs to be converted into a digital signal, and then modulated according to a radio frequency control signal modulation protocol, and then sent to the display device 200 by a radio frequency sending terminal.
[0114] The user input interface 140 can include at least one of a microphone 141, a touchpad 142, a sensor 143, a button 144, etc., so that the user can input user instructions for controlling the display device 200 to the control device 100 through voice, touch, gesture, pressing, etc.
[0115] The output interface 150 outputs the user instructions received by the user input interface 140 to the display device 200, or outputs the image or voice signals received by the display device 200. Here, the output interface 150 can include an LED interface 151, a vibration interface 152 for generating vibration, a sound output interface 153 for outputting sound, and a display 154 for outputting images, etc. For example, the remote controller 100A can receive output signals such as audio, video, or data from the output interface 150, and display the output signals in the form of images on the display 154, in the form of audio on the sound output interface 153, or in the form of vibration on the vibration interface 152.
[0116] The power supply 160 is used to provide operating power support for the elements of the control device 100 under the control of the controller 110. The form can be a battery and related control circuit.
[0117] Figure 2 The hardware configuration block diagram of the display device 200 is exemplarily shown. As shown, the display device 200 can include a tuner 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a memory 260, a user interface 265, a video processor 270, a display 275, an audio processor 280, an audio output interface 285, and a power supply 290. Among them, the display device 200 contains an image decoding device, which can be built into an integrated circuit chip of the display device 200. Figure 2
[0118] The tuner demodulator 210 receives broadcast television signals through wired or wireless means, and can perform modulation and demodulation processing such as amplification, mixing and resonance, etc., for demodulating audio and video signals carried in the frequency of the selected television channel selected by the user from multiple wireless or wired broadcast television signals, as well as additional information (such as EPG data).
[0119] The tuner demodulator 210 can be controlled by the controller 250 to respond to the frequency of the selected television channel and the television signal carried in the frequency according to the user selection.
[0120] The tuner demodulator 210 can receive signals in many ways according to different broadcast standards of television signals, such as terrestrial broadcast, cable broadcast, satellite broadcast or Internet broadcast, etc.; and can be in digital modulation mode or analog modulation mode according to different modulation types; and can demodulate analog signals and digital signals according to different types of received television signals.
[0121] In other exemplary embodiments, the tuner demodulator 210 can also be in an external device, such as an external set-top box, etc. In this way, the set-top box outputs television signals after modulation and demodulation, and inputs them into the display device 200 through the external device interface 240.
[0122] The communicator 220 is a component for communicating with external devices or external servers according to various communication protocol types. For example, the display device 200 can send content data to external devices connected via the communicator 220, or browse and download content data from external devices connected via the communicator 220. The communicator 220 can include a WIFI module 221, a Bluetooth communication protocol module 222, a wired Ethernet communication protocol module 223, and other network communication protocol modules or near field communication protocol modules, so that the communicator 220 can receive control signals of the control device 100 according to the control of the controller 250, and implement the control signals as WIFI signals, Bluetooth signals, radio frequency signals, etc.
[0123] The detector 230 is a component of the display device 200 for collecting signals of the external environment or interacting with the outside. The detector 230 can include a sound collector 231, such as a microphone, which can be used to receive the user's voice, such as the voice signal of the user's control instruction for controlling the display device 200; or can collect environmental sounds for identifying the type of environmental scene, so that the display device 200 can adapt to environmental noise.
[0124] In other exemplary embodiments, the detector 230 can also include an image collector 232, such as a camera, a video camera, etc., which can be used to collect external environmental scenes to adaptively change the display parameters of the display device 200; and can be used to collect the attributes of the user or the interaction gestures with the user to realize the function of interaction between the display device and the user.
[0125] In some other exemplary embodiments, the detector 230 may also include a light receiver for acquiring ambient light intensity to adapt to changes in display parameters of the display device 200, etc.
[0126] In some other exemplary embodiments, the detector 230 may also include a temperature sensor, such as by sensing the ambient temperature, so that the display device 200 can adaptively adjust the display color temperature of the image. For example, in a high-temperature environment, the display device 200 may adjust the color temperature of the displayed image to be cooler; in a low-temperature environment, the display device 200 may adjust the color temperature of the displayed image to be warmer.
[0127] External device interface 240 is a component that provides data transmission between the controller 250 and the display device 200 and external devices. External device interface 240 can be connected to external devices such as set-top boxes, gaming devices, and laptops via wired / wireless means, and can receive data such as video signals (e.g., moving images), audio signals (e.g., music), and additional information (e.g., EPG) from external devices.
[0128] The external device interface 240 may include one or more of the following: an HDMI terminal 241, a composite video blanking synchronization (CVBS) terminal 242, an analog or digital component terminal 243, a universal serial bus (USB) terminal 244, a component terminal (not shown in the figure), and a red, green and blue (RGB) terminal (not shown in the figure).
[0129] The controller 250 controls the operation of the display device 200 and responds to user operations by running various software control programs (such as operating systems and various applications) stored in the memory 260.
[0130] like Figure 2 As shown, the controller 250 includes a random access memory (RAM) 251, a read-only memory (ROM) 252, a graphics processor 253, a CPU processor 254, a communication interface 255, and a communication bus 256. The RAM 251, ROM 252, graphics processor 253, CPU processor 254, and communication interface 255 are connected via the communication bus 256. During image decoding, the controller 250 can be used to control the image decoding device to decode the image to be decoded, and also to control the display 275 to display the decoded image.
[0131] ROM 252 for storing various system booting instructions. When a power-on signal is received, the display device 200 power supply starts booting, the CPU processor 254 runs the system booting instructions in the ROM 252, copies the operating system stored in the memory 260 to the RAM 251 to start running the booting operating system. When the operating system booting is completed, the CPU processor 254 copies various application programs in the memory 260 to the RAM 251, and then starts running the booting various application programs.
[0132] The graphic processor 253 for generating various graphic objects, such as icons, operation menus, and user input instruction display graphics, etc. The graphic processor 253 can include a calculator for performing calculation by receiving various interactive instructions input by the user, and then displaying various objects according to display attributes; and a renderer for generating various objects based on the calculation results of the calculator, and displaying the rendering results on the display 275.
[0133] The CPU processor 254 for executing the operating system and application program instructions stored in the memory 260, and performing processing of various application programs, data and contents according to the received user input instructions, so as to finally display and play various audio and video contents.
[0134] In some exemplary embodiments, the CPU processor 254 can include a plurality of processors. The plurality of processors can include a main processor and a plurality of or one sub-processor. The main processor is used to perform some initialization operations of the display device 200 in the display device pre-loading mode, and / or display screen operations in the normal mode. The plurality of or one sub-processor is used to perform an operation in a state such as the display device standby mode.
[0135] The communication interface 255 can include a first interface to an n-th interface. These interfaces can be network interfaces connected to external devices via a network.
[0136] The controller 250 can control the overall operation of the display device 200. For example, in response to receiving a user input command for selecting a GUI object displayed on the display 275, the controller 250 can perform an operation related to the object selected by the user input command.
[0137] The object can be any one of selectable objects, such as a hyperlink or an icon. The operation related to the selected object can be an operation of displaying a page, a document, an image, etc. connected to the hyperlink, or an operation of executing a program corresponding to the object. The user input command for selecting the GUI object can be a command input through various input devices (e.g., a mouse, a keyboard, a touchpad, etc.) connected to the display device 200 or a voice command corresponding to a voice spoken by the user.
[0138] The memory 260 stores various types of data, software programs or applications that drive and control the operation of the display device 200. The memory 260 can include volatile and / or nonvolatile memory. The term "memory" includes the memory 260, the RAM 251 and the ROM 252 of the controller 250, or a memory card in the display device 200.
[0139] In some embodiments, the memory 260 is specifically used to store programs that drive the operation of the controller 250 in the display device 200; to store various applications that are built-in in the display device 200 and downloaded by the user from external devices; to store data for configuring visual effect images of various GUIs provided by the display 275, various objects related to the GUIs, and selectors for selecting the GUI objects, etc.
[0140] In some embodiments, the memory 260 is specifically used to store programs that drive the operation of the tuner 210, the communicator 220, the detector 230, the external device interface 240, the video processor 270, the display 275, the audio processor 280, etc., and related data, such as external data (e.g., audio / video data) received from the external device interface or user data (e.g., key information, voice information, touch information, etc.) received from the user interface.
[0141] In some embodiments, the memory 260 specifically stores software and / or programs for representing an operating system (OS), which can include, for example: a kernel, middleware, an application programming interface (API), and / or an application program. For example, the kernel can control or manage system resources and functions implemented by other programs (e.g., the middleware, the API, or the application program), and can provide an interface to allow the middleware, the API, or the application program to access the controller to control or manage system resources.
[0142] Figure 3 An exemplary configuration block diagram of an operating system in the memory of the display device 200 is shown. The operating system architecture includes, from top to bottom, an application layer, a middleware layer, and a kernel layer.
[0143] The application layer includes both system built-in application programs and non-system level application programs. The application layer is responsible for direct interaction with the user. The application layer can include a plurality of application programs, such as a settings application program, an electronic poster application program, a media center application program, etc. These application programs can be implemented as web applications that are executed based on a WebKit engine, and can be developed and executed based on HTML5, Cascading Style Sheets (CSS), and JavaScript.
[0144] Here, HTML, the full name of HyperText Markup Language, is a standard markup language for creating web pages, which describes web pages through markup tags. HTML tags are used to describe text, graphics, animation, sound, tables, links, etc. Browsers read HTML documents, interpret the content of the tags in the documents, and display them in the form of web pages.
[0145] CSS, the full name of Cascading Style Sheets, is a computer language used to represent the style of HTML files. It can be used to define style structures such as fonts, colors, positions, etc. CSS styles can be stored directly with HTML web pages or in separate style files to control the styles in web pages.
[0146] JavaScript is a language used for web page programming, which can be inserted into HTML pages and interpreted and executed by browsers. The interaction logic of web applications is implemented through JavaScript. JavaScript can communicate with the kernel layer through the browser and encapsulate JavaScript extension interfaces.
[0147] The middleware layer can provide some standardized interfaces to support the operation of various environments and systems. For example, the middleware layer can be implemented as a multimedia and hypermedia information coding expert group (MHEG) related to data broadcast middleware, as a DLNA middleware related to external device communication middleware, and as a middleware that provides a browser environment for running various applications in a display device.
[0148] The kernel layer provides core system services, such as file management, memory management, process management, network management, and system security permission management. The kernel layer can be implemented as a kernel based on various operating systems, such as a kernel based on the Linux operating system.
[0149] The kernel layer also provides communication between system software and hardware, and provides device driver services for various hardware, such as display drivers for displays, camera drivers for cameras, key drivers for remote controls, WiFi drivers for WiFi modules, audio drivers for audio output interfaces, and power management (PM) drivers for power management modules.
[0150] The user interface 265 receives various user interactions. Specifically, the user interface 265 receives input signals from a user and sends the input signals to the controller 250, or transmits output signals from the controller 250 to the user. For example, the remote controller 100A can send input signals, such as power on / off signals, channel selection signals, volume adjustment signals, etc., input by a user to the user interface 265, which then forwards the input signals to the controller 250. Alternatively, the remote controller 100A can receive output signals, such as audio, video, or data, output from the user interface 265 processed by the controller 250, and display or output the received output signals as audio or vibration.
[0151] In some embodiments, a user can input user commands through a graphical user interface (GUI) displayed on the display 275, and the user interface 265 receives the user input commands through the GUI. Specifically, the user interface 265 can receive user input commands for controlling the position of a selector in the GUI to select different objects or items.
[0152] Alternatively, a user can input user commands by inputting specific sounds or gestures, and the user interface 265 receives the user input commands by recognizing the sounds or gestures through sensors. The video processor 270 receives external video signals, and performs video data processing, such as decompression, decoding, scaling, noise reduction, frame rate conversion, resolution conversion, image composition, etc., according to standard encoding and decoding protocols of the input signals, to obtain video signals that can be directly displayed or played on the display 275.
[0153] For example, the video processor 270 includes a demultiplexing module, a video decoding module, an image composition module, a frame rate conversion module, a display formatting module, etc.
[0154] The demultiplexing module performs demultiplexing processing on input audio and video data streams. For example, if the input is an MPEG-2 stream (a compression standard for digital storage media - motion pictures and audio), the demultiplexing module demultiplexes the input into video signals and audio signals, etc.
[0155] The video decoding module processes the demultiplexed video signals, including decoding and scaling processing, etc.
[0156] The image composition module, such as an image compositor, performs superimposition and mixing processing on the GUI signals generated by the graphics generator according to user input or self-generation, and the scaled video images, to generate image signals that can be displayed.
[0157] The frame rate conversion module converts the frame rate of input video. For example, the frame rate of input 60Hz video can be converted to 120Hz or 240Hz frame rate, which is usually implemented in an interpolation manner.
[0158] a display formatting module for converting the signal outputted from the frame rate conversion module into a signal conforming to a display format, such as a signal converted into an RGB data signal.
[0159] a display 275 for receiving the image signal inputted from the video processor 270 and displaying video content, images, and a user interface for controlling the display apparatus 200. The display 275 displays video content received from the broadcast signal received by the tuner and demodulator 210 or video content inputted from the communicator 220 or the external device interface 240. The display 275 also displays a user interface for controlling the display apparatus 200 generated in the display apparatus 200. The display 275 can also display a decoded PNG format image, such as a booting logo image.
[0160] The display 275 can include a display panel for presenting a screen and a driving component for driving the display. Alternatively, if the display 275 is a projection display, the display 275 can include a projection device and a projection screen.
[0161] an audio processor 280 for receiving an external audio signal, decompressing and decoding the audio signal according to a standard codec protocol of the input signal, and performing audio data processing such as noise reduction, digital-to-analog conversion, and amplification to obtain an audio signal that can be played through a speaker 286.
[0162] For example, the audio processor 280 can support various audio formats, such as MPEG-2, MPEG-4, Advanced Audio Coding (AAC), High-Efficiency AAC (HE-AAC), etc.
[0163] an audio output interface 285 for receiving the audio signal outputted from the audio processor 280 under the control of the controller 250. The audio output interface 285 can include the speaker 286 or an external audio output terminal 287 for outputting to an external device, such as a headphone output terminal.
[0164] In other exemplary embodiments, the video processor 270 can include one or more chipsets. The audio processor 280 can also include one or more chipsets.
[0165] In other exemplary embodiments, the video processor 270 and the audio processor 280 can be separate chips or can be integrated with the controller 250 in one or more chipsets.
[0166] A power supply 290 is configured to supply power to the display device 200 under the control of the controller 250. The power supply 290 can be an internal power supply circuit installed inside the display device 200 or an external power supply installed outside the display device 200.
[0167] The image decoding method provided by the example embodiments of the present application will be described below in conjunction with the above-described application scenarios and with reference to the accompanying drawings. It should be noted that the above-described application scenarios are merely shown for the purpose of facilitating the understanding of the spirit and principles of the present application, and the example embodiments of the present application are not limited in this respect.
[0168] Referring to Figure 4 FIG. 4 shows an implementation flowchart of an image decoding method provided by an example embodiment of the present application, and the execution subject is taken as an example of a display device including an image decoding device. The specific implementation flow of the method includes the following steps S41-S43:
[0169] S41: In a code table decoding state, decode the corresponding code table based on the codeword quantity information of each to-be-decoded code table, to obtain a decoded character length code table and a distance code table.
[0170] Specifically, before decoding the to-be-decoded image, the code table is first decoded to obtain a decoded character length code table and a distance code table, and then the to-be-decoded image is decoded based on the obtained code table. The codeword quantity information of each to-be-decoded code table can be pre-stored in a codeword quantity information file, and the codeword quantity information file is parsed to obtain the codeword quantity information of each to-be-decoded code table.
[0171] In an optional embodiment, each to-be-decoded code table further includes a codeword length code table; as Figure 5 FIG. 5 shows a flowchart of a code table obtaining method in an example embodiment of the present application, and step S41 can be implemented as the following steps S51-S53:
[0172] S51: Decode the codeword length code table based on the first codeword quantity information of the to-be-decoded codeword length code table, to obtain first codeword length information of the codeword length code table;
[0173] S52: Obtain a decoded codeword length code table through a code length decoding tree constructed based on the first codeword length information;
[0174] S53: Decode the corresponding code table based on the second codeword quantity information of the codeword length code table, the second codeword quantity information of the character length code table, and the third codeword quantity information of the distance code table, to obtain a decoded character length code table and a distance code table.
[0175] Wherein, the code word length code table is used to record the code word length information of the character length code table and the distance code table, the first code word quantity information is less than 20, the second code word quantity information is less than 287, and the third code word quantity information is less than 30. Taking the first code word quantity information as C for example, the code word length code table is run-length decoded, and the first code word length information is obtained by looping C times, a huffman tree is constructed, and the huffman decoding is performed to obtain the code word length code table.
[0176] In an alternative embodiment, as shown in FIG. 5B, which is a flowchart of another code table obtaining method in the embodiment of the present application, step S53 can be implemented as steps S61-S62: Figure 6
[0177] S61: matching the code stream based on the code word length code table and the second code word quantity information to obtain the second code word length information of the character length code table, and obtaining the decoded character length code table through the character length decoding tree constructed based on the second code word length information;
[0178] S62: matching the code stream based on the code word length code table and the third code word quantity information to obtain the third code word length information of the distance code table, and obtaining the decoded distance code table through the distance decoding tree constructed based on the third code word length information.
[0179] Specifically, the code stream refers to the binary code data stream obtained after encoding the pixels in the image, for example, it can be 1100 1010 0101 0011…. Taking the second code word quantity information as L and the third code word quantity information as D for example, according to the code word length code table, L times of matching is performed to obtain the code word length information of the litera / length code table (character length code table), a huffman tree is constructed, and the huffman decoding is performed to obtain the litera / length code table; according to the code word length code table, D times of matching is performed to obtain the code word length information of the distance code table (distance code table), a huffman tree is constructed, and the huffman decoding is performed to obtain the distance code table.
[0180] Referring to FIG. 6, which is a flowchart of a code table parsing state processing method in the embodiment of the present application, the functions of each state are as follows: Figure 7
[0181] ST_0: idle, receiving an IDAT flag signal, jumping to ST_1;
[0182] ST_1: IDAT information analysis, obtaining the code word quantity information Cnum of the code word length code table, the code word quantity information Lnum of the litera / length code table, and the code word quantity information Dnum of the distance code table;
[0183] ST_2: code length table statistics, capture Cnum 3-bit values, get the code length information of the code length table;
[0184] ST_3: construct a huffman tree according to the code length information of the code length table, and perform huffman decoding. Get the code length table;
[0185] ST_4: according to the code length table, match the code length information of the litera / length code table, match Lnum times, get the code length information of the litera / length code table, jump to ST_5;
[0186] ST_5: according to the code length information of the litera / length code table, perform huffman decoding. Get the litera / length code table;
[0187] ST_6: according to the code length table, match the code length information of the distance code table, match Dnum times, get the code length information of the distance code table, jump to ST_7;
[0188] ST_7: according to the code length information of the distance code table, perform huffman decoding, get the distance code table;
[0189] ST_8: at this time, the litera / length code table and the distance code table are ready, trigger the data matching state, enter the process of decoding image data.
[0190] S42: in the data matching state, based on the decoded character length code table, match the encoding data of each pixel in the to-be-decoded image from the code stream of the to-be-decoded image, obtain the matching result; based on the matching result and the decoded distance code table, obtain the effective pixel value of each pixel;
[0191] Specifically, after obtaining the decoded character length code table and the distance code table, the code stream can be matched according to the obtained code table to obtain the effective pixel value of each pixel in the to-be-decoded image, and then the decoded image is obtained based on the effective pixel value. First, use the litera / length code table to match the encoding data in the code stream to obtain a matching result, which can include the effective pixel value of the target pixel and the initial length information of the to-be-reconstructed pixel. Based on the initial length information and the decoded distance code table, the effective pixel value of the to-be-reconstructed pixel can be obtained.
[0192] It should be noted that the target pixel herein refers to a pixel whose valid pixel value can be obtained by directly matching the code stream using the litera / length code table, and the pixel to be reconstructed refers to a pixel whose valid pixel value can be reconstructed based on distance information and length information according to distance information obtained based on the distance code table, and the length information obtained by matching the code stream using the litera / length code table. In fact, there is no distinction between the target pixel and the pixel to be reconstructed in the image to be decoded.
[0193] In an optional implementation, the pixel includes the pixel to be reconstructed; as shown in the flowchart of a pixel reconstruction method in the embodiments of the present application, step S42 can be implemented as steps S81-S83. Figure 8
[0194] S81: based on the decoded character length code table, matching the encoding data corresponding to the pixel to be reconstructed from the code stream to obtain the target length information of the pixel to be reconstructed;
[0195] S82: based on the distance code table, matching the encoding data from the code stream to obtain the target distance information of the pixel to be reconstructed;
[0196] S83: based on the target length information and the target distance information, querying the current lookup table to obtain corresponding pixel value information, and obtaining the valid pixel value of the pixel to be reconstructed based on the pixel value information.
[0197] Wherein, the lookup table is dynamically updated based on the obtained valid pixel value, and the obtained valid pixel value includes the valid pixel value of the pixel to be reconstructed and the valid pixel value of the target pixel. The target length information of the pixel to be reconstructed is obtained by matching the code stream using the litera / length code table, the target distance information of the pixel to be reconstructed is obtained by matching the code stream using the distance code table, and the valid pixel value is reconstructed by one lookup table matching according to the target length information and the target distance information. The valid pixel value is output and the lookup table is updated until the number of valid pixel values reaches the number informed by the resolution, and the decoding of the image to be decoded is completed.
[0198] In an optional implementation, the pixel further includes the target pixel; step S42 can also be implemented as:
[0199] based on the decoded character length code table, matching the encoding data corresponding to the pixel to be reconstructed from the code stream to obtain the target length information of the pixel to be reconstructed;
[0200] Specifically, the valid pixel value of the target pixel is directly obtained by matching the encoding data in the code stream using the litera / length code table, and the lookup table is updated based on the obtained valid pixel value.
[0201] Referring to Figure 9 , which is a data matching state processing flow schematic diagram in the embodiment of the present application, the functions of each state are as follows:
[0202] CT_0: idle, a data processing start signal is detected, jump to CT_1;
[0203] CT_1: match the code stream using the litera / length code table, obtain the litera value or the pre_length value. If the litera is a valid pixel value, continue CT_1, if the pre_length value, jump to CT_2;
[0204] CT_2: analyze the pre_length value through the length reference table to obtain the real length value;
[0205] CT_3: match the code stream using the distance code table to obtain the pre_distance value;
[0206] CT_4: analyze the pre_distance value through the distance reference table to obtain the real distance value;
[0207] CT_5: perform a lookup table matching reconstruction according to the length value and the distance value, reconstruct the valid pixel value output and update the lookup table.
[0208] After completing a cycle of processing, jump to CT_1. When the number of valid pixel values reaches the number informed by the resolution, complete all data processing and jump to CT_0.
[0209] S43: obtain the decoded image to be decoded based on each valid pixel value.
[0210] In the embodiment of the present application, the internal model is time-division multiplexed according to different states, and the storage space of other modules can be shared, without additional hardware resources. Finally, the processing module obtains the decoded image to be decoded based on each valid pixel value. Based on this way of image decoding, the system interface is simple, the real-time decoding is improved, and the image decoding efficiency is effectively improved.
[0211] Optionally, step S43 can be implemented based on a processing module, refer to Figure 10 , which is a processing module structure schematic diagram in the embodiment of the present application, the valid pixel value is input into the processing module, and the processing module outputs the image data.
[0212] Optionally, the image decoding method in the present application can be applied to the decoding of PNG images, refer to Figure 11As shown, it is a flow diagram of a PNG image decoding method in the embodiment of the present application. First, PNG flag detection is performed. After detecting the PNG flag, Chunk detection is performed. After detecting the IDAT data block, the IDAT data block is decoded. Until the end flag is detected, the decoding of the PNG image is completed.
[0213] In the present application, the image decoding method can be applied to the process of decoding the IDAT data block. Referring to Figure 12 It is a flow diagram of an IDAT data block decoding method in the embodiment of the present application, including the following steps:
[0214] S1201: Analyzing the code stream to obtain the code word number information of the code word length code table as Cnum, the code word number information of the Litera / length code table as Lnum, and the code word number information of the Distance code table as Dnum;
[0215] S1202: Run code decoding, a total of Cnum times. The code word length information of the code word length code table is obtained, the huffman tree is constructed, and the huffman decoding is performed to obtain the code word length code table;
[0216] S1203: According to the code word length code table, Lnum times of matching are performed to obtain the code word length information of the litera / length code table, the huffman tree is constructed, and the huffman decoding is performed to obtain the litera / length code table;
[0217] S1204: According to the code word length code table, Dnum times of matching are performed to obtain the code word length information of the distance code table, the huffman tree is constructed, and the huffman decoding is performed to obtain the distance code table;
[0218] S1205: Using the litera / length code table to match the encoded data in the code stream to obtain litera or length;
[0219] S1206: Using the distance code table to match the encoded data in the code stream to obtain distance;
[0220] S1207: According to whether it is litera or length, the lookup table is updated or the number is taken from the lookup table.
[0221] S1208: Looping S1205-S1207 until all data is processed.
[0222] In an optional embodiment, as Figure 13As shown, it is a flowchart of an information acquisition method in the embodiment of the present application, and the target length information and the target distance information are obtained through the following steps:
[0223] S1301: If the pixel includes a pixel to be reconstructed, based on the decoded character length code table, the encoded data corresponding to the pixel to be reconstructed is matched from the code stream to obtain initial length information of the pixel to be reconstructed;
[0224] S1302: The initial length information is parsed based on the length reference table to obtain the target length information;
[0225] S1303: Based on the distance code table, the encoded data is matched from the code stream to obtain initial distance information of the pixel to be reconstructed;
[0226] S1304: The initial distance information is parsed based on the distance reference table to obtain the target distance information.
[0227] Specifically, when encoding the image, in order to save the occupied space, only the integer part may be encoded, for example, the target length information is 123.16, the integer part 123 can be encoded to generate the initial length information and put into the code stream, and the decimal part is encoded based on the length reference table. When decoding, first, the litera / length code table is matched with the encoded data in the code stream to obtain the initial length information of the pixel to be reconstructed, and the pre_length value (initial length information) is parsed through the length reference table to obtain the real length value (target length information). Correspondingly, the distance information is also decoded based on the similar manner, the distance code table is matched to obtain the pre_distance value (initial distance information), and the pre_distance value is parsed through the distance reference table to obtain the real distance value (target distance information).
[0228] In an optional implementation, as shown in the figure, Figure 14 As shown, it is a flowchart of a code stream processing method in the embodiment of the present application, including the following steps S1401-S1403:
[0229] S1401: The data block type of the input code stream is detected, and when the target type data block is detected, the code table parsing state is triggered;
[0230] S1402: The input code stream is parsed to obtain the code word quantity information of each code table to be decoded;
[0231] S1403: The input code stream is split according to the code stream size information to obtain the split code stream.
[0232] Specifically, the input code stream is detected for data block type, the target type data block can be IDAT data block, the detected IDAT data block triggers code table parsing state, and code table parsing is started. The input code stream is parsed, which can be a file storing code word quantity information of the code table in the code stream. Code stream size information has different specific values in different steps. When the data block type is detected, 8 bits (bit) size is fixedly input, and the code stream is shifted by 8 bits each time; when the IDAT information is analyzed (i.e., the code word quantity information of the code table is obtained by parsing the code stream), 3 bits size is fixedly input, and the code stream is shifted by 3 bits each time; in addition, during image data processing, the code stream is split according to the real-time parsed code word size.
[0233] Optionally, the step S1401 can be implemented based on a data block detection module, as shown in FIG. 13, which is a structural schematic diagram of a data block detection module (Chunk detection module) in an embodiment of the present application. The data block detection module receives the split code stream, detects the input code stream for data block, and outputs 8-bit code stream each time. Figure 15
[0234] Optionally, the step S1402 can be implemented based on an information analysis module, as shown in FIG. 14, which is a structural schematic diagram of an information analysis module in an embodiment of the present application. The information analysis module receives the split code stream, analyzes the input code stream for IDAT information, and outputs code word quantity information of the code word length code table, the litera / length code table and the distance code table respectively. Figure 16
[0235] Optionally, the step S1403 can be implemented based on a code stream splitting module, as shown in FIG. 15, which is a structural schematic diagram of a code stream splitting module in an embodiment of the present application. The code stream splitting module splits the input code stream, subtracts the processed code stream, and inputs the split code stream into the data block detection module, the information analysis module and the matching module. Figure 17
[0236] The image decoding method in the embodiment of the present application can also be applied to PNG format startup logo image decoding of display devices such as televisions, mobile devices such as mobile phones and computers, and the like, as shown in FIG. 16. Figure 18 It is a system block diagram of an image decoding method in the embodiment of the application, the boot logo image data is stored in a programmable read-only memory, after the mobile device is powered on, a read command of a bridge controller is received through an inter-integrated circuit (IIC), and a code stream is sent out. The code stream passes through the bridge controller and is cached in a synchronous FIFO, and all after the synchronous FIFO are handshake operations, the next stage sends a ready signal to the previous stage, the previous stage sends a valid signal to the next stage, and once the valid and ready signals are seen, a valid operation is performed, the FIFO depth is reduced by 1, the depth of the FIFO is told to the bridge controller, and when the FIFO depth is not full, a read command is sent out. Based on the handshake mechanism, the code stream reading speed can be adaptively adjusted according to the data processing speed. When applied to decoding of a boot logo image of a mobile device, the display module works before other display modules, and therefore the storage space of other modules of the chip can be shared, without additional hardware resources.
[0237] Through function abstraction and processing flow analysis, it can be known that the image decoding is performed around three tables (code word length code table, litera / length code table, and distance code table) and two modules (a matching module and a code stream splitting module). Referring to Figure 19 It is a circuit block diagram of an image decoding device in the embodiment of the application, and includes the following modules.
[0238] The matching module: the input is a code table and a code stream, litera, length, distance and other valid information are matched from the code stream according to the code table, and the size information of the code word is also matched;
[0239] In the ST_4 and ST_6 states, the code word length code table is used for matching, and the litera / length code table code word length and the distance code table code word length are sequentially obtained; in the CT_1 state, the litera / length code table is used for matching, and the litera value or the length value is obtained; and in the CT_3 state, the distance code table is used for matching, and the distance value is obtained;
[0240] The length and the distance are used to look up a table, and the table uses an external static random memory. In a logo display system, the logo is at the front end of the entire display chip work, and the memory of the subsequent functional modules can be shared, and the SRAM interface is released after the logo display is completed.
[0241] The code stream splitting module splits the code stream, subtracts the processed code stream, and sends the unmatched code stream to the next level processing; when performing chunk detection, 8 bitsize is fixedly input, and 8-bit code stream is shifted each time; when performing IDAT information analysis, 3 bitsize is fixedly input, and 3-bit code stream is shifted each time; and when processing image data, the code stream is split according to the size of the code word decoded in real time.
[0242] The chunk detection module detects the input code stream, and outputs 8-bit code stream each time.
[0243] The IDAT information analysis module analyzes the input code stream, and outputs the code word quantity information of the code table of the length of code word, the code table of litera / length, and the distance code table.
[0244] The processing module is input after the valid pixel value is obtained, and outputs image data.
[0245] In the embodiment of the application, the image decoding device separates the matching module and the code stream splitting module according to functions, and performs time multiplexing according to states, thereby reducing the consumption of hardware resources, and the internal module multiplexing rate is high, the storage multiplexing lookup table space is not more than 32 KB, the memory uses an external static random memory. The image decoding device is completely realized by a hardware circuit, input data is automatically judged in format, parameters such as resolution and compression mode are automatically read, and automatic matching decompression is realized without the need of configuring a register parameter. When the image decoding device is applied to the decoding of a boot logo image of a mobile device, the image decoding device works before other display modules, and therefore, the storage space of other modules of a chip can be shared, and no additional hardware resource is needed.
[0246] It should be noted that the image decoding device in the embodiment of the application can be built in a chip of a display device such as a television, and the boot logo display is realized by a complete hardware mode.
[0247] Based on the same inventive concept, the embodiment of the application further provides an image decoding device. As shown in FIG. 2, which is a structural schematic diagram of the image decoding device 2000, the image decoding device 2000 can include: Figure 20
[0248] The matching module 2001 is used for decoding the corresponding code table based on the code word quantity information of each code table to be decoded in a code table analysis state, and obtaining the decoded character length code table and distance code table.
[0249] In the data matching state, based on the decoded character length code table, the encoding data of each pixel in the to-be-decoded image is matched from the code stream of the to-be-decoded image to obtain a matching result; and based on the matching result and the decoded distance code table, the effective pixel value of each pixel is obtained.
[0250] The processing module 2002 is configured to obtain the to-be-decoded image after decoding based on the effective pixel values.
[0251] Optionally, each to-be-decoded code table further includes a code word length code table; and the matching module 2001 is specifically configured to:
[0252] based on the first code word quantity information of the to-be-decoded code word length code table, performing run-length code decoding on the code word length code table to obtain first code word length information of the code word length code table;
[0253] obtaining the decoded code word length code table through a code length decoding tree constructed based on the first code word length information;
[0254] based on the code word length code table, second code word quantity information of the character length code table, and third code word quantity information of the distance code table, decoding the corresponding code tables to obtain the decoded character length code table and the distance code table.
[0255] Optionally, the matching module 2001 is specifically configured to:
[0256] based on the code word length code table and the second code word quantity information, matching the code stream to obtain second code word length information of the character length code table, and obtaining the decoded character length code table through a character length decoding tree constructed based on the second code word length information;
[0257] based on the code word length code table and the third code word quantity information, matching the code stream to obtain third code word length information of the distance code table, and obtaining the decoded distance code table through a distance decoding tree constructed based on the third code word length information.
[0258] Optionally, the pixel includes a to-be-reconstructed pixel; and the matching module 2001 is specifically configured to:
[0259] based on the decoded character length code table, matching the encoding data corresponding to the to-be-reconstructed pixel from the code stream to obtain target length information of the to-be-reconstructed pixel;
[0260] based on the distance code table, matching the encoding data from the code stream to obtain target distance information of the to-be-reconstructed pixel;
[0261] based on the target length information and the target distance information, querying a lookup table to obtain corresponding pixel value information, and obtaining the effective pixel value of the to-be-reconstructed pixel based on the pixel value information; wherein the lookup table is dynamically updated based on the obtained effective pixel value.
[0262] Optionally, the target length information and the target distance information are obtained by the following way:
[0263] If the pixel includes the pixel to be reconstructed, the initial length information of the pixel to be reconstructed is obtained by matching the encoded data corresponding to the pixel to be reconstructed from the code stream based on the decoded character length code table;
[0264] The initial length information is parsed based on the length reference table to obtain the target length information;
[0265] The initial distance information of the pixel to be reconstructed is obtained by matching the encoded data from the code stream based on the distance code table;
[0266] The initial distance information is parsed based on the distance reference table to obtain the target distance information.
[0267] Optionally, the pixel further includes a target pixel; the matching module 2001 is further configured to:
[0268] The effective pixel value of the target pixel is obtained by matching the encoded data corresponding to the target pixel from the code stream based on the decoded character length code table.
[0269] Optionally, the apparatus further includes a data block detection module 2003 configured to:
[0270] Detect the data block type of the input code stream, and trigger the code table parsing state of the matching module when detecting the target type data block;
[0271] An information analysis module 2004 is configured to parse the input code stream to obtain the code word quantity information of each code table to be decoded;
[0272] A code stream splitting module 2005 is configured to split the input code stream according to the code stream size information to obtain the split code stream.
[0273] For the sake of brevity, the above various parts are divided into modules (or units) according to functions and are described respectively. Of course, in the implementation of the present application, the functions of the modules (or units) can be realized in the same or multiple software or hardware.
[0274] Those skilled in the art can understand that each aspect of the present application can be implemented as a system, a method or a program product. Therefore, each aspect of the present application can be specifically implemented as follows: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system".
[0275] In some possible implementation, each aspect of the image decoding method provided by the present application can also be implemented in the form of a program product, which includes a computer program for causing a display device to perform the steps of the image decoding method according to various exemplary embodiments of the present application described above in the specification when the program product is run on the display device, for example, the display device can perform the steps as shown in FIG. 13. Figure 4
[0276] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0277] The program product of the embodiments of the present application can adopt a portable compact disc read-only memory (CD-ROM) and include a computer program, and can be run on a display device. However, the program product of the present application is not limited thereto, and in this document, the readable storage medium can be any tangible medium containing or storing a program that can be used or combined with a command execution system, device or apparatus.
[0278] The readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, in which a readable computer program is carried. Such a propagated data signal can take on many forms, including but not limited to electro-magnetic signal, optical signal or any suitable combination thereof. The readable signal medium can also be any readable medium that is not a readable storage medium and that can transmit, propagate or transport a program for use by or in connection with a command execution system, device or apparatus.
[0279] The computer program contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0280] Computer programs for performing operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer programs can be executed entirely on a user display device, executed partly on a user device, executed as an independent software package, executed partly on a user display device and partly on a remote display device, or entirely on a remote display device or server. In situations in which remote display devices are employed, the remote display devices can be connected to the user display device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the remote display devices can be connected to the Internet or an external display device (e.g., using an Internet service provider to access the Internet).
[0281] It should be noted that while the above detailed description refers to several units or sub-units of the apparatus, such a division is merely exemplary and not mandatory. Indeed, according to embodiments of the present application, features and functionalities of two or more units described above can be embodied in one unit. Conversely, features and functionalities of one unit described above can be further divided into units embodied by several units.
[0282] Moreover, while operations of the methods of the present application are described in a particular order in the figures, this is not required or implied, nor is it required that all of the illustrated operations be performed to achieve a desired result. Additionally or alternatively, certain steps can be omitted, combined into a single step, and / or broken into multiple steps.
[0283] Those skilled in the art will appreciate that embodiments of the present application can be devised for use with three dimensional graphics, video, and the like, without departing from the scope of the present application. Thus, some embodiments of the present application can be embodied in a computer program product that includes a computer-usable storage medium having instructions stored therein which can be used to program a computer or other programmable device to implement the functions of the present application. The described embodiments are to be considered in a descriptive sense only and not for purposes of limitation. Therefore, the scope of the present application is indicated by the appended claims, rather than the foregoing description, and all changes that come within the meaning and range of equivalents are intended to be embraced therein.
[0284] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks and / or the block or blocks of the block diagrams.
[0285] These computer program instructions can also be loaded into computer or other programmable data processing devices to cause a series of operational steps to be performed on the computer or other programmable devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable devices provide steps for implementing the functions specified in the flowchart and / or block diagram block or blocks.
[0286] Although preferred embodiments of the application have been described herein, changes and modifications can be suggested to one skilled in the art, and it is intended that the application encompass such changes and modifications as fall within the scope of the appended claims.
[0287] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. An image decoding apparatus characterized by comprising: The device comprises: A matching module is configured to, in a code table parsing state, decode respective code tables based on code word quantity information of each code table to be decoded, to obtain a decoded character length code table and a distance code table; In a data matching state, based on the decoded character length code table, the matching module is configured to match, from a code stream of an image to be decoded, coding data corresponding to a pixel to be reconstructed included in each pixel, to obtain target length information of the pixel to be reconstructed; Based on the distance code table, the matching module is configured to match, from the code stream, coding data to obtain target distance information of the pixel to be reconstructed; Based on the target length information and the target distance information, the matching module is configured to query a current lookup table to obtain corresponding pixel value information, and based on the pixel value information, obtain an effective pixel value of the pixel to be reconstructed; wherein the lookup table is dynamically updated based on the obtained effective pixel value; and the target length information and the target distance information are obtained in the following manner: if the pixel includes the pixel to be reconstructed, based on the decoded character length code table, the matching module is configured to match, from the code stream, coding data corresponding to the pixel to be reconstructed, to obtain initial length information of the pixel to be reconstructed; based on a length reference table, the matching module is configured to parse the initial length information to obtain the target length information; based on the distance code table, the matching module is configured to match, from the code stream, coding data to obtain initial distance information of the pixel to be reconstructed; based on a distance reference table, the matching module is configured to parse the initial distance information to obtain the target distance information; A processing module is configured to obtain the decoded image to be decoded based on each effective pixel value.
2. The apparatus of claim 1, wherein, Each code table to be decoded further comprises a code word length code table; The matching module is specifically configured to: Based on first code word quantity information of the code word length code table to be decoded, the matching module is configured to perform run-length code decoding on the code word length code table to obtain first code word length information of the code word length code table; Based on a code length decoding tree constructed based on the first code word length information, the matching module is configured to obtain the decoded code word length code table; Based on second code word quantity information of the code word length code table, the character length code table, and third code word quantity information of the distance code table, the matching module is configured to decode respective code tables to obtain the decoded character length code table and the distance code table.
3. The apparatus of claim 2, wherein, The matching module is specifically configured to: Based on the code word length code table and the second code word quantity information, the matching module is configured to match the code stream to obtain second code word length information of the character length code table, and based on a character length decoding tree constructed based on the second code word length information, the matching module is configured to obtain the decoded character length code table; Based on the code word length code table and the third code word quantity information, the matching module is configured to match the code stream to obtain third code word length information of the distance code table, and based on a distance decoding tree constructed based on the third code word length information, the matching module is configured to obtain the decoded distance code table.
4. The apparatus of claim 1, wherein, The pixel further comprises a target pixel; and the matching module is further configured to: Based on the decoded character length code table, the matching module is configured to match, from the code stream, coding data corresponding to the target pixel to obtain an effective pixel value of the target pixel.
5. The apparatus of claim 1, wherein, The device further comprises: a data block detection module, configured to detect a data block type of an input bitstream, and trigger a code table analysis state of the matching module when a target type data block is detected; an information analysis module, configured to analyze the input bitstream to obtain code word quantity information of each code table to be decoded; a bitstream splitting module, configured to split the input bitstream according to bitstream size information, to obtain a split bitstream, and input the split bitstream into the matching module, the data block detection module and the information analysis module.
6. An image decoding method characterized by, comprising: in the code table analysis state, decoding a corresponding code table based on the code word quantity information of each code table to be decoded, to obtain a decoded character length code table and a distance code table; in the data matching state, matching, based on the decoded character length code table, encoding data corresponding to a pixel to be reconstructed included in each pixel from a bitstream of an image to be decoded, to obtain target length information of the pixel to be reconstructed; matching, based on the distance code table, encoding data from the bitstream, to obtain target distance information of the pixel to be reconstructed; querying a current lookup table based on the target length information and the target distance information, to obtain corresponding pixel value information, and obtaining an effective pixel value of the pixel to be reconstructed based on the pixel value information; wherein the lookup table is dynamically updated based on the obtained effective pixel value; and the target length information and the target distance information are obtained in the following manner: if the pixel includes the pixel to be reconstructed, matching, based on the decoded character length code table, encoding data corresponding to the pixel to be reconstructed from the bitstream, to obtain initial length information of the pixel to be reconstructed; analyzing the initial length information based on a length reference table, to obtain the target length information; matching, based on the distance code table, encoding data from the bitstream, to obtain initial distance information of the pixel to be reconstructed; and analyzing the initial distance information based on a distance reference table, to obtain the target distance information; obtaining the image to be decoded after decoding based on each effective pixel value.
7. A display device, characterized by comprising a display and an image decoding device; the image decoding device is configured to, in the code table analysis state, decode a corresponding code table based on the code word quantity information of each code table to be decoded, to obtain a decoded character length code table and a distance code table; in the data matching state, matching, based on the decoded character length code table, encoding data corresponding to a pixel to be reconstructed included in each pixel from a bitstream of an image to be decoded, to obtain target length information of the pixel to be reconstructed; matching, based on the distance code table, encoding data from the bitstream, to obtain target distance information of the pixel to be reconstructed; query a current lookup table based on the target length information and the target distance information, obtain corresponding pixel value information, and obtain an effective pixel value of the pixel to be reconstructed based on the pixel value information; the lookup table is dynamically updated based on the obtained effective pixel value; and the target length information and the target distance information are obtained in the following manner: if the pixel includes the pixel to be reconstructed, based on the decoded character length code table, matching coding data corresponding to the pixel to be reconstructed from the code stream, obtaining initial length information of the pixel to be reconstructed; based on a length reference table, the initial length information is parsed to obtain the target length information; based on the distance code table, matching coding data from the code stream to obtain initial distance information of the pixel to be reconstructed; based on a distance reference table, the initial distance information is parsed to obtain the target distance information; based on each effective pixel value, obtaining a decoded image to be decoded; the display is used to display the decoded image to be decoded.
8. A computer-readable storage medium, characterized in that, The computer program includes a computer program, when the computer program runs on a display device, the computer program is used to make the display device execute the steps of the image decoding method of claim 6.
Citation Information
Patent Citations
Gzip decompression method, device and system based on FPGA
CN110334066A
PNG image decompression logic circuit and device
CN113891088A