WO2018006833A1 - 可变长编码文件的解码方法以及装置 - Google Patents
可变长编码文件的解码方法以及装置 Download PDFInfo
- Publication number
- WO2018006833A1 WO2018006833A1 PCT/CN2017/091866 CN2017091866W WO2018006833A1 WO 2018006833 A1 WO2018006833 A1 WO 2018006833A1 CN 2017091866 W CN2017091866 W CN 2017091866W WO 2018006833 A1 WO2018006833 A1 WO 2018006833A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- file
- decoded
- decoding
- index information
- threshold
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
- H04N19/436—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
- H03M7/42—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code using table look-up for the coding or decoding process, e.g. using read-only memory
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/60—General implementation details not specific to a particular type of compression
- H03M7/6017—Methods or arrangements to increase the throughput
- H03M7/6023—Parallelization
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/44—Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
- H04N19/45—Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder performing compensation of the inverse transform mismatch, e.g. Inverse Discrete Cosine Transform [IDCT] mismatch
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
Definitions
- Embodiments of the present invention relate to a computer decoding method, and in particular, to a decoding method and apparatus for a variable length encoded file.
- JPEG Joint Photographic Experts Group
- the JPEG-based image uses variable-length Huffman entropy encoding, so you can get better images with less disk space. quality.
- the pictures generated by taking pictures of mobile phones, cameras, etc. are all in JPEG format by default.
- the images saved by most of the retouching software are also JPEG format by default.
- Increasing the decoding speed of JPEG images can significantly improve the user's picture browsing experience.
- mobile terminals mainly use two methods to complete the decoding of JPEG pictures: the first one is hardware decoding, that is, a special hardware chip is set in the mobile terminal to complete decoding of JPEG pictures, such as Apple iOS device; the second is software decoding.
- Hardware decoding has the advantage of fast decoding speed, but it needs to add additional chips for decoding in the device, which will increase the cost of the device. Therefore, there is an urgent need for a technology that can speed up the decoding of software in order to enhance the user's picture browsing experience without increasing the production cost of the device.
- the software decoding process of JPEG pictures mainly includes three processes: Huffman entropy decoding, inverse discrete cosine transform and color conversion. Among them, the two processes of inverse discrete cosine transform and color conversion can well support parallelization and multi-thread processing.
- Huffman entropy coding is a kind of Variable-Length Coding (VLC). When decoding, it is impossible to find the decoding boundary and multi-thread parallel processing. Therefore, only single-thread serial decoding can usually be used.
- the embodiment of the invention provides a decoding method and device for a variable length coded file, which is used to improve the speed of file decoding, and at the same time avoid the system jamming phenomenon which may be caused when the file is decoded.
- Metadata Generalized metadata refers to data that describes data.
- the metadata of a file can be stored independently of the file, or it can be stored inside the file, such as the file header or the end of the file.
- Metadata file A file that stores metadata.
- the metadata file corresponding to a file refers to storing the file.
- the metadata file, the file and the metadata file for the file are two different files.
- Database file A file that holds database data.
- a SQL Server database provides a file with a .mdf suffix.
- System file A file that stores the main data of the operating system. Users cannot directly modify it.
- a metadata file for a Linux system For example, a metadata file for a Linux system.
- the metadata file of the Linux system includes some metadata files for describing the characteristics of the user file, and the metadata file has an association relationship with the user file described by the metadata file.
- User file A file created directly by the user or application and can be modified directly by the user.
- the file to be decoded mentioned in the embodiment of the present invention is usually a user file, for example, a picture file obtained after the user takes a picture with the terminal device.
- File stream A form of storage of image files or other types of files in computer memory. Data addition, data deletion, data modification, encoding, and/or decoding of the file are performed by operations on the file stream. Before a file is decoded, the file is first loaded into the computer's memory. Therefore, decoding a file may also be referred to as decoding the file stream corresponding to the file.
- Parallel decoding Multiple (at least two) threads simultaneously perform decoding operations on data in the above file stream.
- MCU Minimum Coded Unit
- the smallest processing unit is an MCU, usually a 16*16 pixel matrix, but some image formats (such as grayscale) may also be 8*8 pixel point matrix.
- a normal-sized JPEG image usually contains thousands of MCUs, that is, the file stream to be decoded corresponding to this picture contains information of thousands of encoded MCUs. Since JPEG uses variable-length Huffman coding, the length of the same-sized MCU after encoding is unknown, and may be the same or different.
- the data in the above file stream contains a plurality of (at least two) data segments, and in the parallel decoding process, the plurality of data segments are respectively subjected to decoding operations by a plurality of threads. If parallel decoding is performed in units of MCUs, there are too many threads to be started at the same time. Therefore, in general, one of the above data segments includes multiple MCUs, so that the number of threads that need to be simultaneously started can be reduced.
- Decoding boundary The boundary between the above data segments is the decoding boundary. Specifically, the decoding boundary may be the starting position of each data segment. More specifically, in some embodiments, the decoding boundary is the first MCU included in each data segment. It should be noted that the first MCU of the entire file stream, that is, the first position of the file, although not the boundary between the two data segments, is also a decoding boundary in some embodiments of the present invention.
- the pre-index information includes information indicating one or more decoding boundaries, and may also include some other information according to the actual needs of the decoding.
- the information of the decoding boundary is the offset location information of the decoding boundary in the file stream. More specifically, in a file stream to be decoded, the information of the decoding boundary may be the offset position information of the first MCU included in each data segment in the file stream.
- the data segments decoded in parallel are usually obtained according to the decoding boundary after the decoding boundary is determined, but the number of data segments to be divided (and the number of decoding boundaries related to the number), that is, decoding is performed in parallel. The number of threads can be determined based on information such as the current processing power of the processing resource before the data segment is obtained.
- Persistent storage Information stored after a computer is powered off or restarted is not lost.
- Typical persistent storage includes file storage and database storage.
- an embodiment of the present invention provides a decoding method, which is applicable to decoding a file obtained by variable length coding, such as a JPEG picture.
- the decoding method includes: reading pre-index information corresponding to the file to be decoded; and performing parallel decoding on the plurality of data segments in the file to be decoded according to the pre-index information.
- the pre-index information includes information for indicating one or more decoding boundaries, where the plurality of data segments are based on the one or more decoding boundaries. One or more divisions.
- the pre-index information is stored in other files associated with the file to be decoded, in other words, the pre-index information is stored independently of the file to be decoded.
- the pre-index information may be stored in a metadata file corresponding to the file to be decoded, where the metadata refers to system data corresponding to the file to be decoded, where the metadata file belongs to a system file, and the like.
- the storage method since it does not involve the operation of copying the entire file, does not need to read and write the hard disk (or other external memory) for the entire file, and only needs to write the pre-index information which is much less than the data amount of the file to the hard disk. Therefore, the I/O operation is effectively reduced, and the system jamming phenomenon which may be caused by decoding is avoided to some extent, especially when the file is large or the file is large, the effect is more remarkable.
- the other file may also be a database file, where the database may be a local database or a remote database; in other implementations, the other The file may also be a file with the same file name but different suffix name in the same directory as the file to be decoded, and the suffix name of the other file cannot conflict with the existing suffix name.
- the pre-index information may also be stored at the end of the file to be decoded. Since the file system supports the operation of appending data to the tail, the storage method stored at the end of the file can avoid the copying operation of the file stream corresponding to the entire file, thereby effectively reducing the I/O operation, thereby avoiding decoding to some extent. Possible system stalls.
- the pre-index information is obtained and stored in the following manner: when the file to be decoded is detected to be opened for the first time, the pre-index information is extracted. And storing the extracted pre-index information.
- the storage includes persistent storage, and the specific storage location may refer to the storage location of the pre-index information introduced in the foregoing implementation manner.
- the process of extracting pre-index information includes performing decoding for variable length coding on the file to be decoded.
- extracting the pre-index information when it is monitored that the file to be decoded is first opened means that the decoding performed when the file is first opened (other decoding methods such as serial decoding or region decoding) is used. ) Extract pre-index information. Since the decoding for the variable length coding is performed when the file is first opened, for the file using the variable length coding, the decoding can be performed to obtain the information of the coding unit, and then the information of the obtained coding unit is obtained. The information of the partial coding unit is selected as the pre-index information.
- the pre-index information is extracted when the file is first opened, so that there is no additional power consumption and overhead for the system, and the file can be decoded in parallel according to the pre-index information when the file is opened later, and the file is opened later.
- the decoding speed at the time is the same.
- the extraction of the pre-index information may also be performed when it is detected that the file to be decoded is added or the file to be decoded is modified.
- the process of extracting the pre-index information may only perform decoding for variable length encoding without performing all processing of opening a file, such as during JPEG image opening. Inverse discrete cosine transform and color conversion process.
- the system may be set at the same time, for example, setting the step of extracting the pre-index information when any of the three conditions is satisfied, unless it is known that the file already has pre-index information; or the system may Only one or two of them are set.
- the system setting performs the step of extracting the pre-index information for the file when it is detected that the file is first opened, and also performs the extraction of the file when the detected file is modified.
- the step of pre-indexing information, this setting can improve the parallel decoding efficiency of the original file, and can modify the pre-index information in time after the initial file is modified, thereby ensuring the accuracy of the pre-index information, thereby ensuring that the modified file is still Can achieve better parallel decoding efficiency.
- the computer system may also initiate the extraction operation of the pre-index information by itself.
- the system may perform pre-index information extraction every fixed time by default, or perform pre-preparation for the x files every time x files are added.
- x is an integer greater than 2.
- the number of decoding boundaries that need to be stored is determined based on the processing capabilities of the processing resources prior to pre-indexing information extraction.
- the processing resources herein include local processing resources of the computer system in which the file to be decoded is located and/or non-local processing resources that the computer system can invoke.
- the number of threads that can be executed in parallel is determined according to the processing capability of the processing resource; the extracted pre-index information includes information of a decoding boundary equal to the number of the threads. Assuming that the current CPU of the system has 4 cores, the number of threads that can be executed in parallel is 4, then the information of 4 decoding boundaries including the information of the head position of the file or 3 of the header position information of the file can be extracted and stored.
- the file first position information is the offset position information of the first MCU block in the file.
- the number of pre-indexed information extracted and stored and the number of threads that can be executed in parallel may be inaccurately equal, only in a similar number. In this way, it is possible to avoid storing information of an excessive number of decoding boundaries, thereby effectively saving storage space.
- the pre-indexing information corresponding to the file to be decoded is read, when the size of the file to be decoded is greater than a preset first threshold, in some implementations. And performing parallel decoding based on the pre-index information. Specifically, in an implementation manner, first determine whether the size of the file to be decoded is greater than a preset first threshold; and when the size of the file to be decoded is greater than (or greater than or equal to) the preset first At the threshold, the pre-index information corresponding to the file to be decoded is read, and parallel decoding is performed according to the pre-index information; when the size of the file to be decoded is less than or equal to (or less than) the preset first At the threshold, parallel decoding is not performed, but serial decoding is performed.
- the solution provided by the embodiment of the present invention can first determine the file size, and perform parallel decoding only on the larger file, thereby improving the decoding efficiency of the larger file. At the same time, it also improves the overall resource utilization of the system.
- the file to be decoded is modified, or the file to be decoded is first time
- the pre-index information is extracted according to the determination result. Specifically, in an implementation manner, it is determined whether the size of the file to be decoded is greater than a preset first threshold, and only when the size of the file to be decoded is greater than the preset first threshold. Pre-index information.
- the size of the file to be decoded is less than or equal to the preset first threshold, it is required to perform an operation according to actual requirements of the file: if the file actually needs to be decoded, for example, when the file is first opened, the file is anyway Need to decode, at this time, although the pre-index information is not obtained, but a series of operations such as serial decoding or region decoding are performed on the file to open the file; if the file does not actually need to be decoded, for example, the file is added or modified, then No decoding-related operations can be performed on the file.
- the step of determining the file size may be performed before the step of extracting the pre-index information and before reading the pre-index information of the file to be decoded.
- the preset first threshold may be determined according to experience, or may be for a large number of each After the file of the size is decoded, it is determined according to the effect of the decoding, and the threshold does not generally change once it is determined.
- the preset first threshold may also be corrected according to actual conditions. Specifically, the preset first threshold may be modified by: after each file to be decoded is decoded, recording related information of the file to be decoded, including file size, decoding time, and whether to perform parallel decoding. If the file to be decoded uses parallel decoding, the decoding time is less than a preset second threshold (for example, 1 ms), and the size of the file to be decoded is greater than the preset first threshold, the pre-modification is modified. The first threshold is set to the size of the file to be decoded.
- a preset second threshold for example, 1 ms
- the file to be decoded is found to use parallel decoding and the decoding time is too small, it proves that the file using this size has little effect on parallel decoding.
- the file smaller than this file uses the parallel decoding band. The effect may be smaller. If the size of the file is larger than the first threshold, the first threshold should be set to the size of the file, so that the first threshold can be corrected in time according to the actual situation, thereby further ensuring the system. The overall utilization of resources.
- some data preparation is required prior to performing parallel decoding on the file to be decoded. Specifically, assuming that the current system can start R threads in parallel, the file stream of the file to be decoded is subjected to a copy operation (only the file stream pointer needs to be copied) to obtain R file streams, so that each thread can see for itself. The data segments in the file stream perform parallel decoding, and finally the execution results of the R threads are synchronized to obtain the final decoding result. This avoids the problem of mutual interference between threads, thus ensuring the correctness of parallel decoding results. Further, the data preparation also includes other data required to prepare the parallel decoding process, such as creating one or more decoding structures.
- the pre-index information after the pre-index information is acquired, the pre-index information needs to be integrity-verified, and if the verification is passed, the pre-index information is used according to the pre-index information.
- the decoded file performs the parallel decoding. If the verification fails, the pre-index information may be lost or modified, in which case the decoded file is subjected to serial decoding. This can avoid parallel decoding failure caused by the loss or modification of the pre-index information of the file.
- the process of parallel decoding at this time includes: determining, according to information of a plurality of decoding boundaries in the pre-index information, a position of each decoding boundary in the file to be decoded; each of the plurality of threads determining a decoding a boundary, and performing decoding from a position of the decoding boundary in the file to be decoded, wherein each thread executes to the next except for the thread in which the last data segment performs decoding (referred to as the last thread) Stops before a decoding boundary, and the last thread executes to the end of the file (or file stream).
- each thread except the last thread processes P/M (integer) data segments, The last thread processes the remaining portion, where M is the number of threads and P is the number of data segments that can be partitioned according to the decoding boundary, which in some implementations is the number of decoding boundaries.
- the number of threads performing parallel decoding may be dynamically changed in the course of parallel decoding according to the actual situation of the processing resources. Specifically, dynamically monitor the currently available processors (such as idle cores), and then adjust (eg, increase) the number of threads to further improve decoding efficiency. rate.
- the embodiment of the present invention further provides a decoding apparatus, including one or more modules that can implement the first aspect or any one of the foregoing first aspects, and each module can perform one or more steps.
- an embodiment of the present invention further provides a terminal device, where the terminal device includes a processor and a memory, where the memory is used to store a software program, and the processor is configured to read a software program stored in the memory and implement The method provided by the first aspect or any one of the foregoing first aspects.
- the embodiment of the present invention further provides a computer storage medium, which may be non-volatile, that is, the content is not lost after power off.
- the storage medium stores a software program that, when read and executed by one or more processors, implements the method provided by the first aspect or any one of the foregoing first aspects.
- the method and apparatus provided by the embodiments of the present invention are applicable to all picture formats that apply variable length coding (Huffman), and the JPEG picture is a picture format currently applying variable length coding, and other applications may be variable length.
- the decoding of the coded picture or the decoding of the picture of the variable length code that may occur in the future may be applied to the method provided by the embodiment of the present invention.
- Other types of files, such as text, audio, video, etc., may be decoded in the same or similar manner as the methods provided by the embodiments of the present invention.
- FIG. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
- FIG. 2 is a diagram showing an example of a decoding method according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of a process of acquiring pre-index information in a decoding method according to an embodiment of the present disclosure
- FIG. 4 is a schematic flowchart of a parallel decoding method according to an embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of a computer system according to an embodiment of the present invention.
- FIG. 5b is a schematic structural diagram of a 2D engine in the computer system provided in FIG. 5a;
- 6a-6b are operational timing diagrams of a parallel decoding method according to an embodiment of the present invention.
- FIGS. 7a-7c are schematic structural diagrams of a decoding apparatus according to an embodiment of the present invention.
- the decoding method provided by the embodiment of the present invention is mainly applied to a terminal device, which may also be referred to as a user equipment (User Equipment, referred to as "UE"), a mobile station (Mobile Station, referred to as "MS”), and a mobile terminal.
- UE User Equipment
- MS Mobile Station
- RAN radio access network
- the terminal can be equipped with a radio access network (Radio Access) Network, RAN)
- Radio Access Radio Access
- the terminal can be a mobile phone (or "cellular" phone), or a computer with mobile nature, for example, the terminal can also be portable, pocket Mobile, handheld, computer built-in or in-vehicle mobile devices.
- the decoding method provided by the embodiment of the present invention can be applied to other types of computer systems in addition to the terminal device.
- the decoding method provided by the embodiment of the present invention utilizes parallel computing capability on a computer
- the embodiment of the invention realizes the parallel decoding of the variable length coded file at the software level by using the parallel computing capability on the computer, thereby improving the decoding speed of the file.
- the following embodiment specifically describes the parallel decoding capability of the file provided in the operating system layer of the computer.
- the operating system layer can provide the parallel decoding capability to the application layer, thereby improving the file decoding speed of the application layer application (for example, a library). To improve the user experience of the app.
- FIG. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
- the terminal device 100 includes a memory 180, a processor 150, and a display device 140.
- the memory 180 stores a computer program including an operating system program 182, an application 181, and the like.
- the processor 150 is configured to read a computer program in the memory 180 and then execute a computer program defined method, for example, the processor 150 reads the operating system program 182 to run an operating system on the terminal device 100 and implement various functions of the operating system. Or reading one or more applications 181 to run the application on the terminal device.
- Processor 150 may include one or more processors.
- processor 150 may include one or more central processors or include a central processing unit and a graphics processor.
- the processor 150 includes a plurality of processors, the plurality of processors may be integrated on the same chip, or may each be a separate chip.
- a processor may include one or more processing cores. The following embodiments are all described by taking multiple cores as an example.
- the parallel decoding method provided by the embodiments of the present invention may also be applied to a single core processor, and the time sharing of the single core processor is utilized. The working principle performs parallel decoding, and the number of threads performing parallel decoding can be determined according to the current load of the single core processor.
- the memory 180 also stores other data 183 in addition to the computer program.
- the other data 183 may include data generated by the operating system 182 or the application 181 after being run, the data including system data (such as operating system configuration parameters) and User data, such as a photo taken by a user, is typical user data, and is also a decoding object of the method provided by the embodiment of the present invention.
- Memory 180 generally includes memory and external memory.
- the memory can be random access memory (RAM), read only memory (ROM), and cache (CACHE).
- the external storage can be a hard disk, a CD, a USB disk, a floppy disk, or a tape drive.
- Computer programs are typically stored on external storage, and the processor loads the computer program from external memory into memory before processing.
- the file to be decoded in the embodiment of the present invention is usually stored in the external memory, and the processor loads the file from the external memory into the memory before performing decoding on the processor.
- the operating system program 182 includes a computer program that can implement the parallel decoding method provided by the embodiment of the present invention, so that after the processor 150 reads the operating system program 182 and runs the operating system, the operating system can be implemented with the present invention.
- the parallel decoding function provided by the example. Further, the operating system can open the calling interface of the parallel decoding function to the upper layer application, and the processor 150 can read the application 181 from the memory 180 and run the application, for example, a gallery application, and the application can pass the call.
- the interface calls the parallel decoding function provided in the operating system to achieve parallel decoding of the file.
- the terminal device 100 may further include an input device 130 for receiving input digital information, character information or contact touch operation/contactless gesture, and generating user settings and function control with the terminal device 100. Off signal input, etc.
- the input device 130 may include a touch panel 131.
- the touch panel 131 also referred to as a touch screen, can collect touch operations on or near the user (such as the user's operation on the touch panel 131 or on the touch panel 131 using any suitable object or accessory such as a finger, a stylus, or the like. ), and drive the corresponding connection device according to a preset program.
- the touch panel 131 may include two parts: a touch detection device and a touch controller.
- the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
- the processor 150 is provided and can receive commands from the processor 150 and execute them. For example, the user clicks a picture with a finger on the touch panel 131, the touch detection device detects the signal brought by the click, and then transmits the signal to the touch controller, and the touch controller converts the signal.
- the coordinates are sent to the processor 150, and the processor 150 performs operations such as decoding the picture according to the coordinates and the type of the signal (click or double click), and finally displays the picture on the display panel 141, thereby implementing "opening". image.
- the touch panel 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
- the input device 130 may further include other input devices 132.
- the other input devices 132 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like. One or more of them.
- the terminal device 100 may further include a display device 140 including a display panel 141 for displaying information input by the user or information provided to the user, various menu interfaces of the terminal device 100, and the like, in the embodiment of the present invention. Mainly used to display decoded pictures or other types of files.
- the display device 140 may include a display panel 141.
- the display panel 141 may be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
- the touch panel 131 can cover the display panel 141 to form a touch display screen.
- the terminal device 100 may further include a power source 190 for supplying power to other modules and a camera 160 for taking a photo or video.
- the terminal device 100 may also include one or more sensors 120, such as acceleration sensors, light sensors, and the like.
- the terminal device 100 may further include a radio frequency (RF) circuit 110 for performing network communication with the wireless network device, and may further include a WiFi module 170 for performing WiFi communication with other devices.
- RF radio frequency
- the following embodiment will describe the decoding method provided by the embodiment of the present invention by taking the decoding of the JPEG picture as an example.
- the decoding method provided by the embodiment of the present invention can be implemented in the operating system program 182 shown in FIG. 1. It should be understood that the method provided by the embodiments of the present invention is not limited to decoding of JPEG pictures.
- FIG. 2 is an exemplary diagram of a decoding method according to an embodiment of the present invention.
- Huffman entropy decoding accounts for more than half of the total time. Because of variable length entropy coding, the starting position of each MCU (Minimum Coded Unit) cannot be perceived before decoding, and parallel decoding cannot be realized. Assuming that there are 100 MCUs (numbered 1-100) in the picture to be decoded, the original Huffman entropy decoding process uses a single-thread serial decoding of the 100 MCUs before using the parallel decoding scheme provided by the embodiment of the present invention.
- the main idea of the JPEG parallel decoding scheme is to divide the picture to be decoded into multiple data segments, and save the starting point information of each data segment by recording the pre-index information.
- the solution provided by the embodiment of the present invention performs Huffman serial decoding in advance on the picture to be decoded, and extracts and records the pre-index information obtained by serial decoding.
- the pre-index information is the number of 4 in the example of Figure 2.
- the four data segments are MCU sets numbered 1-25, 26-50, 51-75, 76-100, and the starting position information of the four data segments is numbered 1, respectively.
- 26, 51 and 76 MCU location information in general, the MCU location information is represented by the MCU offset location information in the file stream corresponding to the picture, the offset location information may be the MCU relative file
- the offset of the first byte can also be the offset of the MCU relative to the first MCU of the file.
- the threads 1 - 4 can start decoding from the positions of the 4 MCUs in parallel, and perform decoding on the four data segments in parallel, thereby improving the speed of picture decoding.
- the decoding method provided by the embodiment of the present invention is introduced by a more detailed method.
- FIG. 3 is a schematic diagram of a process of acquiring pre-index information in a decoding method according to an embodiment of the present invention.
- Step 201 When it is detected that a picture is first opened, for example, when it is detected that the user clicks on the picture, pre-processing of the picture is started.
- the "preprocessing” mentioned in the embodiment of the present invention refers to the extraction process of pre-index information.
- the startup timing of the pre-processing stage may also be when the picture is added or the picture is modified.
- the operating system monitors the addition or modification of the image, for example, the media provider mechanism of the Android system provides the monitoring function.
- the new situation of the picture includes taking a picture with a local camera, downloading pictures from the network to the local, copying pictures from other terminal devices to the local, or editing the local pictures and saving them as a new picture; The situation includes the case where the picture content is modified and not saved as another picture.
- the preprocessing in these two cases may only include serial Huffman entropy decoding.
- the pre-processing may also be initiated by the operating system.
- the operating system may perform serial Huffman entropy decoding on the newly added 10 pictures each time the new picture is full. Extract pre-index information.
- Step 202 Determine whether the picture has pre-index information.
- the pre-index information is stored in an extended attribute of a file system corresponding to the picture, and the extended attribute of the file system includes a metadata file corresponding to the picture.
- the pre-index information may also be stored in other types of files or stored at the end of the picture.
- step 203 If the pre-index information can be read from the metadata file corresponding to the picture, step 203 is performed, where step 203 means that the pre-processing ends and enters the parallel decoding stage; if the pre-index cannot be obtained from the metadata corresponding to the picture If the information or the obtained pre-index information is empty, step 204 is performed.
- the determining step of step 202 may not be performed, that is, all the pictures are not pre-indexed when the first time is opened.
- Step 204 Start the original decoding process of the picture.
- the current picture to be decoded has no pre-index information, and the original decoding process of the picture serial decoding, inverse discrete cosine transform and color conversion will be normally started and executed.
- Step 205 Determine whether the size of the picture is smaller than a preset threshold. If the size of the picture is smaller than a preset threshold, the preprocessing is ended, that is, the pre-index information is no longer obtained, but the original decoding process of the picture continues. This is done because the picture is also opened and displayed on the display under the user's open command; if the size of the picture is greater than or equal to the preset threshold, then step 206 is continued.
- Step 205 mainly considers that the small image adopts parallel decoding, and the gain is not large, and it is not necessary to obtain pre-index information, which can effectively save storage space.
- the step of determining the size of the picture and the original decoding process of initiating the picture may be performed in an exchange order.
- Step 206 Extract pre-index information.
- the Huffman serial decoding of the picture is performed after the step 204, and the Huffman serial decoding process generates the offset position information of all the MCU blocks, and the method provided by the embodiment of the present invention
- the pre-index information used in the example includes offset location information of one or more of the MCU blocks.
- the pre-index information also needs to include the DC (Direct Current) variable value of the previous MCU block corresponding to the one or more MCU blocks, respectively. Correction of the Huffman decoding result.
- the decoding boundary includes the first MCU block of the picture. In other embodiments, the decoding boundary may also not include the first MCU block of the picture.
- the offset position information of the N MCU blocks is obtained by using 1/N of the picture height as an interval, which is assumed to be equivalent to the data amount of each MCU block;
- the offset position information of the N MCU blocks is obtained by using 1/N of the picture length (the overall offset of the file stream corresponding to the picture) as an interval, and the sum of the offsets of the N MCUs acquired in this manner is obtained. Is the offset of the entire picture.
- Step 207 Store the extracted pre-index information.
- the storage may be performed after the extraction of the offset position information of the plurality of MCUs is completed, or the offset position information of one MCU may be extracted, that is, the storage is performed once.
- the pre-index information can be stored in the metadata file of the picture.
- the pre-index information can also be inserted into the tail of the picture, the database file associated with the picture, or The image is in the same directory, with the same file name but different suffixes.
- a field for integrity verification may also be added to the pre-index information before storage.
- the foregoing storage methods are all persistent storage.
- the storage is stored in a file on the external storage (such as a hard disk), so that the pre-index information is not lost, but in other embodiments, If the pre-indexed information can be lost, there is no need to force persistent storage to be performed on it.
- the above storage method avoids the process of copying the entire picture when the pre-index information is inserted into the picture header, thereby effectively reducing the I/O operation, especially when more pictures or single pictures stored in the system are larger.
- the method of the embodiment of the invention reduces the number of I/O operations, thereby avoiding the phenomenon of stagnation or suspended animation of the system to some extent.
- the pre-index information is extracted along with the original decoding process of the picture and stored for the next use, so as to avoid adding too much extra power consumption due to the extraction of the pre-index information.
- steps 206 and 207 may be performed after the original decoding process is completed, or may be performed along with the original decoding process of the picture 204. Specifically, in the process of performing Huffman serial decoding, as the number of decoded MCU blocks increases, the offset position information of the MCU block is extracted according to a preset interval and stored.
- the foregoing embodiment generally introduces the extraction process of the pre-index.
- the following takes the difference encoding and Huffman coding as an example to introduce the composition and specific extraction method of the pre-index information.
- the picture employs differential encoding
- at least the offset position information of the MCU block and the DC variable value of the last MCU block of the MCU block need to be included in the pre-index information.
- some other information that needs to be saved may be included, which is not relevant to the embodiment of the present invention and will not be described in detail.
- the JPEG decoding library (libjpeg) in the Linux system has provided the capability of serial decoding and region decoder, and the index information of all MCU blocks in the picture can be extracted by serial decoding or region decoding.
- the index information includes the pre-index information required by the embodiment of the present invention. Therefore, the data structure Huffman_offset_data defined by the index information can be used as the data structure used by the pre-indexing scheme.
- the parameters and meanings of the Huffman_offset_data structure are as shown in Table 1, in which the "data block" refers to the MCU block in the embodiment of the present invention.
- the index information of all MCU blocks is obtained by the capability provided by the JPEG decoding library, and the index information of each MCU block is stored in the form of the above data structure, and the parameters included in the data structure can be determined according to actual needs.
- All index information may exist in the form of a two-dimensional array [X, Y], where X represents the line number of the MCU block in the picture, and Y represents the first few of the MCU block in a certain line.
- the index information of the appropriate number of MCU blocks is selected from the two-dimensional array as needed to compose the pre-index information required for parallel decoding, and the pre-index information is persistently stored.
- N pieces of pre-index information are selected and stored in an interval of 1/N of the total number of rows of the array.
- FIG. 4 is a schematic flowchart diagram of a parallel decoding method according to an embodiment of the present invention. After the pre-indexing information of the picture is extracted and stored by the above method, the parallel decoding method provided by the embodiment of the present invention may be used when the picture needs to be decoded again (the user opens the picture again).
- Step 301 Determine whether the picture to be decoded has pre-index information. If the picture to be decoded has no pre-index information, perform the original decoding process 302. In the embodiment of the present invention, the original decoding process is a serial decoding process. If the picture to be decoded has pre-index information, step 303 is performed.
- Step 303 Read pre-index information.
- the information of the decoding boundary included in the read pre-index information is N.
- the information of the N decoding boundaries corresponds to N data segments that can be processed in parallel in the picture to be decoded.
- the offset position information of the first MCU block of the picture to be decoded may not be recorded, that is, only N- is recorded.
- the information of one decoding boundary can obtain N data segments in parallel processing.
- the manner of reading the pre-indexed information is related to the storage location of the pre-indexed information.
- the storage location is described in the foregoing embodiment.
- the corresponding reading mode is the prior art, and is not described in detail in the embodiment of the present invention.
- step 301 and step 303 can also be combined into a step of determining whether the picture to be decoded has pre-index information by reading the pre-index information, and if the pre-index information can be read, step 304 is directly performed; If the pre-index information is not read or the read result is empty, step 302 is performed.
- the step of determining the size of the picture to be decoded may be further included before the pre-index information is read. If the size of the picture to be decoded is smaller than a preset threshold, the original decoding process is performed; otherwise, Then, the parallel decoding process is executed after the pre-index information is read, and if the pre-index information is not read, the original decoding process is executed.
- the size information of the picture to be decoded is stored in the picture header, and the size information of the picture can be obtained by parsing the picture header, specifically the SOF (Start of Frame) tag.
- Step 304 Verify the integrity of the read pre-index information.
- a Secure Hash Algorithm SHA is used to verify the integrity of the pre-index information. If the verification fails, the pre-index information is lost or modified.
- the original decoding process of step 305 is performed; if the verification is successful, step 306 is performed.
- the fifth version of the message digest algorithm may be used to perform integrity check of pre-index information, or other types of integrity check algorithms may be used.
- the step 304 may not be performed, that is, the default pre-index information is complete, or the pre-index information may be protected from being tampered by using encryption or the like before storing the pre-index information, and only needs to be used before being used. Decrypt the pre-index information. It should be noted that, if the integrity verification is performed, an additional verification field is added to the pre-index information after the pre-index information is extracted and is stored. This is an existing integrity verification technology, and the embodiment of the present invention does not. Let me repeat.
- Step 307 decoding data preparation.
- the file stream corresponding to the decoded picture is copied.
- the copy file stream here is only a copy file stream pointer, not a copy of the entire file stream.
- the decoding structure is a structure designed by the JPEG decoding library for the decoding operation. It includes pre-declared variables such as quantization tables and color channels. In this way, it is ensured that variables are not shared between the decoding structures corresponding to each thread, so that the same variable is not modified by each other in the multi-threading process.
- each thread can be guaranteed to have its own file stream pointer and decoding structure. This avoids the mutual interference problem caused by the thread modifying the data in the file stream or the decoding structure during the decoding process.
- the creation of the decoding structure is that memory operations do not affect I/O, while file stream replication simply copies a file stream pointer and does not copy the entire file stream, so the efficiency of parallel decoding is not affected.
- Step 308 multiple threads perform decoding in parallel. Taking JPEG pictures as an example, each thread will complete the index position recovery, Huffman entropy decoding, Inverse Discrete Cosine Transform (IDCT) and color conversion stages in turn, and finally output the RGB results of the partial regions of the image.
- IDCT Inverse Discrete Cosine Transform
- step 308 in the above steps may be performed by one main thread, and step 308 may be performed by multiple sub-threads.
- FIG. 5 is a schematic structural diagram of a computer system 400 according to an embodiment of the present invention.
- the computer system 400 can be a terminal device or other type of computer device.
- the computer system includes an application layer 410 and an operating system layer 450, which may be an Android operating system.
- the operating system layer 450 is further divided into a framework layer 420, a core library layer 430, and a driver layer 440.
- the operating system layer 450 in FIG. 5 can be considered as a specific implementation of the operating system 182 in FIG. 1, and the application layer 410 in FIG. 5 can be considered as a specific implementation of the application 181 in FIG.
- the drive layer 440 includes a CPU driver 441, a GPU driver 442, a display controller driver 443, and the like.
- the core library layer 430 is a core part of the operating system, including an input/output service 431, a core service 432, a graphics device interface 434, and a graphics engine (Graphics Engine) 433 that implements CPU or GPU graphics processing.
- the graphics engine 433 may include a 2D engine, a 3D engine, a composition, a frame buffer, an EGL (Embedded-System Graphics Library), etc., where the EGL is a rendering API and an underlying native platform window system.
- Interface, API refers to the application programming interface (Application Programming Interface).
- the framework layer 420 may include a Graphic Service 424, a System Service 421, a Web Service 422, and a Customer Service 423, etc.
- the graphics service 424 may include, for example, a widget (Widget). ), canvas (Canvas) and views (Views).
- the application layer 410 may include a gallery 411, a media player (412), a browser 413, and the like.
- computer system 400 also includes a hardware layer 450.
- the hardware layer of the computer system 400 may include a Central Processing Unit (CPU) 451 and a Graphic Processing Unit (GPU) 452 (corresponding to a specific implementation of the processor 150 in FIG. 1).
- the memory 453 (corresponding to the memory 180 in FIG. 1), including the memory and the external memory, may further include an input device 454 (corresponding to the input device 132 in FIG. 1) and a display device 455 (corresponding to the display in FIG. 1).
- Apparatus 140 such as a Liquid Crystal Display (LCD), Holographic, Projector, etc., may also include one or more sensors 456 (equivalent to sensor 120 in FIG. 1).
- the hardware layer 450 may also include the power source, camera, RF circuit, and WiFi module shown in FIG. 1, and may also include other hardware modules not shown in FIG. 1, such as a memory controller and display control. And so on.
- FIG. 5b is a schematic structural diagram of the 2D engine shown in FIG. 5a.
- the 2D engine 500 mainly includes libskia 501 and libjpeg 502, wherein libskia 501 can call the functions provided by libjpeg 502, and libjpeg 502 is equivalent to the JPEG decoding library mentioned in the previous embodiment.
- the embodiment of the present invention mainly adds the function of parallel decoding in libjpeg 502, and adaptively modifies the interface of libskia 501 to call libjpeg 502.
- the 2D engine The 500 can also include decoding libraries for other image formats, such as libpng 503 and libgif 504.
- FIG. 6a and 6b are operational timing diagrams of the parallel decoding method in the 2D engine 500 according to an embodiment of the present invention, wherein FIG. 6a is a process of acquiring pre-index information, and FIG. 6b is a process of performing parallel decoding according to pre-index information. Both of these running sequence diagrams are described by taking a thumbnail of a picture in the user clicking on the gallery 411 (refer to FIG. 5a) as an example.
- the library 411 sends a decoding request (602a) to libskia 501
- libskia 501 creates a file stream of the picture, and streams the file to libjpeg502.
- libjpeg502 fails to read the pre-index information (604a) and returns the result of the failure of the pre-index information acquisition to libskia 501.
- libskia501 calls the serial decoding function (605a) provided by libjpeg502 according to the returned result, libjpeg502 for the above file
- the stream performs processes such as serial Huffman decoding (606a).
- libjpeg 502 extracts pre-index information (608a) according to the decoding result of 606a and stores the extracted pre-index information (609a). After libjpeg 502 completes the picture decoding, the decoding result is returned to the library 411 (610a) through libskia 501, and then the library 411 displays the opened picture (611a) to the user.
- the serial Huffman decoding is performed by libjpeg 502, so libjpeg 502 can directly extract the pre-index information from the decoding result, but in other embodiments, in order to minimize the original decoding process code, libjpeg502
- the offset position information of all MCU blocks obtained by decoding is passed to libskia501, and then libskia501 passes the index information of all MCU blocks to libjpeg502, and then libjpeg502 extracts pre-index information from the information.
- steps 605a and 606a may be replaced with region decoding, and since the extraction of the offset location information for all MCU blocks in the region decoding is prior to the decoding step, steps 607a and 608a may be placed prior to region decoding.
- the library 411 sends a decoding request (602b) to libskia 501
- libskia 501 creates a file stream of the picture, and streams the file to libjpeg502 (603b)
- libjpeg 502 reads the pre-index information (604b) and verifies the integrity of the pre-index information (605b), and then the verification returns the result to libskia 501
- libskia501 prepares for decoding (607b), including copying M-1 pointers of the above files, etc.
- libjpeg 502 is called after the copy is completed, and M threads are called by libjpeg to perform parallel decoding (608b) on the above file stream.
- the decoding result is returned to the library 411 (609b) through libskia 501, and then the library 411 displays the opened picture (610b) to the user.
- libjpeg 502 reads the description information of the image file (for example, the quantization table, the file size, and the like) in addition to the pre-index information, which are existing technologies and will not be described here.
- the library 411 calls the libskia 501 in the 2D engine, which can be implemented by calling the BitmapFactory interface in the graphics device interface 434 (refer to FIG. 5a), which is also a prior art and will not be described in detail in the embodiments of the present invention.
- FIGS. 6a-6b only exemplarily describe the method embodiments provided by the present invention, and the various methods introduced by those skilled in the art according to the foregoing embodiments of the present invention and the two operation timing charts.
- the example is easy to obtain the running timing diagram corresponding to the other method embodiments provided by the present invention and the corresponding program implementation according to the timing diagram, and details are not described herein again.
- the computer system applying the parallel decoding method provided by the embodiment of the present invention can effectively avoid the system jamming phenomenon while realizing parallel decoding of files and improving decoding efficiency. And enhance the user experience.
- FIG. 7 is a schematic structural diagram of a decoding apparatus 700 according to an embodiment of the present invention.
- the decoding apparatus 700 includes a reading module 701, configured to read, from the memory 800, pre-index information corresponding to a file to be decoded, the pre-index information including information indicating one or more decoding boundaries, and the pre-index information Stored in another file associated with the file to be decoded or at the end of the file to be decoded; and a parallel decoding module 702, configured to: use the plurality of files to be decoded according to the pre-index information
- the data segment performs parallel decoding, wherein the plurality of data segments are partitioned according to one or more of the one or more decoding boundaries.
- the memory 800 includes memory and external memory, and the pre-index information is usually stored on the external memory.
- the decoding apparatus 700 may further include an extracting module 703, configured to: when the file to be decoded is newly added, the file to be decoded is modified, or the file to be decoded When the first time is opened, the pre-index information is extracted; and the storage module 704 is configured to store the extracted pre-index information into the memory 800.
- an extracting module 703 configured to: when the file to be decoded is newly added, the file to be decoded is modified, or the file to be decoded When the first time is opened, the pre-index information is extracted; and the storage module 704 is configured to store the extracted pre-index information into the memory 800.
- the decoding apparatus 700 may further include one or two of a determining module 705 and a determining module 706, both determining modules are configured to determine that the file size is greater than a preset threshold, and the extracting module 703 and the reading module 701 are configured according to The determination result respectively performs a corresponding extraction operation and a reading operation. Further, the decoding apparatus 700 may further include a threshold modification module 707 for modifying the thresholds in the determining module 705 and the determining module 706. In some other embodiments, the determination module 705 and the determination module 706 can also be combined into one module.
- the decoding apparatus 700 may further include an integrity verification module 703 for verifying the integrity of the pre-index information read by the reading module 701, and the parallel decoding module 702 is complete.
- the verification result of the verification module 703 is to perform parallel decoding on the file when passing.
- the decoding apparatus 700 may further include a data preparation module 704, configured to copy a file stream of the file to be decoded to obtain a file stream equal to the number of the plurality of threads performing the parallel decoding, where the file is copied
- a stream refers to a pointer that copies the file stream.
- the data preparation module 704 can also copy or create other information required for parallel decoding according to requirements.
- integrity verification module 703 and the data preparation module 704 may also be added based on the decoding apparatus shown in FIG. 7b.
- the modules indicated by the dashed lines in Figures 7a-7c are all optional modules.
- the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- the connection relationship between the modules indicates that there is a communication connection between them, and specifically, one or more communication buses or signal lines can be realized.
- the drawing device can be implemented by means of software plus necessary general hardware, and of course, the dedicated hardware can also include an ASIC. , dedicated CPU, dedicated memory, dedicated components, etc. to achieve.
- functions performed by computer programs can be easily implemented with the corresponding hardware, and the specific hardware structure used to implement the same function can be various, such as analog circuits, digital circuits, or dedicated circuits. Circuits, etc.
Abstract
Description
Claims (20)
- 一种解码方法,其特征在于,包括:读取待解码的文件对应的预索引信息,所述待解码的文件采用可变长编码;其中,所述预索引信息包括指示一个或多个解码边界的信息,所述预索引信息存储在与所述待解码的文件关联的其他文件中或所述待解码的文件的尾部;根据所述预索引信息,对所述待解码的文件中的多个数据段执行并行解码,所述多个数据段是依据所述一个或多个解码边界中的一个或多个进行划分的。
- 根据权利要求1所述的方法,其特征在于,在所述读取待解码的文件对应的预索引信息之前,还包括:当监测到所述待解码的文件新增、所述待解码的文件被修改、或所述待解码的文件第一次被打开时,提取所述预索引信息;存储提取的所述预索引信息。
- 根据权利要求2所述的方法,其特征在于,提取的所述预索引信息所指示的解码边界的数量是根据处理资源的处理能力确定的。
- 根据权利要求1-3任意一项所述的方法,其特征在于,所述读取所述待解码的文件对应的预索引信息包括:确定所述待解码的文件的大小大于预设的第一阈值;根据所述确定结果读取所述待解码的文件对应的预索引信息。
- 根据权利要求2或3所述的方法,其特征在于,所述提取所述预索引信息包括:确定所述待解码文件的大小大于预设的第一阈值;根据所述确定结果提取所述预索引信息。
- 根据权利要求4或5所述的方法,其特征在于,所述预设的第一阈值通过以下方式修改:在所述待解码的文件被解码完成后,记录所述待解码的文件的大小、解码时间以及是否执行并行解码;若所述待解码的文件使用并行解码,所述解码时间小于预设的第二阈值且所述待解码的文件的大小大于所述预设的第一阈值,修改所述预设的第一阈值为所述待解码的文件的大小。
- 根据权利要求1-6任意一项所述的方法,其特征在于,在根据所述预索引信息,对所述待解码的文件中的多个数据段执行并行解码之前,所述方法还包括:复制所述待解码的文件的文件流以获得与待执行所述并行解码的多个线程的数量相等的文件流,其中,复制所述文件流指的是复制所述文件流的指针。
- 根据权利要求1-7任意一项所述的方法,其特征在于,所述根据所述预索引信息,对所述待解码的文件中的多个数据段执行并行解码包括:确定所述预索引信息通过完整性验证;在确定所述预索引信息通过完整性验证后,根据所述预索引信息,对所述待解码的文件中的多个数据段执行并行解码的步骤。
- 根据权利要求1-8任意一项所述的方法,其特征在于,所述其他文件为元数据文件、数据库文件、或与所述待解码的文件在同一目录下的,与所述待解码的文件的 文件名相同的文件。
- 根据权利要求9所述的方法,其特征在于,所述元数据文件为系统文件。
- 一种计算机系统,其特征在于,包括一个或多个处理器,以及与所述一个或多个处理器耦合的存储器;所述存储器用于存储计算机程序,所述一个或多个处理器用于读取所述计算机程序以执行:读取待解码的文件对应的预索引信息,所述待解码的文件采用可变长编码;其中,所述预索引信息包括指示一个或多个解码边界的信息,所述预索引信息存储在与所述待解码的文件关联的其他文件中或所述待解码的文件的尾部;以及根据所述预索引信息,对所述待解码的文件中的多个数据段执行并行解码,其中所述多个数据段是依据所述一个或多个解码边界中的一个或多个进行划分的。
- 根据权利要求11所述的计算机系统,其特征在于,所述一个或多个处理器还用于:当监测到所述待解码的文件新增、所述待解码的文件被修改、或所述待解码的文件第一次被打开时,提取所述预索引信息;以及存储提取的所述预索引信息。
- 根据权利要求12所述的计算机系统,其特征在于,提取的所述预索引信息所指示的解码边界的数量是根据处理资源的处理能力确定的。
- 根据权利要求12或13所述的计算机系统,其特征在于,所述一个或多个处理器用于:确定所述待解码文件的大小大于预设的第一阈值;根据所述确定结果提取所述预索引信息。
- 根据权利要求14所述的计算机系统,其特征在于,所述一个或多个处理器还用于通过以下方式修改所述预设的第一阈值:在所述待解码的文件被解码完成后,记录所述待解码的文件的大小、解码时间以及是否执行并行解码;若所述待解码的文件使用并行解码,所述解码时间小于预设的第二阈值且所述待解码的文件的大小大于所述预设的第一阈值,修改所述预设的第一阈值为所述待解码的文件的大小。
- 根据权利要求11-15任意一项所述的计算机系统,其特征在于,所述其他文件为元数据文件、数据库文件、或与所述待解码的文件在同一目录下的,与所述待解码的文件的文件名相同的文件。
- 根据权利要求16所述的计算机系统,其特征在于,所述元数据文件为系统文件。
- 一种解码装置,其特征在于,包括:读取模块,用于读取待解码的文件对应的预索引信息,所述预索引信息包括指示一个或多个解码边界的信息,所述预索引信息存储在与所述待解码的文件关联的其他文件中或所述待解码的文件的尾部,并且所述待解码的文件采用可变长编码;以及并行解码模块,用于根据所述预索引信息,对所述待解码的文件中的多个数据段执行并行解码,其中所述多个数据段是依据所述一个或多个解码边界中的一个或多个进行划分的。
- 根据权利要求18所述的解码装置,其特征在于,还包括:提取模块,用于当监测到所述待解码的文件新增、所述待解码的文件被修改、或所述待解码的文件第一次被打开时,提取所述预索引信息;存储模块,用于存储提取的所述预索引信息。
- 根据权利要求19所述的解码装置,其特征在于,所述提取模块提取的所述预索引信息所指示的解码边界的数量是根据处理资源的处理能力确定的。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
BR112018077468A BR112018077468A2 (pt) | 2016-07-08 | 2017-07-05 | método, aparelho, sistema de computador, produto de programa de software, e mídia de armazenamento para decodificar arquivo codificado de comprimento variável |
EP17823645.1A EP3468047A4 (en) | 2016-07-08 | 2017-07-05 | METHOD AND DEVICE FOR DECODING A VARIABLE LENGTH ENCODING FILE |
KR1020197001291A KR102147633B1 (ko) | 2016-07-08 | 2017-07-05 | 가변 길이 코딩된 파일을 디코딩하는 방법 및 장치 |
US16/241,058 US11284119B2 (en) | 2016-07-08 | 2019-01-07 | Method and apparatus for decoding variable-length coded file |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610542045.0 | 2016-07-08 | ||
CN201610542045.0A CN107592118B (zh) | 2016-07-08 | 2016-07-08 | 可变长编码文件的解码方法以及装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/241,058 Continuation US11284119B2 (en) | 2016-07-08 | 2019-01-07 | Method and apparatus for decoding variable-length coded file |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018006833A1 true WO2018006833A1 (zh) | 2018-01-11 |
Family
ID=60912369
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/091866 WO2018006833A1 (zh) | 2016-07-08 | 2017-07-05 | 可变长编码文件的解码方法以及装置 |
Country Status (6)
Country | Link |
---|---|
US (1) | US11284119B2 (zh) |
EP (1) | EP3468047A4 (zh) |
KR (1) | KR102147633B1 (zh) |
CN (1) | CN107592118B (zh) |
BR (1) | BR112018077468A2 (zh) |
WO (1) | WO2018006833A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115001628A (zh) * | 2022-06-07 | 2022-09-02 | 北京百度网讯科技有限公司 | 数据编码的方法及装置、数据解码的方法及装置和数据结构 |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109656712B (zh) * | 2018-11-29 | 2022-12-09 | 中国辐射防护研究院 | 一种提取grib码数据的方法及系统 |
CN109656614A (zh) * | 2018-12-24 | 2019-04-19 | 中国银行股份有限公司 | 文件的处理方法、装置及系统 |
CN112835651B (zh) * | 2021-04-01 | 2023-10-20 | 中国空空导弹研究院 | 一种多路图像并行解码处理方法 |
CN114071154A (zh) * | 2021-11-10 | 2022-02-18 | 湖南国科微电子股份有限公司 | 一种数据解码方法、装置、电子设备及可读存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859585A (zh) * | 2010-07-01 | 2010-10-13 | 福建省三奥信息科技有限公司 | 一种对视频素材进行帧精确剪辑的系统和方法 |
CN102761745A (zh) * | 2012-07-12 | 2012-10-31 | 国家计算机网络与信息安全管理中心 | 解码方法和解码设备 |
CN105578194A (zh) * | 2016-01-06 | 2016-05-11 | 珠海全志科技股份有限公司 | Jpeg图像解码方法和解码器 |
Family Cites Families (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5381145A (en) * | 1993-02-10 | 1995-01-10 | Ricoh Corporation | Method and apparatus for parallel decoding and encoding of data |
US6043765A (en) | 1997-09-26 | 2000-03-28 | Silicon Engineering, Inc. | Method and apparatus for performing a parallel speculative Huffman decoding using both partial and full decoders |
US7129864B2 (en) * | 2004-12-31 | 2006-10-31 | Intel Corporation | Fast compact decoder for huffman codes |
US8121428B2 (en) | 2005-05-31 | 2012-02-21 | Microsoft Corporation | Accelerated image rendering |
CN100546198C (zh) * | 2006-10-20 | 2009-09-30 | 宁波大学 | 一种数字音乐作品认证信息的嵌入方法 |
SE533185C2 (sv) | 2007-02-16 | 2010-07-13 | Scalado Ab | Metod för behandling av en digital bild samt bildrepresentationsformat |
CN101051846A (zh) * | 2007-05-09 | 2007-10-10 | 上海广电(集团)有限公司中央研究院 | 一种基于上下文的快速哈夫曼解码方法 |
CN101626504B (zh) * | 2008-07-09 | 2012-06-06 | 上海飞来飞去多媒体创意有限公司 | 一种高速jpeg解码的方法 |
US8423520B2 (en) * | 2009-11-23 | 2013-04-16 | Dell Products L.P. | Methods and apparatus for efficient compression and deduplication |
US8520958B2 (en) | 2009-12-21 | 2013-08-27 | Stmicroelectronics International N.V. | Parallelization of variable length decoding |
US8174414B2 (en) * | 2010-04-13 | 2012-05-08 | Research In Motion Limited | Methods and devices for load balancing in parallel entropy coding and decoding |
EP2381685B1 (en) * | 2010-04-13 | 2019-01-02 | BlackBerry Limited | Methods and devices for load balancing in parallel entropy coding and decoding |
EP2622744B1 (en) * | 2010-10-01 | 2019-11-06 | BlackBerry Limited | Methods and devices for parallel encoding and decoding using a bitstream structured for reduced delay |
CN103297767B (zh) | 2012-02-28 | 2016-03-16 | 三星电子(中国)研发中心 | 一种适用于多核嵌入式平台的jpeg图像解码方法及解码器 |
CN103377131A (zh) * | 2012-04-13 | 2013-10-30 | 索尼公司 | 数据处理装置和方法 |
CN102970544A (zh) | 2012-12-07 | 2013-03-13 | 豪威科技(上海)有限公司 | Jpeg编码和解码方法及系统 |
-
2016
- 2016-07-08 CN CN201610542045.0A patent/CN107592118B/zh active Active
-
2017
- 2017-07-05 BR BR112018077468A patent/BR112018077468A2/pt unknown
- 2017-07-05 WO PCT/CN2017/091866 patent/WO2018006833A1/zh unknown
- 2017-07-05 KR KR1020197001291A patent/KR102147633B1/ko active IP Right Grant
- 2017-07-05 EP EP17823645.1A patent/EP3468047A4/en active Pending
-
2019
- 2019-01-07 US US16/241,058 patent/US11284119B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859585A (zh) * | 2010-07-01 | 2010-10-13 | 福建省三奥信息科技有限公司 | 一种对视频素材进行帧精确剪辑的系统和方法 |
CN102761745A (zh) * | 2012-07-12 | 2012-10-31 | 国家计算机网络与信息安全管理中心 | 解码方法和解码设备 |
CN105578194A (zh) * | 2016-01-06 | 2016-05-11 | 珠海全志科技股份有限公司 | Jpeg图像解码方法和解码器 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3468047A4 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115001628A (zh) * | 2022-06-07 | 2022-09-02 | 北京百度网讯科技有限公司 | 数据编码的方法及装置、数据解码的方法及装置和数据结构 |
CN115001628B (zh) * | 2022-06-07 | 2024-02-27 | 北京百度网讯科技有限公司 | 数据编码的方法及装置、数据解码的方法及装置和数据结构 |
Also Published As
Publication number | Publication date |
---|---|
KR102147633B1 (ko) | 2020-08-25 |
KR20190020039A (ko) | 2019-02-27 |
CN107592118A (zh) | 2018-01-16 |
CN107592118B (zh) | 2021-06-22 |
US11284119B2 (en) | 2022-03-22 |
BR112018077468A2 (pt) | 2019-04-02 |
EP3468047A1 (en) | 2019-04-10 |
EP3468047A4 (en) | 2019-06-26 |
US20190141356A1 (en) | 2019-05-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018006833A1 (zh) | 可变长编码文件的解码方法以及装置 | |
US11347370B2 (en) | Method and system for video recording | |
US20210235093A1 (en) | Backward-compatible video capture and distribution | |
KR102124231B1 (ko) | 플레이스홀더 및 콘텐츠 스트리밍 기법 | |
KR102128138B1 (ko) | 플레이스홀더에 의한 하이드레이션 및 디하이드레이션 기법 | |
KR102128139B1 (ko) | 플레이스홀더에 의한 파일 관리 기법 | |
US8996468B1 (en) | Block status mapping system for reducing virtual machine backup storage | |
CN106453572B (zh) | 基于云服务器同步图像的方法及系统 | |
US10430040B2 (en) | Method and an apparatus for providing a multitasking view | |
US20120307078A1 (en) | Automatic sharing and replacement of content based on network connectivity | |
US20140258347A1 (en) | Grouping files for optimized file operations | |
KR102575541B1 (ko) | 이미지를 캡처하기 위한 방법, 단말기 및 이의 저장 매체 | |
WO2023083064A1 (zh) | 视频处理方法、装置、电子设备及可读存储介质 | |
WO2018201993A1 (zh) | 图像绘制方法、终端及存储介质 | |
KR20160131827A (ko) | 클라우드 스트리밍 서비스 시스템, 알파 레벨을 이용한 이미지 클라우드 스트리밍 서비스 방법 및 이를 위한 장치 | |
US20210264657A1 (en) | Method, system, and non-transitory computer-readable record medium for providing animation using sprite jpeg | |
CN108235144B (zh) | 播放内容获取方法、装置及计算设备 | |
CN104392410A (zh) | 皮肤系统中的图片整合方法、皮肤绘制方法及设备 | |
KR102247887B1 (ko) | 클라우드 스트리밍 서비스 시스템, 소스 정보를 이용한 클라우드 스트리밍 서비스 방법 및 이를 위한 장치 | |
JP5890674B2 (ja) | 情報処理装置、情報処理方法 | |
US11599293B2 (en) | Consistent data stream replication and reconstruction in a streaming data storage platform | |
WO2022111435A1 (zh) | 一种usb设备随通道录音的方法、装置及存储介质 | |
KR102425277B1 (ko) | 클라우드 스트리밍 서버의 자가 오류 검증을 위한 테스트 화면 제공 방법 및 이를 위한 장치 | |
CN117648142A (zh) | 一种图像的获取方法和电子设备 | |
CN116934570A (zh) | 一种应用程序页面的图像处理方法、装置及电子设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17823645 Country of ref document: EP Kind code of ref document: A1 |
|
REG | Reference to national code |
Ref country code: BR Ref legal event code: B01A Ref document number: 112018077468 Country of ref document: BR |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 20197001291 Country of ref document: KR Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 2017823645 Country of ref document: EP Effective date: 20190103 |
|
ENP | Entry into the national phase |
Ref document number: 112018077468 Country of ref document: BR Kind code of ref document: A2 Effective date: 20181228 |