CN101141648A - Column diagram based weight predicting method - Google Patents

Column diagram based weight predicting method Download PDF

Info

Publication number
CN101141648A
CN101141648A CN 200710046143 CN200710046143A CN101141648A CN 101141648 A CN101141648 A CN 101141648A CN 200710046143 CN200710046143 CN 200710046143 CN 200710046143 A CN200710046143 A CN 200710046143A CN 101141648 A CN101141648 A CN 101141648A
Authority
CN
China
Prior art keywords
frame
weighted prediction
histogram
brightness
macro
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.)
Pending
Application number
CN 200710046143
Other languages
Chinese (zh)
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.)
Central Academy of SVA Group Co Ltd
Original Assignee
Central Academy of SVA Group 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 Central Academy of SVA Group Co Ltd filed Critical Central Academy of SVA Group Co Ltd
Priority to CN 200710046143 priority Critical patent/CN101141648A/en
Publication of CN101141648A publication Critical patent/CN101141648A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present invention provides a weight forecasting method based on histogram, which relates to the digital audio frequency and video frequency coding and decoding technology. Firstly the method estimates whether the scene changing happens between two frames according to a histogram which is counted by the current frame and the former frame; then the images of a former frame and a later frame are divided into a plurality of macro-blocks in the same size, and the average value of the brightness of each macro-block is calculated; then the average values of the brightness of the macro-blocks which are respectively positioned in the same places in the former frame and the later frame are compared, to find out a suitable macro-block, and the weight coefficient and the deviant in the weight forecasting are worked out by the least square method; then a frame data which is gained by weight forecasting is worked out according to the weight coefficient and the deviant; at last the histogram of the frame data is counted, the X<2> counted distance of the histogram of the current frame is calculated, and the effectiveness of the weight forecasting is estimated. An appropriate coding form to the image can be chosen according to the estimating result by the method, to improve the compression quality of the video frequency in the situation that the same compression efficiency is ensured.

Description

Histogram-based weighted prediction method
Technical Field
The invention relates to a digital audio and video coding and decoding technology, in particular to a weighted prediction method based on a histogram.
Background
In recent years, a lot of digital audio and video coding and decoding standards appear at home and abroad, wherein more representative standards include international standard h.264/MPEG-4AVC, standard AVS independently established in China, and the like, and a technology called weighted prediction is introduced in all the standards, and the technology can improve the compression rate of videos to a certain extent on the premise of the same video quality, particularly for some special sequences, such as: there is a gradual change in the brightness of each frame in a video sequence or, in the case of flashing lights in a news program, the brightness changes abruptly and greatly between successive frames without the image content of the frames changing significantly. Under the above condition, the correlation between the current frame and the reference frame is smaller than the correlation between the frame and the reference frame after certain linear transformation, so that the weighted prediction technology can be used for better predictive coding, and the compression efficiency is improved. Although the technique of weighted prediction is proposed in the h.264 or AVS standard, there is no clear question of how the technique should be used, how to determine weighting coefficients and offset values, and the like. Therefore, how to effectively apply the weighted prediction to the audio/video encoding and decoding technology becomes a technical problem to be solved urgently in the industry.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a weighted prediction method suitable for video coding to determine whether scene switching occurs in a video sequence, whether a weighted prediction algorithm needs to be applied, and improve the compression quality of a video by reasonably applying different coding techniques while ensuring the same compression efficiency.
In order to solve the technical problem, the invention is realized as follows: a histogram-based weighted prediction method for determining and verifying whether a scene cut occurs between two consecutive frames in a video sequence consisting of a plurality of consecutive frames and whether a subsequent frame is suitable for weighted prediction encoding using a previous frame, while calculating a weighting coefficient and an offset value at the time of weighted prediction encoding, the method comprising the steps of:
(1) According to the data of the current frame and the previous frame, the histogram of each frame is counted, and the χ of the two histograms is calculated 2 Counting the distance, judging whether scene switching occurs between the two frames, if so, entering the step (2), otherwise, performing common interframe predictive coding on the frame, and simultaneously continuing to perform the step (1) on the next frame;
(2) Dividing the images of the front frame and the rear frame into a plurality of macro blocks with the same size respectively, and calculating the brightness average value of each macro block;
(3) Effective macro blocks suitable for linear fitting are found out by comparing the brightness average values of macro blocks at the same positions in the front frame and the rear frame, and a weighting coefficient and an offset value in weighting prediction are calculated according to the brightness average values of the effective macro blocks by using a least square method;
(4) Calculating frame data obtained through weighted prediction according to the weighting coefficient and the deviation value;
(5) Counting the histogram of the frame data, and calculating χ of the histogram and the histogram of the current frame 2 And (5) counting the distance, and judging whether the weighted prediction is effective or not so as to verify whether scene switching occurs or not.
The size of each macroblock in step (2) above is denoted MicroSize × MicroSize, and 0 < MicroSize < 64.
In the step (3), if the difference between the average brightness values of the macroblocks at the same positions in the previous and subsequent frames is greater than or equal to a threshold and less than or equal to 10 times the threshold, it is determined that the macroblock is a valid macroblock, where the threshold is greater than 5 and less than 30.
Further, if the average value of the brightness of each effective macro block in the current frame is y 1 ,y 2 ,...,y n The average value of the brightness of each effective macro block of the previous frame corresponding to the average value is x 1 ,x 2 ...,x n Then, the weighting factor a and the offset value B are calculated by the following formula:
Figure A20071004614300051
Figure A20071004614300052
wherein, the first and the second end of the pipe are connected with each other,
Figure A20071004614300053
Figure A20071004614300054
if the weighted prediction is judged to be effective in the step (5), carrying out weighted prediction coding on the current frame; if the weighted prediction is judged to be invalid, the scene switching is indicated to occur, and the intra-frame prediction coding is carried out on the current frame.
The histogram-based weighted prediction method provided by the invention can be used for predicting the chi of two frames in a video sequence 2 Counting the distance and the difference value of the brightness average value of each macro block to judge whether scene switching occurs between two frames or whether weighted prediction needs to be applied, and selecting a proper coding mode for coding the image according to the obtained result, thereby improving the coding without improving the coding complexity and influencing the coding speedAnd (4) quality.
Drawings
The histogram-based weighted prediction method of the present invention is illustrated by the following examples and accompanying drawings.
FIG. 1 is a flowchart illustrating a weighted prediction method according to an embodiment of the present invention.
Detailed Description
The histogram-based weighted prediction method of the present invention will be described in further detail below.
As shown in fig. 1, the weighted prediction method of the present invention mainly includes the following steps:
first, step S1, i.e. the detection of scene cuts, is performed. Counting histograms of each frame according to input YUV data of a current frame and a previous frame, then calculating chi 2 statistical distance of the two histograms, judging whether the sequence has scene switching between the two frames, and entering a step S2 if the sequence has scene switching; if not, the common interframe predictive coding is carried out on the frame, and meanwhile, the step S1 is continuously carried out on the next frame.
The scene cut detection step further comprises two sub-steps:
s1.1, calculating the statistical difference value of the brightness signals of the current frame image and the previous frame image, wherein the calculation formula is as follows:
Figure A20071004614300061
where L is the gray level of the video sequence, f n (i) Obtained according to the following statement:
for i=0;i<W;i++
for j=0;j<H;j++
{
f n (image n (i,j))++
}
wherein W and H are the width and height of the image, respectively; image n (i, j) is the luminance value of the pixel at (i, j) in the nth frame image, f n (i) Has an initial value of zero.
S1.2, calculating a threshold for judging whether scene switching occurs:
in a preferred embodiment of the present invention, the average value of the statistical difference values of the frame images calculated in step S1.1 in the current group of picture sequences (GOP) is used as the threshold value for determining scene change, and the specific calculation formula is as follows:
Figure A20071004614300062
where N is the one in the current group of image sequences which has been coded in step S1.1The number of image frames. If Diff n Greater than Diff average * weight (weight is a weighting coefficient), it indicates that scene switching has occurred, otherwise, scene switching has not occurred.
Next, step S2 is executed to divide the two previous and next frames of images into several macro blocks with the same size, and calculate the average value of the brightness of each macro block, where the size of each macro block can be expressed as MicroSize × MicroSize, where 0 < MicroSize < 64.
Then step S3 is executed, a macroblock meeting certain requirements is selected according to the result in step S2, and a weighting coefficient a and an offset B in weighted prediction are calculated, which further includes the following two substeps:
s3.1, selecting macro blocks meeting certain requirements:
since the weighted prediction is linear prediction, in practice, a suitable point is found, and then a straight line fitting is performed, in the present invention, the mean VALUE of the luminance of each macroblock is equivalent to each point in the straight line fitting process, the mean VALUEs of the macroblocks at the same positions of the previous and next frames calculated in step S2 are compared, and if the difference between the two mean VALUEs is less than the threshold VALUE TH _ VALUE, or the difference between the two mean VALUEs is greater than 10 times of the threshold VALUE TH _ VALUE, the macroblock is determined to be an unsatisfactory macroblock, and needs to be discarded in the weighted prediction process. The threshold VALUE TH _ VALUE is an empirical VALUE, and the VALUE thereof is greater than 5 and less than 30.
S3.2 apply the least squares method to calculate the weighting coefficients a and offsets B:
recording the mean value of each effective macro block meeting the requirement in the current frame as y 1 ,y 2 ,...,y n The mean value of each macroblock of the previous frame corresponding to it is denoted as x 1 ,x 2 ,...,x n Then, linear fitting is carried out on the linear fitting by using a formula of a least square method, and the following calculation is carried out:
Figure A20071004614300071
wherein, the first and the second end of the pipe are connected with each other,
Figure A20071004614300073
Figure A20071004614300074
next, step S4 is executed to calculate frame data obtained through weighted prediction according to the weighting coefficient a and the offset B obtained in step S3 and the luminance value of each pixel of the previous frame.
Finally, step S5 is executed, according to the prediction frame data obtained in step S4, a histogram of the prediction frame is counted, and χ of the histogram and the histogram of the current frame is calculated 2 Counting the distance and judging whether the weighted prediction is effective, wherein the method further comprises the following two substeps:
s5.1 calculating the X between the predicted frame and the current frame based on the histogram feature 2 Statistical distance d χ 2 (H forecast ,H current ) Simultaneously calculating χ of the current frame and the previous frame 2 Statistical distance d χ 2 (H pre ,H current )。
Histogram feature based χ between two frames 2 The statistical distance is defined as follows:
Figure A20071004614300081
i=0,1,...,L-1
wherein H 1 Corresponding to H in the previous formula forcast And H pre And H is 2 Corresponds to H current And L is the gray level of the video sequence,
Figure A20071004614300082
i=0,1,...,L-1
s5.2, judging whether the weighted prediction is effective:
if it satisfies
Figure A20071004614300083
Then the weighted sum isCarrying out prediction coding on the current frame according to the result of weighted prediction; otherwise, the weighted prediction is invalid, which indicates that scene switching occurs between the previous frame and the current frame, so that the intra-frame prediction coding is performed on the frame. Wherein, coefficient is an empirical coefficient, and 0 < coefficient < 1.
The weighted prediction method based on the histogram is applied to an AVS encoder, and a news program sequence containing the appearance conditions of a plurality of flash lamps is adopted for carrying out experiments, and the experimental results show that the method can distinguish the real scene switching in the sequence and the conditions of frames suitable for applying the weighted prediction algorithm, and can adopt different coding modes for each frame according to different conditions, so that the quality of the coded image is improved under the condition of the same compression ratio.

Claims (5)

1. A histogram-based weighted prediction method for determining and verifying whether a scene cut occurs between two consecutive frames in a video sequence consisting of a plurality of consecutive frames and whether a subsequent frame is suitable for weighted prediction coding using a previous frame, and calculating a weighting coefficient and an offset value in weighted prediction coding, the method comprising the steps of:
(1) According to the data of the current frame and the previous frame, the histogram of each frame is counted, and the χ of the two histograms is calculated 2 Counting the distance, judging whether scene switching occurs between the two frames, if so, entering the step (2), otherwise, performing common interframe predictive coding on the frame, and simultaneously continuing to perform the step (1) on the next frame;
(2) Dividing the images of the front frame and the rear frame into a plurality of macro blocks with the same size respectively, and calculating the brightness average value of each macro block;
(3) Effective macro blocks suitable for linear fitting are found out by comparing the brightness average values of macro blocks at the same positions in the front frame and the rear frame, and a weighting coefficient and an offset value in weighting prediction are calculated according to the brightness average values of the effective macro blocks by using a least square method;
(4) Calculating frame data obtained through weighted prediction according to the weighting coefficient and the deviation value;
(5) Counting the histogram of the frame data, and calculating the χ of the histogram and the histogram of the current frame 2 Counting the distance, and judging whether the weighted prediction is effective or not so as to verify whether scene switching occurs or not.
2. The weighted prediction method of claim 1, wherein: the size of each macroblock in step (2) is denoted MicroSize × MicroSize, and 0 < MicroSize < 64.
3. The weighted prediction method of claim 1, wherein: in the step (3), if the difference between the average brightness values of the macroblocks at the same positions in the previous and subsequent frames is greater than or equal to a threshold and less than or equal to 10 times the threshold, it is determined that the macroblock is a valid macroblock, wherein the threshold is greater than 5 and less than 30.
4. A method of weighted prediction as defined in claim 3, characterized by: if the average value of the brightness of each effective macro block in the current frame is y 1 ,y 2 ,...,y n The average value of the brightness of each effective macro block of the previous frame corresponding to the average value is x 1 ,x 2 ,...,x n Then, the calculation formula of the weighting coefficient a and the offset value B is:
Figure A2007100461430002C1
Figure A2007100461430002C2
wherein, the first and the second end of the pipe are connected with each other,
Figure A2007100461430002C4
5. the weighted prediction method of claim 1, wherein: if the weighted prediction is judged to be effective in the step (5), performing interframe prediction coding of the weighted prediction on the current frame; if the weighted prediction is judged to be invalid, the scene switching is shown to occur, and the intra-frame prediction coding is carried out on the current frame.
CN 200710046143 2007-09-20 2007-09-20 Column diagram based weight predicting method Pending CN101141648A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200710046143 CN101141648A (en) 2007-09-20 2007-09-20 Column diagram based weight predicting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200710046143 CN101141648A (en) 2007-09-20 2007-09-20 Column diagram based weight predicting method

Publications (1)

Publication Number Publication Date
CN101141648A true CN101141648A (en) 2008-03-12

Family

ID=39193343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200710046143 Pending CN101141648A (en) 2007-09-20 2007-09-20 Column diagram based weight predicting method

Country Status (1)

Country Link
CN (1) CN101141648A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045556B (en) * 2009-10-22 2012-10-31 杭州华三通信技术有限公司 Method and device for coding low-bandwidth scene change video image
CN103493482A (en) * 2012-05-08 2014-01-01 青岛海信信芯科技有限公司 Method and device for extracting and optimizing depth map of image
WO2014063373A1 (en) * 2012-10-23 2014-05-01 青岛海信信芯科技有限公司 Methods for extracting depth map, judging video scenario switching and optimizing edge of depth map
CN106603916A (en) * 2016-12-14 2017-04-26 天脉聚源(北京)科技有限公司 Key frame detection method and device
CN107707915A (en) * 2017-09-30 2018-02-16 上海兆芯集成电路有限公司 Sample the control method and its image processing system of point self-adapted skew filtering

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045556B (en) * 2009-10-22 2012-10-31 杭州华三通信技术有限公司 Method and device for coding low-bandwidth scene change video image
CN103493482A (en) * 2012-05-08 2014-01-01 青岛海信信芯科技有限公司 Method and device for extracting and optimizing depth map of image
CN103493482B (en) * 2012-05-08 2016-01-20 青岛海信信芯科技有限公司 The method and apparatus of a kind of extraction and optimized image depth map
WO2014063373A1 (en) * 2012-10-23 2014-05-01 青岛海信信芯科技有限公司 Methods for extracting depth map, judging video scenario switching and optimizing edge of depth map
CN106603916A (en) * 2016-12-14 2017-04-26 天脉聚源(北京)科技有限公司 Key frame detection method and device
CN107707915A (en) * 2017-09-30 2018-02-16 上海兆芯集成电路有限公司 Sample the control method and its image processing system of point self-adapted skew filtering

Similar Documents

Publication Publication Date Title
CN106961606B (en) HEVC intra-frame coding mode selection method based on texture division characteristics
CN103997646B (en) Fast intra-mode prediction mode selecting method in a kind of HD video coding
WO2019091235A1 (en) Boundary filtering method for intra prediction
CN101394565B (en) Intra-frame prediction method
CN102883157B (en) Method for video coding and video encoder
CN107087200B (en) Skip coding mode advanced decision method for high-efficiency video coding standard
CN100574447C (en) Fast intraframe predicting mode selecting method based on the AVS video coding
CN103384325A (en) Quick inter-frame prediction mode selection method for AVS-M video coding
WO2010078759A1 (en) Method for image temporal and spatial resolution processing based on code rate control
CN101141648A (en) Column diagram based weight predicting method
CN114222145A (en) Low-complexity rapid VVC intra-frame coding method
CN111246219A (en) Quick dividing method for depth of CU (Central Unit) in VVC (variable valve timing) frame
CN103384327A (en) AVS fast mode selection algorithm based on adaptive threshold
CN101202915A (en) Method and apparatus for selecting frame inner forecasting mode
CN108989818B (en) Image coding parameter adjusting method and device
CN101883275B (en) Video coding method
CN101895761B (en) Quick intraframe prediction algorithm
JP2006115487A (en) Spatial domain information pre-processing for reducing computational complexity in advanced video coding (avc)
CN103297774B (en) The fast encoding method of B frame in a kind of Video coding
CN105791865A (en) Intra-frame prediction and deblocking filtering method
JP2005505165A5 (en)
CN102438148B (en) Fast mode selection method based on DVS for H.264 intra prediction coding
JP2005348008A (en) Moving picture coding method, moving picture coder, moving picture coding program and computer-readable recording medium with record of the program
CN114554219A (en) Rate distortion optimization method and device based on motion detection
CN101977317B (en) Intra-frame prediction method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20080312