CN100452878C - Motion image handling method in video coding - Google Patents

Motion image handling method in video coding Download PDF

Info

Publication number
CN100452878C
CN100452878C CNB2005100568858A CN200510056885A CN100452878C CN 100452878 C CN100452878 C CN 100452878C CN B2005100568858 A CNB2005100568858 A CN B2005100568858A CN 200510056885 A CN200510056885 A CN 200510056885A CN 100452878 C CN100452878 C CN 100452878C
Authority
CN
China
Prior art keywords
frame
movement velocity
quantization parameter
scene switching
movement
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
CNB2005100568858A
Other languages
Chinese (zh)
Other versions
CN1842162A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CNB2005100568858A priority Critical patent/CN100452878C/en
Publication of CN1842162A publication Critical patent/CN1842162A/en
Application granted granted Critical
Publication of CN100452878C publication Critical patent/CN100452878C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention discloses a motion image processing method in video encoding. The video encoding uses a P frame encoding mode, the method is that firstly the motion velocity of the current frame of an image is determined, and according to the motion velocity of the current frame, a quantization coefficient of a next frame is adjusted. When the motion velocity of the current frame is enlarged, the quantization coefficient of the next frame is enlarged, and then according to the determined quantization coefficient, the next frame is encoded. Simultaneously, the present invention also discloses an other motion image processing method in the video encoding. The present invention has a scheme that according to the motion velocity of the current frame, the quantization coefficient of the next frame is adjusted, when the motion of the current frame image is intensified, the quantization coefficient of the next frame is enhanced. According to the adjusted quantization coefficient, the next frame is encoded to increase the encoding compression ratio of the next frame and reduce the output of code stream.

Description

Motion image processing method in a kind of video coding
Technical field
The present invention relates to real-time video coding techniques field, relate to the motion image processing method in a kind of video coding or rather.
Background technology
At present, the real-time video coding techniques has been widely used in occasions such as video telephone, Internet video chat, video conference.When video coding, a two field picture can be divided into several macro blocks, and image encoding need be encoded respectively to each macro block.Video coding mainly comprises intraframe predictive coding and two kinds of coding modes of inter prediction encoding, and intraframe predictive coding is I frame coding, and interframe encode is P frame coding.I frame coding mainly is to utilize the adjacent macroblocks of this two field picture to predict current macro, and P frame coding then mainly is to utilize the former frame image to predict current macro.
Under normal conditions, the correlation in the image sequence between frame and the frame is bigger, and is especially true for the little image that moves, so the compression effectiveness of P frame coding is relatively good.Present video coding mostly adopts this coded system.
But, adopting P frame coding to carry out under the situation of video compression at present, if the image of input is a moving image, then the code efficiency of encoder can reduce, and compression ratio decline, output code flow increases.If the code efficiency of encoder is too low, then can cause computer and to transfer out with the image real-time coding of input, this has just influenced the application of video coding technique in occasion in real time.If output code flow is too big, then under band-limited situation, the code stream of output often can't in time arrive the other side by Network Transmission, thereby make real-time video use problems such as delay, obstruction occur, this will reduce the experience effect of user to image, even makes real-time video can't use fully.
Summary of the invention
In view of this, subject matter to be solved by this invention is to provide the motion image processing method in a kind of video coding, with when image moves, can guarantee the relatively stable of code stream.
The present invention also provides the motion image processing method in the another kind of video coding simultaneously, the code efficiency when entering the scene switching state to improve image.
Motion image processing method in a kind of video coding of the present invention, described video coding adopts the P frame coding mode, and this method may further comprise the steps:
A. determine the movement velocity of image present frame according to the average motion vector of image present frame;
B. adjust the quantization parameter of next frame according to the movement velocity of present frame, and when the movement velocity of present frame increases, increase the quantization parameter of next frame;
C. according to the determined quantization parameter of step b, next frame is encoded.
The average motion vector mv of described present frame passes through formula mv ‾ = 1 N Σ n = 0 N - 1 mv n Calculate, wherein, N is the macroblock number of a frame, mv nMotion vector for macro block n.
Further comprise before the described step b: the corresponding relation of movement velocity and quantization parameter is set, and movement velocity is high more, the corresponding quantitative coefficient is high more;
Described step b comprises: determine the pairing quantization parameter of movement velocity of present frame according to described corresponding relation, and with the quantization parameter of determined quantization parameter as next frame.
Further comprise before the described step b: the corresponding relation of movement velocity and movement degree grade is set, and the corresponding relation of movement degree grade and quantization parameter;
Described step b comprises: according to the corresponding movement degree grade of the determined movement velocity of corresponding relation determining step a of movement velocity and movement degree grade, and determine current definite pairing quantization parameter of movement degree grade according to the corresponding relation of movement degree grade and quantization parameter, afterwards with the quantization parameter of determined quantization parameter as next frame.
This method is before execution in step b, further comprise: judge the current scene switching state that whether is in according to the movement velocity of present frame, if, then use the I frame coding mode instead one or more subsequent frame is encoded, adopt the P frame coding mode to encode afterwards again; Otherwise, continue execution in step b.
When using the I frame coding mode instead and encode, further comprise: adjust the quantization parameter that needs adopt the subsequent frame that the I frame coding mode encodes according to the movement velocity of present frame, and described subsequent frame is carried out I frame coding according to adjusted quantization parameter.
Described movement velocity according to present frame judges that the current scene switching state that whether is in is: whether the movement velocity of judging present frame is greater than the scene switching threshold that sets in advance, if then be in the scene switching state; Otherwise, be not in the scene switching state.
Described before determining to be in the scene switching state, further comprise: determine the movement velocity of next frame, and whether the movement velocity of judging next frame is greater than the scene switching threshold that sets in advance, if then determine to be in the scene switching state; Otherwise, determine not to be in the scene switching state.
This method further comprises: the corresponding relation that movement velocity and movement degree grade are set;
Described movement velocity according to present frame judges that the current scene switching state that whether is in is: the pairing movement degree grade of movement velocity of determining present frame according to described corresponding relation, and judge whether this movement degree grade is the largest motion intensity grade, if then determine to be in the scene switching state; Otherwise, determine not to be in the scene switching state.
Described before determining to be in the scene switching state, further comprise: the movement velocity of determining next frame, and determine the pairing movement degree grade of movement velocity of this next frame according to the corresponding relation of described movement velocity and movement degree grade, judge whether this movement degree grade is the largest motion intensity grade, if then determine to be in the scene switching state; Otherwise, determine not to be in the scene switching state.
The present invention program adjusts the quantization parameter of next frame according to the movement velocity of present frame, when current frame image motion aggravation, improve the quantization parameter of next frame, and next frame is encoded according to adjusted quantization parameter, thereby increased encoding compression ratio, and then reduced code stream output next frame.
The present invention program also can determine the current scene switching state that whether is in according to the movement velocity of present frame, and determining currently when being in the scene switching state, follow-up one or more two field picture is adopted the image processing scheme of the I frame coding mode of intraframe predictive coding.P frame coding mode than inter prediction encoding, several frames that are in the scene switching state are adopted the I frame coding mode, improved code efficiency, thereby when having realized that code stream output is stable, can also further improve code efficiency moving image to moving image.
Description of drawings
Fig. 1 carries out the flow chart of image processing by adjustment quantization parameter QP for the present invention;
Fig. 2 carries out the flow chart of image processing for the present invention by adjusting coded system.
Embodiment
Because the coding of prediction residual comprises dct transform, quantification and this several steps of encoding in the P frame coding mode, and quantization parameter QP directly influences the compression ratio of coding, therefore, the present invention has mainly provided the scheme of quantization parameter QP being adjusted according to the movement degree of present image, and next frame is encoded according to adjusted quantization parameter QP, thereby adjusted the compression ratio of coding, and then reached output code flow, the metastable purpose of maintenance code stream that reduces under the image strenuous exercise situation.
Below in conjunction with drawings and the specific embodiments the present invention program is described in further detail.
The scheme of adjusting quantization parameter QP among the present invention as shown in Figure 1, corresponding following steps:
Step 101, determine the movement velocity of image present frame.
The movement velocity of image present frame can be weighed according to the average motion vector mv of present frame, and mv then can adopt following formula to calculate:
mv ‾ = 1 N Σ n = 0 N - 1 mv n
Wherein, N is the macroblock number of a frame, when macro block n is the Inter macro block, and mv nThe motion vector value that obtains for the macro block estimation; When n is the Intra macro block, mv nMotion vector value for maximum search radius correspondence.
Step 102, determine the quantization parameter QP of next frame according to the determined movement velocity of step 101.
Specifically, the present invention program can be provided with the pairing quantization parameter QP of different motion speed, and setting principle is: movement velocity is high more, and the corresponding quantitative coefficient is high more.Because movement velocity is very many, the corresponding relation more complicated of movement velocity and QP directly is set, to simplify the process, can determine corresponding movement degree grade, and the pairing quantization parameter QP of each movement degree grade is set according to movement velocity.
Be example with the corresponding relation that movement degree grade and QP are set below.At first, for determine the movement degree grade of image present frame according to the value of mv, a plurality of movement degree grades can be set, and the pairing threshold value of different brackets is set, thereby can determine the movement degree of present frame according to set threshold value.Such as, movement degree is divided into I, II, III and four grades of IV, and following threshold decision relation is set:
Mv<m 1, image is steady, and it is very little to move, and does not have motion (1)
m 1≤ mv<m 2Image has less motion, is I level motion (2)
m 2≤ mv<m 3Image has bigger motion, is II level motion (3)
m 3≤ mv<m 4Image motion is very big, is III level motion (4)
Mv 〉=m 4Image strenuous exercise is IV level motion (5)
Wherein, m1, m2, m3 and m4 can be provided with as required, such as, be set to m1=3, m2=10, m3=17, m4=24.
After having determined the movement degree of image present frame according to the value of mv, can think that next frame also is this movement degree, therefore can determine the quantization parameter QP of next frame according to the movement degree grade of this present frame, and adjust the quantization parameter QP of next frame with this.
Wherein, when the pairing quantization parameter QP of different motion degree is set, can be that a basic frame quantization parameter QP is set earlier 0, this QP 0Be the quantization parameter under the no motion conditions, and the recruitment of the required increase of different motion intensity grade is set, such as, can be set as follows:
I level moving image: QP=QP 0+ Δ 1(6)
II level moving image: QP=QP 0+ Δ 2(7)
III level moving image: QP=QP 0+ Δ 3(8)
IV level moving image: QP=QP 0+ Δ 4(9)
Wherein, Δ 1, Δ 2, Δ 3, Δ 4Concrete choosing value can be provided with as required, such as, Δ can be set 1=1, Δ 2=2, Δ 3=3, Δ 4=4.
By above-mentioned steps, can realize according to the adjustment of present frame to next frame quantization parameter QP.Such as, determine that according to step 101 present frame is in II level movement degree, then the quantization parameter of next frame is set to QP 0+ Δ 2
Step 103, with the quantization parameter QP of the determined quantization parameter QP of step 102 as next frame, next frame is encoded.
Promptly realized processing by above-mentioned steps to moving image.
In addition, the P frame coding mode that video coding adopted has made full use of the relativity of time domain of image, can obtain higher compression ratio usually, but when being in the scene switching state, adopts the compression effectiveness of P frame coding good unlike the compression effectiveness of I frame coding.This is because when scene is switched, and the relativity of time domain of image is very little, and the strenuous exercise of image has caused the efficient of estimation very low during the scene switching, thereby causes code efficiency very low.And therefore I frame coding can not cause code efficiency to reduce because of the strenuous exercise of image owing to be infra-frame prediction, and compression effectiveness in this case is often very nearly the same with the compression effectiveness of P frame coding.
For these reasons, for improving code efficiency, the present invention has further proposed to adopt the scheme of I frame coding mode when scene is switched.Certainly, realize the conversion of coded system, at first will determine when to be the scene switching.Owing to can determine the different motion degree of image in the scheme shown in Figure 1, therefore can when the movement degree of determining present frame is maximum level, determine the current scene switching state that is in.Also can be that a scene switching threshold is set, if the movement velocity of present frame greater than this threshold value, is then determined the current scene switching state that is in.Wherein, for guaranteeing the judgment accuracy of scene switching state, can also determine that two continuous frames or two frames are maximum level with the movement degree of epigraph, or corresponding movement velocity shows that image enters the scene switching state during greater than set scene switching threshold.
Determine current be in the scene switching state after, can directly change coded system, specifically, ensuing M frame can be regarded as scene switching transition frames, this M frame is adopted I frame coding, after adopting the I frame coding mode to finish dealing with, adopt the P frame coding mode that the frame of back is carried out encoding process again to this M frame.Wherein, the concrete frame number of this M frame can be provided with as required.Certainly, when adopting I frame coding, can also adjust quantization parameter QP simultaneously, and carry out I frame coding,, reduce output code flow to increase compression ratio according to adjusted quantization parameter QP.
In addition, after adopting the P frame coding mode again, can also proceed quantization parameter adjustment and follow-up processing such as scene switching according to such scheme.
Scheme described above mainly is based on the adjustment to the frame quantization parameter, and further increased processing when the scene switching state, in actual treatment, to simplify the process, can also quantization parameter not adjusted, judge just whether present frame is in the scene switching state, if the current scene switching state that is not in then continues to adopt the P frame coding mode to carry out encoding process; If be in the scene switching state, then the current P frame coding mode that adopts is changed to the I frame coding mode, promptly adopt the I frame coding mode that M frame carried out encoding process, after this M frame coding finished, think that promptly the scene switching finishes, and adopts the P frame coding mode to encode again again.Certainly, after adopting the P frame coding mode again, can also continue by judging that the current scene switching state that whether is in determines whether to change coded system.This realization flow as shown in Figure 2.Based on processing shown in Figure 2, the concrete judgment mode of its scene switching state is identical with aforementioned manner, therefore repeats no more.
The above only is the present invention program's preferred embodiment, not in order to limit protection scope of the present invention.

Claims (10)

1, the motion image processing method in a kind of video coding, described video coding adopts the P frame coding mode, it is characterized in that this method may further comprise the steps:
A. determine the movement velocity of image present frame according to the average motion vector of image present frame;
B. adjust the quantization parameter of next frame according to the movement velocity of present frame, and when the movement velocity of present frame increases, increase the quantization parameter of next frame;
C. according to the determined quantization parameter of step b, next frame is encoded.
2, method according to claim 1 is characterized in that, the average motion vector mv of described present frame passes through formula mv ‾ = 1 N Σ n = 0 N - 1 mv n Calculate, wherein, N is the macroblock number of a frame, mv nMotion vector for macro block n.
3, method according to claim 1 is characterized in that, further comprise before the described step b: the corresponding relation of movement velocity and quantization parameter is set, and movement velocity is high more, the corresponding quantitative coefficient is high more;
Described step b comprises: determine the pairing quantization parameter of movement velocity of present frame according to described corresponding relation, and with the quantization parameter of determined quantization parameter as next frame.
4, method according to claim 1 is characterized in that, further comprises before the described step b: the corresponding relation of movement velocity and movement degree grade is set, and the corresponding relation of movement degree grade and quantization parameter;
Described step b comprises: according to the corresponding movement degree grade of the determined movement velocity of corresponding relation determining step a of movement velocity and movement degree grade, and determine current definite pairing quantization parameter of movement degree grade according to the corresponding relation of movement degree grade and quantization parameter, afterwards with the quantization parameter of determined quantization parameter as next frame.
5, method according to claim 1, it is characterized in that, this method is before execution in step b, further comprise: judge the current scene switching state that whether is in according to the movement velocity of present frame, if, then use the I frame coding mode instead one or more subsequent frame is encoded, adopt the P frame coding mode to encode afterwards again; Otherwise, continue execution in step b.
6, method according to claim 5, it is characterized in that, when using the I frame coding mode instead and encode, further comprise: adjust the quantization parameter that needs adopt the subsequent frame that the I frame coding mode encodes according to the movement velocity of present frame, and described subsequent frame is carried out I frame coding according to adjusted quantization parameter.
7, method according to claim 5, it is characterized in that, described movement velocity according to present frame judges that the current scene switching state that whether is in is: whether the movement velocity of judging present frame is greater than the scene switching threshold that sets in advance, if then be in the scene switching state; Otherwise, be not in the scene switching state.
8, method according to claim 7, it is characterized in that, described before determining to be in the scene switching state, further comprise: the movement velocity of determining next frame, and whether the movement velocity of judging next frame is greater than the scene switching threshold that sets in advance, if then determine to be in the scene switching state; Otherwise, determine not to be in the scene switching state.
9, method according to claim 5 is characterized in that, this method further comprises: the corresponding relation that movement velocity and movement degree grade are set;
Described movement velocity according to present frame judges that the current scene switching state that whether is in is: the pairing movement degree grade of movement velocity of determining present frame according to described corresponding relation, and judge whether this movement degree grade is the largest motion intensity grade, if then determine to be in the scene switching state; Otherwise, determine not to be in the scene switching state.
10, method according to claim 9, it is characterized in that, described before determining to be in the scene switching state, further comprise: the movement velocity of determining next frame, and determine the pairing movement degree grade of movement velocity of this next frame according to the corresponding relation of described movement velocity and movement degree grade, judge whether this movement degree grade is the largest motion intensity grade, if then determine to be in the scene switching state; Otherwise, determine not to be in the scene switching state.
CNB2005100568858A 2005-03-28 2005-03-28 Motion image handling method in video coding Active CN100452878C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100568858A CN100452878C (en) 2005-03-28 2005-03-28 Motion image handling method in video coding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100568858A CN100452878C (en) 2005-03-28 2005-03-28 Motion image handling method in video coding

Publications (2)

Publication Number Publication Date
CN1842162A CN1842162A (en) 2006-10-04
CN100452878C true CN100452878C (en) 2009-01-14

Family

ID=37030983

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100568858A Active CN100452878C (en) 2005-03-28 2005-03-28 Motion image handling method in video coding

Country Status (1)

Country Link
CN (1) CN100452878C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546917B (en) * 2010-12-31 2014-10-22 联想移动通信科技有限公司 Mobile terminal with camera and video processing method therefor
CN103167282B (en) * 2011-12-16 2016-09-14 中国科学院沈阳自动化研究所 A kind of online updating method of image compression dynamic regulation
WO2014054325A1 (en) * 2012-10-05 2014-04-10 ソニー株式会社 Encoding control device and encoding control method
WO2014094204A1 (en) * 2012-12-17 2014-06-26 Intel Corporation Leveraging encoder hardware to pre-process video content
CN103327329B (en) * 2013-06-09 2017-04-12 深圳市云宙多媒体技术有限公司 Method and system for quantitative adjustment of image quality jump
CN111770331A (en) * 2020-07-17 2020-10-13 广州市奥威亚电子科技有限公司 Video coding method, device and system
CN112637549A (en) * 2020-11-18 2021-04-09 合肥市卓迩无人机科技服务有限责任公司 Panoramic code stream reduction method for multi-path quasi-real-time spliced video

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0697792A2 (en) * 1994-08-19 1996-02-21 Sony Corporation Recording digital video signals
US6101222A (en) * 1996-11-26 2000-08-08 Sony Corporation Scene change detection
CN1328747A (en) * 1998-09-29 2001-12-26 通用仪器公司 Method and apparatus for detecting scene changes and adjusting picture coding type in high definition television encoder
US6389072B1 (en) * 1998-12-23 2002-05-14 U.S. Philips Corp. Motion analysis based buffer regulation scheme
US20020150160A1 (en) * 2000-12-11 2002-10-17 Ming-Chang Liu Video encoder with embedded scene change and 3:2 pull-down detections
US6480543B1 (en) * 1998-08-06 2002-11-12 Stmicroelectronics S.R.L. Detection of a change of scene in a motion estimator of a video encoder

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0697792A2 (en) * 1994-08-19 1996-02-21 Sony Corporation Recording digital video signals
US6101222A (en) * 1996-11-26 2000-08-08 Sony Corporation Scene change detection
US6480543B1 (en) * 1998-08-06 2002-11-12 Stmicroelectronics S.R.L. Detection of a change of scene in a motion estimator of a video encoder
CN1328747A (en) * 1998-09-29 2001-12-26 通用仪器公司 Method and apparatus for detecting scene changes and adjusting picture coding type in high definition television encoder
US6389072B1 (en) * 1998-12-23 2002-05-14 U.S. Philips Corp. Motion analysis based buffer regulation scheme
US20020150160A1 (en) * 2000-12-11 2002-10-17 Ming-Chang Liu Video encoder with embedded scene change and 3:2 pull-down detections

Also Published As

Publication number Publication date
CN1842162A (en) 2006-10-04

Similar Documents

Publication Publication Date Title
CN100452878C (en) Motion image handling method in video coding
CN101138250B (en) Adaptive intra-frame refresh for digital video encoding
CN100353769C (en) Video data conversion device and video data conversion method
CN101115208B (en) Picture coding apparatus
CN101015215B (en) Methods and apparatus for performing fast mode decisions in video codecs.
KR100281967B1 (en) Image coding apparatus using spatial correlation and method thereof
CN100401782C (en) Method and apparatus for controlling rate of video sequence, video encoding device
CN101835042B (en) Wyner-Ziv video coding system controlled on the basis of non feedback speed rate and method
CN103533359B (en) One is bit rate control method H.264
TW200605675A (en) Method and apparatus for lossless encoding and decoding
CN1949877A (en) Adaptive quantization controller and method thereof
CN100574447C (en) Fast intraframe predicting mode selecting method based on the AVS video coding
CN101009838B (en) Bit rate conversion coding method, conversion encoder, and integrated circuit capable of restraining drift error
CN109862356A (en) A kind of method for video coding and system based on area-of-interest
CN101562750B (en) Device and method for fast selecting video coding mode
CN101909211A (en) H.264/AVC high-efficiency transcoder based on fast mode judgment
CN101304529A (en) Method and device for selecting macro block pattern
CN1694536A (en) Video encoder using average histogram difference and method for controlling the same
CN103384327A (en) AVS fast mode selection algorithm based on adaptive threshold
CN110351552B (en) Fast coding method in video coding
CN112543328A (en) Auxiliary encoding method, auxiliary encoding device, computer equipment and storage medium
CN106888379A (en) It is applied to H.264 arrive the interframe fast video code-transferring method of HEVC
CN101883275B (en) Video coding method
CN108989818B (en) Image coding parameter adjusting method and device
CN101516028B (en) Efficient video coding technique aiming at video call application in mobile network

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