Summary of the invention
The invention provides a kind of method for processing video frequency, this method can reduce the amount of calculation of deinterleaving and can alleviate the computing cost of decoding end.
The invention provides a kind of processing system for video, this system can reduce the amount of calculation of deinterleaving and can alleviate the computing cost of decoding end.
The present invention also provides a kind of deinterlacing processor, and this deinterlacing processor can reduce the amount of calculation of deinterleaving and can alleviate the computing cost of decoding end.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
The invention discloses a kind of method for processing video frequency, this method is included in the following steps that coding side is carried out each current frame image data:
Reception is from the motion vector information of the previous frame image of the current frame image data of video collector and encoder feedback; The motion vector information of described previous frame image was a preset value when wherein, present frame was first frame;
Motion vector information according to the previous frame image calculates filtering strength, selects filter patterns according to the filtering strength that is calculated;
Filter patterns according to described selection carries out the deinterleaving processing to the current frame image data, current frame image data after the deinterleaving processing are sent to encoder carry out encoding process, be sent to decoding end by the current frame image data of encoder after again with encoding process, and by the motion vector information of encoder feedback current frame image.
The invention discloses a kind of processing system for video, this processing system for video comprises in decoding end: video collector, deinterlacing processor and encoder, wherein,
Video collector is used for gathering in real time vedio data, and each current frame image data is sent to deinterlacing processor;
Deinterlacing processor, be used to receive motion vector information from the previous frame image of the current frame image data of video collector and encoder feedback, motion vector information according to described previous frame image calculates filtering strength, select filter patterns according to the filtering strength that calculated, the current frame image data are carried out sending to encoder after deinterleaving is handled according to the filter patterns of described selection; The motion vector information of described previous frame image was a preset value when wherein, present frame was first frame;
Encoder is used for the current frame image data from deinterlacing processor are carried out encoding process, and the current frame image data after the encoding process is sent to decoding end, and by the motion vector information of encoder to deinterlacing processor feedback current frame image.
The invention also discloses a kind of deinterlacing processor, the two ends of this deinterlacing processor connect image acquisition device and encoder respectively, and this deinterlacing processor comprises: receiver module, and analysis module and processing module, wherein,
Receiver module, be used to receive motion vector information from the previous frame image of the current frame image data of video collector and encoder feedback, the motion vector information of described previous frame image is sent to analysis module, described current frame image data are sent to processing module; The motion vector information of described previous frame image was a preset value when wherein, present frame was first frame;
Analysis module is used for calculating filtering strength according to the motion vector information of the previous frame image that is received, and selects filter patterns according to the filtering strength that is calculated, and with selected filter patterns notification handler module;
Processing module is used for according to the filter patterns of analysis module notice the current frame image data that received being carried out sending to encoder after deinterleaving is handled.
As seen from the above technical solution, this deinterlacing processor of the present invention calculates filtering strength according to the motion vector information of the previous frame image of encoder feedback, select filter patterns according to the filtering strength that is calculated, filter patterns according to described selection carries out being sent to the technical scheme that encoder carries out encoding process after deinterleaving is handled to the current frame image data then, owing to the deinterleaving of finishing with reference to the motion vector information of previous frame image the current frame image data, therefore greatly reduce the amount of calculation of deinterleaving, and handle owing to finish deinterleaving, therefore can alleviate the computing cost of decoding end at coding side.
Embodiment
Core concept of the present invention is: carry out deinterleaving at coding side and handle, the filtering strength and the pattern of the motion vector information control deinterlacing processor that obtains by cataloged procedure, thereby reduce the computation complexity of deinterleaving, under the situation of limited bandwidth, improve coding quality.
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
Fig. 2 is the composition schematic diagram of a kind of processing system for video of the embodiment of the invention.This processing system for video comprises at coding side as shown in Figure 2: video collector, deinterlacing processor and encoder comprise in decoding end: decoder and display device.
In Fig. 2, video collector is used for gathering in real time vedio data, and each current frame image data is sent to deinterlacing processor;
Deinterlacing processor, be used to receive motion vector information from the previous frame image of the current frame image data of video collector and encoder feedback, motion vector information according to the previous frame image calculates filtering strength, select filter patterns according to the filtering strength that calculated, the current frame image data are carried out sending to encoder after deinterleaving is handled according to the filter patterns of described selection; Wherein, the motion vector information of described previous frame image was a preset value when present frame was first frame, and generally this preset value gets zero;
Encoder is used for the current frame image data from deinterlacing processor are carried out encoding process, and the current frame image data after the encoding process is sent to decoding end, and by the motion vector information of encoder to deinterlacing processor feedback current frame image;
Decoder is used to receive the current frame image data from coding side, and carries out being sent to display device after the decoding processing;
Display device is used to show the current frame image data of output from decoder.
In system shown in Figure 2, the algorithm flow that deinterlacing processor carries out the adaptive de interleaving treatment according to motion vector information comprise following some:
A1, encoder are divided into different image-regions according to big young pathbreaker's one two field picture of coded macroblocks, and the horizontal motion vector and the vertical motion vector in different images zone are fed back to deinterlacing processor;
A2, for each image-region of current frame image, deinterlacing processor takes absolute value to each horizontal motion vector and the vertical motion vector in the previous above frame correspondence image zone of present frame, then the summation;
For example, for current N two field picture, deinterlacing processor can be only according to the former frame image, and promptly the motion vector information of N-1 two field picture carries out summation operation.Here be example with certain image-region A, the horizontal motion vector of the image-region A of N-1 frame is AX (N-1), and vertical motion vector is AY (N-1), and what then obtain with value SNM is:
SUM=ABS(AX(N-1))+ABS(AY(N-1));
Wherein, ABS represents to take absolute value.
Again for example, for current N two field picture, deinterlacing processor can be according to first three two field picture, and promptly the motion vector information of N-1 frame, N-2 frame and N-3 two field picture carries out summation operation.Be example still with certain image-region A, the horizontal motion vector of the image-region A of N-1 frame is AX (N-1), vertical motion vector is AY (N-1), the horizontal motion vector of the image-region A of N-2 frame is AX (N-2), vertical motion vector is AY (N-2), what then obtain at last by that analogy, with value SUM is:
SUM=ABS(AX(N-1))+ABS(AY(N-1))+ABS(AX(N-2))
+ABS(AY(N-2))+ABS(AX(N-3))+ABS(AY(N-3));
Wherein, if do not have N-1, N-2 and N-3 frame, corresponding value is handled by zero.
A3, select filter strength value corresponding to this image-region according to described and value, general described and value is big more, selected filter strength value is also big more;
For example, the initialization filter strength value is filterBS=0, then follow-up can be according to following regular calculation of filtered intensity level filterBS:
If SUM>100, then filterBS=3;
Otherwise, if SUM>45, then filterBS=2;
Otherwise, if SUM>20, then filterBS=1;
Otherwise filterBS=0;
Certainly the value of the filterBS under threshold value here (as 100,45,20 etc.) and the various condition can change according to actual conditions, just illustrates here.
A4, deinterlacing processor select suitable filters that the image-region of the correspondence of present frame is carried out deinterleaving according to filtering strength filterBS and handle not filtering when filterBS=0.
In Fig. 2, deinterlacing processor, the image coding information that can also be further used for obtaining in the deinterleaving processing procedure of current frame image data sends to encoder; Encoder is used for according to described image coding information the current frame image data being carried out encoding process.Encoder also can promote code efficiency and performance like this, and then improves picture quality.
In system shown in Figure 2, deinterlacing processor obtains image coding information in the deinterleaving processing procedure mode may further comprise the steps:
B1, be divided into different image-regions according to big young pathbreaker's one two field picture of coded macroblocks; Each image-region for current frame image is carried out following step, is that example describes with some image-region A still here;
B2, to the image-region A of current frame image, the capable pixel value of n of this image-region A inside is deducted the capable pixel value of n+1, n is an odd number, and asks the absolute value sum of each difference to obtain the first parameter Adiff0; Be in this step the pixel value between adjacent two row of the field, top of image-region A inside and field, the end to be subtracted each other.
Here, the capable pixel value of n of this image-region A inside is deducted the capable pixel value of n+1, n is that odd number is specially: the 1st row pixel value of image-region A inside is deducted the 2nd row as numerical value, and the 3rd row deducts the 4th row as numerical value as numerical value, and the 5th row deducts the 6th row pixel value as numerical value ....
B3, the capable pixel value of 2m-1 of this image-region A inside is deducted the capable pixel value of 2m+1, m is a natural number, and asks the absolute value sum of each difference to obtain the second parameter Adiff1; Perhaps, the capable pixel value of 2m of image-region A inside is deducted the capable pixel value of 2m+2, m is a natural number, and asks the absolute value sum of each difference to obtain the second parameter Adiff1; Be in this step the pixel value between adjacent two row in same (field, top or field, the end) of image-region A inside to be subtracted each other.
Here, the capable pixel value of 2m-1 of this image-region A inside is deducted the capable pixel value of 2m+1, m is that natural number is specially: for the field, top of this image-region A inside, first row deducts the third line as numerical value as numerical value, the third line pixel value deducts the fifth line pixel value, the fifth line pixel value deducts the 7th row pixel value, and the 7th row pixel value deducts the 9th row pixel value ...;
The capable pixel value of 2m of this image-region A inside is deducted the capable pixel value of 2m+2, m is that natural number is specially: for the field, the end of image-region A inside, the second row pixel value deducts the fourth line pixel value, the fourth line pixel value deducts the 6th row pixel value, the 6th row pixel value deducts the 8th row pixel value, and the 8th row pixel value deducts the tenth row pixel value ....
If b4 is Adiff0<Adiff1, and the filter strength value filterBS of this image-region A is greater than zero, then obtain this image-region is carried out field mode image encoded coded message, otherwise, obtain this image-region is carried out frame pattern image encoded coded message.
Here, because Adiff0<Adiff1, and filterBS>0 this image-region of expression A exists image to jump, continuity is relatively poor, therefore is fit to encode according to field mode, otherwise, then there is not jump in presentation video, and continuity is good, can encode according to frame pattern.
In system shown in Figure 2, because deinterlacing processor calculates the filtering strength that carries out the deinterleaving processing according to video image content and motion vector information, the filtering strength that utilization obtains just can be selected suitable filter patterns (being filter), and do not need to carry out just selecting suitable filter patterns after the very complicated data analysis according to video image content, therefore greatly reduce the amount of calculation that deinterleaving is handled, and no longer need carry out deinterleaving and handle in decoding end, decoder directly is sent to decoded video image display device and shows output, does not need extra computing cost.
Fig. 3 is the flow chart that the coding side of system shown in Figure 2 carries out the method for Video processing in real time.As shown in Figure 3, this method may further comprise the steps:
Step 301, video collector are gathered vedio data in real time, and the current frame video image data of being gathered are input to deinterlacing processor.
Step 302, the motion vector information that current frame video image data that deinterlacing processor receiver, video collector sends and encoder send.
In this step, the motion vector information that encoder sends is the motion vector information of the previous frame video image of present frame, can be set to zero by its previous frame video image motion Vector Message for first frame.
Step 303, deinterlacing processor calculates filtering strength according to the motion vector information of previous frame video image.
Step 304, deinterlacing processor is selected suitable filter patterns according to the filtering strength that is calculated.
Step 305, deinterlacing processor carries out deinterleaving according to selected filter patterns to the current frame video image data that received to be handled, and the view data after the deinterleaving sent to encoder, simultaneously the image coding information that obtains in the deinterleaving processing procedure is sent to encoder.
In this step, the image coding information that obtains in the deinterleaving processing procedure is some relevant informations of the reference frame when can be used as coding.
Step 306, encoder carries out the compressed encoding processing according to the image coding information that is received to the current frame image data that received, and is sent to decoding end by network.
Step 307, the motion vector information of encoder record current frame image, and this motion vector information fed back to deinterlacing processor, so that deinterlacing processor can be finished according to the motion vector information of this current frame image the deinterleaving of next frame view data is handled.
So far finished deinterleaving and encoding process, and follow-uply can carry out identical processing according to this method for each frame image data to the current frame image data.
Fig. 4 is the composition structured flowchart of the deinterlacing processor among Fig. 2.As shown in Figure 4, this deinterlacing processor comprises: receiver module 401, analysis module 402 and processing module 403.
In Fig. 4, receiver module 401, be used to receive motion vector information from the previous frame image of the current frame image data of video collector and encoder feedback, the motion vector information of described previous frame image is sent to analysis module 402, described current frame image data are sent to processing module 403; The motion vector information of described previous frame image was a preset value when wherein, present frame was first frame;
Analysis module 402 is used for calculating filtering strength according to the motion vector information of the previous frame image that is received, and selects filter patterns according to the filtering strength that is calculated, and with selected filter patterns notification handler module 403;
Processing module 403 is used for according to the filter patterns of analysis module notice the current frame image data that received being carried out sending to encoder after deinterleaving is handled.
In Fig. 4, receiver module 401 is used for horizontal motion vector and vertical motion vector corresponding to the different images zone that the received code device feeds back; Described different images zone is divided according to the coded macroblocks size; Analysis module 402, be used for each image-region to current frame image, each horizontal motion vector and vertical motion vector to the previous above frame correspondence image zone of present frame take absolute value, summation then, and select filter strength value corresponding to this image-region according to this and value.
In Fig. 4, processing module 403, the image coding information that is further used for obtaining in the deinterleaving processing procedure of current frame image data sends to encoder, makes encoder carry out encoding process according to described image coding information to the current frame image data.
In Fig. 4, processing module 403 is used for each image-region to current frame image, and the capable pixel value of n of this image-region inside is deducted the capable pixel value of n+1, and n is an odd number, and asks the absolute value sum of each difference to obtain first parameter; The capable pixel value of 2m-1 of this image-region inside is deducted the capable pixel value of 2m+1, and perhaps the capable pixel value of 2m with this image-region inside deducts the capable pixel value of 2m+2, and m is a natural number, and asks the absolute value sum of each difference to obtain second parameter; If first parameter is less than second parameter, and the filter strength value of this image-region then obtains this image-region is carried out field mode image encoded coded message greater than zero, otherwise, obtain this image-region is carried out frame pattern image encoded coded message; Wherein, the different images zone of current frame image is divided according to the coded macroblocks size.
In sum, this deinterlacing processor of the present invention calculates filtering strength according to the motion vector information of the previous frame image of encoder feedback, select filter patterns according to the filtering strength that is calculated, filter patterns according to described selection carries out being sent to the technical scheme that encoder carries out encoding process after deinterleaving is handled to the current frame image data then, owing to the deinterleaving of finishing with reference to the motion vector information of previous frame image the current frame image data, therefore greatly reduce the amount of calculation of deinterleaving, and handle owing to finish deinterleaving, therefore can alleviate the computing cost of decoding end at coding side.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention, all any modifications of being made within the spirit and principles in the present invention, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.