Video image motion compensator
Technical field
The present invention relates to a kind of video image encoding and decoding compensation arrangement, especially a kind of video image motion compensator.
Background technology
Since nineteen nineties, the ISO of International Standards Organization, International Electrotechnical Commissio IEC and the ITU of International Telecommunications Union have formulated the standard and the suggestion of a series of multimedia codings, and MPEG series international standard, H.26x series video compression standard and joint video coding standard JVT etc. are typically arranged.China is also formulating digital audio/video encoding and decoding standard AVS.
Science and technology department of China Ministry of Information Industry ratifies to have set up " digital audio/video encoding and decoding technique standard operation group " in June, 2002.Working group's working centre is a digital audio/video encoding and decoding standard of formulating China.Be called as AVS (Advance Video Coding Standard) before the standard mesh of being worked out.AVS is the very wide technical standard of a cover adaptive surface, and advantage shows the following aspects: independence, high compression rate, low complex degree, low cost.
Movement compensating algorithm:
1, reference picture is selected:
Unlike H.264, the reference picture that the every two field picture of AVS standard code uses should not surpass two frames or four fields.Can be preceding 2 I/P frames in the DISPLAY ORDER for P frame reference picture specifically, can be preceding 4 I/P fields in the DISPLAY ORDER for P field reference picture.For B frame reference picture is two nearest I/P frames of front and back in the DISPLAY ORDER, is nearest two nearest I/P fields of two I/P fields and back, front in the DISPLAY ORDER for B field reference picture.If the field, the end of a special I frame is the P field, it can only be with reference to the field, top of same frame.The reference key value is used for the label present image and carries out the used reference picture of decoding processing, because can there be 4 reference field the P field, so the span of reference key is 0-3.Reference key does not appear in the bit stream sometimes, and default reference picture is to be labeled as 0 image (or).
The position of frame index (picture_distance) expression current encoded frame in image sequence exactly is the position in the original sequence before the coding.The number of frame can be a lot of in the image sequence, and each frame all distributes an index to be unpractiaca nor to be beneficial to hardware and to realize, so the method for expressing of frame index is the frame that recycles in 0~255 flag sequence.Allow during coding and skip some original images (Numberskipframe<128), so picture_distance is discontinuous.Computational methods are as follows: picture_distancecurrent=(picture_distanceprevious+1+Numberskipframe) mod256.(1)
Index (DistanceIndex) is equivalent to the current block institute label in original sequence on the scene, and in the frame coding, all pieces all are considered to belong to first or field, top, and DistanceIndex equals picture_distance and takes advantage of 2.In the coding on the scene, if block belongs to second or field, the end, and DistanceIndex equals picture_distance and takes advantage of 2 to add 1; If block belongs to first or field, top, and DistanceIndex equals picture_distance and takes advantage of 2.
2, vector forecasting and generation:
H.264 identical, AVS also adopts the vector forecasting technology of spatial domain prediction and time domain prediction.
2.1, spatial domain prediction:
Spatial domain prediction is meant that the motion vector that utilizes peripheral piece carries out the prediction mode of differential coding to the motion vector of current block, and it is a kind of way of removing motion vector spatial redundancy information.Spatial domain prediction is that the motion of promptly adjacent piece is similar according to a such hypothesis.Just have very big correlation between the adjacent like this piece, the spatial domain prediction of vector has made full use of this correlation and has improved code efficiency.Locus between adjacent brightness piece A, B, C and the D that current luminance block E and its spatial domain prediction need as shown in Figure 1.In the spatial prediction, at first will be according to these four adjacent piece generation forecast vectors, secondly the MVD value addition that promptly obtains in the code stream of predicted vector (MVEPred) and difference vector obtains motion vector.The size of E can be any block type of AVS standard code, such as 16 * 16,16 * 8,8 * 16 or 8 * 8.
Field distance between piece distance (BlockDistance) expression current block (belonging to present image) and its motion vector reference block (belonging to reference picture) pointed is calculated as follows:
If forward direction:
BlockDistance=(DistanceIndexcur-DistanceIndexref+512)mod512。(2)
If the back to:
BlockDistance=(DistanceIndexref-DistanceIndexcur+512)mod512。(3)
In certain situation,, can directly judge the value of MVEPred according to the reference key of piece A, B, C and their availability.Under 16 * 8 patterns, if the last piece of B " available " and reference key value and E is identical, MVEPred equals the motion vector of B piece such as E.If A " available " and reference key value and E following is identical, MVEPred equals the motion vector of A piece.In addition, just need carry out vectorial spatial domain prediction calculating and could produce predicted vector.The process of spatial domain prediction is as follows:
At first, according to the motion vector convergent-divergent of BlockDistance to adjacent block, the motion vector behind the note convergent-divergent is MVA, MVB, MVC.If the BlockDistance of reference block and current block is different, so directly uses the motion vector of reference block to produce prediction and can cause deviation on the time domain.Solution is before using the reference block motion vector, earlier it is zoomed on the time domain plane identical with current block.If represent adjacent block A, B, C with Z, with z representation vector component x, y, mvZ_z represents the motion vector component of some adjacent blocks, and then vectorial convergent-divergent carries out as follows:
MVZ_z=(mvZ_z×BlockDistanceE×(256/BlockDistanceZ)+128)>>8。(4)
Secondly, calculate MVA, MVB, the distance between the MVC.(MV1 MV2) is defined as the absolute value of x component difference of two vectors and the absolute value sum of y component difference to distance D ist between two motion vectors.
At last, by three distance D ist (MVA, MVB), Dist (MVA, MVC), Dist (MVC, the assignment of MVB) intermediate value decision MVEPred.If intermediate value is the distance between A piece and the B piece motion vector, MVEPred equals the motion vector MVC of C piece, and intermediate value is the distance between A piece and the C piece motion vector else if, and MVEPred equals the motion vector MVB of B piece, otherwise MVEPred equals MVB.
Spatial domain prediction predicted value and difference value addition to be obtained final motion vector at last, the base unit of motion vector is 1/4th samples.
2.2, time domain prediction
Time domain prediction is meant the prediction mode that the motion vector that utilizes consecutive frame same position piece is derived to the motion vector of current block, and it is a kind of way of removing the motion vector time redundancy.Time domain prediction is that the i.e. motion of consecutive frame same position piece is similar according to a such hypothesis.Very big correlation is arranged between the motion vector of these pieces, and time domain prediction has made full use of this correlation, and it does not need the code differential motion vector, is the effective tool that improves code efficiency.Time domain prediction only uses in the Direct Model of B frame.Direct Model also adopts the spatial domain prediction mode, if the coding mode of the piece identical with the current block position is intraframe coding in the reference frame, the motion vector prediction mode of current block adopts spatial domain prediction, for convenience of description, the corresponding motion vector of the reference block that mark is identical with the current block position is mvRef, the reference picture of this motion vector points be DistanceIndexRef apart from index.The process of time domain prediction is as follows:
At first determine current block forward reference frame and back to reference frame, and obtain their index DistanceIndexFw and DistanceIndexBw.If current block place image is the frame coding, forward reference frame and back are exactly nearest anchor (I, P frame or I, P field) and the nearest anchor in back in front in the DISPLAY ORDER to reference frame.If current block place image is a coding, the selection of forward reference frame is determined by DistanceIndexRef, if reference key is but that the image of DistanceIndexRef is in current block forward direction term of reference, the forward direction reference picture is exactly the image of DistanceIndexRef indication, but otherwise forward reference frame is from present frame reference field farthest.The back is to the selection of the reference frame field decision by the current block place, if current block on the top, then the back also is top to reference frame, on the contrary still.
Calculate BlockDistanceRef, DistanceIndexBw, BlockDistanceFw according to the BlockDistance formula.
If represent Bw or Fw with Z, z represents component of a vector x or y.The formula of each component of calculating Direct Model forward direction and reverse vector is as follows:
mvZ_z=signal(mvRef_z)×(((16384/BlockDistanceRef)×(1-mvRef_z×BlockDistanceZ)-1)>>14) (5)
2.3, symmetric pattern:
Symmetric pattern is a predictive mode exclusive in the AVS standard, is similar to bi-directional predictedly, and different is bi-directional predictedly needs two difference vectors of coding, and only need the encode difference vector of a forward direction of symmetric pattern.The reverse vector is forward motion vector convergent-divergent and the reverse result who extends.If the forward direction vector is mvFw then then to vector is:
mvBw_z=-(mvFw_z×BlockDistanceBw×(256/BlockDistanceFw)+128)>>8 (6)
Read back with reference to pixel data:
The function of this part is according to the length and width of motion vector appointed positions and relevant parameter appointment, reads with reference to pixel from chip external memory.It is not in the scope of video standard specifies.
The pixel interpolation algorithm:
Video sequence obtains by the sampling to analog input signal, and whole picture element is the effective sampling points of video image.Generally adopting macro block in the video coding is basic coding unit, and macro block is exactly one 16 * 16 a pixel square formation, and macro block can be divided by 16 * 8,8 * 16,8 * 8,4 * 8,8 * 4,4 * 4 pixel blocks.Inferior picture element is between the whole picture element, obtains by whole picture element interpolation, and various criterion interpolation method difference, but interosculate and similarity.Be the interpolation algorithm of AVS below:
As shown in Figure 2, be the position view of integral sample, 1/2nd samples and 1/4th samples, what wherein use the capitalization mark is the integral sample position, and with the lowercase mark is 1/2nd and four/the same this position.
/ 2nd samples and 1/4th samples realize that by filtering filter is respectively F1 (1,5,5 ,-1), F2 (1,7,7,1).
The computational process of 1/2nd samples is as follows:
/ 2nd sample b: at first with F1 to 4 nearest on horizontal direction integral sample filtering, obtain median b '=(C+5D+5E-F); Final predicted value b=Clip1 ((b '+4) 3).
/ 2nd sample h: at first with F1 to 4 nearest on vertical direction integral sample filtering, obtain median h '=(A+5D+5H-K); Final predicted value h=Clip1 ((h '+4) 3).
/ 2nd sample j: at first use F1 on level or vertical direction to nearest 4 1/2nd sample medians filtering, obtain median j '=(bb '+5h '+5m '-cc '), perhaps j '=(aa '+5b '+5s '-dd ').Aa ' wherein, dd ' and s ' they are relevant position 1/2nd sample medians (obtaining with F1 filtering in the horizontal direction), bb ', cc ' and m ' they are relevant position 1/2nd sample medians (obtaining in vertical direction filtering with F1).Final predicted value j=Clip1 ((j '+32) 6).The value that adopts horizontal direction or vertical direction filtering to obtain is identical.
The computational process of 1/4th samples is as follows:
/ 4th sample a: at first with F2 in the horizontal direction to ee ', D ', four value filterings of b ' and E ' obtain median a '=(ee '+7D '+7b '+E '); Final predicted value a=Clip1 ((a '+64) 7).Wherein ee ' and b ' are relevant position 1/2nd sample medians, and D ' and E ' are that the relevant position integral sample is amplified 8 times value.
/ 4th sample d: at first with F2 in vertical direction to ff ', D ', four value filterings of h ' and H ' obtain median d '=(ff '+7D '+7h '+H '); Final predicted value d=Clip1 ((d '+64) 7).Wherein ff ' and h ' are relevant position 1/2nd sample medians, and D ' and H ' are that the relevant position integral sample is amplified 8 times value.The interpolation process of/4th sample n is identical with the interpolation process of d.
/ 4th sample i: at first with F2 in the horizontal direction to gg ', h ", j ' and m " four value filterings, obtain median i '=(gg '+7h "+7j '+m "); Final predicted value i=Clip1 ((i '+512) 10).Wherein gg ' and j ' they are relevant position 1/2nd medians, h " and m " be that relevant position 1/2nd sample medians are amplified 8 times value, the interpolation process of 1/4th sample k is identical with the interpolation process of i.
/ 4th sample f: at first with F2 in vertical direction to hh ', b ", j ' and s " four value filterings, obtain median f '=(hh '+7b "+7j '+s "); Final predicted value f=Clip1 ((f '+512) 10).Wherein hh ' and j ' they are relevant position 1/2nd medians, b " and s " be that relevant position 1/2nd sample medians are amplified 8 times value, the interpolation process of 1/4th sample q is identical with the interpolation process of f.
/ 4th sample e, g, p and r:
e=(D”+j’+64)>>7
g=(E”+j’+64)>>7
p=(H”+j’+64)>>7
r=(I”+j’+64)>>7
D wherein ", E ", H " and I " be that the relevant position integral sample is amplified 64 times value, j ' is relevant position 1/2nd sample medians.
Publication number is the method and apparatus that 1125030 Chinese patent " method and apparatus that is used for motion compensated interpolation " has provided a kind of interpolation, mainly is the interpolation arithmetic of realizing 1/2nd pixel accuracies, can't solve the interpolation of 1/4th pixel accuracies.
Publication number be 1140958 Chinese patent " to receive the half-pixel motion compensation controller of MPEG2 " also be half pixel interpolation that only is directed to MPEG-2 because the restriction of computing capability input data bandwidth can't be satisfied the requirement that 1/4th pixel interpolations are handled.
Publication number is that 1167533 Chinese patent " method and apparatus that is used for improved motion compensation " is a kind of estimation implementation method and device of coding, and only is applicable to H.261 MPEG-1, standards such as MPEG-2, and be not suitable for MPEG-4, and H.264, new standards such as AVC.Publication number is that 1115953 Chinese patent " the motion compensation encoding method and the device thereof that adapt to the motion size " and publication number are that 1134084 Chinese patent " is used in the improved motion compensation unit in the image encoding system " same defective is also arranged.
Publication number is that main what describe is a motion compensation address calculating circuit that comprises address generator, address calculator, adder for 1139358 Chinese patent " the initial sum end address generation circuit that motion compensation is used in the moving image compensation coding process ", this patent motion compensation address computation parts are returned the specific address parts unified calculation outside the motion compensation, therefore not have the address computation parts be the pixel data reading device to this patent accordingly, be used for producing the preliminary treatment of needed control signal of calculated address and return data, different with this patent.
Present video image interpolation can realize 1/2nd pixel interpolations, 1/4th pixel interpolations even 1/8th pixel interpolations, and from the evolution process of pixel interpolation algorithm, its calculating becomes increasingly complex, and amount of calculation is also increasing.Aspect the special relevancy of data, interrelated, the complicated flowing structure of needs that influences each other between processed data improve processing speed in the pixel block on the one hand, the interblock data are uncorrelated on the other hand, need data times between the processing to adjacent block, and common stream treatment device can't be worked in this time, therefore can influence treatment effeciency.Simultaneously, above patent is not all considered the processing of unrestricted motion vector, and demands urgently further being improved.
Summary of the invention
Technical problem to be solved by this invention is to provide a kind of video image motion compensator, can realize the video image motion compensation of SD video and HD video preferably, improves the processing speed and the treatment effeciency of video image effectively.
Technical problem to be solved by this invention is achieved by the following technical solution:
A kind of video image motion compensator, it comprises motion vector prediction module, pixel data read module and pixel interpolation computing module; Described motion vector prediction module connects the pixel data read module by first cache module, and described pixel data read module connects the pixel interpolation computing module by second cache module;
The algorithm computation that according to the motion vector residual sum MPEG-x in the code stream, H.26x described motion vector prediction module reaches the AVS standard code goes out the macro block motion vector, sends the pixel data read module to by first cache module; Described pixel data read module is accepted the data that external memory storage reads back according to the address of external memory storage, and data are sent to the pixel interpolation computing module through splicing and unrestricted motion Vector Processing by second cache module; Described pixel interpolation computing module realizes being obtained by whole picture element interpolation the interpolation algorithm of the inferior picture element between the described whole picture element.
Adopt apparatus of the present invention, can realize the video image motion compensation of SD video and HD video preferably,, can improve the processing speed and the treatment effeciency of video image effectively as calculating of 1/2nd pixel interpolations or 1/4th pixel interpolation calculating etc.; Considered simultaneously the processing of unrestricted motion vector is applicable to MPEG-4, H.264, new standards such as AVC.
Description of drawings
Fig. 1 is the spatial relation schematic diagram of luminance block E and adjacent brightness piece;
Fig. 2 is the position view of integral sample, 1/2nd samples and 1/4th samples;
Fig. 3 is a structural representation of the present invention;
Fig. 4 is the structural representation of motion vector prediction module of the present invention;
Fig. 5 is the structural representation of spatial domain prediction module among Fig. 4;
Fig. 6 is the structural representation of pixel data read module of the present invention;
Fig. 7 is the structural representation of pixel interpolation computing module of the present invention;
Fig. 8 is the data flowchart of pixel interpolation computing module of the present invention;
Fig. 9 is the structural representation of computing unit among Fig. 7;
Figure 10 is the structural representation of Fig. 9 median filter.
Embodiment
Below in conjunction with the drawings and specific embodiments technical scheme of the present invention is further specified:
As shown in Figure 3, be structural representation of the present invention, a kind of video image motion compensator comprises motion vector prediction module, pixel data read module and pixel interpolation computing module; The motion vector prediction module connects the pixel data read module by first cache module, the pixel data read module connects the pixel interpolation computing module by second cache module, and cache module can be register or first in first out cache module FIFO or cache memory CACHE or random access memory ram or other memory module; Comprise support in the pixel data read module to the unrestricted motion vector.
Wherein, the motion vector prediction module is finished the motion vector prediction algorithm; The pixel data read module is finished reading of reference data; The pixel interpolation computing module is finished the pixel interpolation computational algorithm.The algorithm computation that according to the motion vector residual sum MPEG-x in the code stream, H.26x the motion vector prediction module reaches the AVS standard code goes out the macro block motion vector, send first cache module to, first cache module is when pixel data read module request msg, input sequence by data sends data to the pixel data read module, if first cache module is full of, then the motion vector prediction module stops to send data to it, if first cache module is empty, then the pixel data read module stops to ask for data to it.The pixel data read module is according to the address of external memory storage, accept the data that memory reads back, data are through splicing and unrestricted motion Vector Processing, send second cache module to, second cache module is when pixel interpolation computing module request msg, input sequence by data sends data to the pixel interpolation computing module, if second cache module is full of, then the pixel data read module stops to send data to it, if second cache module is empty, then the pixel interpolation computing module stops to ask for data to it.The pixel interpolation computing module realizes being obtained by whole picture element interpolation the interpolation algorithm of the inferior picture element between the described whole picture element.
1, motion vector prediction module:
The motion vector prediction module is finished and is calculated predicted vector and predicted vector and two functions of differential motion vector addition, and differential motion vector is from input.
As shown in Figure 4, be the structural representation of motion vector prediction module of the present invention, the motion vector prediction module comprises five parts: input buffer module, spatial domain prediction module, vectorial cache module, time domain vector forecasting module and output buffer module.The data that the input buffer module buffer memory is imported into, these data comprise differential motion vector information and parameter information, input buffer module is sent to spatial domain prediction module or time domain vector forecasting module with differential motion vector information and parameter information then; The spatial domain prediction module is finished motion vector spatial domain prediction algorithm, and its result can export by output buffer module on the one hand, can be transferred to time domain vector forecasting module by behind the buffer memory of vectorial cache module on the other hand; The vector cache module outside dateout of buffer memory motion vector prediction module not only, also inside input data of buffer memory motion vector prediction module, it is two-way that data flow; Time domain vector forecasting module is finished motion vector time domain vector forecasting modular algorithm, and result data is exported the result at last by the buffer memory of output buffer module.
As shown in Figure 5, be the structural representation of the spatial domain prediction module in the motion vector prediction module of the present invention, wherein the implication of A, B, C, D, E is seen Fig. 1.The spatial domain prediction module is made up of register module group, cache module and computing unit, and the register module group is the memory module that register makes up, and is the structure of a similar FIFO.Register module group and cache module are formed storage organization in the spatial domain prediction module.
Current macro E and A, B, C, D preserve with register module, using the purpose of register is do not need to guarantee address computation just can obtain data, the first in first out cache module FIFO of a N-3 storage cell or the cache module group that random access memory ram makes up are arranged between A and the C, and N is data relevant with the number of the every capable macro block of image.
When a write signal is effective, each register module is given the register module or the cache module of this register immediate right data passes in this storage organization, each cache module is given the cache module or the register module of this buffer immediate right data passes, and data need N-3 write signal could be delivered to the right from the left side of fifo module.Each register module A, B, C, D are connected to arithmetic unit ALU.Arithmetic unit ALU is realized the time domain prediction algorithm.
2, pixel data read module:
The effect of pixel data read module is the Control Parameter that generates the memory access needs, the Control Parameter of supporting the unrestricted motion vector, and the preliminary treatment of fetching data.
As shown in Figure 6, be the structural representation of pixel data read module of the present invention, the pixel data read module is divided into four modules: address parameter generation module, required parameter generation module, parameter cache module and data splicing and unrestricted motion Vector Processing module.The address parameter generation module generates address and the parameters needed that memory access needs, and delivers to the required parameter generation module; Whether the required parameter generation module can send the memory access request according to solicited status decision at present, if can send request, then request signal and one group of memory access parameter send to external memory storage, and part memory access parameter is sent parameter cache module buffer memory; The parameter cache module is memory devices such as first in first out cache module FIFO or RAM, the data that it can cache request parameter generation module generates, and when data splicing and unrestricted motion Vector Processing resume module data, read out, the work of control data splicing and unrestricted motion Vector Processing module, the parameter transmission can effectively improve concurrency by the FIFO buffer memory; Data splicing and unrestricted motion Vector Processing module are obtaining the data that memory access is returned, and obtain the parameter of corresponding data from the parameter cache module after, by interpolation requirement splicing data and by unrestricted motion vector algorithm deal with data, result data output.In each internal module of whole pixel data read module, carry out for parallel pipelining process between preceding two modules (address parameter generation module and required parameter generation module) and latter two module (data splicing and unrestricted motion Vector Processing module), that is to say that preceding two modules can not consider the state of latter two module and continuous work, latter two module also can not considered the state of two modules in front and continuous work; The effect of parameter cache module can guarantee that intermodule can walk abreast and correct work.In the pixel data read module, support the unrestricted motion vector.By data splicing and unrestricted motion Vector Processing resume module constrained motion vector, this module comprises two submodules, data splicing module and unrestricted motion Vector Processing module.Specifically the mode of working is after effective data arrive inside modules and process data splicing resume module, the built-in unrestricted motion Vector Processing module of this module requires to carry out the filling of data according to algorithm, with the output result of the data after filling as the pixel data read module.
3, the data structure of pixel interpolation computing module interpolation algorithm and data flow process:
As shown in Figure 7, be the structural representation of pixel interpolation computing module of the present invention, register array and computing unit that the pixel interpolation computing module comprises the input register group that is made of M register, is made of N column register group.In register array, each column register comprises M register, selects N * N register to constitute register window, and the row and column of register window is as the input of computing unit.In described device, to install manageable pixel data block size relevant with this for the value of M, can be the length of data block, also can be the width of data block; N is the top step number of interpolation arithmetic median filter.
Pixel data is input in the register array through N all after dates by the input register group, promptly suppose the column register group from right to left be numbered 1,2 ... N, then the 1st cycle, the data of the M in the input register group are input in the column register group 1; The 2nd cycle, the data of the M in the column register group 1 are input in the column register group 2, and carry out and the 1st identical input operation of cycle; In the 3rd cycle, the data of the M in the column register group 2 are input in the column register group 3, and carry out and the 2nd identical input operation of cycle; By that analogy, in N-1 cycle, M data among the column register group N-2 are input among the column register group N-1, and carry out and N-2 identical input operation of cycle; N cycle, M data among the column register group N-1 are input to row and deposit among the group N, and carry out and N-1 identical input operation of cycle.Subsequently, behind the intact data line of every calculating, all to import delegation's pixel data by the input register group through a clock cycle.
For all required pixel datas of interpolation result of calculating were appeared in the register window a clock cycle, pixel data need transmit in register array, comprises three kinds of transfer modes: transmit left, circulate and upwards transmit and circulation transmission downwards.Transmission left is meant all registers in the register array are close to register transfer from the data of oneself preserving to its left side.Circulation is upwards transmitted and is meant all registers that remove top line in the register array with the lastrow register transfer of own data to its next-door neighbour, and the register of top line with oneself data passes to the register of bottom line under it.Circulation is transmitted downwards and is meant all registers that remove bottom line in the register array with the next line register transfer of own data to its next-door neighbour, and the register of bottom line with oneself data passes to the register of top line directly over it.
The flow process that the pixel interpolation computing module carries out interpolation calculation as shown in Figure 8.The at first transmission left of N clock cycle of passing through of the N in the capable pixel data of Q in the input register array, begins data line is calculated then, and calculating data line needs M-N+1 clock cycle.When calculating the odd number line data, each clock cycle of M-N clock cycle wherein, data in the register array all circulate and transmit downwards, a clock cycle after M-N+1 clock cycle, data in the register array are all transmitted left, and the data that next line is not imported in register array input Q line data; When calculating the even numbers line data, each clock cycle of M-N clock cycle wherein, data in the register array all circulate and upwards transmit, a clock cycle after M-N+1 clock cycle, data in the register array are all transmitted left, and the data that next line is not imported in register array input Q line data; Finish up to whole calculating of the data that Q is capable.
Provide an embodiment below.If pending block of pixel data is 13 * 13 data block to the maximum, and the filter order in the interpolation arithmetic is at most 6, and then the pixel interpolation computing module has 6 column register groups, and each column register group has 13 registers, therefore have 78 registers, each register is 8.Register window is to be made of 6 * 6 registers, and the data in the register window will output to computing unit and carry out interpolation calculation.Its flow process is as follows:
At first, through the transmission left in 6 cycles, 6 line data in required 13 line data of interpolation arithmetic are input in the register array;
Calculate first line data, need 8 clock cycle, each clock of 7 clock cycle wherein, the data in the register array all circulate and transmit downwards;
A clock cycle after 8 clock cycle, the data in the register array are transmitted left;
Calculate second line data, need 8 clock cycle, each clock of 7 clock cycle wherein, the data in the register array all circulate and upwards transmit;
A clock cycle after 8 clock cycle, the data in the register array are transmitted left;
Calculate the third line data, need 8 clock cycle, each clock of 7 clock cycle wherein, the data in the register array all circulate and transmit downwards;
A clock cycle after 8 clock cycle, the data in the register array are transmitted left;
By that analogy, finish up to calculating the 8th line data.
Fig. 9 is the schematic diagram of computing unit in the pixel interpolation computing module of the present invention, comprise first bank of filters, second bank of filters, MUX, multichannel selection follower, the first delay register group and the second delay register group, every group of filter can comprise a plurality of filters, and concrete number is determined by concrete encoding and decoding technique.First bank of filters is used for the data that the receiving register window is exported, and carries out filtering, and outputs to second bank of filters and MUX; Second bank of filters is carried out filtering after receiving the result of first bank of filters output, and outputs to multichannel and select follower; The first delay register group is delayed time after receiving the data of register window output, outputs to MUX; The second delay register group of received is selected follower from the output of MUX through outputing to multichannel after the time-delay; MUX receives the output of the first delay register group and first bank of filters, selects to output to multichannel and selects follower; Multichannel selects follower then to the data from register window, second bank of filters, the second delay register group and MUX output, selects one of them data as a result of to export.
Filter Structures comprises 7 adders and 9 delay registers as shown in figure 10.Adder 1, adder 2 and adder 3, carry out add operation respectively from the data of register window input, the result outputs to respectively in delay register 1, delay register 2 and the delay register 3, and delay register is mainly used in the buffer memory result of calculation of a clock cycle.The result of calculation of delay register 1 and delay register 3 outputs carries out outputing to delay register 4 after the addition in adder 4, the result of calculation of delay register 2 and delay register 3 outputs is then carried out addition in adder 5, output to delay register 5 then.Addition is carried out in the output of 6 pairs of delay registers 4 of adder and delay register 5, outputs to delay register 6 again.The result of calculation of delay register 2 outputs outputs in the adder 7 through twice time-delay of delay register 7 and delay register 8, carries out addition with the result of calculation of delay register 6 outputs, at last by delay register 9 outputs.
Above-mentioned Filter Structures belongs to flowing structure, and streamline length is four clock cycle, and when streamline fully was utilized, this filter can produce a result each clock cycle.Though be filter construction, do not have multiplication unit, all calculating realize by add tree.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not breaking away from the spirit and scope of technical solution of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.