Data decoding method, device, equipment and storage medium

By performing memory writing and decoding operations in the preset memory, the problem of low decoding efficiency caused by multiple copies of frame stream data is solved, achieving more efficient data decoding and reducing power consumption.

CN115714879BActive Publication Date: 2024-10-08SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202211438773.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-17
Publication Date
2024-10-08
Estimated Expiration
2042-11-17

AI Technical Summary

Technical Problem

After the digital TV receives the transport stream, the frame stream data is copied multiple times, resulting in a longer transmission time for the transport stream to the decoder, which in turn results in lower data decoding efficiency.

Method used

By performing memory writing operations and decoding operations in the preset memory, repeated copying of data is avoided, data decoding efficiency is improved, and power consumption of electronic devices is reduced.

Benefits of technology

It improves the efficiency of data decoding, avoids excessive fragmentation of memory, and reduces the power consumption of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115714879B_ABST
    Figure CN115714879B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data decoding method, device, equipment and storage medium, in which PES data is obtained; multiple unit data are obtained from the PES data; a memory write operation is performed on the multiple unit data, and a decoding operation is performed on the undecoded unit data in the preset memory in the preset memory to obtain audio and video data, and the memory write operation is used to write the multiple unit data into the preset memory. Not only can the memory write operation be performed in the preset memory, but decoding can also be performed directly in the preset memory without repeatedly copying the data, thereby improving the efficiency of data decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of audio and video coding and decoding technology, and specifically relates to a data decoding method, device, equipment and storage medium. Background Art

[0002] After a digital TV receives a transport stream (TS), it generally uses demultiplexing hardware to put the packet elementary stream (PES) data encapsulated inside the transport stream into discrete ring buffers for audio and video. The driver software then extracts the frame stream data (encoded audio and video frame data) from the PES data and puts it into the frame memory. The frame stream data is then copied from the frame memory to the decoder side for decoding by the decoder to obtain the audio and video frame data.

[0003] Since the frame code stream data is copied multiple times, it takes a long time for the transport stream to be transmitted to the decoder, which leads to low efficiency of data decoding. Summary of the invention

[0004] The embodiments of the present application relate to a data decoding method, apparatus, device and storage medium, which improve the efficiency of data decoding.

[0005] In a first aspect, an embodiment of the present application provides a data decoding method, including:

[0006] Determine a plurality of unit data according to the packaged elementary code stream PES data;

[0007] A memory write operation is performed on the multiple unit data, and a decoding operation is performed on the undecoded unit data in the preset memory to obtain audio and video data. The memory write operation is used to write the multiple unit data into the preset memory.

[0008] In a possible implementation, performing a memory write operation on a plurality of unit data, and performing a decoding operation on undecoded unit data in a preset memory to obtain audio and video data includes:

[0009] performing a memory write operation on a plurality of unit data by a first process, and,

[0010] The second process performs a decoding operation on the undecoded unit data in the preset memory in the preset memory to obtain audio and video data; wherein the first process and the second process are executed in parallel.

[0011] In a possible implementation manner, decoding the undecoded unit data in the preset memory to obtain the audio and video data includes:

[0012] Determine at least one frame code stream data in the undecoded unit data, the frame code stream data includes at least one undecoded unit data, and one frame code stream data corresponds to one audio and video frame data;

[0013] Decoding operations are performed on at least one frame code stream data in sequence to obtain audio and video data.

[0014] In a possible implementation manner, for any frame code stream data, determining a frame code stream data in the undecoded unit data includes:

[0015] Determine the starting position and offset position of the frame code stream data;

[0016] The frame code stream data is determined in the undecoded unit data according to the start position and the offset position.

[0017] In a possible implementation, writing a plurality of unit data into a preset memory includes:

[0018] Determine the target memory in the preset memory;

[0019] Writes multiple cells of data to the target memory.

[0020] In a possible implementation, determining the target memory in the preset memory includes:

[0021] Determine that the last byte of the undecoded unit data in the preset memory is the first position in the preset memory;

[0022] Determine that the last byte of the decoded unit data in the preset memory is at a second position in the preset memory;

[0023] A memory between the first location and the second location is determined as a target memory.

[0024] In a possible implementation manner, the preset memory is a memory with discrete physical addresses and continuous logical addresses, or the preset memory is a memory with continuous physical addresses and continuous logical addresses.

[0025] In a possible implementation, a plurality of unit data are determined according to the PES data, including:

[0026] determining at least one start code;

[0027] determining at least one unit data location in the PES data based on at least one start code;

[0028] A plurality of unit data are determined in the PES data according to at least one unit data position.

[0029] In a second aspect, an embodiment of the present application provides a data decoding device, comprising:

[0030] A determination module, used for determining a plurality of unit data according to the PES data;

[0031] A writing module, used for performing a memory writing operation on the plurality of unit data, wherein the memory writing operation is used for writing the plurality of unit data into a preset memory;

[0032] The decoding module is used to perform a decoding operation on the undecoded unit data in the preset memory in the preset memory to obtain audio and video data.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;

[0034] Memory stores computer-executable instructions;

[0035] The processor executes the computer-executable instructions stored in the memory, so that the processor executes any method described in the first aspect.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement any method described in the first aspect.

[0037] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any method described in the first aspect.

[0038] In a sixth aspect, an embodiment of the present application provides a chip having a computer program stored thereon, and when the computer program is executed by the chip, the method as described in any one of the first aspects is implemented.

[0039] In a possible implementation manner, the chip is a chip in a chip module.

[0040] The embodiment of the present application provides a data decoding method, device, equipment and storage medium, in which PES data is obtained; multiple unit data are obtained from the PES data; a memory write operation is performed on the multiple unit data, and a decoding operation is performed on the undecoded unit data in the preset memory in the preset memory to obtain audio and video data, and the memory write operation is used to write the multiple unit data into the preset memory. Not only can the memory write operation be performed in the preset memory, but decoding can also be performed directly in the preset memory without repeatedly copying the data, thereby improving the efficiency of data decoding. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0042] Figure 2A flowchart of a data decoding method provided in an embodiment of the present application;

[0043] Figure 3 A flowchart of another data decoding method provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of the target memory provided in the embodiment of the present application;

[0045] Figure 5 The position of each pointer in the preset memory during the write operation provided in the embodiment of the present application;

[0046] Figure 6 A flowchart of a method for using a preset memory provided in an embodiment of the present application;

[0047] Figure 7 A schematic diagram of the position pointed to by a pointer provided in an embodiment of the present application;

[0048] Figure 8 A schematic diagram of the structure of a data decoding device provided in an embodiment of the present application;

[0049] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] It should be noted that, although the terms "first", "second", etc. are used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. Optionally, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.

[0052] It should be understood that the terms "comprises" and "includes" indicate the presence of the previously mentioned features, steps, operations, but do not exclude the presence, occurrence or addition of one or at least one other feature, step, operation. The terms "and / or" and the like used in this application may be interpreted as inclusive, or mean any one or any combination. Optionally, "A and / or B" means "any of the following: A; B; A and B". In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.

[0053] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include at least one sub-step or at least one stage, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0054] For ease of understanding, the following Figure 1 , the application scenarios to which the embodiments of the present application are applicable are described.

[0055] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 , the electronic device includes demultiplexing (Demux) hardware, decoder and player. When the electronic device receives TS, it can obtain frame code stream data through demultiplexing hardware, transmit the frame code stream data to the decoder for decoding to obtain audio and video data, transmit the audio and video data to the player, and the player can play the audio and video data.

[0056] It should be noted that Figure 1 This is only an exemplary description of the embodiment of the present application and should not be used as a limitation on the protection scope of the present application. For example, the demultiplexing hardware, decoder and player in the electronic device can be an integrated device or a system connected by a signal line, and the present application does not limit this.

[0057] In the above process, the frame code stream data is copied multiple times, resulting in a longer time for the transmission stream to be transmitted to the decoder, which in turn leads to lower efficiency of data decoding; at the same time, the frame memory storing the frame code stream data is dynamically and repeatedly allocated, which will cause the frame memory to be too fragmented and increase the memory allocation time; and repeated memory allocation and data copying will increase the power consumption of electronic equipment.

[0058] In order to avoid the above-mentioned technical problems, an embodiment of the present application provides a data decoding method, in which the preset memory only needs to be allocated once, thereby avoiding excessive memory fragmentation; and the electronic device can store frame code stream data in the preset memory, and at the same time can decode the frame code stream data in the preset memory, thereby avoiding repeated copying of the frame code stream data, thereby improving the efficiency of data decoding and reducing the power consumption of the electronic device.

[0059] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0060] Figure 2 A flowchart of a data decoding method provided in an embodiment of the present application. Figure 2 , the method comprising:

[0061] S201. Acquire multiple unit data from PES data.

[0062] The execution subject of the embodiment of the present application can be an electronic device such as a digital television, or a data decoding device set in the electronic device. The data decoding device can be implemented by software or by a combination of software and hardware.

[0063] The PES data may be audio PES data and / or video PES data.

[0064] For example, the PES data may be PES data encapsulating High Efficiency Video Coding (HEVC) data.

[0065] In a possible implementation, after receiving the transport stream, the electronic device may filter the transport stream by a packet identifier (Packet Identifier, PID) to obtain PES data.

[0066] After the electronic device obtains the PES data, it can put the PES data into discrete ring buffers for audio and video.

[0067] The unit data may be basic code stream data encapsulated with a frame header. For example, at the data source end of a TV station, video data may be composed of multiple Network Abstraction Layer Units (NALUs) after being encoded by HEVC.

[0068] After being encoded, one frame of audio and video data may be composed of at least one unit data, that is, one frame of audio and video data corresponds to at least one unit data.

[0069] S202, performing a memory write operation on the plurality of unit data, and performing a decoding operation on the undecoded unit data in the preset memory in the preset memory to obtain audio and video data, wherein the memory write operation is used to write the plurality of unit data into the preset memory.

[0070] The preset memory may be a memory with discrete physical addresses and continuous logical addresses, or a memory with continuous physical addresses and continuous logical addresses.

[0071] If the preset memory is memory with discrete physical addresses, the memory of each physical address can be displayed through a page table.

[0072] The preset memory may be a ring memory.

[0073] In the embodiment of the present application, the preset memory only needs to be allocated once, thus avoiding excessive memory fragmentation.

[0074] In order to avoid repeated copying of data, the form of allocated memory can be determined according to different system platforms and frameworks. If the decoder supports the Input / Output Memory Management Unit (IOMMU), a section of memory with discrete physical addresses and continuous logical addresses can be dynamically allocated for recycling to store unit data; if the decoder does not support IOMMU, a section of memory with continuous physical and logical addresses can be allocated through the Contiguous Memory Allocation (CMA) or reserved memory. In either case, this section of memory can be transferred across processes and recycled.

[0075] In one possible implementation, the electronic device can perform a memory write operation on multiple unit data through a first process, and perform a decoding operation on undecoded unit data in a preset memory through a second process to obtain audio and video data; wherein the first process and the second process can be executed in parallel.

[0076] By executing the first process and the second process in parallel, not only the memory usage efficiency can be improved, but also the data decoding efficiency can be improved.

[0077] exist Figure 2 In the illustrated embodiment, the electronic device obtains multiple unit data from PES data, performs a memory write operation on the multiple unit data, and performs a decoding operation on the undecoded unit data in the preset memory in the preset memory to obtain audio and video data, and the memory write operation is used to write the multiple unit data into the preset memory. Not only can the memory write operation be performed in the preset memory, but decoding can also be performed directly in the preset memory without repeatedly copying data, thereby improving the efficiency of data decoding and reducing the power consumption of the electronic device.

[0078] exist Figure 2 Based on the embodiment shown, the following Figure 3 Describe the data decoding method in detail.

[0079] Figure 3 A flowchart of another data decoding method provided in an embodiment of the present application. Figure 3 , the method comprising:

[0080] S301. Obtain PES data.

[0081] S302: Determine at least one start code.

[0082] In a PES data, if a data unit constitutes a frame of audio or video frame data, each data unit has a start code; if multiple data units constitute a frame of audio or video frame data, the first data unit among the multiple data units has a start code, and the remaining data units do not have a start code.

[0083] If multiple PES data constitute one frame of audio or video frame data, the first PES data has a start code, and the remaining PES data may only contain data without a start code.

[0084] The start code can be set according to the encoding rules of different code streams. The structure of the start code can be 0x000001XX or 0x00000001XX. For example, for an H264 code stream, the start code can be set to 0x00000148.

[0085] S303: Determine at least one unit data position in the PES data according to at least one start code.

[0086] After determining at least one start code, the demultiplexing hardware / driver software can scan the ring buffer where the PES data is located according to the determined start code to determine at least one unit data position.

[0087] Because the PES is placed in a ring buffer, the position of at least one unit data in the ring buffer can be determined according to the determined at least one start code.

[0088] The location referred to in the embodiments of the present application may be a physical address or a logical address, wherein the logical address is a virtual address.

[0089] After determining at least one unit data position, the at least one unit data position is recorded.

[0090] S304: Determine a plurality of unit data in the PES data according to at least one unit data position.

[0091] If there is only one unit data position in one PES data, all unit data after the unit data position may be determined as unit data of one frame of audio and video data.

[0092] If there are multiple unit data positions in one PES data, the unit data between two unit data positions can be determined as the unit data of one frame of audio and video data.

[0093] If only the first PES data among multiple PES data has a unit data position, all unit data after the unit data position in the first PES data and unit data in the remaining PES data can be determined as unit data of one frame of audio and video data.

[0094] S305, writing a plurality of unit data into a preset memory.

[0095] In a possible implementation, the plurality of unit data may be written into the preset memory in the following manner: determining a target memory in the preset memory; and writing the plurality of unit data into the target memory.

[0096] The target memory is the available memory. Initially, all the memory in the preset memory is the target memory.

[0097] In one possible implementation, unused memory can be determined in the preset memory in the following manner: determine that the last byte of the undecoded unit data is at the first position in the preset memory, and the last byte of the decoded unit data is at the second position in the preset memory; and determine the memory between the first position and the second position as the target memory.

[0098] The first position and the second position may both be offset positions of corresponding bytes relative to a preset unstored starting position.

[0099] The first position may be the starting position of the target memory, and the second position may be the ending position of the target memory; data may be written from the starting position and in the direction of data storage. Figure 4 As shown, the direction of data storage is clockwise, and the entire circle represents the preset memory, wherein the filled part is the target memory.

[0100] Both the first position and the second position may be the end position of a byte.

[0101] S306: Determine at least one frame code stream data in the undecoded unit data, where the frame code stream data includes at least one undecoded unit data.

[0102] One frame of code stream data corresponds to one audio or video frame of data.

[0103] In a possible implementation, for any frame code stream data, a frame code stream data can be determined in the undecoded unit data in the following manner: determining the starting position and offset position of the frame code stream data; and determining the frame code stream data in the undecoded unit data according to the starting position and the offset position.

[0104] In the preset memory, the starting position and offset position of the frame code stream data may be offset values ​​relative to the starting position of the preset memory.

[0105] S307 . Decode at least one frame stream data in sequence to obtain audio and video data.

[0106] After the frame code stream data is determined, the position information of the frame code stream data may be sent to the decoder, and the decoder performs a decoding operation on the frame code stream data in a preset memory according to the position information of the frame code stream data to obtain audio and video data.

[0107] After decoding is completed, the decoded unit data in the preset memory may be deleted; or the decoded unit data in the preset memory may not be deleted and the decoded unit data may be automatically overwritten when subsequent data is written.

[0108] exist Figure 3 In the illustrated embodiment, the electronic device obtains PES data; determines at least one start code, and determines the positions of multiple unit data in the PES data according to the at least one start code; determines multiple unit data in the PES data according to the positions of the multiple unit data; writes the multiple unit data into a preset memory; determines at least one frame code stream data in the undecoded unit data, and the frame code stream data includes at least one undecoded unit data; and sequentially performs decoding operations on at least one frame code stream data to obtain audio and video data. Not only can the memory write operation be performed in the preset memory, but decoding can also be performed directly in the preset memory without repeatedly copying the data, thereby improving the efficiency of data decoding and reducing the power consumption of the electronic device.

[0109] Based on any of the above embodiments, Figure 5 and Figure 6 This section explains how to use the preset memory.

[0110] Figure 5 The positions of each pointer in the preset memory during the write operation provided in the embodiment of the present application. Figure 5The preset memory includes 5 pointers, among which the start pointer points to the starting address of the preset memory, and the position pointed to by the start pointer will not change; the frame pointer points to the first byte of the unit data that has not been framed in the preset memory; the boundary pointer points to the position of the start code of the unit data that has not been framed in the preset memory, and the position of the boundary pointer is updated each time a complete unit data is written; the write pointer points to the position of the latest written data; the decoded consumed pointer points to the position of the decoded consumed data. Since the preset memory is used cyclically, the position of the decoded consumed pointer needs to be updated after the decoding is completed to avoid data overwriting caused by too fast offset of the write pointer.

[0111] It should be noted that Figure 5 The names of the various pointers are only exemplary and should not be used as a limitation on the protection scope of the present application. For example, the start pointer can also be called the first pointer.

[0112] Figure 6 This is a flowchart of the preset memory usage method provided in the embodiment of the present application. Figure 6 , including the following steps:

[0113] S601. When initially allocating memory, all pointers point to the starting position of the memory.

[0114] S602, writing the unit data into a preset memory.

[0115] S603, determine whether the first few bytes of the written unit data are the set start code (new start code starts).

[0116] If yes, execute S604.

[0117] If not, execute S605.

[0118] S604: Update the boundary pointer.

[0119] Point the boundary indicator to the location of the unit data start code

[0120] S605: Update the write pointer.

[0121] The position of the write pointer is updated to the position corresponding to the end of the latest written data.

[0122] S606: If the positions pointed to by the boundary pointer and the frame pointer are different, determine whether the boundary pointer points to a new frame.

[0123] If yes, execute S607.

[0124] If not, execute S608.

[0125] The encoding rules can be used to determine whether the boundary pointer points to the first byte of the new frame.

[0126] S607: Transmit the unit data between the position pointed to by the frame pointer and the position pointed to by the boundary pointer to the decoder.

[0127] When the boundary pointer points to a new frame, it means that the unit data between the position pointed to by the frame pointer and the position pointed to by the boundary pointer is the data corresponding to the frame code stream data.

[0128] Transmitting the unit data to the decoder may mean informing the decoder of the position of the unit data in the preset memory, rather than copying the unit data to the decoder, and the decoder decodes the unit data in the preset memory according to the position information.

[0129] After decoding, the decoded consumed pointer is updated to point to the end of the decoded consumed data.

[0130] S608: Update the frame pointer to point to the beginning of the new frame.

[0131] And continue to execute S602, so as to continuously write the unit data into the preset memory, and continuously decode the frame code stream data of the frame grouping in the preset memory through the decoder.

[0132] The following is a specific example to illustrate how to use the preset memory.

[0133] The data to be processed are two frame code stream data, namely the first frame code stream data and the second frame code stream data; the two frame code stream data each include 2 unit data, which are named as the first unit data, the second unit data, the third unit data and the fourth unit data in the writing order; wherein, the first unit data and the second unit data belong to the first frame code stream data, and the third unit data and the fourth unit data belong to the second frame code stream data; each unit data has 60 bytes, and the start code of each unit data occupies 4 bytes.

[0134] Initially, all pointers point to the starting position of the preset memory. When writing the frame code stream data to the preset memory, when writing the 10th byte of the first unit data, the frame pointer and boundary pointer both point to the position where the first byte of the first unit data is located, and the write pointer points to the position where the end of the 10th byte is located.

[0135] When writing the 4th byte of the second unit data, the frame pointer points to the position where the front end of the first byte of the first unit data is located, the boundary pointer is updated, and the boundary pointer points to the position where the front end of the first byte of the second unit data is located, and the write pointer is updated, and the write pointer points to the position where the end of the 4th byte of the second unit data is located. At this time, it can be determined according to the encoding rules whether the second unit data pointed to by the boundary pointer is the beginning of a new frame. If so, the position of the frame pointer and the position of the boundary pointer can be informed to the decoder, allowing the decoder to decode the unit data in the middle of the corresponding position and update the frame pointer. The frame pointer points to the position pointed to by the boundary pointer at this time; if not, there is no need to update the position of the frame pointer. Since the second unit data is not the beginning of a new frame, the position of the frame pointer remains unchanged.

[0136] When writing the 4th byte of the third unit data, the frame pointer points to the position where the front end of the first byte of the first unit data is located, the boundary pointer is updated, and the boundary pointer points to the position where the front end of the first byte of the third unit data is located, and the write pointer is updated, and the write pointer points to the position where the end of the 4th byte of the third unit data is located. At this time, it can be determined according to the encoding rules whether the third unit data pointed to by the boundary pointer is the beginning of a new frame. If so, the position pointed to by the frame pointer and the position pointed to by the boundary pointer can be informed to the decoder, and the decoder decodes the unit data in the middle of the corresponding position and updates the frame pointer. The frame pointer points to the position pointed to by the boundary pointer at this time; if not, there is no need to update the position of the frame pointer. Since the third unit data is the beginning of a new frame, the position pointed to by the frame pointer and the position pointed to by the boundary pointer can be informed to the decoder, and the decoder decodes the unit data in the middle of the corresponding position and updates the frame pointer. The frame pointer points to the position pointed to by the boundary pointer at this time.

[0137] When writing the 4th byte of the 4th unit data, the frame pointer points to the position where the front end of the first byte of the 3rd unit data is located, the boundary pointer is updated, and the boundary pointer points to the position where the front end of the 1st byte of the 4th unit data is located, and the write pointer is updated, and the write pointer points to the position where the end of the 4th byte of the 4th unit data is located. At this time, it can be determined according to the encoding rules whether the fourth unit data pointed to by the boundary pointer is the beginning of a new frame. If so, the position of the frame pointer and the position of the boundary pointer can be informed to the decoder, allowing the decoder to decode the unit data in the middle of the corresponding position and update the frame pointer. The frame pointer points to the position pointed to by the boundary pointer at this time; if not, there is no need to update the position of the frame pointer. Since the fourth unit data is not the beginning of a new frame, the position of the frame pointer remains unchanged.

[0138] For ease of understanding, the following Figure 7 Describes where the pointer is pointing.

[0139] Figure 7 A schematic diagram of the location pointed to by a pointer provided in an embodiment of the present application. Figure 7 When the "data decoding method" is stored in the memory, at this time, the position of the frame pointer is the position of the front end of the "number", and the position of the write pointer is the position of the end of the "method".

[0140] Figure 8 This is a schematic diagram of the structure of a data decoding device provided in an embodiment of the present application. Figure 8 The device 10 includes a determination module 11, a writing module 12 and a decoding module 13, wherein:

[0141] A determination module 11, used to determine a plurality of unit data according to the PES data;

[0142] A writing module 12, used to perform a memory writing operation on a plurality of unit data, wherein the memory writing operation is used to write the plurality of unit data into a preset memory;

[0143] The decoding module 13 is used to perform a decoding operation on the undecoded unit data in the preset memory in the preset memory to obtain audio and video data.

[0144] In a possible implementation, operations of the writing module 12 and the decoding module 13 are performed in parallel.

[0145] In a possible implementation manner, the decoding module 13 is specifically configured to:

[0146] Determine at least one frame code stream data in the undecoded unit data, the frame code stream data includes at least one undecoded unit data, and one frame code stream data corresponds to one audio and video frame data;

[0147] Decoding operations are performed on at least one frame code stream data in sequence to obtain audio and video data.

[0148] In a possible implementation manner, the decoding module 13 is specifically configured to:

[0149] Determine the starting position and offset position of the frame code stream data;

[0150] The frame code stream data is determined in the undecoded unit data according to the start position and the offset position.

[0151] In a possible implementation manner, the writing module 12 is specifically used for:

[0152] Determine the target memory in the preset memory;

[0153] Writes multiple cells of data to the target memory.

[0154] In a possible implementation manner, the writing module 12 is specifically used for:

[0155] Determine that the last byte of the undecoded unit data in the preset memory is the first position in the preset memory;

[0156] Determine that the last byte of the decoded unit data in the preset memory is at a second position in the preset memory;

[0157] A memory between the first location and the second location is determined as a target memory.

[0158] In a possible implementation manner, the preset memory is a memory with discrete physical addresses and continuous logical addresses, or the preset memory is a memory with continuous physical addresses and continuous logical addresses.

[0159] In a possible implementation manner, the determination module 11 is specifically configured to:

[0160] determining at least one start code;

[0161] determining at least one unit data location in the PES data based on at least one start code;

[0162] A plurality of unit data are determined in the PES data according to at least one unit data position.

[0163] Fig. 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig. 9 , the electronic device 20 may include: a transceiver 21, a memory 22, and a processor 23. The transceiver 21 may include: a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, a transmitter, a transmission port, a transmission interface, or similar descriptions, and the receiver may also be referred to as a receiver, a reception port, a reception interface, or similar descriptions. Exemplarily, the transceiver 21, the memory 22, and the processor 23 are interconnected via a bus 24.

[0164] The memory 22 is used to store program instructions;

[0165] The processor 23 is used to execute the program instructions stored in the memory, so as to enable the electronic device 20 to execute any of the above-mentioned data decoding methods.

[0166] The transceiver 21 is used to perform the transceiver function of the electronic device 20 in the data decoding method.

[0167] The electronic device 20 may be a chip, a module, an integrated development environment (IDE), etc.

[0168] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above-mentioned data decoding method.

[0169] An embodiment of the present application also provides a computer program product, which can be executed by a processor. When the computer program product is executed, any of the data decoding methods shown above can be implemented.

[0170] The data decoding device, electronic device, computer-readable storage medium and computer program product of the embodiments of the present application can execute the technical solutions shown in the above-mentioned data decoding method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.

[0171] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.

[0172] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0173] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0175] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data decoding method, It is characterized in that include: Determine a plurality of unit data according to the packaged elementary code stream PES data; Performing a memory write operation on the multiple unit data, and determining at least one frame code stream data in the undecoded unit data in the preset memory, the frame code stream data includes at least one undecoded unit data, and one frame code stream data corresponds to one audio and video frame data; sequentially performing a decoding operation on the at least one frame code stream data to obtain audio and video data; the memory write operation is used to write the multiple unit data into the preset memory; For any frame code stream data, determining a frame code stream data in the undecoded unit data includes: Determine that the unit data between the position pointed to by the frame pointer and the position pointed to by the boundary pointer is the data corresponding to a frame code stream data; wherein the frame pointer points to the first byte of the unit data that has not yet been framed in the preset memory; the boundary pointer points to the position of the start code of the unit data that has not yet been framed in the preset memory, and the position of the boundary pointer is updated each time a complete unit data is written.

2. The method according to claim 1, It is characterized in that Performing a memory write operation on the plurality of unit data, and performing a decoding operation on the undecoded unit data in the preset memory to obtain audio and video data, including: performing a memory write operation on the plurality of unit data through a first process, and, The audio and video data are obtained by performing a decoding operation on the undecoded unit data in the preset memory in the preset memory through a second process; wherein the first process and the second process are executed in parallel.

3. The method according to claim 1 or 2, It is characterized in that Writing the plurality of unit data into the preset memory comprises: Determining a target memory in the preset memory; The plurality of unit data are written into the target memory.

4. The method according to claim 3, It is characterized in that Determining a target memory in the preset memory includes: Determine that the last byte of the undecoded unit data in the preset memory is the first position in the preset memory; Determine a second position in the preset memory of the last byte of the decoded unit data; A memory between the first position and the second position is determined as the target memory.

5. The method according to claim 1, It is characterized in that The preset memory is a memory with discrete physical addresses and continuous logical addresses, or the preset memory is a memory with continuous physical addresses and continuous logical addresses.

6. The method according to claim 1 or 2, It is characterized in that Based on the PES data, multiple unit data are determined, including: determining at least one start code; determining at least one unit data location in the PES data based on the at least one start code; The plurality of unit data are determined in the PES data according to the at least one unit data position.

7. A data decoding device, It is characterized in that include: A determination module, used for determining a plurality of unit data according to the PES data; A writing module, used for performing a memory writing operation on the plurality of unit data, wherein the memory writing operation is used for writing the plurality of unit data into a preset memory; A decoding module, used to determine at least one frame code stream data from the undecoded unit data in a preset memory, wherein the frame code stream data includes at least one undecoded unit data, and one frame code stream data corresponds to one audio and video frame data; and sequentially perform decoding operations on the at least one frame code stream data to obtain audio and video data; For any frame code stream data, determining a frame code stream data in the undecoded unit data includes: Determine that the unit data between the position pointed to by the frame pointer and the position pointed to by the boundary pointer is the data corresponding to a frame code stream data; wherein the frame pointer points to the first byte of the unit data that has not yet been framed in the preset memory; the boundary pointer points to the position of the start code of the unit data that has not yet been framed in the preset memory, and the position of the boundary pointer is updated each time a complete unit data is written.

8. An electronic device, It is characterized in that include: Processor, memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

Citation Information

Patent Citations

  • Internal memory management method in audio / video decoding course

    CN101404764A

  • Memory buffer management mechanism supporting audio / video frame storage

    CN102243615A

  • Fast and stable mechanism for allocating contiguous memory

    CN107818054A

  • Audio and video code stream processing method and device and electronic equipment

    CN114339378A

  • Memory collaborative management system and method

    CN115269450A