Summary of the invention
The invention provides method and the device of a kind of decoding, coding audio/video data.For solving lower 64 programs of 64 bit manipulation systems and 32 program compatibility operations and enough ensureing the problem that data read errors rate is high, the embodiment of the present invention is achieved through the following technical solutions:
The decode method of audio, video data, the method comprises:
The first program is notified the second program initialization;
After the second program initialization completes, obtain frame data to be decoded and decode by the first program, depositing decoded frame data in first internal memory, and sending the first instruction;
The first program reads described decoded frame data by the first instruction to the first internal memory, and described the first instruction is emptied.
Wherein, the first described program notifies the second program initialization to be specially:
The first program in the first internal memory, notifies the second program to read needed decoded data Parameter storage;
The second program to the first internal memory reads described parameter and carries out initialization, and notifies the first program initialization to complete.
Wherein, the second described program is obtained frame data to be decoded by the first program and is specially:
After the information that the second program initialization completes, frame data to be decoded are write the first internal memory by the first program; Notify the second program to read; The second program to the first internal memory reads described frame data to be decoded.
Wherein, the second described program is obtained frame data to be decoded by the first program and is specially:
The first program is further stored in the first internal memory by the store path of data to be decoded;
The second program is obtained frame data to be decoded by described store path.
Wherein, the second described program is further stored to the first internal memory and the second internal memory by a decoded frame data circulation;
The second described program is stored to the second internal memory by decoded frame data and is specially:
The second described program continues to obtain frame data to be decoded and decodes after sending the first instruction, and deposits decoded frame data in second internal memory, and sends the second instruction;
The first program reads described decoded frame data by the second instruction to the second internal memory, and described the second instruction is emptied.
Corresponding to the method for decoding audio, video data provided by the invention, the present invention also provides a kind of method of coding audio/video data, and the method comprises:
The 3rd program is notified the 4th program initialization;
After the 4th program initialization completes, notify the 3rd program, frame data to be encoded are stored to the 3rd internal memory by the 3rd program, and send the 3rd instruction;
The 4th program reads described frame data to be encoded by the 3rd instruction and encodes, and the 3rd instruction is emptied.
Wherein, the 3rd described program notifies the 4th program initialization to be specially:
The 3rd program in the 3rd internal memory, notifies the 4th program to read needed coded data Parameter storage;
The 4th program to the three internal memories read described parameter and carry out initialization, and notify the 3rd program initialization to complete.
Wherein, the 3rd described program is further stored to the 3rd internal memory and the 4th internal memory by a frame data to be encoded circulation;
The 3rd described program is stored to the 4th internal memory by frame data to be decoded and is specially:
After the 4th described program initialization completes, the 3rd program is further stored to the 4th internal memory by frame data to be encoded, and sends the 4th instruction;
The 4th program reads described frame data to be encoded by the 4th instruction to the four internal memories and encodes, and the 4th instruction is emptied.
Corresponding to the method for decoding audio, video data provided by the invention, the present invention also provides a kind of device of the audio, video data of decoding, and described device comprises:
The first program unit, for notifying the second program initialization; The first instruction to the first internal memory sending by the second program unit reads described decoded frame data, and the first instruction is emptied.
The second program unit, by first program unit is obtained a frame to be decoded data and is decoded after completing for initialization, deposits decoded frame data in first internal storage location, and sends the first instruction;
The first internal storage location, for storing described frame data to be decoded and decoded frame data.
Wherein, the first described program unit comprises:
The first notification unit, for by needed decoded data Parameter storage in the first internal storage location, notify the second program unit to read;
The first control unit, reads described decoded frame data for the first instruction to the first internal storage location sending by the second program unit, and the first instruction is emptied;
The second described program unit specifically comprises:
The first initialization unit, for receiving the notice of the first program unit, reads described parameter to the first internal storage location and carries out initialization, notifies the first program unit initialization to complete;
The first decoding unit, by first program unit is obtained a frame to be decoded data and is decoded after completing for initialization, deposits decoded frame data in first internal storage location, and sends the first instruction;
The first internal storage location, for being further used for the described data parameters to be decoded of storage.
Wherein, the first control unit of described the first program unit specifically comprises:
First writes code element, after the information that reception the second program unit initialization completes, frame data to be decoded is write to the first internal storage location, notifies the second program unit to read described frame data to be decoded;
The first reading unit, reads described decoded frame data for the first instruction to the first internal storage location sending by the second program unit, and the first instruction is emptied;
The first decoding unit of described the second program unit specifically comprises:
The second reading unit, for receiving the described frame data notification to be decoded that reads, reads described frame data to be decoded to the first internal storage location and also decodes;
Second writes code element, for depositing decoded frame data in first internal storage location, and sends the first instruction.
Wherein, described first write code element and be further used for: the store path of data to be decoded is stored in to the first internal storage location;
The second described reading unit is further used for, and obtains frame data to be decoded by described store path.
Wherein, described device further comprises the second internal storage location;
Described second writes code element is further used for a decoded frame data circulation to be stored to the first internal storage location and the second internal storage location; Decoded frame data are stored to the second internal memory to be specially: after transmission the first instruction, continue to obtain frame data to be decoded and decode, depositing decoded frame data in second internal storage location, and send the second instruction;
The first described reading unit is further used for reading described decoded frame data by the second instruction to the second internal storage location, and described the second instruction is emptied;
The second described internal storage location is used for storing decoded frame data.
Corresponding to the method for coding audio/video data provided by the invention, the present invention also provides a kind of device of coding audio/video data, and described device comprises:
The 3rd program unit, for notifying the second program unit initialization, receives after initialization completes information frame data to be encoded is stored to the 3rd internal storage location, and send the 3rd instruction;
The 4th program unit, notifies three program unit after completing for initialization; Read described frame data to be encoded by the 3rd instruction and encode, and the 3rd instruction is emptied;
The 3rd internal storage location, for storing described frame data to be encoded.
Wherein, the 3rd described program unit specifically comprises:
The second notification unit, for by needed coded data Parameter storage in the 3rd internal storage location, notify the second program to read;
The second control unit, for frame data to be encoded are stored to the 3rd internal storage location, and sends the 3rd instruction;
The 4th described program unit specifically comprises:
The second initialization unit, for receiving the notice of the 3rd program unit, reads described parameter to the 3rd internal storage location and carries out initialization, notifies the 3rd program unit initialization to complete;
The second decoding unit, reads described frame data to be encoded by the 3rd instruction and encodes, and the 3rd instruction is emptied.
The 3rd memory cell, is further used for the needed parameter of memory encoding data.
Wherein, described device further comprises the 4th internal storage location;
The second described control unit is further used for a frame data to be encoded circulation to be stored to the 3rd internal storage location and the 4th internal storage location; One frame data to be decoded are stored to the 4th internal memory to be specially: receive after the second program unit initialization completes notice and further frame data to be encoded are stored to the 4th internal storage location, and send the 4th instruction;
The second described decoding unit, is further used for reading described frame data to be encoded by the 4th instruction to the four internal storage locations and encodes, and the 4th instruction is emptied.
The present invention controls reading out data by flag bit the first/bis-/tri-/tetra-instructions, only have to write when having decoded after frame data/after data to be encoded have write, just can send flag bit, corresponding also only can after flag, just go back to read the rear frame data of decoding or frame data to be encoded receiving, while so just having avoided reading out data, frame data do not write and caused the situation of reading out data mistake, and having solved the many problems of IO access times simultaneously.
Embodiment
The embodiment of the present invention provides method and the device of a kind of decoding, coding audio/video data, has effectively solved 64 programs and has ensured that with reaching of 32 programs of compatibility operation under 64 bit manipulation systems data read the problem that accuracy is low.
Embodiment 1, referring to Fig. 1, a kind of decoding audio, video data method is specially:
Step 10: the first program is notified the second program initialization;
Wherein step 10 concrete methods of realizing is:
Step 101, the first program in the first internal memory, notifies the second program to read needed decoded data Parameter storage;
Step 102: the second program to the first internal memory reads described parameter and carries out initialization, and notifies the first program initialization to complete.
Step 11: obtain frame data to be decoded and decode by the first program after the second program initialization completes, depositing decoded frame data in first internal memory, and sending the first instruction;
Wherein the concrete methods of realizing of step 11 is:
Step 111: the first program receives after the information that the second program initialization completes, and frame data to be decoded are write to the first internal memory, notifies the second program to read;
Step 112: the second program to the first internal memory reads described frame data to be decoded, and sends the first instruction;
Step 12: the first program reads described decoded frame data by the first instruction to the first internal memory, and described the first instruction is emptied.
Describe as an example of the data MP3 of needs decodings example below, referring to Fig. 2.For example the first program is 64 programs, and the second program is 32 programs.
Step 201:64 position program in the first internal memory, and sends the needed Parameter storage of mp3 file of decoding start and notifies 32 programs to read;
Step 202:32 position program reads the needed parameter of decoding MP3 to the first internal memory after receiving start, and carries out initialization, sends 64 program initializations of ready instruction notification and complete after initialization completes;
Step 203:64 position program receives after the information that completes of ready initialization that 32 programs send, and frame MP3 data are write to the first internal memory, sends decode and notifies 32 programs to read;
Step 204:32 position program to the first internal memory reads described frame MP3 data to be decoded decoding, deposits decoded frame data in first internal memory; Read rear transmission read1;
Step 205:64 position program reads described decoded frame MP3 data by the first instruction to the first internal memory, and read1 is emptied.
In above embodiment, the present invention is by flag bit the first instruction, namely read1 controls reading out data, only have when 32 programs and decoded after writing frame data and just sent afterwards flag bit read1,64 programs also only can receive that the internal memory that just goes back after flag read1 reads decoding frame data afterwards, while so just having avoided 64 programs to remove the first internal memory read data, also frame data are not decoded and caused the situation of reading out data mistake for 32, and solved the many problems of IO access times simultaneously.
Embodiment 2, referring to Fig. 3, a kind of decoding audio, video data method is specially:
Step 30: the first program is notified the second program initialization;
Wherein step 30 concrete methods of realizing is:
Step 301, the first program in the first internal memory, notifies the second program to read needed decoded data Parameter storage;
Step 302: the second program to the first internal memory reads described parameter and carries out initialization, and notifies the first program initialization to complete.
Step 31: obtain frame data to be decoded and decode by the first program after the second program initialization completes, depositing decoded frame data in first internal memory, and sending the first instruction;
Wherein the concrete methods of realizing of step 31 is:
Step 311: the first program is further stored in the first internal memory by the store path of data to be decoded;
Step 312: the second program is obtained frame data to be decoded and decoded by described store path, deposits decoded frame data the first internal memory in and sends the first instruction;
Step 32: the first program reads described decoded frame data by the first instruction to the first internal memory, and described the first instruction is emptied.
Embodiment 1 is similar to embodiment 2, and difference is that embodiment 2 obtains frame data to be decoded by file store path to be decoded.Embodiment 2 is also by flag bit the first instruction, namely read1 controls reading out data, only have when 32 programs decoded frame data and deposit the first internal memory in after just send afterwards flag bit read1,64 programs also only can receive that the internal memory that just goes back after flag read1 reads decoding frame data afterwards, while so just having avoided 64 programs to remove the first internal memory read data, also frame data do not decoded and caused the situation of reading out data mistake for 32, and having solved the too much problem of IO access times simultaneously.
Embodiment 3 referring to Fig. 4, has increased rear frame data to the first internal memory of the second program cycle storage decoding and the second internal memory on the basis of embodiment 1, and a kind of decoding audio, video data method is specially:
Step 40: the first program is notified the second program initialization;
Wherein step 40 concrete methods of realizing is:
Step 401, the first program in the first internal memory, notifies the second program to read needed data to be decoded Parameter storage;
Step 402: the second program to the first internal memory reads described parameter and carries out initialization, and notifies the first program initialization to complete.
Step 41: obtain frame data to be decoded and decode by the first program after the second program initialization completes, depositing decoded frame data in first internal memory, and sending the first instruction;
Wherein the concrete methods of realizing of step 41 is:
Step 411: the first program receives after the information that the second program initialization completes, and frame data to be decoded are write to the first internal memory, notifies the second program to read;
Step 412: the second program to the first internal memory reads described frame data to be decoded decoding, decoded frame data is stored to the first internal memory, and sends the first instruction;
Step 42: the first program reads described decoded frame data by the first instruction to the first internal memory, and described the first instruction is emptied;
Step 43: the second program continues decoding next frame data having decoded after frame data, and decoded data are stored to the second internal memory, sends the second instruction;
Step 44: the first program reads described decoded frame data by described the second instruction to the second internal memory, and the second instruction is emptied.
Above step 41 to 44 be circulation process, the first program cycle deposits frame data to be decoded in the first internal memory and the second internal memory, so corresponding the second program also reads and decodes with regard to accordingly to the first internal memory and the second internal memory, and deposits decoded frame data in corresponding the first internal memory and the second internal memory.
This embodiment further increased the process that datacycle is write to the first internal memory and the second internal memory on the basis of embodiment 1, so just improved program and write and the speed of reading out data, improved the efficiency of decoding.
3 processes that datacycle write to the first internal memory and the second internal memory that provide of enforcement also can, for embodiment 2, be not repeated at this.
Embodiment 4, the invention provides a kind of method of coding audio/video data referring to Fig. 5:
Step 50: the 3rd program is notified the 4th program initialization;
Wherein step 50 concrete methods of realizing is:
Step 501, the 3rd program in the 3rd internal memory, notifies the 4th program to read needed data to be decoded Parameter storage;
Step 502: the 4th program to the three internal memories read described parameter and carry out initialization, and notify the 3rd program initialization to complete;
Step 51: notify the 3rd program after the 4th program initialization completes, frame data to be encoded are stored to the 3rd internal memory by the 3rd program, and send the 3rd instruction;
Step 52: the 4th program reads described frame data to be encoded by the 3rd instruction and encodes, and the 3rd instruction is emptied.
Describe as an example of needs coded data MP3 example below, referring to Fig. 6.For example the 3rd program is 64 programs, and the 4th program is 32 programs.
Step 601:64 position program in the 3rd internal memory, and sends the needed Parameter storage of mp3 file of coding start and notifies 32 programs to read;
Step 602:32 position program reads the needed parameter of decoding MP3 to the 3rd internal memory after receiving start, and carries out initialization, sends 64 program initializations of ready instruction notification and complete after initialization completes;
Step 603:64 position program receives after the information that completes of ready initialization that 32 programs send, and frame MP3 data are write to the 3rd internal memory, sends read1 and notifies 32 programs to read;
Step 604:32 position program to the three internal memories read described frame MP3 data to be encoded and encode; After having encoded, read1 is emptied.
In above embodiment, the present invention is by flag bit the 3rd instruction, namely read1 controls reading out data, only have after 64 programs write frame data to be encoded and just send flag bit read1,32 programs also only can just can go internal memory to read frame data to be encoded receiving after flag read1 so, and while so just having avoided 32 programs to remove the first internal memory read data, 64 programs have not also write frame data to be decoded and cause the situation of reading out data mistake.
Corresponding to embodiment 3, on the basis of embodiment 4, the 3rd program can also further be stored to the 3rd internal memory and the 4th internal memory by a frame data to be encoded circulation, connects so step 53 and continues as:
Step 53: the 3rd program receives completing after notice of the 4th program transmission, further data to be encoded is stored to the 4th internal memory, and sends the 4th instruction;
Step 54: the 4th program reads described frame data to be encoded by the 4th instruction to the four internal memories and encodes, and the 4th instruction is emptied.
Decode and sent after the 3rd or the 4th instruction in the 4th program, can, further by a decoded frame data storage, facilitate more users to read.
Above step 52 is to 55 being processes of circulation, and the first program cycle deposits the first internal memory and the second internal memory in by frame data to be encoded, and so corresponding the second program also reads and encodes with regard to accordingly to the first internal memory and the second internal memory.Further improve program by such circulation and write and the speed of reading out data, and then improved the efficiency of decoding, and solved the too much problem of IO access times simultaneously.
Embodiment 5, referring to Fig. 7, the invention provides a kind of device of the audio, video data of decoding, and this device comprises:
The first program unit 70, for notifying the second program unit initialization; The first instruction to the first internal storage location sending by the second program unit reads described decoded frame data, and the first instruction is emptied.
The second program unit 71, by first program unit is obtained a frame to be decoded data and is decoded after completing for initialization, deposits decoded frame data in first internal storage location, and sends the first instruction;
The first internal storage location 72, for storing described frame data to be decoded and decoded frame data.
Wherein the first program unit 70 specifically comprises:
The first notification unit 700, for by needed decoded data Parameter storage in the first internal storage location, notify the second program to read;
The first control unit 701, reads described decoded frame data for the first instruction to the first internal storage location sending by the second program unit, and the first instruction is emptied;
Wherein the second program unit 71 specifically comprises:
The first initialization unit 710, for receiving the notice of the first program unit, reads described parameter to the first internal storage location and carries out initialization, notifies the first program unit initialization to complete;
The first decoding unit 711, by first program unit is obtained a frame to be decoded data and is decoded after completing for initialization, deposits decoded frame data in first internal storage location, and sends the first instruction;
The first internal storage location 72, is further used for the described data parameters to be decoded of storage.
Wherein the first control unit 701 of the first program unit 70 specifically comprises:
First writes code element 7010, after the information that reception the second program unit initialization completes, frame data to be decoded is write to the first internal storage location, notifies the second program unit to read described frame data to be decoded;
The first reading unit 7011, reads described decoded frame data for the first instruction to the first internal storage location sending by the second program unit, and the first instruction is emptied;
The first decoding unit 711 of the second program unit 71 specifically comprises:
The second reading unit 7110, for receiving the described frame data notification to be decoded that reads, reads described frame data to be decoded to the first internal storage location and also decodes;
Second writes code element 7111, for depositing decoded frame data in first internal storage location, and sends the first instruction.
The method that one frame data to be decoded are provided by the first program after the second program initialization providing corresponding to embodiment 2 completes, first of the present embodiment is write code element 7010 and is further used for the store path of data to be decoded to be stored in the first internal storage location;
The second described reading unit 7110 is further used for, and obtains frame data to be decoded by described store path.
The method of frame data to the first internal memory and the second internal memory after the second program cycle storage decoding providing corresponding to embodiment 3, the device of decoding audio, video data provided by the invention further comprises the second internal storage location 73;
Described second writes code element 7111 is further used for a decoded frame data circulation to be stored to the first internal storage location 72 and the second internal storage location 73;
Decoded frame data are stored to the second internal storage location 73 to be specially: after transmission the first instruction, continue to obtain frame data to be decoded and decode, depositing decoded frame data in second internal storage location 73, and send the second instruction;
The first described reading unit 7011 is further used for reading described decoded frame data by the second instruction to the second internal storage location, and described the second instruction is emptied;
The second described internal storage location 73 is for storing decoded frame data.
Embodiment 6, referring to Fig. 8, corresponding to embodiment 4, the invention provides a kind of device of coding audio/video data, and this device comprises:
The 3rd program unit 80, for notifying the 4th program unit 81 initialization, receives after initialization completes information frame data to be encoded is stored to the 3rd internal storage location 82, and send the 3rd instruction;
The 4th program unit 81, notifies three program unit 80 after completing for initialization; Read described frame data to be encoded by the 3rd instruction and encode, and the 3rd instruction is emptied;
The 3rd internal storage location 82, for storing described frame data to be encoded and the needed parameter of coded data.
Wherein the 3rd program unit 80 specifically comprises:
The second notification unit 800, for by needed data to be encoded Parameter storage in the 3rd internal storage location 82, notify the 4th program unit 81 to read;
The second control unit 801, for frame data to be encoded are stored to the 3rd internal storage location 82, and sends the 3rd instruction;
Wherein the 4th program unit 81 specifically comprises:
The second initialization unit 810, for receiving the notice of the 3rd program unit 80, reads described parameter to the 3rd internal storage location and carries out initialization, notifies the 3rd program unit 80 initialization to complete;
The second coding unit 811, reads described frame data to be encoded by the 3rd instruction and encodes, and the 3rd instruction is emptied.
The 3rd program providing corresponding to embodiment 4 can also further be stored to a frame data to be encoded circulation method of the 3rd internal memory and the 4th internal memory, and this device further comprises the 4th internal storage location 83;
The second described control unit 801 is further used for a frame data to be encoded circulation to be stored to the 3rd internal storage location 82 and the 4th internal storage location 83; One frame data to be encoded are stored to the 4th internal storage location to be specially: receive after the 4th program unit 81 initialization complete notice and further frame data to be encoded are stored to the 4th internal storage location 83, and send the 4th instruction;
The second described coding unit 811, is further used for reading described frame data to be encoded by the 4th instruction to the four internal storage locations 83 and encodes, and the 4th instruction is emptied.
To the present invention, a kind of method to decoding, coding audio/video data and device are described in detail above, for one of ordinary skill in the art, according to the thought of the embodiment of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.