A kind of video frequency decoding method and system of being used for
Technical field
The present invention relates to the multimedia video transmission technique field, refer in particular to a kind of video frequency decoding method and system of being used for.
Background technology
In application-specific integrated circuit (ASIC) (ASIC) solution of video decode, good hardware pipeline framework is the basis that guarantees chip cost and power consumption.Adopt hardware decoded ip (7170) in the vc0830 project now; Under normal working frequency (100Mhz-133Mhz), just support SD decoding at full speed; But in the process of carrying out the decoding of 720P definition, be subject to problems such as backend process and power consumption increase, the operating frequency of IP is difficult to improve a lot; Therefore can not carry out the full speed decoding, cause the shrink of chip functions.
Fig. 1 is the decoding process sketch map of prior art.Like Fig. 1, the source code flow of decoded data is stored in the data flow cache module 1 of external memory storage, and entropy decoder module 2 obtains data from this data flow cache module 1, data is resolved produce corresponding syntactic element.Afterwards, the residual error coefficient that 3 pairs of entropy decoder modules of counter-scanning module (SCD) 2 produce reorders, and the result of generation is sent to inverse transformation and inverse quantization module (IT/IQ) 4, carries out time-frequency and is converted to residual values.In addition; After carrying out movement velocity prediction and frame mode prediction; Through intraframe decoder module 5 and motion compensating module 6, the corresponding syntactic element that produces in conjunction with 2 decodings of entropy decoder module carries out in the frame and the interframe decoding, and the result of generation compares with the residual values of inverse transformation and inverse quantization module 4; Through removing the edge effect that blocking effect module 7 is removed between piece and the piece, obtain final result at last.
Handle above-mentioned the execution through entropy decoder module 2, counter-scanning module 3 and inverse transformation and inverse quantization module 4; Obtain in the computational process of residual values; Like Fig. 2, entropy decoder module 2 is stored in the decoded data of entropy in the buffer unit 8, must wait for the data that counter-scanning module 3 is extracted in this buffer unit 8; The residual error coefficient of those data reordered to be finished, and entropy decoder module 2 can carry out computing to follow-up data; Equally, be stored in the buffer unit 9, must wait for that inverse transformation and inverse quantization module 4 extract data in these buffer units 9 and carry out the time-frequency conversion and finish, the computing that can do to go on foot to follow-up data for counter-scanning module 3 data that finish that will reorder.
Therefore, in the decoded stream waterline of prior art, there is certain stand-by period on entropy decoder module 2 and the counter-scanning module 3, makes the disposal ability of decoding work be difficult to improve, can not carry out the full speed decoding, influence chip performance and cost.
Summary of the invention
The purpose of technical scheme of the present invention provides a kind of video frequency decoding method and system of being used for, and reduces in the prior art video decoding process, the stand-by period when carrying out data processing, reaches the purpose that improves the video decoding system disposal ability.
For realizing above-mentioned purpose, one aspect of the present invention provides a kind of video frequency decoding method that is used for, and said method comprises:
Step 1 is carried out the entropy decoding to first initial data, will carry out entropy decoding back data and be stored in first buffer unit, obtains the first entropy decoded data;
Step 2 is carried out the entropy decoding to second initial data, will carry out entropy decoding back data and be stored in second buffer unit, obtains the second entropy decoded data; When said second initial data being carried out the entropy decoding, extract the said first entropy decoded data, the residual error coefficient that the said first entropy decoded data is comprised reorders, and the result that will reorder is stored in the 3rd buffer unit, obtains the first counter-scanning data;
Step 3 is extracted the said first counter-scanning data, and the said first counter-scanning data are carried out time-frequency conversion, obtains and the first corresponding residual values of the said first entropy decoded data.
Preferably; Above-mentioned described method is in the said step 3, when the said first counter-scanning data are carried out time-frequency conversion; Also comprise: extract the said second entropy decoded data; The residual error coefficient that the said second entropy decoded data is comprised reorders, and the result that will reorder is stored in the 4th buffer unit, obtains the second counter-scanning data.
Preferably, also comprise after the above-mentioned described method, said step 3:
Step 4 is extracted the said second counter-scanning data, and the said second counter-scanning data are carried out time-frequency conversion, obtains and the second corresponding residual values of the said second entropy decoded data.
Preferably, above-mentioned described method also comprises after said step 2:
The 3rd initial data is carried out the entropy decoding, will carry out entropy decoding back data to said the 3rd initial data and be stored in said first buffer unit, regain the said first entropy decoded data.
Preferably, above-mentioned described method, said method also comprises:
The said first entropy decoded data is carried out decoding with interframe in the frame,, obtain first summarized information carrying out addition with the data result and said first residual values of interframe decoding in the frame;
Remove the macro block of said first summarized information and the edge effect between the macro block, obtain first decode value.
Preferably; Above-mentioned described method; Said first initial data and said second initial data are unit with the sub-macro block of n * n; The memory capacity of said first buffer unit and said second buffer unit is n * n * 16, and the memory capacity of said the 3rd buffer unit and said the 4th buffer unit is n * n * 13.
The present invention provides a kind of system that is used for video decode on the other hand, and said system comprises:
The entropy decoder module is used for first initial data is carried out the entropy decoding, will carry out entropy decoding back data and be stored in first buffer unit, obtains the first entropy decoded data; Afterwards, second initial data is carried out the entropy decoding, will carry out entropy decoding back data and be stored in second buffer unit, obtain the second entropy decoded data;
The counter-scanning module; Be used for said entropy decoder module said second initial data is carried out entropy decoding time; Extract the said first entropy decoded data; The residual error coefficient that the said first entropy decoded data is comprised reorders, and the result that will reorder is stored in the 3rd buffer unit, obtains the first counter-scanning data;
Inverse transformation and inverse quantization module are used to extract the said first counter-scanning data, and the said first counter-scanning data are carried out time-frequency conversion, obtain and the first corresponding residual values of the said first entropy decoded data.
Preferably, above-mentioned described system, said counter-scanning module also is used for:
When said inverse transformation and inverse quantization module are carried out time-frequency conversion to the said first counter-scanning data; Extract the said second entropy decoded data; The residual error coefficient that the said second entropy decoded data is comprised reorders; The result that will reorder is stored in the 4th buffer unit, obtains the second counter-scanning data.
Preferably, above-mentioned described system, said inverse transformation and inverse quantization module also are used for, and extract the said second counter-scanning data, and the said second counter-scanning data are carried out time-frequency conversion, obtain and the second corresponding residual values of the said second entropy decoded data.
Preferably, above-mentioned described system, said system also comprises:
With the interframe decoder module, be used for the said first entropy decoded data is carried out decoding with interframe in the frame in the frame;
The data summation module is used for obtaining first summarized information with carrying out addition with the data result and said first residual values of interframe decoding in the frame;
Remove the blocking effect module, be used to remove the edge effect between said first summarized information macro block and the macro block, obtain first decode value.
In the specific embodiment of the invention technique scheme at least one has following beneficial effect:
The said method and system of the specific embodiment of the invention; Through two buffer units are set between entropy decoder module and counter-scanning module; Two buffer units are set between counter-scanning module and inverse transformation and inverse quantization module, and the flow chart of data processing that will on entropy decoder module, counter-scanning module, inverse transformation and inverse quantization module, carry out is merged into pipeline processing mode, makes the counter-scanning module when carrying out data parsing; The entropy decoder module can carry out the entropy decoding operation simultaneously; And inverse transformation and inverse quantization module be when carrying out the time-frequency conversion to data, and the counter-scanning module can be carried out data parsing simultaneously, has therefore reduced entropy decoder module and the time of counter-scanning module when carrying out data processing; Shorten the time of video decode streamline, reached the purpose that improves the system decodes disposal ability.
In addition; Said entropy decoder module, counter-scanning module, inverse transformation and inverse quantization module are to handle for unit according to sub-macro block (like 4 * 4 sub-macro blocks in 264); Rather than the macro block base unit of employing prior art, therefore also reached the purpose of saving buffer memory capacity.
Description of drawings
Fig. 1 is the sketch map of prior art video decoding process;
Fig. 2 is in the prior art video decoding process, the workflow sketch map of entropy decoder module, counter-scanning module and inverse transformation and inverse quantization module;
Fig. 3 is the schematic flow sheet of the said method of the specific embodiment of the invention;
Fig. 4 is in the method for the invention, the structural representation between entropy decoder module, counter-scanning module, inverse transformation and the inverse quantization module;
Fig. 5 carries out the effect contrast figure of video decode and prior art video encoding/decoding method for adopting the method for the invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing and specific embodiment to describe the present invention below.
Said video frequency decoding method and the system of being used for of the specific embodiment of the invention; The source code flow data are being resolved, when calculating residual values, utilizing two buffer units to preserve the decoded data of entropy; Make the entropy decoder module alternately to preserve data at these two buffer units; The counter-scanning module is then alternately carried out dissection process to the data in two buffer units, has solved prior art owing to have only a buffer unit, and the counter-scanning module is when handling the data of this buffer unit; The entropy decoder module must be waited for; Make that entropy decoder module, counter-scanning module, inverse transformation and inverse quantization module can only work in series, the problem that finally causes the disposal ability of whole decode system to be difficult to improve, the method for the invention and system; Reduce the needed time of entropy decoder module deal with data, reached the purpose that improves the decode system disposal ability.
In addition more preferably; Also utilize two buffer units to preserve the data result of counter-scanning module parses; When inverse transformation and inverse quantization module data are carried out the time-frequency conversion; Reduce the stand-by period of counter-scanning module, constitute the pipeline organization of decoding processing between said entropy decoder module, counter-scanning module, said inverse transformation and the inverse quantization module, further reached the purpose that improves the decode system disposal ability.
Below will be used for video frequency decoding method and system is described in detail to the specific embodiment of the invention is said.
Fig. 3 is the schematic flow sheet of the said method of the specific embodiment of the invention; Said method is resolved through entropy decoder module 10, buffer unit 11 and 12, counter-scanning module (SCD) 20, buffer unit 21 and 22, inverse transformation and 30 pairs of original data streams of inverse quantization module (IT/IQ), obtains residual values.Consult Fig. 3, said method comprises:
Step S301, entropy decoder module 10 obtains source code flow;
Step S302, first initial data in 10 pairs of source code flows of entropy decoder module is carried out the entropy decoding, will carry out the decoded data of entropy and be stored in first buffer unit 11, obtains the first entropy decoded data;
Step S303, second initial data in 10 pairs of source code flows of entropy decoder module is carried out the entropy decoding, will carry out the decoded data of entropy and be stored in second buffer unit 12, obtains the second entropy decoded data;
Simultaneously; After first buffer unit 11 is preserved the first entropy decoded data; When 10 pairs second initial data of entropy decoder module are carried out the entropy decoding; Counter-scanning module 20 is extracted the said first entropy decoded data, and the residual error coefficient that the said first entropy decoded data is comprised reorders, and the result that will reorder is stored in the 3rd buffer unit 21;
S304, inverse transformation and inverse quantization module 30 are extracted the said first counter-scanning data from the 3rd buffer unit 21, and these first counter-scanning data are carried out time-frequency conversion, obtain first residual values corresponding with the first entropy decoded data;
Simultaneously; After 20 pairs of said first entropy decoded datas completion of counter-scanning module are reordered; Inverse transformation and inverse quantization module 30 are when carrying out time-frequency conversion to the first counter-scanning data, and counter-scanning module 20 is also extracted the said second entropy decoded data, the flow process that the residual error coefficient that the said second entropy decoded data is comprised reorders and handles; The result that will reorder is stored in the 4th buffer unit 22, obtains the second counter-scanning data;
Step S305, inverse transformation and inverse quantization module 30 are extracted the said second counter-scanning data from the 4th buffer unit 22, and the said second counter-scanning data are carried out time-frequency conversion, obtain and the second corresponding residual values of the said second entropy decoded data.
It will be appreciated by those skilled in the art that; Need handle a series of original data stream when said video decode is handled, so said entropy decoder module 10, counter-scanning module 20, inverse transformation and inverse quantization module 30 are carried out uninterruptedly when carrying out the data parsing processing.Therefore, after step S303 counter-scanning module 20 is extracted the said first entropy decoded data, said entropy decoder module 10 with the 3rd initial data as said first initial data; Again carry out said step S302; At step S304, after counter-scanning module 20 is extracted the said second entropy decoded data, and with the 4th initial data as said second initial data; Execution in step S303 is to continue to carry out data entropy decoding processing.
In addition, it will be understood by those skilled in the art that in video decoding process; Like Fig. 1, also need carry out motion-vector prediction and frame mode prediction, further to pass through motion compensating module and intraframe decoder module to the decoded data of entropy; Carry out the interior and interframe decoding of frame respectively, with carrying out addition, the acquisition summarized information with the data result of interframe decoding and the residual values of above-mentioned steps S301 to S305 acquisition in the frame; Further resolve this summarized information afterwards, finally obtain decode value through decoder module.
Adopt the said method of the specific embodiment of the invention; The example that is decoded as with 264; The base unit of operation is 4 * 4 sub-macro block between entropy decoder module 10, counter-scanning module 20, inverse transformation and the inverse quantization module 30; Wherein the data cached stream of first buffer unit and second buffer unit all is set to 4 * 4 * 16, and the data cached stream of the 3rd buffer unit and the 4th buffer unit is set to 4 * 4 * 13, like Fig. 4; In the method for the invention, the structural representation between entropy decoder module, counter-scanning module, inverse transformation and the inverse quantization module.If MPEG compatible 4; Operation can be that base unit is handled with 8 * 8 sub-macro block between entropy decoder module 10, counter-scanning module 20, inverse transformation and the inverse quantization module 30; Like this; The data cached stream of first buffer unit and second buffer unit can be set to 8 * 8 * 16, and the data cached stream of the 3rd buffer unit and the 4th buffer unit can be set to 8 * 8 * 13.
Fig. 5 carries out the effect contrast figure of video decode and prior art video encoding/decoding method for adopting the method for the invention.Like Fig. 5, adopt the method for the invention, the time that the brightness and the colourity of a macro block are calculated residual values respectively is t1, the total time that this macro block is decoded is t2; And the time of utilizing prior art that the brightness and the colourity of a macro block are calculated residual values is T1, and the total time that this macro block is decoded is T2.From the comparison diagram of Fig. 5, can find out; Owing to adopt the method for the invention to carry out the time t1 shortening that residual values is calculated, therefore t1 makes the length of the total streamline of decoding shorten greatly less than time T 1; T2 is less than T2; Reduce the stand-by period of decoding unit, reached and improved decoding work disposal ability, significantly improved the purpose of decoding performance.
The said method of the specific embodiment of the invention; Through above-mentioned process; Through two buffer units are set between entropy decoder module 10 and counter-scanning module 20; Between counter-scanning module 20 and inverse transformation and inverse quantization module 30, two buffer units are set, the flow chart of data processing that will on entropy decoder module 10, counter-scanning module 20, inverse transformation and inverse quantization module 30, carry out is merged into pipeline processing mode, makes counter-scanning module 20 when carrying out data parsing; Entropy decoder module 10 can carry out the entropy decoding operation simultaneously; And inverse transformation and 30 pairs of data of inverse quantization module are when carrying out the time-frequency conversion, and counter-scanning module 20 can be carried out data parsing simultaneously, has therefore reduced entropy decoder module 10 and the stand-by period of counter-scanning module 20 when carrying out data processing.
In addition; In the said method of the specific embodiment of the invention; Said entropy decoder module 10, counter-scanning module 20, inverse transformation and inverse quantization module 30 are to handle for unit according to sub-macro block (like 4 * 4 sub-macro blocks in 264); Rather than the macro block base unit of employing prior art, therefore also reached the purpose of saving buffer memory capacity, reducing cost.
The specific embodiment of the invention provides a kind of system that is used for video decode on the other hand, comprises like the said system of Fig. 3:
Entropy decoder module 10 is used for first initial data is carried out the entropy decoding, will carry out entropy decoding back data and be stored in first buffer unit 11, obtains the first entropy decoded data; Afterwards, second initial data is carried out the entropy decoding, will carry out entropy decoding back data and be stored in second buffer unit 12, obtain the second entropy decoded data;
Counter-scanning module 20; Be used for: when 10 pairs of said second initial data of said entropy decoder module are carried out the entropy decoding; Extract the said first entropy decoded data; The residual error coefficient that the said first entropy decoded data is comprised reorders, and the result that will reorder is stored in the 3rd buffer unit 21, obtains the first counter-scanning data;
Inverse transformation and inverse quantization module (IT/IQ) 30 is used for: extract the said first counter-scanning data, the said first counter-scanning data are carried out time-frequency conversion, obtain and the first corresponding residual values of the said first entropy decoded data.
And said counter-scanning module 20 also is used for: when said inverse transformation and 30 pairs of said first counter-scanning data of inverse quantization module are carried out time-frequency conversion; Extract the said second entropy decoded data; The residual error coefficient that the said second entropy decoded data is comprised reorders; The result that will reorder is stored in the 4th buffer unit 22, obtains the second counter-scanning data.
And said inverse transformation and inverse quantization module 30 also be used for, and extracts the said second counter-scanning data, and the said second counter-scanning data are carried out time-frequency conversion, obtains and the second corresponding residual values of the said second entropy decoded data.
It will be understood by those skilled in the art that said system also includes:
With the interframe decoder module, comprise motion compensation units and intraframe decoder unit in the frame, carry out respectively decoding with interframe in the frame;
The data summation module is used for obtaining summarized information with carrying out addition with the data result of interframe decoding and the residual values of acquisition in the frame;
Remove the blocking effect module, be used to remove the macro block of said first summarized information and the edge effect between the macro block, obtain decode value.
Through the said method and system of the specific embodiment of the invention; Solved prior art owing to have only a buffer unit; The counter-scanning module is when handling the data of this buffer unit; The entropy decoder module must wait for, makes the problem that the system decodes disposal ability is difficult to improve, and said entropy decoder module, counter-scanning module, inverse transformation and inverse quantization module are to be that unit handles according to sub-macro block simultaneously; Rather than the macro block base unit of employing prior art, therefore also reached the purpose of saving buffer memory capacity, reducing cost.。
The above only is a preferred implementation of the present invention; Should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; Can also make some improvement and retouching, these improvement and retouching also should be regarded as protection scope of the present invention.