CN102769753B - H264 encoder and coding method - Google Patents

H264 encoder and coding method Download PDF

Info

Publication number
CN102769753B
CN102769753B CN201210272224.9A CN201210272224A CN102769753B CN 102769753 B CN102769753 B CN 102769753B CN 201210272224 A CN201210272224 A CN 201210272224A CN 102769753 B CN102769753 B CN 102769753B
Authority
CN
China
Prior art keywords
data
frame
unit
prediction
reference data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210272224.9A
Other languages
Chinese (zh)
Other versions
CN102769753A (en
Inventor
郑宇驰
李�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omnivision Technologies Shanghai Co Ltd
Original Assignee
Omnivision Technologies Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omnivision Technologies Shanghai Co Ltd filed Critical Omnivision Technologies Shanghai Co Ltd
Priority to CN201210272224.9A priority Critical patent/CN102769753B/en
Publication of CN102769753A publication Critical patent/CN102769753A/en
Application granted granted Critical
Publication of CN102769753B publication Critical patent/CN102769753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides one H.264 encoder and coding method, when realizing inter prediction, by setting suitable search window and decoding to reference code stream, thus the reference data needed for acquisition current macro, involved memory space only comprises code stream for reference and part reference data, size is far smaller than the size of a two field picture, thus effectively reduces the memory space of H.264 reference frame needed for encoder; Simultaneously owing to not using chip external memory, cost and the system power dissipation of whole H.264 encoder are effectively reduced, and, because the readwrite performance stored in sheet generally will be much better than sheet external memory, so when carrying out large-size images coding, while guarantee picture quality, greatly can improve and store data throughput.

Description

H264 encoder and coding method
Technical field
The present invention relates to technical field of image processing, particularly relate to one H.264 encoder and coding method.
Background technology
H.264 standard is a kind of good digital video encoding and decoding standard that joint video team (JVT, JointVideoTeam) proposes, and its maximum advantage has very high data compression rate.Under the condition of equal picture quality, H.264 compression ratio can reach 2 times of MPEG-4, why can there is so high compression ratio, this is because H.264 contain a series of new feature, such as multi-frame-reference, change block size motion compensation, also have the compensation of high-precision sub-pel motion, block elimination effect filter etc.
According to standard regulation H.264, macro block (Macroblock or abbreviation MB) type mainly divides two large classes: (Intra) coding and interframe (Inter) coding in frame.Intraframe coding uses the adjacent data of current macro to give a forecast, and then deducts predicted value by current macro data, thus produces residual error data, and finally carry out follow-up coded treatment to this residual error, whole process does not need the data using other images.And interframe encode needs to utilize encoded reconstruction image to do prediction, namely in reconstruction image, the data block of mating most with current block is searched out, due to video image redundancy in time, inter prediction often can find the data of more mating current block than infra-frame prediction, which improves whole image compression performance.As can be seen here, use interframe encode can improve the compression performance of video image, but needing when doing inter prediction certain memory space to go to store some rebuilds image, or be called reference frame (referenceframe) image.According to H.264 standard, reference frame at least 1 frame, can be at most 16 frames, if the picture size of required coding comparatively large (such as VGA:640x480), so the memory space of this reference frame is still very considerable.
As shown in Figure 1, at present disclosed in H.264 encoder comprise following submodule:
CurrentFrame: input current image date;
ME/MC:MotionEstimation/MotionCompensation, namely realizes inter prediction;
ChooseIntraMode: by comparing Coding cost, selects best intra prediction mode;
IntraPrediction: according to the frame mode of the best, realize infra-frame prediction;
ModeDecision: come choice for use infra-frame prediction or inter prediction according to the size of Coding cost;
DCT/Q: realize the dct transform (i.e. integral discrete cosine transform) of forward and quantize;
EntropyEncoder: entropy code module;
IDCT/InvQ: realize reverse dct transform and inverse quantization;
Deblocking: filtering is carried out to image in order to reduce blocking effect;
Chip external memory: reference frame data 1 ~ 16ReferenceFrames that 1 ~ 16 frame is provided.
H.264 standard adopt integral discrete cosine transform (i.e. dct transform) and the dynamic range of the correlation that quantizes to come in removal of images signal and reduction Image Coding to reach the object of compression.In FIG, the residual error data Dn obtained by present frame, after the dct transform and quantification treatment of forward, enters entropy code module on the one hand and encodes, then provide the code stream (bitstream) after image compression; On the other hand, after entering reverse dct transform and inverse quantization, add predicted value, just obtain data reconstruction Fn', this data reconstruction can participate in the infra-frame prediction of present frame as adjacent block value, and they are written into chip external memory after loop Deblocking filtering, can as the reference data of the inter prediction of subsequent frame.
Although the H.264 encoder of prior art can realize inter prediction by using chip external memory, to the space of memory and the high request of data throughput when meeting the coding of large-size images, but on the other hand can greatly increase system cost and system power dissipation due to the very high data throughput of chip external memory, make this H.264 encoder can not meet the requirement of low power consuming devices.
Summary of the invention
The object of the present invention is to provide one H.264 encoder and coding method, while guarantee picture quality, the memory space of reference frame can be saved, improve data throughput, reduce system cost and system power dissipation.
For solving the problem, the present invention proposes one H.264 encoder, comprising:
Code-subsystem, for inputting the data of present image, carry out the infra-frame prediction of current macro or inter prediction to obtain the residual error data of described current macro, the code stream of described current macro is exported after dct transform and quantification and entropy code are carried out to described residual error data, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs;
Code stream cache module, for buffer memory with reference to code stream, described reference code stream is the code stream of reference frame image after coding;
Decoding sub-system, for carrying out entropy decoding and oppositely dct transform and inverse quantization to described reference code stream, obtains reference data required when described code-subsystem carries out inter prediction;
Reference data cache module for the reference data that decoding sub-system described in buffer memory obtains, and is reference data required in search window when described code-subsystem provides the inter prediction of current macro.
Further, described code-subsystem comprises:
Control unit, for inputting current macro data, and provides a macro block enabling signal and is distributed to other unit to notify that other unit starting macro blocks calculate accordingly;
Ask residual error unit, for carrying out infra-frame prediction or the inter prediction of current macro, obtain the residual error data of described current macro, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and required reference data is got out in described search window, this reference data obtains by decoding to reference code stream;
Forward dct transform and quantifying unit, for carrying out forward dct transform and quantification to described residual error data;
Entropy code unit, for carrying out entropy code by described to forward dct transform and the residual error data after quantizing, generates the code stream of described current macro;
Reverse dct transform and inverse quantization unit, for carrying out reverse dct transform and inverse quantization to forward dct transform and the residual error data after quantizing;
Reconfiguration unit, for being added the data after the infra-frame prediction of the residual error data after reverse dct transform and inverse quantization and described current macro or inter prediction, obtains reconstruct data, for the infra-frame prediction of next macro block provides reference data.
Further, residual error unit is asked to comprise described in:
Predictive mode selects module, for according to the size of Coding cost being current macro selection infra-frame prediction or inter-frame forecast mode;
Inter prediction module, under inter-frame forecast mode, is current macro setting search window, and from described reference data cache module, select the reference data of described search window needs, and carries out inter prediction according to described reference data to current macro;
Intra prediction mode selection module, for the reconstruct data obtained according to previously encoded macro block, selects the optimum frame inner estimation mode of current macro;
Intra-framed prediction module, for carrying out infra-frame prediction according to described optimum frame inner estimation mode and described reconstruct data to described current macro;
Multi-path choice module, for realizing the selection of the prediction data that predictive mode selects module, intra-framed prediction module and Inter prediction module to export.
Further, described decoding sub-system comprises:
Entropy decoding unit, for carrying out entropy decoding to described reference code stream;
Reverse dct transform and inverse quantization unit, carry out reverse dct transform and inverse quantization for the residual error coefficient exported described entropy decoding unit;
Intraprediction unit, carries out infra-frame prediction for the intra prediction mode exported according to described entropy decoding unit;
Reconfiguration unit, for being added the prediction data of the reverse dct transform of decoding sub-system and the residual error data of inverse quantization unit output and intraprediction unit output, obtains reconstruct data, as reference data required in search window during macro block inter prediction.
Further, the intraprediction unit of described decoding sub-system and the intra-framed prediction module of described code-subsystem are multiplexing same intra predictor generator or two independently intra predictor generator.
Further, the reverse dct transform of described decoding sub-system and the reverse dct transform of inverse quantization unit and described code-subsystem and inverse quantization unit are multiplexing same reverse dct transform/inverse DCT or two independently reverse dct transform/inverse DCT.
Further, described decoding sub-system also comprises: filter unit, and the reference data for obtaining at described decoding sub-system carries out filtering to described reference data before being cached to described reference data cache module.
Further, described reference data cache module is circulating memory, be provided with the memory space of certain macroblock number, when the reference data that decoding sub-system described in buffer memory obtains, the reference data of current acquisition covers in described circulating memory the reference data that can not re-use when carrying out inter prediction.
Further, the computing formula of the macroblock number S of described reference data cache module storage is:
S=Ceil(sw_height_by_pix/16)*pic_width_by_mb-(pic_width_by_mb-Ceil(sw_width_by_pix/16))+1
Wherein, Ceil (x) represents the smallest positive integral being more than or equal to x;
Sw_height_by_pix is the height of the search window represented in units of pixel;
Sw_width_by_pix is the width of the search window represented in units of pixel;
Pic_width_by_mb is the width of the image represented in units of macro block.
Further, the described reference data of described reference data cache module buffer memory also comprises the data of P frame, and the data of described P frame are obtained for reference data coding and by described decoding sub-system decoding with an I frame by code-subsystem.
Further, during the follow-up P frame coding of described code-subsystem to the present image of input, with the I frame data in described reference data cache module or P frame data for reference data.
Further, described decoding sub-system comprises the I frame decoding system of the P frame decoding system of the reference data for providing described P frame type and the reference data of described I frame type.
Further, described I frame decoding system comprises:
First entropy decoding unit, for carrying out entropy decoding to described with reference to the I frame reference code stream in code stream;
First reverse dct transform and inverse quantization unit, carries out reverse dct transform and inverse quantization for the residual error coefficient exported described first entropy decoding unit;
First intraprediction unit, carries out infra-frame prediction for the intra prediction mode exported according to described first entropy decoding unit;
First reconfiguration unit, prediction data for exporting residual error data and first intraprediction unit of the described first reverse dct transform and inverse quantization unit output is added, obtain the reconstruct data of described I frame with reference to code stream, for reference data required in its search window when the decoding of P frame with reference to code stream or the inter prediction as current macro;
First filter unit, for carrying out filtering to the reference data of the first reconfiguration unit.
Further, described P frame decoding system comprises:
Second entropy decoding unit, for carrying out entropy decoding to described with reference to the P frame reference code stream in code stream;
Second reverse dct transform and inverse quantization unit, for carrying out reverse dct transform and inverse quantization to the residual error coefficient of described second entropy decoding unit;
Second intraprediction unit, carries out infra-frame prediction for the intra prediction mode exported according to described second entropy decoding unit;
Second inter prediction unit, carries out inter prediction for the motion vector exported according to reconstruct data and the described second entropy decoding unit of the first described reconfiguration unit;
Second reconfiguration unit, for being added the residual error data of the described second reverse dct transform and inverse quantization unit output and the prediction data of the second intraprediction unit or the output of the second inter prediction unit, obtain described P frame with reference to the reconstruct data of code stream, reference data required in its search window during inter prediction for described current macro;
Second filter unit, for carrying out filtering to the reference data of the second reconfiguration unit.
Accordingly, the present invention also provides a kind of coding method H.264, comprises the following steps:
(1) judge that current macro is the need of carrying out inter prediction, if do not need inter prediction, then encodes to current macro, and proceed to step (4), if need inter prediction, then enter next step;
(2) be current macro setting search window, judge whether the reference data in search window is ready to, if so, then according to reference data, current macro is encoded, proceed to step (4), if not, then enter next step;
(3) reference code stream is decoded, obtain the reference data of a macro block, return step (2);
(4) judge whether to terminate coding, if do not terminated, then process next macro block and return step (1).
Further, described reference data is the reference data of I frame type.
Further, described reference data comprises the reference data of P frame type, the reference data of described P frame type be with the reference frame data of I frame type for reference to encoding, decoding obtains.
Further, in step (1), when not needing inter prediction, the process that current macro is encoded is comprised:
Carry out the infra-frame prediction of current macro according to the reference data obtained after previous encoded reconstructing macroblocks process, obtain intra prediction value, then deduct this predicted value by current macro data, obtain the residual error data of described current macro;
Forward dct transform and quantification are carried out to described current macro residual error data;
By described, entropy code is carried out to forward dct transform and the residual error data after quantizing, generate the code stream of described current macro and buffer memory;
Reverse dct transform and inverse quantization are carried out to forward dct transform and the residual error data after quantizing;
The prediction data of the residual error data after reverse dct transform and inverse quantization and described optimum prediction mode is reconstructed, obtains the reference data of the infra-frame prediction for next macro block.
Further, in step (2), the process preparing the reference data of current macro in search window comprises:
Entropy decoding is carried out to the reference code stream of buffer memory;
The residual error coefficient obtained being decoded by entropy carries out reverse dct transform and inverse quantization;
Infra-frame prediction is carried out according to the intra prediction mode that entropy decoding exports;
Residual error data after reverse dct transform and inverse quantization and the prediction data after infra-frame prediction are reconstructed, the reference data needed in search window when obtaining the inter prediction of current macro buffer memory.
Further, in step (2), after the reference data in search window is ready to, according to reference data, the process that current macro is encoded is comprised:
The inter prediction of current macro is carried out according to described reference data, by comparing the Coding cost of infra-frame prediction and inter prediction, select the less predictive mode of Coding cost to export as the optimum prediction mode of current macro, and obtain the residual error data of described current macro;
Forward dct transform and quantification are carried out to described current macro residual error data;
By described, entropy code is carried out to forward dct transform and the residual error data after quantizing, generate the code stream of described current macro and buffer memory;
Reverse dct transform and inverse quantization are carried out to forward dct transform and the residual error data after quantizing;
The prediction data of the residual error data after reverse dct transform and inverse quantization and described optimum prediction mode is reconstructed, obtains the reference data of the infra-frame prediction for next macro block.
Compared with prior art, the H.264 encoder that theres is provided of the present invention and coding method, when realizing inter prediction, the reference data needed for current macro is obtained by setting search window, the memory space related to only comprises reference code stream and the part reference data of storage, size is far smaller than the size of a two field picture, thus effectively reduces the memory space of H.264 reference frame needed for encoder; Simultaneously owing to not using chip external memory, cost and the system power dissipation of whole H.264 encoder are effectively reduced, and, because the readwrite performance stored in sheet generally will be much better than sheet external memory, so when carrying out large-size images coding, while guarantee picture quality, greatly can improve and store data throughput.
Accompanying drawing explanation
Fig. 1 is the structural representation of a kind of H.264 encoder of prior art;
Fig. 2 is the structural representation of H.264 encoder of the present invention;
Fig. 3 is the coding work simple process figure of H.264 encoder of the present invention;
Fig. 4 is the structural representation of the H.264 encoder of the embodiment of the present invention one;
Fig. 5 is coded sequence and the referring-to relation schematic diagram of the H.264 encoder of the embodiment of the present invention one;
Fig. 6 is the corresponding search window position schematic diagram of macro block of the H.264 encoder of the embodiment of the present invention one;
Fig. 7 is the macro block corresponding relation schematic diagram of the coding/decoding subsystem of the H.264 encoder of the embodiment of the present invention one;
Fig. 8 is the structural representation of the H.264 encoder of the embodiment of the present invention two;
Fig. 9 is the macro block corresponding relation schematic diagram of the coding/decoding subsystem of the H.264 encoder of the embodiment of the present invention two;
Figure 10 is the structural representation of the H.264 encoder of the embodiment of the present invention three;
Figure 11 is coded sequence and the referring-to relation schematic diagram of the H.264 encoder of the embodiment of the present invention three;
Figure 12 is the macro block corresponding relation schematic diagram of the coding/decoding subsystem of the H.264 encoder of the embodiment of the present invention three.
Embodiment
Because inter prediction macro block is divided into predicted macroblock and bidirectional interframe predictive macro block between forward frame, so the frame type that existence three kinds is main in the h .264 standard: I frame, P frame and B frame.Wherein all macro blocks of I frame are all infra-frame predictions, and P frame contains predicted macroblock and infra-frame prediction macro block between forward frame, and B frame then contains bidirectional interframe predictive macro block and infra-frame prediction macro block.Certainly, realize P frame and B frame coding need reference frame, I frame does not then need.
Therefore, the H.264 encoder that the present invention proposes and coding method, mainly comprise the following aspects:
Code stream (bitstream) after storage of reference frames coding, namely with reference to code stream;
During inter prediction, set a certain size search window (searchwindow), search optimum Match blocks of data all carries out in search window;
By decoding to reference code stream, obtaining the search window data needed for current macro, and storing these data;
Consider the independence that reference code stream is decoded, so have at least a frame to be I frame with reference in code stream.
Therefore, please refer to Fig. 2, H.264 encoder provided by the invention, mainly comprise following four parts:
Code-subsystem 10, for inputting the data of present image, carry out the infra-frame prediction of current macro or inter prediction to obtain the residual error data of described current macro, the code stream of described current macro is exported after dct transform and quantification and entropy code are carried out to described residual error data, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs;
Code stream cache module 20, for buffer memory with reference to code stream, described reference code stream is the code stream of reference frame image after coding, if namely present frame can be used to the reference frame of subsequent frame, so the code stream of all macro blocks of present frame can be saved always, until this frame is cancelled as the attribute with reference to frame; If present frame is not used to the reference frame of subsequent frame, so the code stream of current macro is after being sent coded system, and such as write SD card, these code streams can be covered by follow-up bit stream data;
Decoding sub-system 30, for carrying out entropy decoding and oppositely dct transform and inverse quantization, reference data required in search window when obtaining the inter prediction of current macro to described reference code stream;
Reference data cache module 40 for the reference data that decoding sub-system described in buffer memory obtains, and is reference data required in search window when described code-subsystem provides the inter prediction of current macro.
Please refer to Fig. 3, the coding/decoding process of H.264 encoder provided by the invention all with macro block (MB) for unit carries out, and while current MB is encoded, decoding sub-system also can work simultaneously, be that next macro block prepares reference data in advance, effectively can improve the coding rate of whole system.Current macro realize inter prediction time, the search window of setting current macro, and in described search window, get out the reference data of needs, if the reference data of preparation, then call decoding sub-system 30, according to the raster scan order of macro block, reference code stream is decoded further, obtain the reference data described in current macro inter prediction.
The H.264 encoder proposed the present invention below in conjunction with the drawings and specific embodiments and coding method are described in further detail.
Embodiment one
Please refer to Fig. 4, the present embodiment provides one H.264 encoder, comprises following four parts:
Code-subsystem 10, for inputting the data of present image, carry out the infra-frame prediction of current macro or inter prediction to obtain the residual error data of described current macro, the code stream of described current macro is exported after dct transform and quantification and entropy code are carried out to described residual error data, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs;
Code stream cache module BitstreamBuffer20, for buffer memory with reference to code stream, described reference code stream is the code stream of reference frame image after coding;
Decoding sub-system 30, for decoding to described reference code stream and oppositely dct transform and inverse quantization, reference data required in search window when obtaining the inter prediction of current macro;
Reference data cache module ReferenceData40 for the reference data that decoding sub-system described in buffer memory obtains, and is reference data required in search window when described code-subsystem provides the inter prediction of current macro.
Please continue to refer to Fig. 4, in the present embodiment, code-subsystem 10 comprises following subelement:
Control unit CurrentFrame101, for inputting current macro data, and provides a macro block enabling signal and is distributed to other unit to notify that other unit starting macro blocks calculate accordingly;
Ask residual error unit, for carrying out infra-frame prediction or the inter prediction of current macro, obtain the residual error data of described current macro, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs, this reference data obtains by decoding to reference code stream;
Forward dct transform and quantifying unit DCT/Q103, for carrying out forward dct transform and quantification to described residual error data;
Entropy code unit EntropyEncoder104, for carrying out entropy code by described to forward dct transform and the residual error data after quantizing, generates the code stream of described current macro;
Reverse dct transform and inverse quantization unit IDCT/InvQ105, for carrying out reverse dct transform and inverse quantization to forward dct transform and the residual error data after quantizing;
Reconfiguration unit 106, for being added the data after the infra-frame prediction of the residual error data after reverse dct transform and inverse quantization and described current macro or inter prediction, obtains reconstruct data, for the infra-frame prediction of next macro block provides reference data.
Please continue to refer to Fig. 4, in the present embodiment, described in ask residual error unit to comprise following submodule:
Predictive mode selects module ModeDecision102a, for according to the size of Coding cost being current macro selection infra-frame prediction or inter-frame forecast mode;
Inter prediction module ME/MC(MotionEstimation/MotionCompensation) 102b, for under inter-frame forecast mode, for current macro setting search window, and from described reference data cache module, select the reference data of described search window needs, and according to described reference data, inter prediction is carried out to current macro;
Infra-frame prediction selects module ChooseIntraMode102c, for the reconstruct data obtained according to previously encoded macro block, the predictive mode selecting Coding cost minimum by the Coding cost of more each intra prediction mode is as the optimum frame inner estimation mode of current macro;
Intra-framed prediction module IntraPrediction102d, for carrying out infra-frame prediction according to described optimum frame inner estimation mode and described reconstruct data to described current macro;
Multi-path choice module MUX102e, for realizing the selection of the prediction data that predictive mode selects module 102a, Inter prediction module 102b and intra-framed prediction module 102d to export;
Computing module 102f, for the input data of current macro and infra-frame prediction or inter prediction data being subtracted each other, obtains the residual error data of current macro.
Please continue to refer to Fig. 4, in the present embodiment, described decoding sub-system 30 comprises following subelement:
Entropy decoding unit EntropyDecoder301, for carrying out entropy decoding to described reference code stream;
Reverse dct transform and inverse quantization unit IDCT/InvQ302, carry out reverse dct transform and inverse quantization for the residual error coefficient exported described entropy decoding unit;
Intraprediction unit IntraPrediction303, for carrying out infra-frame prediction according to the described intra prediction mode of entropy decoding unit output and the reconstruct data of previous decoded macro block;
Reconfiguration unit 304, prediction data for exporting residual error data and the intraprediction unit 303 of reverse dct transform and inverse quantization unit 302 output is added, obtain reconstruct data, reference data required in its search window when this reconstruct data is the inter prediction of current macro.
In the present embodiment, intraprediction unit 303 and the described intra-framed prediction module 102d of residual error unit that asks of described decoding sub-system 30 are two independently intra predictor generators; The reverse dct transform of the reverse dct transform of described decoding sub-system 30 and inverse quantization unit 302 and described code-subsystem 10 and inverse quantization unit 105 are two independently reverse dct transform/inverse DCTs.
In the present embodiment, described decoding sub-system 30 also comprises: filter unit Deblocking305, reference data for obtaining at described reconfiguration unit 304 carries out filtering to described reference data, to reduce blocking effect before being cached to described reference data cache module.In other embodiments of the invention, also Deblocking305 can be saved.
In the present embodiment, BitstreamBuffer20 and ReferenceData40 is preferably SRAM.Wherein, the size of BitstreamBuffer20 is correlated with coded image size and the quantization parameter selected.In addition, if will realize B frame coding, so necessary first buffer memory current image date, next frame Image Coding is encoded after completing again by the time, which increases the memory space of coded system.Therefore, in order to reduce memory space and reduce coded system cost, the H.264 encoder of the present embodiment is more suitable for I frame and P frame coding.
In the present embodiment, described reference data cache module ReferenceData40 is a circulating memory (cyclicbuffer), be provided with the memory space of certain macroblock number, when the reference data that decoding sub-system described in buffer memory obtains, the reference data of current acquisition will cover the reference data that can not be used to inter prediction in described circulating memory again, and newly-generated data of that is decoding can cover " old " data; The primitive stored as ReferenceData40 is a macro block, and the macroblock number S that so its minimum needs stores can represent with formula below:
S=Ceil(sw_height_by_pix/16)*pic_width_by_mb-(pic_width_by_mb-Ceil(sw_width_by_pix/16))+1
Wherein, Ceil (x) represents the smallest positive integral being more than or equal to x;
Sw_height_by_pix is the height of the search window represented in units of pixel;
Sw_width_by_pix is the width of the search window represented in units of pixel;
Pic_width_by_mb is the width of the image represented in units of macro block.
Illustrate the concrete operation method based on the H.264 encoder shown in Fig. 4 below, suppose that the picture size needing coding is 640x480, picture format is Y: Cb:Cr=4:2:0, and the size of search window is 592x48.First, can obtain the memory space of ReferenceData40 minimum according to the formula of above-mentioned macroblock number is 118 macro blocks, but in order to read and write the convenience of addressing, setting this storage size is 120 macro blocks, i.e. three complete macro block bars (MB-line), namely 45Kbyte; In addition, the I frame code stream size of a VGA image generally can control within 25Kbyte.To sum up, in order to realize the P frame coding of VGA image, traditional H.264 encoder at least needs storage reference picture, i.e. the memory space of 450Kbyte, and uses the coding method of the H.264 encoder of the present embodiment, then only need the memory space of 70Kbyte.Detailed process is shown in Fig. 5, Fig. 6, Fig. 7.
Fig. 5 is the H.264 encoder picture coding order of the present embodiment and the referring-to relation between them.What deserves to be explained is, P frame can not be limited only with reference to nearest I frame above, if P-24 frame I-0 frame makes reference in such as figure, so must ensure that the code stream of I-0 frame is also stored in BitstreamBuffer20, and not cover by the code stream of I-22 frame, the cost certainly paid just is the increase in memory space; In addition, the P frame number between two I frames is also can be arbitrary.
Fig. 6 describes the moving process of search window position.In figure, dotted line frame is the search window of P frame first macro block (i.e. MB0), along with coded macroblocks according to raster scan (rasterscan) sequentially, the so position of search window also corresponding change, in figure, another dotted line frame is the search window of MB59 in P frame.Although the size of search window can free setting, but in actual applications, the sheet memory space that coded system has is fixing, the maximum of search window so the formula of the macroblock number that can store according to above-mentioned ReferenceData40 is retrodicted out.
Fig. 7 is coding/decoding subsystem respective start-up time and their relativeness.Decoding sub-system can be started working in advance, decodes according to the macro block of order to reference frame of raster scan (rasterscan), for current P frame prepares reference data.When P frame first macro block search window needed for reference data be all ready to after, code-subsystem is started working, and following coding/decoding carries out simultaneously.When decoding sub-system proceeds to MB120, in ReferenceData40, the memory space of reference data has been filled with, at this time the decoded data of MB120 will be covered the space of originally depositing MB0 data, because the data of MB0 are used as reference data never again, namely so-called circulation stores.Finally, decoding sub-system can terminate in advance, if subsequent frame remains a P frame, so decoding sub-system can be decoded to reference frame again.
It should be noted that, if the coding efficiency of the H.264 encoder of the present embodiment will be promoted, can search window be strengthened on the one hand; A few frame can be stored on the other hand with reference to code stream more, form multi-frame-reference.These 2 is all that certain cost is just the increase in sheet memory space in order to find the reference data of more mating current macro, as long as memory space used is less than traditional implementation, it is exactly significant for doing so like this.
Embodiment two
For the hardware implementing of H.264 encoder, usually need from the viewpoint of following four: 1). hard-wired area; 2). the highest frequency of work clock; 3). coding rate, namely processes the clock cycle (cycles) needed for each macro block; 4). coding efficiency, the code stream namely generated under identical picture quality is the smaller the better.And these aspects are interactional, such as, to reduce area used, a part of logical block will be shared or reduce memory space, and so will reduce coding rate or coding efficiency; If improve maximum functional clock frequency, so generally will area increased; If promote coding efficiency, generally can strengthen computation complexity and memory space, so that predicted value can mate current macro data more, turn increase area like this.
Hard-wired four factors based on above-mentioned H.264 encoder are considered, the present embodiment provides a kind of H.264 encoder relatively can saving area, code-subsystem wherein and decoding sub-system can multiplexing part same logical block, the such as functional module of multiplexing reverse DCT/ inverse quantization and infra-frame prediction, please refer to Fig. 8, concrete structure comprises:
Code-subsystem 10, for inputting the data of present image, carry out the infra-frame prediction of current macro or inter prediction to obtain the residual error data of described current macro, the code stream of described current macro is exported after dct transform and quantification and entropy code are carried out to described residual error data, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs;
Code stream cache module BitstreamBuffer20, for buffer memory with reference to code stream, described reference code stream is the code stream after reference frame image coding, if namely present frame can be used to the reference frame of subsequent frame, so the code stream of all macro blocks of present frame can be saved always, until this frame is cancelled as the attribute with reference to frame; If present frame is not used to the reference frame of subsequent frame, so the code stream of current macro is after being sent coded system, and such as write SD card, these code streams can be covered by follow-up bit stream data;
Decoding sub-system 30, for carrying out entropy decoding and oppositely dct transform and inverse quantization, reference data required in search window when obtaining the inter prediction of current macro to reference code stream;
Reference data cache module ReferenceData40 for the reference data that decoding sub-system described in buffer memory obtains, and is reference data required in search window when described code-subsystem provides the inter prediction of current macro.
Please continue to refer to Fig. 8, in the present embodiment, code-subsystem 10 comprises following subelement:
Control unit CurrentFrame101, for inputting current macro data, and provides a macro block enabling signal and is distributed to other unit to notify that other unit starting macro blocks calculate accordingly;
Ask residual error unit, for carrying out infra-frame prediction or the inter prediction of current macro, obtain the residual error data of described current macro, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs, this reference data obtains by decoding to reference code stream;
Forward dct transform and quantifying unit DCT/Q103, for carrying out forward dct transform and quantification to described residual error data;
Entropy code unit EntropyEncoder104, for carrying out entropy code by described to forward dct transform and the residual error data after quantizing, generates the code stream of described current macro;
Reverse dct transform and inverse quantization unit IDCT/InvQ105, for carrying out reverse dct transform and inverse quantization to forward dct transform and the residual error data after quantizing;
Reconfiguration unit 106, for being added the prediction data after the infra-frame prediction of the residual error data Dn after reverse dct transform and inverse quantization and described current macro or inter prediction, obtains reconstruct data, for the infra-frame prediction of next macro block provides reference data.
Please continue to refer to Fig. 8, in the present embodiment, described in ask residual error unit to comprise following submodule:
Predictive mode selects module ModeDecision102a, for according to the size of Coding cost being current macro selection infra-frame prediction or inter-frame forecast mode;
Inter prediction module ME/MC(MotionEstimation/MotionCompensation) 102b, for under inter-frame forecast mode, for current macro setting search window, and from described reference data cache module, select the reference data of described search window needs, and according to described reference data, inter prediction is carried out to current macro;
Infra-frame prediction selects module ChooseIntraMode102c, for the reconstruct data obtained according to previously encoded macro block, by the Coding cost of more each intra prediction mode, selects the optimum frame inner estimation mode of current macro;
Intra-framed prediction module IntraPrediction102d, for carrying out infra-frame prediction according to described optimum frame inner estimation mode and described reconstruct data to described current macro;
Multi-path choice module MUX102e, for realizing the selection of the prediction data that predictive mode selects module 102a, Inter prediction module 102b and intra-framed prediction module 102d to export;
Computing module 102f, for the input data of current macro and infra-frame prediction or inter prediction data being subtracted each other, obtains the residual error data of current macro.
Please continue to refer to Fig. 8, in the present embodiment, described decoding sub-system 30 comprises following subelement:
Entropy decoding unit EntropyDecoder301, for carrying out entropy decoding to described reference code stream;
Reverse dct transform and inverse quantization unit IDCT/InvQ105, namely the reverse dct transform of described code-subsystem 10 and inverse quantization unit 105 carry out reverse dct transform and inverse quantization for the residual error coefficient exported described entropy decoding unit;
Intraprediction unit IntraPrediction102d, asks the intra-framed prediction module 102d of residual error unit namely, for carrying out infra-frame prediction according to the described intra prediction mode of entropy decoding unit 301 output and the reconstruct data of previous decoded macro block;
Reconfiguration unit 304, be added for the prediction data after the residual error data that exports reverse dct transform and inverse quantization unit 105 and intra-framed prediction module 102d export, obtain reconstruct data, as reference data required in search window during macro block inter prediction.
In the present embodiment, described decoding sub-system 30 also comprises: filter unit Deblocking305, reference data for obtaining at described reconfiguration unit 304 carries out filtering to described reference data, to reduce blocking effect before being cached to described reference data cache module.In other embodiments of the invention, also Deblocking305 can be saved.
Please refer to Fig. 9, due to code-subsystem in the H.264 encoder of the present embodiment and the multiplexing partial logic of decoding sub-system, so code-subsystem and decoding sub-system just can not work simultaneously, timesharing can only be adopted to carry out Code And Decode, such process macro block data just needs the more clock cycle, so the relative embodiment of coding rate is once declining to some extent.
Embodiment three
Similarly, hard-wired four factors based on the H.264 encoder described in embodiment two are considered, the present embodiment provides a kind of by storing a few frame with reference to code stream to form the H.264 encoder that multi-frame-reference promotes coding efficiency more, and please refer to Figure 10, concrete structure comprises:
Code-subsystem 10, for inputting the data of present image, carry out the infra-frame prediction of current macro or inter prediction to obtain the residual error data of described current macro, the code stream of described current macro is exported after dct transform and quantification and entropy code are carried out to described residual error data, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs;
Code stream cache module BitstreamBuffer20, for buffer memory with reference to code stream, described reference code stream is the code stream after reference frame image coding, if namely present frame can be used to the reference frame of subsequent frame, so the code stream of all macro blocks of present frame can be saved always, until this frame is cancelled as the attribute with reference to frame; If present frame is not used to the reference frame of subsequent frame, so the code stream of current macro is after being sent coded system, and such as write SD card, these code streams can be covered by follow-up bit stream data;
Decoding sub-system 30, for carrying out entropy decoding and oppositely dct transform and inverse quantization, reference data required in search window when obtaining the inter prediction of current macro to the reference code stream of institute's buffer memory;
Reference data cache module ReferenceData40 for the reference data that decoding sub-system described in buffer memory obtains, and is reference data required in search window when described code-subsystem provides the inter prediction of current macro.
Please continue to refer to Figure 10, in the present embodiment, code-subsystem 10 comprises following subelement:
Control unit CurrentFrame101, for inputting current macro data, and provides a macro block enabling signal and is distributed to other unit to notify that other unit starting macro blocks calculate accordingly;
Ask residual error unit, for carrying out infra-frame prediction or the inter prediction of current macro, obtain the residual error data of described current macro, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in described search window, get out the reference data of needs, this reference data obtains by decoding to reference code stream;
Forward dct transform and quantifying unit DCT/Q103, for carrying out forward dct transform and quantification to described residual error data;
Entropy code unit EntropyEncoder104, for carrying out entropy code by described to forward dct transform and the residual error data after quantizing, generates the code stream of described current macro;
Reverse dct transform and inverse quantization unit IDCT/InvQ105, for carrying out reverse dct transform and inverse quantization to forward dct transform and the residual error data after quantizing;
Reconfiguration unit 106, for being added the prediction data after the infra-frame prediction of the residual error data Dn after reverse dct transform and inverse quantization and described current macro or inter prediction, obtains the reference data of the infra-frame prediction for next macro block.
Please continue to refer to Figure 10, in the present embodiment, described in ask residual error unit to comprise following submodule:
Predictive mode selects module ModeDecision102a, for according to the size of Coding cost being current macro selection infra-frame prediction or inter-frame forecast mode;
Inter prediction module ME/MC(MotionEstimation/MotionCompensation) 102b, for under inter-frame forecast mode, for current macro setting search window, and from described reference data cache module, select the reference data of described search window needs, and according to described reference data, inter prediction is carried out to current macro;
Infra-frame prediction selects module ChooseIntraMode102c, for the reconstruct data obtained according to previously encoded macro block, the predictive mode selecting Coding cost minimum by the Coding cost of more each intra prediction mode is as the optimum frame inner estimation mode of current macro;
Intra-framed prediction module IntraPrediction102d, for carrying out infra-frame prediction according to described optimum frame inner estimation mode and described reconstruct data to described current macro;
Multi-path choice module MUX102e, for realizing the selection of the prediction data that predictive mode selects module 102a, Inter prediction module 102b and intra-framed prediction module 102d to export;
Computing module 102f, for the input data of current macro and infra-frame prediction or inter prediction data being subtracted each other, obtains the residual error data of current macro.
Please continue to refer to Figure 10, in the present embodiment, owing to wherein having P frame as reference data, so a set of logic can decoded to P frame will be increased in decoding sub-system, therefore, described decoding sub-system 30 comprises the I frame decoding system of the P frame decoding system of the reference data for providing described P frame type and the reference data of described I frame type.
Wherein, please continue to refer to Figure 10, described I frame decoding system comprises:
First entropy decoding unit EntropyDecoder301b, for carrying out entropy decoding to described with reference to the I frame reference code stream in code stream;
First reverse dct transform and inverse quantization unit IDCT/InvQ302b, carries out reverse dct transform and inverse quantization for the residual error coefficient exported described first entropy decoding unit 301b;
First intraprediction unit IntraPrediction303b, carries out infra-frame prediction for the intra prediction mode exported according to described first entropy decoding unit 301b;
First reconfiguration unit 304b, prediction data for exporting residual error data and the first intraprediction unit 303b of the described first reverse dct transform and inverse quantization unit 302b output is added, reference data required in its search window when obtaining the inter prediction of the current macro that described I frame provides with reference to code stream, this reference data can be used for P frame with reference to inter prediction during code stream decoding simultaneously.
First filter unit Deblocking305b, for carrying out filtering to the reference data of the first reconfiguration unit 304b.
Described P frame decoding system comprises:
Second entropy decoding unit EntropyDecoder301a, for carrying out entropy decoding to described with reference to the P frame reference code stream in code stream;
Second reverse dct transform and inverse quantization unit IDCT/InvQ302a, carries out reverse dct transform and inverse quantization for the residual error coefficient exported described second entropy decoding unit 301a;
Second intraprediction unit IntraPrediction303a, carries out infra-frame prediction for the intra prediction mode exported according to described second entropy decoding unit 301a;
Second inter prediction unit MC306, carries out inter prediction for the motion vector exported according to reconstruct data and the described second entropy decoding unit 301a of the first described reconfiguration unit 304b;
MUX MUX307, for realizing the selection of the prediction data that the second intraprediction unit IntraPrediction303a and the second inter prediction unit MC306 exports;
Second reconfiguration unit 304a, be added for the prediction data after the residual error data that exports the described second reverse dct transform and inverse quantization unit 302a and the second intraprediction unit 303a or the process of the second inter prediction unit 306, obtain the reconstruct data of described P frame with reference to code stream, reference data required in its search window during inter prediction for described current macro, if the next macro block of this reference code stream is infra-frame prediction, so this reconstruct data is also as the reference data of infra-frame prediction during decoding;
Second filter unit Deblocking305a, for carrying out filtering to the reference data of the second reconfiguration unit 304a.
Please continue to refer to Figure 10, in the present embodiment, reference data cache module comprises the I frame buffer module 401 of the reference data for buffer memory I frame type, the P frame buffer module 402 of buffer memory P frame type and for selecting the selector 403 of the reference data of I frame type or P frame type.
In other embodiments of the invention, also Deblocking305a, 305b can be saved, also can the principle of reference example two, by the module of identical function in code-subsystem and decoding sub-system or/or cell mesh multiplexing, only can affect the relativeness that coding/decoding subsystem runs after multiplexing.
Figure 11 shows that coded sequence and the referring-to relation of the H.264 encoder of the present embodiment.What deserves to be explained is, must be after an i frame, and this P ' frame must be for referencial use with I frame as the P ' frame with reference to frame.In addition, follow-up P frame both can be for referencial use with P ' frame, also can be for referencial use with the reference frame (i.e. I frame) of P ' frame.
Figure 12 describes the relativeness that coding/decoding subsystem runs.This figure still supposes that coded image is of a size of 640x480, and search window size is 592x48.As shown in Figure 12, if present frame with reference to P ' frame, so first will will solve the reference frame (i.e. I frame) of P ' frame, and then could decode to P ' frame, and could encode after above two steps complete to current P frame.
Although the H.264 encoder of the present embodiment adds the implementation complexity of system, and adds sheet memory space, owing to providing multi-frame-reference, therefore improve the performance of coded system, can select as the one of practical application.
In addition, the present invention also provides a kind of coding method H.264, comprises the following steps:
(1) judge that current macro is the need of carrying out inter prediction, if do not need inter prediction, then encodes to current macro, and proceed to step (4), if need inter prediction, then enter next step;
(2) be current macro setting search window, judge whether the reference data in search window is ready to, if so, then according to reference data, current macro is encoded, proceed to step (4), if not, then enter next step;
(3) reference code stream is decoded, obtain the reference data of a macro block, return step (2);
(4) judge whether to terminate coding, if do not terminated, then process next macro block and return step (1).
Wherein said reference data can be the reference data of I frame type, can also comprise the reference data of P frame type, the reference data of described P frame type be with the reference frame data of I frame type for reference to encoding, decoding obtains.
In step (1), when not needing inter prediction, the process that current macro is encoded is comprised:
Carry out the infra-frame prediction of current macro according to the reference data obtained after previous encoded reconstructing macroblocks process, obtain intra prediction value, then deduct this predicted value by current macro data, obtain the residual error data of described current macro;
Forward dct transform and quantification are carried out to described current macro residual error data;
By described, entropy code is carried out to forward dct transform and the residual error data after quantizing, generate the code stream of described current macro and buffer memory;
Reverse dct transform and inverse quantization are carried out to forward dct transform and the residual error data after quantizing;
The prediction data of the residual error data after reverse dct transform and inverse quantization and described optimum prediction mode is reconstructed, obtains the reference data of the infra-frame prediction for next macro block.
In step (2), the process preparing the reference data of current macro in search window comprises:
Entropy decoding is carried out to the reference code stream of buffer memory;
The residual error coefficient obtained being decoded by entropy carries out reverse dct transform and inverse quantization;
Infra-frame prediction is carried out according to the intra prediction mode that entropy decoding exports;
Residual error data after reverse dct transform and inverse quantization and the prediction data after infra-frame prediction are reconstructed, the reference data needed in search window when obtaining the inter prediction of current macro buffer memory.
In step (2), after the reference data in search window is ready to, according to reference data, the process that current macro is encoded is comprised:
The inter prediction of current macro is carried out according to described reference data, by comparing the Coding cost of infra-frame prediction and inter prediction, select the less predictive mode of Coding cost to export as the optimum prediction mode of current macro, and obtain the residual error data of described current macro;
Forward dct transform and quantification are carried out to described current macro residual error data;
By described, entropy code is carried out to forward dct transform and the residual error data after quantizing, generate the code stream of described current macro and buffer memory;
Reverse dct transform and inverse quantization are carried out to forward dct transform and the residual error data after quantizing;
The prediction data of the residual error data after reverse dct transform and inverse quantization and described optimum prediction mode is reconstructed, obtains the reference data of the infra-frame prediction for next macro block.
Known from the above mentioned, the H.264 encoder that the present embodiment proposes and coding method are not all initial data of storage of reference frames, but refine to macro-block level, store the reference data needed for current macro, these reference datas obtain by decoding to reference code stream again, add that the memory space of some reference datas just instead of the memory space of whole reference frame like this with reference to code stream.Because deposited reference data must comprise the data of whole search window, so the memory space of reference data is relevant with search window size, and according to image compression performance, the size of search window can free setting, but generally can be far smaller than the size of a two field picture, which reduces the memory space H.264 needed for encoder.Therefore according to said method, make to utilize less on-chip SRAM just can H.264 encode, concrete hardware implementations as shown in Figure 3.Owing to not using chip external memory, the cost of so whole coded system reduces, and also reduces system power dissipation simultaneously.And the readwrite performance of on-chip SRAM generally will be much better than the outer SDRAM memory of sheet, so when carrying out large-size images coding, the data throughput of memory also can not become problem.
In sum, the H.264 encoder that theres is provided of the present invention and coding method, when realizing inter prediction, the reference data needed for current macro is obtained by setting search window, the memory space related to only comprises code stream and the part reference data of storage, size is far smaller than the size of a two field picture, thus effectively reduces the memory space of H.264 reference frame needed for encoder; Simultaneously owing to not using chip external memory, cost and the system power dissipation of whole H.264 encoder are effectively reduced, and, because the readwrite performance stored in sheet generally will be much better than sheet external memory, so when carrying out large-size images coding, while guarantee picture quality, greatly can improve and store data throughput.
Obviously, those skilled in the art can carry out various change and modification to invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (12)

1. a H.264 encoder, is characterized in that, comprising:
Code-subsystem, for inputting the data of present image, carry out the infra-frame prediction of current macro or inter prediction to obtain the residual error data of described current macro, the code stream of described current macro is exported after dct transform and quantification and entropy code are carried out to described residual error data, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and in search window, get out the reference data of needs;
Code stream cache module, for buffer memory with reference to code stream, described reference code stream is the code stream of reference frame image after coding;
Decoding sub-system, for carrying out entropy decoding and oppositely dct transform and inverse quantization to described reference code stream, obtains reference data required when described code-subsystem carries out inter prediction;
Reference data cache module for the reference data that decoding sub-system described in buffer memory obtains, and is reference data required in search window when described code-subsystem provides the inter prediction of current macro;
Wherein, described reference data cache module is circulating memory, when the reference data that decoding sub-system described in buffer memory obtains, the reference data of current acquisition covers in described circulating memory the reference data that can not re-use when carrying out inter prediction, described reference data cache module is provided with the memory space of certain macroblock number, and the computing formula of its macroblock number S stored is:
S=Ceil(sw_height_by_pix/16)*pic_width_by_mb-(pic_width_by_mb-Ceil(sw_width_by_pix/16))+1
Wherein, Ceil (x) represents the smallest positive integral being more than or equal to x;
Sw_height_by_pix is the height of the search window represented in units of pixel;
Sw_width_by_pix is the width of the search window represented in units of pixel;
Pic_width_by_mb is the width of the image represented in units of macro block.
2. H.264 encoder as claimed in claim 1, it is characterized in that, described code-subsystem comprises:
Control unit, for inputting current macro data, and provides a macro block enabling signal and is distributed to other unit to notify that other unit starting macro blocks calculate accordingly;
Ask residual error unit, for carrying out infra-frame prediction or the inter prediction of current macro, obtain the residual error data of described current macro, wherein, when carrying out inter prediction to current macro, the search window of setting current macro, and required reference data is got out in described search window, this reference data obtains by decoding to reference code stream;
Forward dct transform and quantifying unit, for carrying out forward dct transform and quantification to described residual error data;
Entropy code unit, for described forward dct transform and the residual error data after quantizing are carried out entropy code, generates the code stream of described current macro;
Reverse dct transform and inverse quantization unit, for carrying out reverse dct transform and inverse quantization to forward dct transform and the residual error data after quantizing;
Reconfiguration unit, for being added the prediction data after the infra-frame prediction of the residual error data after reverse dct transform and inverse quantization and described current macro or inter prediction, obtains reconstruct data, for the infra-frame prediction of next macro block provides reference data.
3. H.264 encoder as claimed in claim 2, is characterized in that, described in ask residual error unit to comprise:
Predictive mode selects module, for according to the size of Coding cost being current macro selection infra-frame prediction or inter-frame forecast mode;
Inter prediction module, under inter-frame forecast mode, is current macro setting search window, and from described reference data cache module, select the reference data of described search window needs, and carries out inter prediction according to described reference data to current macro;
Intra prediction mode selection module, for the reconstruct data obtained according to previously encoded macro block, the predictive mode selecting Coding cost minimum is as the optimum frame inner estimation mode of current macro;
Intra-framed prediction module, for carrying out infra-frame prediction according to described optimum frame inner estimation mode and described reconstruct data to current macro;
Multi-path choice module, for realizing the selection of the prediction data that predictive mode selects module, intra-framed prediction module and Inter prediction module to export.
4. H.264 encoder as claimed in claim 2, it is characterized in that, described decoding sub-system comprises:
Entropy decoding unit, for carrying out entropy decoding to reference code stream;
Reverse dct transform and inverse quantization unit, carry out reverse dct transform and inverse quantization for the residual error coefficient exported described entropy decoding unit;
Intraprediction unit, for carrying out infra-frame prediction according to the described intra prediction mode of entropy decoding unit output and the reconstruct data of previous decoded macro block;
Reconfiguration unit, for being added the prediction data of the reverse dct transform of described decoding sub-system and the residual error data of inverse quantization unit output and intraprediction unit output, obtain reconstruct data, as reference data required in search window during macro block inter prediction.
5. H.264 encoder as claimed in claim 4, is characterized in that, the intraprediction unit of described decoding sub-system and the described intra-framed prediction module of residual error unit of asking are multiplexing same intra predictor generator or two independently intra predictor generator.
6. H.264 encoder as claimed in claim 4, it is characterized in that, the reverse dct transform of the reverse dct transform of described decoding sub-system and inverse quantization unit and described code-subsystem and inverse quantization unit are multiplexing same reverse dct transform/inverse DCT or two independently reverse dct transform/inverse DCT.
7. H.264 encoder as claimed in claim 4, it is characterized in that, described decoding sub-system also comprises: filter unit, and the reference data for obtaining at described decoding sub-system carries out filtering to described reference data before being cached to described reference data cache module.
8. H.264 encoder as claimed in claim 1, it is characterized in that, described decoding sub-system comprises the I frame decoding system of the reference data for providing I frame type, and described I frame decoding system comprises:
First entropy decoding unit, for carrying out entropy decoding to described with reference to the I frame reference code stream in code stream;
First reverse dct transform and inverse quantization unit, carries out reverse dct transform and inverse quantization for the residual error coefficient exported described first entropy decoding unit;
First intraprediction unit, carries out infra-frame prediction for the intra prediction mode exported according to described first entropy decoding unit;
First reconfiguration unit, prediction data for exporting residual error data and first intra-framed prediction module of the described first reverse dct transform and inverse quantization unit output is added, obtain the reconstruct data of described I frame with reference to code stream, for reference data required in its search window when the decoding of P frame with reference to code stream or the inter prediction as current macro;
First filter unit, for carrying out filtering to the reference data of the first reconfiguration unit.
9. H.264 encoder as claimed in claim 8, it is characterized in that, described decoding sub-system also comprises the P frame decoding system of the reference data for providing P frame type, and described P frame decoding system comprises:
Second entropy decoding unit, for carrying out entropy decoding to described with reference to the P frame reference code stream in code stream;
Second reverse dct transform and inverse quantization unit, for carrying out reverse dct transform and inverse quantization to the residual error coefficient of described second entropy decoding unit;
Second intraprediction unit, carries out infra-frame prediction for the intra prediction mode exported according to described second entropy decoding unit;
Second inter prediction unit, carries out inter prediction for the motion vector exported according to reconstruct data and the described second entropy decoding unit of the first described reconfiguration unit;
Second reconfiguration unit, for being added the residual error data of the described second reverse dct transform and inverse quantization unit output and the prediction data of the second intraprediction unit or the output of the second inter prediction unit, obtain described P frame with reference to the reconstruct data of code stream, reference data required in its search window during inter prediction for described current macro;
Second filter unit, for carrying out filtering to the reference data of the second reconfiguration unit.
10. the H.264 coding method using the H.264 encoder according to any one of claim 1 ~ 9 to realize, is characterized in that, comprise the steps:
(1) judging that current macro is the need of carrying out inter prediction, if do not need inter prediction, then encodes to current macro, proceeding to step (4), if need inter prediction, then entering next step;
(2) be current macro setting search window, judge whether the reference data in search window is ready to, if so, then according to reference data, current macro is encoded, proceed to step (4), if not, then enter next step;
(3) reference code stream is decoded, obtain the reference data of a macro block, return step (2);
(4) judge whether to terminate coding, if do not terminated, then process next macro block and return step (1).
11. H.264 coding methods as claimed in claim 10, it is characterized in that, described reference data is the reference data of I frame type.
12. H.264 coding methods as claimed in claim 10, it is characterized in that, described reference data comprises the reference data of P frame type, the reference data of described P frame type be with the reference frame data of I frame type for reference to encoding, decoding obtains.
CN201210272224.9A 2012-08-02 2012-08-02 H264 encoder and coding method Active CN102769753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210272224.9A CN102769753B (en) 2012-08-02 2012-08-02 H264 encoder and coding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210272224.9A CN102769753B (en) 2012-08-02 2012-08-02 H264 encoder and coding method

Publications (2)

Publication Number Publication Date
CN102769753A CN102769753A (en) 2012-11-07
CN102769753B true CN102769753B (en) 2015-12-09

Family

ID=47096989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210272224.9A Active CN102769753B (en) 2012-08-02 2012-08-02 H264 encoder and coding method

Country Status (1)

Country Link
CN (1) CN102769753B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038766A (en) * 2014-05-14 2014-09-10 三星电子(中国)研发中心 Device used for using image frames as basis to execute parallel video coding and method thereof
CN105530517B (en) * 2014-09-29 2018-07-31 炬芯(珠海)科技有限公司 A kind of decoder and the method for damaging decoding video images
JP7224892B2 (en) * 2018-12-18 2023-02-20 ルネサスエレクトロニクス株式会社 MOVING IMAGE ENCODER AND OPERATION METHOD THEREOF, VEHICLE INSTALLING MOVING IMAGE ENCODER
CN110035293B (en) * 2019-04-22 2022-01-11 湖南国科微电子股份有限公司 Electronic equipment and image coded data storage method and device
CN110798684A (en) * 2019-09-30 2020-02-14 武汉兴图新科电子股份有限公司 Image segment peak-shifting coding transmission method
CN114727116A (en) * 2022-04-06 2022-07-08 展讯通信(上海)有限公司 Encoding method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1905677A (en) * 2006-08-07 2007-01-31 清华大学 Data buffer storage method of variable size block motion compensation and implementing apparatus thereof
CN1964495A (en) * 2006-12-08 2007-05-16 北京中星微电子有限公司 A method and device for carrying out buffer control to real time digital video stream
CN101340588A (en) * 2008-08-20 2009-01-07 炬力集成电路设计有限公司 Motion estimation method, apparatus and multimedia processor
CN101502125A (en) * 2006-09-06 2009-08-05 索尼株式会社 Image data processing method, program for image data processing method, recording medium with recorded program for image data processing method and image data processing device
CN101924938A (en) * 2010-08-11 2010-12-22 上海交通大学 Method for processing adjacent block information in video decoding macro-block prediction and boundary filtering

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1905677A (en) * 2006-08-07 2007-01-31 清华大学 Data buffer storage method of variable size block motion compensation and implementing apparatus thereof
CN101502125A (en) * 2006-09-06 2009-08-05 索尼株式会社 Image data processing method, program for image data processing method, recording medium with recorded program for image data processing method and image data processing device
CN1964495A (en) * 2006-12-08 2007-05-16 北京中星微电子有限公司 A method and device for carrying out buffer control to real time digital video stream
CN101340588A (en) * 2008-08-20 2009-01-07 炬力集成电路设计有限公司 Motion estimation method, apparatus and multimedia processor
CN101924938A (en) * 2010-08-11 2010-12-22 上海交通大学 Method for processing adjacent block information in video decoding macro-block prediction and boundary filtering

Also Published As

Publication number Publication date
CN102769753A (en) 2012-11-07

Similar Documents

Publication Publication Date Title
JP7483035B2 (en) Video decoding method and video encoding method, apparatus, computer device and computer program thereof
Cheung et al. Video coding on multicore graphics processors
US9807410B2 (en) Late-stage mode conversions in pipelined video encoders
CN102769753B (en) H264 encoder and coding method
US8279942B2 (en) Image data processing apparatus, image data processing method, program for image data processing method, and recording medium recording program for image data processing method
Chen et al. Analysis and design of macroblock pipelining for H. 264/AVC VLSI architecture
US8009740B2 (en) Method and system for a parametrized multi-standard deblocking filter for video compression systems
US20040252768A1 (en) Computing apparatus and encoding program
US9380314B2 (en) Pixel retrieval for frame reconstruction
CN103460700A (en) Method for decoding image in intra prediction mode
JP2009540680A (en) Parallel batch decoding of video blocks
JP2009544225A (en) Parallel processing unit for video compression
CN101166277B (en) Method for accessing memory in apparatus for processing moving pictures
US20160050431A1 (en) Method and system for organizing pixel information in memory
WO2013071721A1 (en) Method and apparatus of video encoding with partitioned bitstream
CN109391816B (en) Parallel processing method for realizing entropy coding link in HEVC (high efficiency video coding) based on CPU (Central processing Unit) and GPU (graphics processing Unit) heterogeneous platform
US9077996B2 (en) Predicted motion vectors
US10070139B2 (en) Multimedia codec, application processor including the same, and method of operating the application processor
JP2008271127A (en) Coding apparatus
CN105100799A (en) Method for reducing intraframe coding time delay in HEVC encoder
KR20130006578A (en) Residual coding in compliance with a video standard using non-standardized vector quantization coder
US12034949B2 (en) Video decoding apparatus and video decoding method
JP2007325119A (en) Image processing apparatus and method
CN103780914A (en) Loop filter accelerating circuit and loop filter method
US20160165235A1 (en) Method of encoding image data, encoder using the method, and application processor including the encoder

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant