WO2012041055A1 - Method and system for adjusting quantization parameters of frame level and macroblock level - Google Patents

Method and system for adjusting quantization parameters of frame level and macroblock level Download PDF

Info

Publication number
WO2012041055A1
WO2012041055A1 PCT/CN2011/072822 CN2011072822W WO2012041055A1 WO 2012041055 A1 WO2012041055 A1 WO 2012041055A1 CN 2011072822 W CN2011072822 W CN 2011072822W WO 2012041055 A1 WO2012041055 A1 WO 2012041055A1
Authority
WO
WIPO (PCT)
Prior art keywords
contrast
frame
quantization parameter
static
current
Prior art date
Application number
PCT/CN2011/072822
Other languages
French (fr)
Chinese (zh)
Inventor
舒倩
Original Assignee
深圳市融创天下科技股份有限公司
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 深圳市融创天下科技股份有限公司 filed Critical 深圳市融创天下科技股份有限公司
Publication of WO2012041055A1 publication Critical patent/WO2012041055A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Definitions

  • the present invention relates to the field of video coding, and in particular, to a frame layer and macroblock layer quantization parameter adjustment method and system.
  • RC rate control
  • macroblock division macroblock division
  • motion vector motion vector
  • quantization quantization
  • distortion the degree of the selection of quantization and the selection of quantization parameters especially important.
  • the first coded frame is reconstructed and used as the reference frame of the subsequent coded frame, so that the quality of the subsequent coded frame is closely related to the quality of the reference frame.
  • the prior art generally adopts a fixed-period frame layer quantization parameter adjustment mode. Since it does not consider the characteristics of the image, it cannot be adaptively adjusted online, thereby restricting its performance.
  • the object of the embodiments of the present invention is to provide a frame layer quantization parameter adjustment method, which aims to solve the problem that the frame layer quantization parameter adjustment mode in the prior art cannot be adaptively adjusted online, the rate distortion performance of the encoder is not high, and the code rate fluctuation performance is unstable. The problem.
  • the frame layer quantization parameter adjustment method includes the following steps: extracting static contrast information and dynamic contrast information of a current frame; determining a frame according to the static contrast information of the current frame, the dynamic contrast information, and a quantization parameter of a code rate control output. a final adjustment function of the layer quantization parameter; controlling the output quantization parameter and the final adjustment function according to the code rate of the current frame to obtain a new quantization parameter of the frame layer.
  • the static contrast information of the current frame is:
  • t is the time serial number of the image in the video sequence
  • n is the label of the macroblock in the image
  • Contrast-static is the static contrast information of the t- frame image
  • ContmSt - blood tic is the static contrast of the n-th macroblock of the t-th frame Information
  • M is the nth macroblock of the tth frame, ⁇ g''.
  • the CwtraW —static nt sum ( ⁇ (Contrast ijt ) ⁇ p ijt e M nt ) , f(x)>Thres f(x) ) is the corresponding decision threshold t
  • Cont and t - 's' ⁇ is a t-th frame the n-th macroblock static contrast information, C a s t Lj, the contrast of the pixel ⁇ % t frame image i-th row j-th column, A is ⁇ in.
  • Contrast i j ⁇ - max( fe(5 * Contrast — 3 * Contrast 5 , ))/15
  • Contrast is the contrast of the pixel ⁇ small ' in the i-th row and the j-th column of the t-th frame image, Contrast-3; the small tk is the three-contiguous k- th mode of the pixel, and Q ⁇ r W_5 i is the pixel ⁇ .' ⁇ ''The five adjacency kth mode.
  • the Contrast _5 ij tk is specifically:
  • the current frame dynamic contrast information is:
  • Contrast _m OV ing t is the dynamic contrast information of the t-th frame image
  • M is the n-th macroblock of the t-th frame, for the statistical image area, mean is the mean function
  • Contrast "The contrast of the pixel ⁇ ⁇ , for the i-th row and the j-th column of the t-frame image, Contrast is the three-contiguous k- th mode of the pixel A, Q ⁇ ra w_5 i , which is the five-contiguous k- th pattern of the pixel';
  • the foot represents the horizontal component of the motion vector of the nth macroblock of the tth frame, and represents the vertical component of the motion vector of the nth macroblock of the tth frame.
  • the determining the final adjustment function of the frame layer quantization parameter specifically includes the following steps: determining a picture group fluctuation period according to a frame rate and an image sequence number of the image;
  • the image group fluctuation period is:
  • Period f (id t , fps) where per iod is the image group fluctuation period, which is the coding sequence number of the t-th frame, fp S , and the image group fluctuation period function determined by the frame rate plus the coding order id of the image;
  • ⁇ ijd t , fps k t , Thres ⁇ ⁇ fps ⁇ Thres i & 8dd t e ⁇ ?
  • a statistical constant determined according to different frame rates and a set of coding sequence numbers
  • the initial adjustment function of the frame layer quantization parameter is:
  • dQP lt f 2 (Contrast _ static t , Contrast _ moving t , dQP lt ) Represents the t-frame quantization parameter correction function; / 2( , z) satisfies a/ 2 (x , y , z) ⁇ o ,
  • a m j is a division set of different fluctuation periods and coding sequence numbers, and is a statistical adjustment constant determined according to the above division set;
  • the final adjustment function of the frame layer quantization parameter is:
  • Medium W is the final adjustment function of the t-frame quantization parameter, and Bitt is the current bit value.
  • Another object of the embodiments of the present invention is to provide a frame layer quantization parameter adjustment system, where the system includes: a current frame static and dynamic contrast information, and is used to extract static contrast information and dynamic contrast information of a current frame. ;
  • a final adjustment function obtaining module of the frame layer quantization parameter configured to determine a final adjustment function of the frame layer quantization parameter according to the static contrast information of the current frame, the dynamic contrast information, and the quantization parameter of the code rate control output;
  • the frame layer new quantization parameter obtaining module is configured to obtain a new quantization parameter of the frame layer according to the sum of the quantization parameter outputted by the code rate control of the current frame and the final adjustment function.
  • the final adjustment function acquisition module of the frame layer quantization parameter includes: an image group fluctuation period determining module, configured to determine image group fluctuation according to a frame rate and an image sequence number of the image. Cycle
  • a frame layer quantization parameter initial adjustment function determining module configured to determine an initial adjustment function of the frame layer quantization parameter according to the image group fluctuation period
  • a frame layer quantization parameter correction function determining module configured to acquire a frame layer quantization parameter correction function according to the static contrast information of the current frame, the dynamic contrast information, and the initial adjustment function
  • a frame layer quantization parameter final adjustment function determining module And configured to adjust the frame layer quantization parameter correction function according to a current bit or a code rate control output quantization parameter to obtain a final adjustment function of the frame layer quantization parameter.
  • Another object of the embodiments of the present invention is to provide a macroblock layer quantization parameter adjustment method, the method comprising: extracting dynamic and static contrast information of a current macroblock and a current frame; and determining, by a frame layer, a current macroblock and a current macroblock, The dynamic and static contrast information of the frame determines the quantization parameters of the current macroblock.
  • the quantization parameter of the current macroblock is:
  • ⁇ S ⁇ Weight mb where is the quantization parameter of the current macroblock, ⁇ is the quantization parameter of the original t-frame, ⁇ eight mb movmg , which is the weight of the static contrast information and the dynamic contrast information respectively; f mb static (Contrast - static Nt , Contrast _ static t ) ⁇ is a quantization based on static contrast information d ⁇ , ⁇ ; 0 df mb x, y)
  • the parameter adjustment function, , ⁇ The parameter adjustment function, , ⁇ .
  • Another object of the embodiments of the present invention is to provide a macroblock layer quantization parameter adjustment system, where the system includes: a dynamic block and a dynamic contrast information of a current macroblock and a frame, which are used to extract the current macroblock and the current frame. Static contrast information and dynamic contrast information;
  • the quantization parameter obtaining module of the current macroblock is configured to determine, by the frame layer quantization parameter, the current macroblock, the static contrast information of the current frame, and the dynamic contrast information, the quantization parameter of the current macroblock.
  • the embodiment of the present invention determines the adjustment range of the frame layer quantization parameter by using the dynamic and static contrast information of the image, and further adjusts the QP condition of the current bit or RC output, which can effectively control the actual bit rate direction.
  • the target bit rate is close.
  • the embodiment of the present invention adaptively adjusts the quantization parameter of the current macroblock by using the current macroblock, the static and dynamic contrast information of the current frame, and the frame layer quantization parameter, thereby maintaining the code rate while improving the rate distortion performance of the encoder. Stability of wave performance.
  • FIG. 1 is a flowchart of a method for adjusting a frame layer quantization parameter according to a preferred embodiment of the present invention
  • FIG. 2 is a flowchart of a method for acquiring a final adjustment function of a frame layer quantization parameter in the method of FIG. 1.
  • FIG. 3 is a preferred embodiment of the present invention.
  • FIG. 4 is a detailed structural diagram of a final adjustment function of a frame layer quantization parameter in the system of FIG. 3;
  • FIG. 5 is a flow chart of a macroblock layer quantization parameter adjustment method according to a preferred embodiment of the present invention;
  • Figure 6 is a block diagram showing the structure of a macroblock layer quantization parameter adjustment system in accordance with a preferred embodiment of the present invention.
  • the embodiment of the invention adopts a new frame layer quantization parameter adjustment method.
  • the dynamic amplitude and static contrast information of the image are used to determine the adjustment range of the frame layer quantization parameter, and on the other hand, the current bit or the QP of the RC output is used.
  • the embodiment of the present invention also proposes a new macroblock layer self-quantization parameter adjustment method, which utilizes the current macro block, the static and dynamic of the current frame.
  • the contrast information and the frame layer quantization parameter adaptively adjust the quantization parameter of the current macroblock, thereby improving the rate distortion performance of the encoder while maintaining the stability of the rate fluctuation performance.
  • FIG. 1 is a flowchart of a method for adjusting a frame layer quantization parameter according to an embodiment of the present invention, where the method includes:
  • S101 extract static contrast information and dynamic contrast information of the current frame
  • Contrast moving t meaniContrast moving] nt )
  • t is the time sequence number of the image in the video sequence
  • n is the label of the macroblock in the image, and the static contrast information of the Contrast- static frame image
  • C - St - blood tic is the static contrast information of the nth macroblock of the tth frame
  • M is the nth macroblock of the tth frame
  • C_t_m OV i ngl is the dynamic contrast information of the image of the tth frame
  • Contrast _ moving] nt indicates the dynamic contrast information of the nth macroblock of the tth frame obtained by different methods
  • the current macroblock be Mb n , t , be the pixel in Mb n , t , t denote the time serial number of the image in the video sequence
  • n is the label of the macroblock in the image
  • i and j respectively represent the current pixel image
  • M is the nth macroblock of the tth frame, that is, the current macroblock, and is the pixel of the i th row and the jth column of the tth frame image in M, that is, the current pixel.
  • the three adjacencies are:
  • Contrast _ .5 i , t, k ' sum ijt - Contrast — 3 ijtk
  • the contrast of the current pixel A is:
  • Contrast i'j max(abs(5 * Contrast _ 3 ⁇ ⁇ ] ⁇ ( -3 * Contrast _ 5 i J tk )) / 15 C on tm S t i jt ⁇ tPixel of the i-th row and j-th column of the frame image That is, the contrast of the current pixel ', Contrast _ 3 ijt lc is the three-contiguous k- th mode of the current pixel ⁇ ⁇ '", and Contrast _5 ijt lc is the five-contiguous k- th mode of the current pixel.
  • the static contrast of the current macroblock M (the nth macroblock of the tth frame) is:
  • Static contrast information t n-th frame macroblocks Contrast C a sti, j, t t frame image i-th row pixel column j i.e. the current pixel contrast, ⁇ ", 'as Mb n, t frame t
  • the pixel of the i-th row and the j-th column of the image is also the current pixel.
  • Contrast _ static t mean(Contrast _ static nt
  • Embodiments of the present invention provide two methods for acquiring the contrast of dynamic information of a video image macroblock.
  • Contrast _ moving ⁇ nt sum ⁇ d ⁇ Contrast tjt )
  • p ijt e Mb nt && p ijt p ijt — p This method does not require motion search and is computationally intensive.
  • nt sum(S(mvx nt + mvy nt ))
  • the foot represents the horizontal component of the motion vector of the nth macroblock of the tth frame, representing the nth macroblock of the tth frame
  • the method is based on motion vectors obtained by motion search with high precision.
  • the current frame dynamic contrast is obtained as follows:
  • Contrast _ moving! mean(Contrast _ moving) nt )
  • Mb nt e region, j lor 2)
  • S102 Determine a final adjustment function rf W of the frame layer quantization parameter QP from the dynamic static contrast information of the current frame image and the RC output.
  • RC is the rate control
  • QP is the quantization parameter
  • ' is the quantization parameter of the original t-frame
  • 2 is a flowchart of a method for acquiring a final adjustment function of a frame layer quantization parameter, where the method for obtaining a final adjustment function of a frame layer quantization parameter includes the following steps:
  • the image group fluctuation period is determined by the frame rate plus the code number of the image.
  • Period f 0 (id t , fps)
  • period is the image group fluctuation period, which is the coding sequence number of the t-th frame, : birthday, fp S , frame rate plus the image coding order id 'determined image group fluctuation period function .
  • f 0 (id t , fps) can be selected as follows:
  • dQP xt f x (id period ) (x,y) . 0
  • dQPr MdQP 2l , QP t , bit t )
  • FIG. 3 is a schematic structural diagram of a frame layer quantization parameter adjustment system according to an embodiment of the present invention, where the system includes: a current frame static and dynamic contrast information. Used to extract static contrast information and dynamic contrast information of the current frame;
  • a final adjustment function obtaining module of the frame layer quantization parameter configured to determine a final adjustment function of the frame layer quantization parameter according to the static contrast information of the current frame, the dynamic contrast information, and the quantization parameter of the code rate control output;
  • the frame layer new quantization parameter obtaining module is configured to obtain a new quantization parameter of the frame layer according to the sum of the quantization parameter outputted by the code rate control of the current frame and the final adjustment function.
  • FIG. 4 is a schematic structural diagram of a frame layer quantization parameter final adjustment function acquiring module in the system of FIG.
  • the frame layer quantization parameter final adjustment function obtaining module includes: an image group fluctuation period determining module, configured to use a frame rate according to a frame rate And a coding sequence number of the image, determining a picture group fluctuation period; a frame layer quantization parameter initial adjustment function determining module, configured to determine a frame layer quantization parameter initial adjustment function according to the image group fluctuation period; a frame layer quantization parameter correction function determining module, configured to The static contrast information of the current frame, the dynamic contrast information, and the initial adjustment function acquire a frame layer quantization parameter correction function; a frame layer quantization parameter final adjustment function determining module for controlling quantization of the output according to a current bit or code rate In the case of the parameter, the frame layer quantization parameter correction function is adjusted to obtain a final adjustment function of the frame layer quantization parameter.
  • the frame layer quantization parameter adjustment method of the embodiment of the invention can not only improve the rate distortion performance of the encoder, but also can make the code rate fluctuation of the encoder more gradual, improve the network transmission performance of the code stream, and can also make The actual output bit rate of the encoder is closer to the encoding target bit rate.
  • FIG. 5 is a flowchart of a macroblock layer quantization parameter adjustment method according to an embodiment of the present invention.
  • the current macroblock layer quantization parameters are determined by various modes such as energy determination method based on AC coefficient, macroblock layer rate control determination method, and visual characteristic adjustment method.
  • the method based on the AC coefficient energy calculates the cylinder list and has good preservation characteristics for high frequency detail information.
  • the static and dynamic contrast information of the macroblock, the static and dynamic contrast information of the frame, and the frame layer quantization parameter are combined to determine the quantization parameter of the current macroblock.
  • the static and dynamic contrast information are used to protect the high frequency information of the motion macroblock and the static macroblock, respectively.
  • the macroblock layer quantization parameter adjustment method includes the following steps:
  • the method of acquiring Contrast moving t has been described in detail above and will not be described here.
  • S502 Determine a quantization parameter QP of the current macroblock by the frame layer quantization parameter and the current macroblock, the static contrast information of the current frame, and the dynamic contrast information.
  • is the quantization parameter of the original t-frame, which is the weight of the static contrast and dynamic contrast information, respectively;
  • FIG. 6 is a schematic structural diagram of a macroblock layer quantization parameter adjustment system according to an embodiment of the present invention, where the system includes: a dynamic and static contrast information extraction module of a current macroblock and a frame, configured to extract a current macroblock and a current frame. Static contrast information and dynamic contrast information; a quantization parameter acquisition module of the current macroblock, configured to determine a quantization parameter of the current macroblock from the frame layer quantization parameter and the current macroblock, the static contrast information of the current frame, and the dynamic contrast information.
  • a dynamic and static contrast information extraction module of a current macroblock and a frame configured to extract a current macroblock and a current frame.
  • Static contrast information and dynamic contrast information Static contrast information and dynamic contrast information
  • a quantization parameter acquisition module of the current macroblock configured to determine a quantization parameter of the current macroblock from the frame layer quantization parameter and the current macroblock, the static contrast information of the current frame, and the dynamic contrast information.
  • the macroblock layer quantization parameter adjustment method of the embodiment of the present invention can maintain the stability of the rate fluctuation performance while improving the rate distortion performance of the encoder.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. Within the scope.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A method and system for adjusting frame level and macroblock level quantization parameters are provided by the present invention. The method comprises the following steps: determining an adjustment range for a frame level quantization parameter on the basis of dynamic and static contrast information of an image; making further adjustments on the basis of a current bit or a QP output from an RC. The method enables effective control in moving a real bit rate closer to a target bit rate. Furthermore, a new method for adjusting the macroblock level quantization parameter is also provided by the present invention. The method enables self-adaptive adjustment of a current macroblock quantization parameter by using static and dynamic contrast information of the current macroblock and that of the current frame and by using the frame level quantization parameter, thereby improving the rate distortion performance of an encoder while maintaining the stability of the code rate volatility.

Description

一种帧层和宏块层量化参数调整方法和系统  Frame layer and macroblock layer quantization parameter adjustment method and system
技术领域 Technical field
本发明涉及视频编码领域,尤其涉及一种帧层和宏块层量化参数调整方法 和系统。  The present invention relates to the field of video coding, and in particular, to a frame layer and macroblock layer quantization parameter adjustment method and system.
背景技术 Background technique
视频编码中的核心问题之一就是 RC (码率控制), 通过其来确定各类编码 模式, 如宏块划分、 运动矢量、 量化参数等。 其中由于量化会引起失真, 使得 量化的构建及量化参数的选择尤为重要。 同时, 在视频编码中, 先编码的帧重 构后将作为后续编码帧的参考帧,从而使得后续编码帧的质量与参考帧的质量 息息相关。  One of the core problems in video coding is RC (rate control), which is used to determine various coding modes, such as macroblock division, motion vector, quantization parameters, and so on. Among them, the quantization causes distortion, which makes the selection of quantization and the selection of quantization parameters especially important. At the same time, in video coding, the first coded frame is reconstructed and used as the reference frame of the subsequent coded frame, so that the quality of the subsequent coded frame is closely related to the quality of the reference frame.
现有技术一般采用固定周期的帧层量化参数调整模式,由于其没有考虑图 像的特性的, 故无法在线自适应调整, 从而制约了其性能。  The prior art generally adopts a fixed-period frame layer quantization parameter adjustment mode. Since it does not consider the characteristics of the image, it cannot be adaptively adjusted online, thereby restricting its performance.
发明内容 Summary of the invention
本发明实施例的目的在于提出一种帧层量化参数调整方法,旨在解决现有 技术帧层量化参数调整模式无法在线自适应调整, 编码器的率失真性能不高, 码率波动性能不稳定的问题。  The object of the embodiments of the present invention is to provide a frame layer quantization parameter adjustment method, which aims to solve the problem that the frame layer quantization parameter adjustment mode in the prior art cannot be adaptively adjusted online, the rate distortion performance of the encoder is not high, and the code rate fluctuation performance is unstable. The problem.
所述帧层量化参数调整方法包括以下步骤: 提取当前帧的静态对比度信息和动态对比度信息; 根据当前帧的所述静态对比度信息、所述动态对比度信息及码率控制输出 的量化参数, 确定帧层量化参数的最终调整函数; 根据当前帧的所述码率控制输出的量化参数和所述最终调整函数的和得 出帧层新的量化参数。 在本发明所述的帧层量化参数调整方法中,所述当前帧的所述静态对比度 信息为: The frame layer quantization parameter adjustment method includes the following steps: extracting static contrast information and dynamic contrast information of a current frame; determining a frame according to the static contrast information of the current frame, the dynamic contrast information, and a quantization parameter of a code rate control output. a final adjustment function of the layer quantization parameter; controlling the output quantization parameter and the final adjustment function according to the code rate of the current frame to obtain a new quantization parameter of the frame layer. In the frame layer quantization parameter adjustment method of the present invention, the static contrast information of the current frame is:
Contrast static t - meaniContrast static n t \ Mbn t€ region) Contrast static t - meaniContrast static nt \ Mb nt € region)
其中 t 表示图像在视频序列中的时间序号, n 为图像中宏块的标号, Contrast— static,为 t帧图像的静态对比度信息; ContmSt -血 tic 为第 t帧第 n个宏块的静态对比度信息, M 为第 t帧第 n个宏块, ^g''。"为进行统计的 图像区域, mean为取均值函数。 Where t is the time serial number of the image in the video sequence, n is the label of the macroblock in the image, Contrast-static is the static contrast information of the t- frame image; ContmSt - blood tic is the static contrast of the n-th macroblock of the t-th frame Information, M is the nth macroblock of the tth frame, ^g''. "For the image area for statistics, mean is the mean function.
在本发明所述的帧层量化参数调整方法中,  In the frame layer quantization parameter adjustment method according to the present invention,
所述 CwtraW —static n t = sum (δ (Contrast i j t) \ pi j t e M n t) , f(x)>Thresf(x) 其中
Figure imgf000004_0001
)为相应的判定阈值 t
The CwtraW —static nt = sum (δ (Contrast ijt ) \ p ijt e M nt ) , f(x)>Thres f(x)
Figure imgf000004_0001
) is the corresponding decision threshold t
Cont而 t -' s'^ "为第 t帧第 n个宏块的静态对比度信息, C一 stLj.,^% t帧图像第 i行第 j列的像素的对比度, AΒί中第 t帧图像第 i行第 j 列的像素; Cont and t - 's' ^ "is a t-th frame the n-th macroblock static contrast information, C a s t Lj, the contrast of the pixel ^% t frame image i-th row j-th column, A is Βί in. The pixel of the i-th row and the j-th column of the t-th frame image;
计 ^ Contrasti j τ - max( fe(5 * Contrast — 3 * Contrast 5 , ))/15 ^ Contrast i j τ - max( fe(5 * Contrast — 3 * Contrast 5 , ))/15
Contrast, .,为第 t帧图像第 i行第 j列的像素 Ρί小'的对比度, Contrast— 3;小 t k 为像素 的三邻接第 k种模式, Q^r W_5i 为像素 Α.'·''的五邻接第 k种模 式。 Contrast, . is the contrast of the pixel Ρί small ' in the i-th row and the j-th column of the t-th frame image, Contrast-3; the small tk is the three-contiguous k- th mode of the pixel, and Q^r W_5 i is the pixel Α .'· ''The five adjacency kth mode.
在本发明所述的帧层量化参数调整方法中, 所述 Q^raw— 3, 具体为: 的三邻接第一种模式: Cost - 3 ,',i = + Pi-u,t + Pi-In the frame layer quantization parameter adjustment method according to the present invention, the Q^raw-3, specifically: the three adjacency first mode: Co coffee st - 3 , ', i = + Pi-u, t + Pi-
Pi,"的三邻接第二种模式: CQntmst - 3"'" = -ij, + Pi-W + / i,j+Ut Pi,"的三邻接第三种模式: Contrast - 3",',3 = Pi-w + + A i++l,j+l,tPi, "The three adjacencies of the second mode: CQntmst - 3 "'" = -ij, + Pi- W + / i, j + Ut Pi, "three adjacencies of the third mode: Contrast - 3 ", ', 3 = Pi-w + + A i + +l,j+l,t
Pu,t的三邻接第四种模式: Cost - 3",',4 = Pw + A+1,/+i,t + Pi+lj,t Pi,"的三邻接第五种模式: Contrast - 3 ,',5 = Pi+w + + PM - t Pi,"的三邻接第六种模式: Co st - 3 ,',6 = Pi+y ,t + +U-i,t + P l,t Pi,"的三邻接第七种模式: Contrast - = P^w + Pi -ut + Pi- Pi,"的三邻接第八种模式: Contrast - 3 ,',8 = P' -ut + Pi-uj- t + Pu, t three adjacent fourth pattern: Co coffee st - 3 ", ', 4 = Pw + A +1 , / + i, t + P i + l j, t Pi, "The third mode of the third adjacency: Contrast - 3 , ', 5 = Pi + w + + PM - t Pi," the third adjacency sixth mode: Co st - 3 , ', 6 = Pi + y , t + +U -i,t + P l,t Pi," the three adjacent modes of the seventh mode: Contrast - = P^w + Pi -ut + Pi-Pi," the three adjacency eighth mode: Contrast - 3 ,',8 = P' -ut + Pi-uj- t +
所述 Contrast _5i j tk具体为: The Contrast _5 ij tk is specifically:
Pij,t的五邻接第 种模式: Contrast _5iJ = sumiJt - Contrast _ >iJ 其中,匪 ij,t = Pi-u- t + Pi-i ,, + Pi-lJ+ t + Pij-ut + PiJ+ut + Pi+lJ-ut + PMJ, + Pi+W , t 表示图像在视频序列中的时间序号, i j分别表示当前像素仔图像中的行、 列标号, 像素 "为当前宏块中第 t帧图像第 i行第 j列的像素。 Pij, the five adjacency modes of t : Contrast _5 iJ = sum iJt - Contrast _ > iJ where ij, t = Pi-u- t + Pi-i ,, + Pi- lJ+ t + Pij-ut + Pi J+ ut + Pi +lJ -ut + PMJ, + P i+W , t represents the time serial number of the image in the video sequence, ij represents the row and column label in the current pixel image, and the pixel is the current macroblock. The pixel of the i-th row and the j-th column of the t-frame image.
在本发明所述的帧层量化参数调整方法中, 所述当前帧动态对比度信息 为:  In the frame layer quantization parameter adjustment method of the present invention, the current frame dynamic contrast information is:
Contrast moving τ - mean Contrast _movingj η τ) | Mbn t€ region,] - \or2) Contrast moving τ - mean Contrast _movingj η τ ) | Mb nt € region,] - \or2)
其中, Contrast _mOVingt为第 t帧图像的动态对比度信息; M 为第 t帧第 n 个宏块, 为进行统计的图像区域, mean 为取均值函数; Contrast _ movingjn,t表示用不同方法求取的第 t帧第 n个宏块的动态对比度信息, j=l时, 表示不使用运动矢量 mv信息时第 t帧第 n个宏块 M 的动态对比度, j=2时, 表示使用运动矢量 mv信息时第 t帧第 n个宏块 „ 的动态对比度; Contrast _m OV ing t is the dynamic contrast information of the t-th frame image; M is the n-th macroblock of the t-th frame, for the statistical image area, mean is the mean function; Contrast _ movingj n , t means different The dynamic contrast information of the nth macroblock of the tth frame obtained by the method, j=l, indicating the dynamic contrast of the nth macroblock M of the tth frame when the motion vector mv information is not used, and j=2, indicating use The dynamic contrast of the nth macroblock „ of the tth frame in the motion vector mv information;
Contrast _ moving\n t = sum(S(Contrasti j t) \ pt Jt ^ Mbn t & & pt } t = p; t - p; , Contrast, , t = max(abs(5 * Contrast 3 , -3 * Contrast 5 , , , ))/15 Contrast _ moving\ nt = sum(S(Contrast i j t ) \ p t Jt ^ Mb nt && p t } t = p ; t - p ; , Contrast, , t = max(abs(5 * Contrast 3 , -3 * Contrast 5 , , , ))/15
? J' l≤k≤ & ~ J" ~ '7' ' J ' l ≤ k ≤ & ~ J " ~ ' 7 ''
Contrast; "为 t帧图像第 i行第 j列的像素 Α·,"的对比度, Contrast 为像素 A 的三邻接第 k种模式, Q^raw_5i , 为像素 '的五邻接第 k种模 式; Contrast; "The contrast of the pixel Α ·, for the i-th row and the j-th column of the t-frame image, Contrast is the three-contiguous k- th mode of the pixel A, Q^ ra w_5 i , which is the five-contiguous k- th pattern of the pixel';
Contrast moving! n t - sum(S(mvxn t + mvyn t )) | mvn t€ Mbn t) 其中腳 表示第 t帧第 n个宏块的运动矢量的水平分量, 表示第 t 帧第 n个宏块的运动矢量的垂直分量。 Contrast moving! nt - sum(S(mvx nt + mvy nt )) | mv nt € Mb nt ) Wherein the foot represents the horizontal component of the motion vector of the nth macroblock of the tth frame, and represents the vertical component of the motion vector of the nth macroblock of the tth frame.
在本发明所述的帧层量化参数调整方法中,所述确定帧层量化参数的最终 调整函数具体包括以下步骤: 根据帧率及图像的编码序号, 确定图像组波动周期;  In the frame layer quantization parameter adjustment method of the present invention, the determining the final adjustment function of the frame layer quantization parameter specifically includes the following steps: determining a picture group fluctuation period according to a frame rate and an image sequence number of the image;
根据所述图像组波动周期确定帧层量化参数的初始调整函数;  Determining an initial adjustment function of the frame layer quantization parameter according to the image group fluctuation period;
根据当前帧的所述静态对比度信息、所述动态对比度信息和所述初始调整 函数获取帧层量化参数修正函数;  Obtaining a frame layer quantization parameter correction function according to the static contrast information of the current frame, the dynamic contrast information, and the initial adjustment function;
根据当前比特或码率控制输出的量化参数情况,调整所述帧层量化参数修 正函数, 获取所述帧层量化参数的最终调整函数。  And adjusting the frame layer quantization parameter correction function according to a current bit or code rate control output quantization parameter to obtain a final adjustment function of the frame layer quantization parameter.
在本发明所述的帧层量化参数调整方法中, 所述图像组波动周期为:  In the frame layer quantization parameter adjustment method of the present invention, the image group fluctuation period is:
period = f (idt , fps) 其中, per iod为图像组波动周期, 为第 t帧的编码序号, , fpS、为 帧率加及图像的编码顺序 id'确定的图像组波动周期函数; Period = f (id t , fps) where per iod is the image group fluctuation period, which is the coding sequence number of the t-th frame, fp S , and the image group fluctuation period function determined by the frame rate plus the coding order id of the image;
Λ ijdt , fps) = kt , Thres^ < fps < Thresi & 8dd t e Ω? 其中 为根据不同帧率和编码序号 集合划分确定的统计常量, 7¾r%— ^ΤΤ»^.为相应的门限值, Ω, 为编码序号的类别 集合; Λ ijd t , fps) = k t , Thres^ < fps < Thres i & 8dd t e Ω? Where is a statistical constant determined according to different frame rates and a set of coding sequence numbers, 73⁄4r% - ^ΤΤ»^. is the corresponding threshold value, Ω, which is a category set of coding sequence numbers;
所述帧层量化参数初始调整函数为:  The initial adjustment function of the frame layer quantization parameter is:
dQPx t = fx (id period ) dQP xt = f x (id period )
^(^y) ; o ^(^y) ; o
其中/ ! y)满足, dx , A (x + ky, y) = Ά y) , dQp为第 t帧量化参数 初始调整函数, k为周期常数, 3是求偏导; 所述帧层量化参数修正函数为: Where / ! y) satisfies, d x , A (x + ky, y) = Ά y) , d Q p is the initial adjustment function of the quantization parameter of the t-th frame, k is the period constant, 3 is the partial derivative; The layer quantization parameter correction function is:
dQPl t = f2 (Contrast _ static t , Contrast _ moving t , dQPl t ) 表示第 t 帧量化参数修正函数; /2( ,z)满足 a/2(xyz)<o , dQP lt = f 2 (Contrast _ static t , Contrast _ moving t , dQP lt ) Represents the t-frame quantization parameter correction function; / 2( , z) satisfies a/ 2 (x , y , z) <o ,
dx 其中 3是求偏导,
Figure imgf000007_0001
Where dx is the partial derivative,
Figure imgf000007_0001
amj为不同波动周期和编码序号的划分集合, 为根据上述划分集合确定的 统计调整常量; 所述帧层量化参数最终调整函数为: a m j is a division set of different fluctuation periods and coding sequence numbers, and is a statistical adjustment constant determined according to the above division set; the final adjustment function of the frame layer quantization parameter is:
dQPr = MdQP2l,QPt,bitt) / χ, 满足^ ^〉0^ ^〉0, Λ^,ζ) = Λ(χ,υ^Ω 的函数, 其 ox ΟΖ dQPr = MdQP 2l , QP t , bit t ) / χ, satisfy ^ ^ > 0 ^ ^ > 0, Λ ^, ζ) = Λ ( χ, υ ^ Ω function, its ox ΟΖ
中 W为第 t帧量化参数最终调整函数, Bitt为当前比特值。 Medium W is the final adjustment function of the t-frame quantization parameter, and Bitt is the current bit value.
本发明实施例的另一目的在于提出一种帧层量化参数调整系统,所述系统 包括: 当前帧静态和动态对比度信息提耳 ^莫块,用于提取当前帧的静态对比度信 息和动态对比度信息;  Another object of the embodiments of the present invention is to provide a frame layer quantization parameter adjustment system, where the system includes: a current frame static and dynamic contrast information, and is used to extract static contrast information and dynamic contrast information of a current frame. ;
帧层量化参数的最终调整函数获取模块,用于根据当前帧的所述静态对比 度信息、所述动态对比度信息及码率控制输出的量化参数,确定帧层量化参数 的最终调整函数;  a final adjustment function obtaining module of the frame layer quantization parameter, configured to determine a final adjustment function of the frame layer quantization parameter according to the static contrast information of the current frame, the dynamic contrast information, and the quantization parameter of the code rate control output;
帧层新量化参数获取模块,用于根据当前帧的所述码率控制输出的量化参 数和所述最终调整函数的和得出帧层新的量化参数。  The frame layer new quantization parameter obtaining module is configured to obtain a new quantization parameter of the frame layer according to the sum of the quantization parameter outputted by the code rate control of the current frame and the final adjustment function.
在本发明所述的帧层量化参数调整系统中,所述帧层量化参数的最终调整 函数获取模块包括: 图像组波动周期确定模块, 用于根据帧率及图像的编码序号,确定图像组 波动周期;  In the frame layer quantization parameter adjustment system of the present invention, the final adjustment function acquisition module of the frame layer quantization parameter includes: an image group fluctuation period determining module, configured to determine image group fluctuation according to a frame rate and an image sequence number of the image. Cycle
帧层量化参数初始调整函数确定模块,用于根据所述图像组波动周期确定 帧层量化参数的初始调整函数; 帧层量化参数修正函数确定模块, 用于根据当前帧的所述静态对比度信 息、 所述动态对比度信息和所述初始调整函数获取帧层量化参数修正函数; 帧层量化参数最终调整函数确定模块,用于根据当前比特或码率控制输出 的量化参数情况,调整所述帧层量化参数修正函数, 获取所述帧层量化参数的 最终调整函数。 a frame layer quantization parameter initial adjustment function determining module, configured to determine an initial adjustment function of the frame layer quantization parameter according to the image group fluctuation period; a frame layer quantization parameter correction function determining module, configured to acquire a frame layer quantization parameter correction function according to the static contrast information of the current frame, the dynamic contrast information, and the initial adjustment function; a frame layer quantization parameter final adjustment function determining module, And configured to adjust the frame layer quantization parameter correction function according to a current bit or a code rate control output quantization parameter to obtain a final adjustment function of the frame layer quantization parameter.
本发明实施例的另一目的在于提出一种宏块层量化参数调整方法,所述方 法包括: 提取当前宏块及当前帧的动态和静态对比度信息; 由帧层量化参数及当前宏块、当前帧的动态和静态对比度信息确定当前宏 块的量化参数。 在本发明所述的宏块层量化参数调整方法中, 所述当前宏块的量化参数为:  Another object of the embodiments of the present invention is to provide a macroblock layer quantization parameter adjustment method, the method comprising: extracting dynamic and static contrast information of a current macroblock and a current frame; and determining, by a frame layer, a current macroblock and a current macroblock, The dynamic and static contrast information of the frame determines the quantization parameters of the current macroblock. In the macroblock layer quantization parameter adjustment method of the present invention, the quantization parameter of the current macroblock is:
^^S^ Weight mb 其中 为当前宏块的量化参数, ^为原始第 t帧的量化参数, , ^eightmb movmg , 分别为静态对比度信息和动态对比度信息的权重; fmb static (Contrast —static n t , Contrast _ static t ) ^ 为基于静态对比度信息的量化 d Λχ,Ύ ; 0 dfmb x, y) ^^S^ Weight mb where is the quantization parameter of the current macroblock, ^ is the quantization parameter of the original t-frame, ^eight mb movmg , which is the weight of the static contrast information and the dynamic contrast information respectively; f mb static (Contrast - static Nt , Contrast _ static t ) ^ is a quantization based on static contrast information d Λχ, Ύ ; 0 df mb x, y)
参数调整函数, , ^ ^ ^ ; Parameter adjustment function, , ^ ^ ^ ;
fmb― moVing (Contrast _ movingj^ Contrast _ moving t ) ? 为基于动态对比度信息的量化 Fm b ― mo Ving (Contrast _ movingj^ Contrast _ moving t ) ? is quantization based on dynamic contrast information
3fmbmg x, y < 0 dfmb (x, y) 3f mbmg x , y < 0 df mb (x, y)
■0  ■0
参数调整函数, , ^ 。 The parameter adjustment function, , ^ .
本发明实施例的另一目的在于提出一种宏块层量化参数调整系统,所述系 统包括: 当前宏块及帧的动态和静态对比度信息提 莫块,用于提取当前宏块及当 前帧的静态对比度信息和动态对比度信息; 当前宏块的量化参数获取模块,用于由帧层量化参数及当前宏块、 当前帧 的静态对比度信息和动态对比度信息, 确定当前宏块的量化参数。 Another object of the embodiments of the present invention is to provide a macroblock layer quantization parameter adjustment system, where the system includes: a dynamic block and a dynamic contrast information of a current macroblock and a frame, which are used to extract the current macroblock and the current frame. Static contrast information and dynamic contrast information; The quantization parameter obtaining module of the current macroblock is configured to determine, by the frame layer quantization parameter, the current macroblock, the static contrast information of the current frame, and the dynamic contrast information, the quantization parameter of the current macroblock.
本发明的有益效果: The beneficial effects of the invention:
本发明实施例一方面通过图像的动态、静态对比度信息确定帧层量化参数 的调整幅度, 另一方面通过当前的比特或 RC输出的 QP情况, 作进一步调整, 这可以有效地控制实际比特率向目标比特率靠拢。利用本发明的帧层量化参数 调整策略,不仅可以提升率失真性能而且也可以使得编码器输出码流的码率波 动更为平緩,从而提升网络传输性能, 此外还可以使编码器实际输出比特率更 接近编码目标比特率。  The embodiment of the present invention determines the adjustment range of the frame layer quantization parameter by using the dynamic and static contrast information of the image, and further adjusts the QP condition of the current bit or RC output, which can effectively control the actual bit rate direction. The target bit rate is close. By using the frame layer quantization parameter adjustment strategy of the present invention, not only the rate distortion performance but also the code rate fluctuation of the encoder output code stream can be made more gradual, thereby improving the network transmission performance, and also enabling the encoder to actually output the bit rate. Closer to the encoding target bit rate.
此外, 本发明实施例利用当前宏块、 当前帧的静态和动态对比度信息和帧 层量化参数, 自适应调整当前宏块的量化参数,从而在提升编码器的率失真性 能的同时, 保持码率波动性能的稳定性。  In addition, the embodiment of the present invention adaptively adjusts the quantization parameter of the current macroblock by using the current macroblock, the static and dynamic contrast information of the current frame, and the frame layer quantization parameter, thereby maintaining the code rate while improving the rate distortion performance of the encoder. Stability of wave performance.
附图说明 DRAWINGS
图 1是本发明的优选实施例一种帧层量化参数调整方法流程图; 图 2是图 1方法中的帧层量化参数最终调整函数的获取方法流程图; 图 3是本发明的优选实施例一种帧层量化参数调整系统结构示意图; 图 4是图 3系统中的帧层量化参数最终调整函数的详细结构示意图; 图 5是本发明的优选实施例一种宏块层量化参数调整方法流程图; 图 6是本发明的优选实施例一种宏块层量化参数调整系统结构示意图。  1 is a flowchart of a method for adjusting a frame layer quantization parameter according to a preferred embodiment of the present invention; FIG. 2 is a flowchart of a method for acquiring a final adjustment function of a frame layer quantization parameter in the method of FIG. 1. FIG. 3 is a preferred embodiment of the present invention. FIG. 4 is a detailed structural diagram of a final adjustment function of a frame layer quantization parameter in the system of FIG. 3; FIG. 5 is a flow chart of a macroblock layer quantization parameter adjustment method according to a preferred embodiment of the present invention; Figure 6 is a block diagram showing the structure of a macroblock layer quantization parameter adjustment system in accordance with a preferred embodiment of the present invention.
具体实施方式 Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白, 以下结合附图和实 施例, 对本发明进行进一步详细说明, 为了便于说明, 仅示出了与本发明实施 例相关的部分。 应当理解, 此处所描写的具体实施例, 仅仅用于解释本发明, 并不用以限制本发明。 本发明实施例采用一种新的帧层量化参数调整方法,一方面通过图像的动 态、静态对比度信息确定帧层量化参数的调整幅度, 另一方面通过当前的比特 或 RC输出的 QP情况,作进一步调整,这可以有效地控制实际比特率向目标比 特率靠拢;此外,本发明实施例还提出了一种新的宏块层自量化参数调整方法, 利用当前宏块、 当前帧的静态和动态对比度信息和帧层量化参数, 自适应调整 当前宏块的量化参数,从而在提升编码器的率失真性能的同时,保持码率波动 性能的稳定性。 The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. For the convenience of description, only the parts related to the embodiments of the present invention are shown. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiment of the invention adopts a new frame layer quantization parameter adjustment method. On one hand, the dynamic amplitude and static contrast information of the image are used to determine the adjustment range of the frame layer quantization parameter, and on the other hand, the current bit or the QP of the RC output is used. Further, this can effectively control the actual bit rate to be close to the target bit rate; in addition, the embodiment of the present invention also proposes a new macroblock layer self-quantization parameter adjustment method, which utilizes the current macro block, the static and dynamic of the current frame. The contrast information and the frame layer quantization parameter adaptively adjust the quantization parameter of the current macroblock, thereby improving the rate distortion performance of the encoder while maintaining the stability of the rate fluctuation performance.
图 1是本发明实施例一种帧层量化参数调整方法流程图, 所述方法包括:  FIG. 1 is a flowchart of a method for adjusting a frame layer quantization parameter according to an embodiment of the present invention, where the method includes:
S 101: 提取当前帧的静态对比度信息和动态对比度信息; S101: extract static contrast information and dynamic contrast information of the current frame;
Contrast static t - mean{Contrast static n t | Mbn t€ region) Contrast static t - mean{Contrast static nt | Mb nt € region)
Contrast moving t = meaniContrast moving] n t) | Mbn t€ region, ] - \or2) 其中 t 表示图像在视频序列中的时间序号, n 为图像中宏块的标号, Contrast— static 帧图像的静态对比度信息; CSt —血 tic 为第 t帧第 n个宏块的静态对比度信息; M 为第 t帧第 n个宏块; C一 t _ mOVingl为第 t帧图像的动态对比度信息; Contrast _ moving] n t表示用不同方法求取的第 t帧 第 n个宏块的动态对比度信息, j=l 时, 表示不使用运动矢量 mv信息时第 t 帧第 n个宏块 „ 的动态对比度, j=2时, 表示使用运动矢量 mv信息时第 t 帧第 n个宏块 „ 的动态对比度; 为进行统计的图像区域, mean为取均 值函数。 Contrast moving t = meaniContrast moving] nt ) | Mb nt € region, ] - \or2) where t is the time sequence number of the image in the video sequence, n is the label of the macroblock in the image, and the static contrast information of the Contrast- static frame image ; C - St - blood tic is the static contrast information of the nth macroblock of the tth frame; M is the nth macroblock of the tth frame; C_t_m OV i ngl is the dynamic contrast information of the image of the tth frame; Contrast _ moving] nt indicates the dynamic contrast information of the nth macroblock of the tth frame obtained by different methods, and j=l indicates the dynamic contrast of the nth macroblock „ of the tth frame when the motion vector mv information is not used. When j=2, it indicates the dynamic contrast of the nth macroblock „ of the tth frame when the motion vector mv information is used; for the image area to be statistically, mean is the mean function.
( 1 ) 当前帧的静态对比度信息提取方法如下:  (1) The method for extracting the static contrast information of the current frame is as follows:
设当前宏块为 Mbn,t , 为 Mbn,t中的像素, t表示图像在视频序列中的时 间序号, n为图像中宏块的标号, i , j分别表示当前像素仔图像中的行、 列 标号, M 为第 t帧第 n个宏块也即当前宏块, 为 M 中第 t帧图像第 i 行第 j列的像素也即当前像素。 则 Ρ ''的 8邻接像素列表如下: Let the current macroblock be Mb n , t , be the pixel in Mb n , t , t denote the time serial number of the image in the video sequence, n is the label of the macroblock in the image, and i and j respectively represent the current pixel image The row and column labels, M is the nth macroblock of the tth frame, that is, the current macroblock, and is the pixel of the i th row and the jth column of the tth frame image in M, that is, the current pixel. The Ρ '' of the 8 pixels adjacent to the following list:
Figure imgf000011_0004
己 sum;, = Pi-W + Pi-u,t + Pi-i +i,t + Pi -i,t + Pi +i,t + Pi+W + Pi+i ,t + Pi+W
Figure imgf000011_0004
Sumsum;, = Pi- W + Pi-u, t + Pi-i + i, t + Pi -i, t + P i + i, t + P i+W + P i+ i , t + P i+ W
的三邻接为: The three adjacencies are:
Pi'"的三邻接第一种模式: Contrast j,t, ―
Figure imgf000011_0001
+ Pi-\,j,t + Pi-\,j+\,t
Pi '" three adjacency first mode: Contrast j,t, ―
Figure imgf000011_0001
+ Pi-\,j,t + Pi-\,j+\,t
Α·,Λί的三邻接第二种模式: Contrast ~ Pi + Pi + Pi Α·, Λί 's three adjacencies second mode: Contrast ~ Pi + Pi + Pi
Α·,Λί的三邻接第三种模式: Contrast /V ~ Pi + Pi + Pi Α·, Λί 's three adjacencies, the third mode: Contrast /V ~ Pi + Pi + Pi
Pi'"的三邻接第四种模式: Contrast /V ~ Pi '" three adjacencies fourth mode: Contrast /V ~
Ρ ''的三邻接第五种模式: Contrast j,t ~ Ρ ''Three adjacencies fifth mode: Contrast j,t ~
Pi'"的三邻接第六种模式: Contrast j,t ~
Figure imgf000011_0002
+ Pi + Pi,j-l,t
Pi '" three adjacency sixth mode: Contrast j,t ~
Figure imgf000011_0002
+ Pi + Pi,jl,t
Ρ ''的三邻接第七种模式: Contrast /V ~ Pi + Pi,j-l,t + Pi-\,j-\,t Ρ ''Three adjacency seventh mode: Contrast /V ~ Pi + Pi,jl,t + Pi-\,j-\,t
Pi'"的三邻接第八种模式: Contrast ~ Pi,j-l,t + Pi +
Figure imgf000011_0003
五邻接为:
Pi '" three adjacency eighth mode: Contrast ~ Pi, jl, t + Pi +
Figure imgf000011_0003
Five adjacencies are:
的五邻接第 种模式: Contrast _ .5 i ,t,k ' = sumijt- Contrast— 3ijtk 当前像素 A 的对比度为: The fifth neighboring first mode: Contrast _ .5 i , t, k ' = sum ijt - Contrast — 3 ijtk The contrast of the current pixel A is:
Contrast i'j = max(abs(5 * Contrast _ 3ιί]ίΙ( -3 * Contrast _ 5i J tk)) / 15 ContmSti jt^ t帧图像第 i行第 j列的像素也即当前像素 '的对比度, Contrast _ 3i j t lc为当前像素 Ρί'"的三邻接第 k种模式, Contrast _5i j t lc为当前像素 的五邻接第 k种模式。 当前宏块 M (第 t帧第 n个宏块) 的静态对比度为: Contrast i'j = max(abs(5 * Contrast _ 3ι ί]ίΙ( -3 * Contrast _ 5 i J tk )) / 15 C on tm S t i jt ^ tPixel of the i-th row and j-th column of the frame image That is, the contrast of the current pixel ', Contrast _ 3 ijt lc is the three-contiguous k- th mode of the current pixel Ρ ί '", and Contrast _5 ijt lc is the five-contiguous k- th mode of the current pixel. The static contrast of the current macroblock M (the nth macroblock of the tth frame) is:
Contrast static n t - sum (δ (Contrast i j t ) pi } t e M n t ) Contrast static nt - sum (δ (Contrast i j t ) p i } t e M nt )
1 , f(x) > Thresf{x) 1 , f(x) > Thres f{x)
S(f(x)) =  S(f(x)) =
其中 0dse , 而77 "^/w为相应的判定阈值 Where 0 , dse , and 77 "^/w is the corresponding decision threshold
Contrast t帧第 n个宏块的静态对比度信息, C一 sti,j,t t帧图像第 i行第 j列的像素也即当前像素的对比度, ρ",'为 Mbnt 第 t帧图 像第 i行第 j列的像素也即当前像素。 Static contrast information t n-th frame macroblocks Contrast, C a sti, j, t t frame image i-th row pixel column j i.e. the current pixel contrast, ρ ", 'as Mb n, t frame t The pixel of the i-th row and the j-th column of the image is also the current pixel.
则当前帧静态对比度为: Then the current frame static contrast is:
Contrast _ static t = mean(Contrast _ static n t | Mbn t e region) Contrast _ static t = mean(Contrast _ static nt | Mb nt e region)
( 2 ) 当前帧动态对比度信息提取方法如下: (2) The current frame dynamic contrast information extraction method is as follows:
本发明实施例提供两种获取视频图像宏块动态信息对比度的方法。  Embodiments of the present invention provide two methods for acquiring the contrast of dynamic information of a video image macroblock.
方法 1: 不使用运动矢量 mv信息, 当前宏块 Mbn t的动态对比度为: Method 1: Without the motion vector mv information, the dynamic contrast of the current macroblock Mb nt is:
Contrast _ moving\n t = sum{d {Contrast t j t ) | pi j t e Mbn t & & pi j t = pi j t— p 该方法无需进行运动搜索, 计算量小。 Contrast _ moving\ nt = sum{d {Contrast tjt ) | p ijt e Mb nt && p ijt = p ijt — p This method does not require motion search and is computationally intensive.
方法 2: 使用运动矢量 mv信息, 当前宏块 Mbn t的动态对比度为: Method 2: Using the motion vector mv information, the dynamic contrast of the current macroblock Mb nt is:
Contrast _ moving! n t = sum(S(mvxn t + mvyn t )) | mvn t e Mbn t ) 腳 表示第 t帧第 n个宏块的运动矢量的水平分量, 表示第 t帧第 n个宏块的运动矢量的垂直分量。 Contrast _ moving! nt = sum(S(mvx nt + mvy nt )) | mv nt e Mb nt ) The foot represents the horizontal component of the motion vector of the nth macroblock of the tth frame, representing the nth macroblock of the tth frame The vertical component of the motion vector.
该方法基于运动搜索获取的运动向量, 精度高。  The method is based on motion vectors obtained by motion search with high precision.
基于以上两种获取视频图像宏块动态信息对比度的方法,得出当前帧动态 对比度为:  Based on the above two methods for obtaining the dynamic information contrast of the video image macroblock, the current frame dynamic contrast is obtained as follows:
Contrast _ moving! = mean(Contrast _ moving] n t) | Mbn t e region, j = lor 2) Contrast _ movingjn t表示用不同方法求取的第 t帧第 n个宏块的动态对比度 信息; j =l时, 表示不使用运动矢量 mv信息时第 t帧第 n个宏块 „ 的动态 对比度, j=2时, 表示使用运动矢量 mv信息时第 t帧第 n个宏块 „ 的动态 对比度。 Contrast _ moving! = mean(Contrast _ moving) nt ) | Mb nt e region, j = lor 2) Contrast _ movingj nt represents the dynamic contrast information of the nth macroblock of the tth frame obtained by different methods; j = l, when the motion vector mv information is not used, the dynamics of the nth macroblock „ of the tth frame Contrast, when j=2, indicates the dynamic contrast of the nth macroblock „ of the tth frame when the motion vector mv information is used.
S102: 由当前帧图像的动态静态对比度信息及 RC输出的 确定帧层量 化参数 QP的最终调整函数 rfW。 其中 RC为码率控制, QP为量化参数, '为 原始第 t帧的量化参数, 为第 t帧量化参数的调整函数。 图 2为所述帧层量化参数最终调整函数的获取方法流程图, 所述帧层量化 参数最终调整函数的获取方法包括以下步骤: S102: Determine a final adjustment function rf W of the frame layer quantization parameter QP from the dynamic static contrast information of the current frame image and the RC output. Where RC is the rate control, QP is the quantization parameter, 'is the quantization parameter of the original t-frame, and is the adjustment function of the quantization parameter of the t-th frame. 2 is a flowchart of a method for acquiring a final adjustment function of a frame layer quantization parameter, where the method for obtaining a final adjustment function of a frame layer quantization parameter includes the following steps:
S1021: 首先由帧率加及图像的编码序号 , 确定图像组波动周期。  S1021: First, the image group fluctuation period is determined by the frame rate plus the code number of the image.
period = f0 (idt , fps) 其中, period为图像组波动周期, 为第 t帧的编码序号, : 誕, fpS、 帧率加及图像的编码顺序 id'确定的图像组波动周期函数。 f0(idt,fps)可选如下分段统计函数: Period = f 0 (id t , fps) where period is the image group fluctuation period, which is the coding sequence number of the t-th frame, : birthday, fp S , frame rate plus the image coding order id 'determined image group fluctuation period function . f 0 (id t , fps) can be selected as follows:
Λ « , fPs) = , Thres^ < fps < Thresi 8c 8cidt e Ω? 其中 为根据不同帧率和编码序号 集合划分确定的统计常量, ΤΤ^ ,ΤΤ»^.为相应的门限值, Ω, 为编码序号的类别 集合; Λ « , fP s ) = , Thres^ < fps < Thres i 8c 8cid t e Ω? Wherein is a statistical constant determined according to different frame rates and a set of coding sequence numbers, ΤΤ^, ΤΤ»^. is a corresponding threshold value, Ω, which is a category set of coding sequence numbers;
S 1022: 由所述图像组波动周期确定帧层量化参数初始调整 函数  S 1022: determining an initial adjustment function of the frame layer quantization parameter by the image group fluctuation period
dQPx t = fx(id period ) (x,y) .0 dQP xt = f x (id period ) (x,y) . 0
其中/xj)满足, dx , f (x + k ,y) = f (x,y) ? dQP、'为% t帧量化参数初始调整函数, k为周期常数, 3是求偏导。 S1023: 结合当前帧图像的动态、 静态对比度信息和所述初始调整函数获 取帧层量化参数修正 函数 Where /xj) satisfies, dx , f (x + k , y) = f (x, y) ? d QP , ' is the initial adjustment function for the quantization mask of % t frame, k is the period constant, and 3 is the partial derivative. S1023: Acquire a frame layer quantization parameter correction function by combining dynamic and static contrast information of the current frame image and the initial adjustment function.
dQP2 t = f2 (Contrast _ static t , Contrast _ moving t , dQPl t ) 表示第 t 帧量化参数修正函数; /2(x,y,z)可选满足 a/2(XyZ)<0 , = ^,ΖεΩ 例如满足上述条件筒
Figure imgf000014_0001
dQP 2 t = f 2 (Contrast _ static t , Contrast _ moving t , dQP lt ) represents the t-frame quantization parameter correction function; / 2 (x, y , z ) optionally satisfies a/ 2 ( X , y , Z )<0 , = ^, Ζε Ω, for example, satisfying the above conditional cylinder
Figure imgf000014_0001
单的线性函数 /2 ^,z) = -x+ y+ 其中 3是求偏导, ilTid j为不同波动周期和编码序 号的划分集合, kkj为根据上述划分集合确定的统计调整常量; The linear function of a single / 2 ^, z ) = -x + y + where 3 is the partial derivative, il Tid j is the set of partitions of different fluctuation periods and coding numbers, and kkj is the statistical adjustment constant determined according to the above division set;
S1024: 根据当前比特或 RC输出的 QP情况, 调整帧层量化参数修正函数 dQP" , 获取帧层 QP最终调整函数^^,。 S1024: Adjust the frame layer quantization parameter correction function dQP " according to the current bit or the QP condition of the RC output, and obtain the frame layer QP final adjustment function ^^.
dQPr = MdQP2l,QPt,bitt) dQPr = MdQP 2l , QP t , bit t )
/3^,2)可选满足^ ^〉0^ ^〉0, MX,y,z) = Mx,kkkm,z),ye^m, 例如 / 3 ^, 2) Optional satisfies ^ ^〉0^ ^〉0, M X , y, z) = Mx , kkk m , z) , ye^ m , for example
OX oz 满足上述条件筒单分段函数 /3 ( , y,z) = x + kkkm + (z > Thresbuffer Ία'.—b) , 其中 为第 t 帧量化参数最终调整函数, Bitt为当前比特值, Ω 为不同量化参数 β 的划 分集合, „为根据量化参数集合确定的统计调整常量, ThreSbuffer为 Buffer 过 量使用调整门限, ^^为常数, 2>7¾ 含义为如果 z大于调整门限 77^ , 贝'】 ζ = α, 否贝' jz = _6。 OX oz satisfies the above condition single-segment function / 3 ( , y, z) = x + kkk m + (z > Thres buffer Ία'.-b) , where is the final adjustment function of the t- frame quantization parameter, Bitt is the current The bit value, Ω is a set of partitions of different quantization parameters β, „ is a statistical adjustment constant determined according to the quantization parameter set, Th reSbuffer is a buffer overflow limit, ^^ is a constant, 2> 73⁄4 means that if z is greater than the adjustment threshold 77 ^ , 贝'] ζ = α, No Bay' jz = _6.
S103: 获取帧层新的量化参数 ^  S103: Obtain a new quantization parameter of the frame layer ^
QPt ∞w =QPt+dQP;av 如图 3所示是本发明实施例一种帧层量化参数调整系统结构示意图,所述 系统包括: 当前帧静态和动态对比度信息提耳 ^莫块,用于提取当前帧的静态对比度信 息和动态对比度信息; QP t ∞w = QP t + dQP; av FIG. 3 is a schematic structural diagram of a frame layer quantization parameter adjustment system according to an embodiment of the present invention, where the system includes: a current frame static and dynamic contrast information. Used to extract static contrast information and dynamic contrast information of the current frame;
帧层量化参数的最终调整函数获取模块, , 用于根据当前帧的所述静态对 比度信息、所述动态对比度信息及码率控制输出的量化参数,确定帧层量化参 数的最终调整函数;  a final adjustment function obtaining module of the frame layer quantization parameter, configured to determine a final adjustment function of the frame layer quantization parameter according to the static contrast information of the current frame, the dynamic contrast information, and the quantization parameter of the code rate control output;
帧层新量化参数获取模块,用于根据当前帧的所述码率控制输出的量化参 数和所述最终调整函数的和得出帧层新的量化参数。 如图 4所示是图 3系统中的帧层量化参数最终调整函数获取模块的详细结 构示意图, 所述帧层量化参数最终调整函数获取模块包括: 图像组波动周期确定模块, 用于根据帧率及图像的编码序号,确定图像组 波动周期; 帧层量化参数初始调整函数确定模块,用于根据图像组波动周期确定帧层 量化参数初始调整函数; 帧层量化参数修正函数确定模块, 用于根据当前帧的所述静态对比度信 息、 所述动态对比度信息和所述初始调整函数获取帧层量化参数修正函数; 帧层量化参数最终调整函数确定模块,用于根据当前比特或码率控制输出 的量化参数情况,调整所述帧层量化参数修正函数, 获取帧层量化参数的最终 调整函数。 使用本发明实施例的帧层量化参数调整方法,不仅可以提升编码器的率失 真性能, 而且也可以使编码器的码率波动更为平緩,提升了码流的网络传输性 能, 此外还可以使编码器实际输出比特率更接近编码目标比特率。 The frame layer new quantization parameter obtaining module is configured to obtain a new quantization parameter of the frame layer according to the sum of the quantization parameter outputted by the code rate control of the current frame and the final adjustment function. FIG. 4 is a schematic structural diagram of a frame layer quantization parameter final adjustment function acquiring module in the system of FIG. 3, where the frame layer quantization parameter final adjustment function obtaining module includes: an image group fluctuation period determining module, configured to use a frame rate according to a frame rate And a coding sequence number of the image, determining a picture group fluctuation period; a frame layer quantization parameter initial adjustment function determining module, configured to determine a frame layer quantization parameter initial adjustment function according to the image group fluctuation period; a frame layer quantization parameter correction function determining module, configured to The static contrast information of the current frame, the dynamic contrast information, and the initial adjustment function acquire a frame layer quantization parameter correction function; a frame layer quantization parameter final adjustment function determining module for controlling quantization of the output according to a current bit or code rate In the case of the parameter, the frame layer quantization parameter correction function is adjusted to obtain a final adjustment function of the frame layer quantization parameter. The frame layer quantization parameter adjustment method of the embodiment of the invention can not only improve the rate distortion performance of the encoder, but also can make the code rate fluctuation of the encoder more gradual, improve the network transmission performance of the code stream, and can also make The actual output bit rate of the encoder is closer to the encoding target bit rate.
图 5是本发明实施例一种宏块层量化参数调整方法流程图。  FIG. 5 is a flowchart of a macroblock layer quantization parameter adjustment method according to an embodiment of the present invention.
目前的宏块层量化参数的确定存在多种模式如依据 AC 系数的能量确定 法, 宏块层码率控制确定法, 基于视觉特性调整法。 其中基于 AC系数能量的 方法计算筒单,且对高频细节信息具有良好的保存特性。本发明实施例则结合 宏块的静态和动态对比度信息及帧的静态和动态对比度信息、 帧层量化参数, 确定当前宏块的量化参数。其中,静态和动态对比度信息分别用于保护运动宏 块及静止宏块的高频信息。  The current macroblock layer quantization parameters are determined by various modes such as energy determination method based on AC coefficient, macroblock layer rate control determination method, and visual characteristic adjustment method. The method based on the AC coefficient energy calculates the cylinder list and has good preservation characteristics for high frequency detail information. In the embodiment of the present invention, the static and dynamic contrast information of the macroblock, the static and dynamic contrast information of the frame, and the frame layer quantization parameter are combined to determine the quantization parameter of the current macroblock. Among them, the static and dynamic contrast information are used to protect the high frequency information of the motion macroblock and the static macroblock, respectively.
所述宏块层量化参数调整方法包括以下步骤:  The macroblock layer quantization parameter adjustment method includes the following steps:
S501 : 提取当前宏块及当前帧的静态对比度信息和动态对比度信息; 当前宏块的静态对比度 Cost—血 、 当前宏块的动态对比度 Contrast— moving! n t ( j = 1 or 2 ) 以及当前帧的静态对比度 、 当前 帧的动态对比度 Contrast moving t的获取方法前文已经详细记载, 在此不再赘 述。 S501: extracting static contrast information and dynamic contrast information of the current macroblock and the current frame; static contrast of the current macroblock Co- st , blood, dynamic contrast of the current macroblock Contrast— moving! nt ( j = 1 or 2 ) and the static contrast of the current frame and the dynamic contrast of the current frame. The method of acquiring Contrast moving t has been described in detail above and will not be described here.
S502 : 由帧层量化参数 ^及当前宏块、 当前帧的静态对比度信息和动态 对比度信息确定当前宏块的量化参数 QP S502: Determine a quantization parameter QP of the current macroblock by the frame layer quantization parameter and the current macroblock, the static contrast information of the current frame, and the dynamic contrast information.
Weight mb Weight mb
其中 ^为原始第 t帧的量化参数, 分别为静态对 比度和动态对比度信息的权重;  Where ^ is the quantization parameter of the original t-frame, which is the weight of the static contrast and dynamic contrast information, respectively;
(Contrast — static n t , Contrast —static t、 为基于静态对比度信息的量 ^匕 (Contrast — static nt , Contrast —static t , is the amount based on static contrast information ^匕
^L (x,y) ; 0 dfmb static (x, y) ^L (x,y) ; 0 df mb static (x, y)
参数调整函数, , ^ ^ ^ ; Parameter adjustment function, , ^ ^ ^ ;
(Contrast _ movingj^ Contrast _ moving t ) ? 为基于动态对比度信息的量化 (Contrast _ movingj^ Contrast _ moving t ) ? is quantization based on dynamic contrast information
3fmbmg x, y < 0 dfmb (x, y) 3f mbmg x , y < 0 df mb (x, y)
■0  ■0
参数调整函数, , ^ Parameter adjustment function, , ^
如图 6所示是本发明实施例一种宏块层量化参数调整系统结构示意图,所 述系统包括: 当前宏块及帧的动态和静态对比度信息提取模块,用于提取当前宏块及当 前帧的静态对比度信息和动态对比度信息; 当前宏块的量化参数获取模块, 用于由帧层量化参数及当前宏块、 当前帧 的静态对比度信息和动态对比度信息, 确定当前宏块的量化参数。  FIG. 6 is a schematic structural diagram of a macroblock layer quantization parameter adjustment system according to an embodiment of the present invention, where the system includes: a dynamic and static contrast information extraction module of a current macroblock and a frame, configured to extract a current macroblock and a current frame. Static contrast information and dynamic contrast information; a quantization parameter acquisition module of the current macroblock, configured to determine a quantization parameter of the current macroblock from the frame layer quantization parameter and the current macroblock, the static contrast information of the current frame, and the dynamic contrast information.
使用本发明实施例的宏块层量化参数调整方法则可以在提升编码器的率 失真性能的同时, 保持码率波动性能的稳定性。 以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发 明的精神和原则之内所作的任何修改、等同替换和改进等, 均应包含在本发明 的保护范围之内。  The macroblock layer quantization parameter adjustment method of the embodiment of the present invention can maintain the stability of the rate fluctuation performance while improving the rate distortion performance of the encoder. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. Within the scope.

Claims

权 利 要 求 Rights request
1、 一种帧层量化参数调整方法, 其特征在于, 所述方法包括以下步骤: 提取当前帧的静态对比度信息和动态对比度信息; A method for adjusting a frame layer quantization parameter, the method comprising the steps of: extracting static contrast information and dynamic contrast information of a current frame;
根据当前帧的所述静态对比度信息、所述动态对比度信息及码率控制输出 的量化参数, 确定帧层量化参数的最终调整函数;  Determining a final adjustment function of the frame layer quantization parameter according to the static contrast information of the current frame, the dynamic contrast information, and the quantization parameter of the code rate control output;
根据当前帧的所述码率控制输出的量化参数和所述最终调整函数的和得 出帧层新的量化参数。  The new quantization parameter of the frame layer is obtained by controlling the sum of the output quantization parameter and the final adjustment function according to the code rate of the current frame.
2、 如权利要求 1所述的帧层量化参数调整方法, 其特征在于,  2. The frame layer quantization parameter adjustment method according to claim 1, wherein:
所述当前帧的所述静态对比度信息为:  The static contrast information of the current frame is:
Contrast _ static t - niecm{Contrast _ static n t | Mb,l t G region) Contrast _ static t - niecm{Contrast _ static nt | Mb, lt G region)
其中 t 表示图像在视频序列中的时间序号, n 为图像中宏块的标号, Contrast— static!为 t帧图像的静态对比度信息; C t而 t - static «, % t帧第 n个宏块的静态对比度信息, M 为第 t帧第 n个宏块, '。"为进行统计的 图像区域, mean为取均值函数。 Where t is the time sequence number of the image in the video sequence, n is the label of the macroblock in the image, Contrast-static! is the static contrast information of the t- frame image; C t and t - static «, the n-th macroblock of the % t frame Static contrast information, M is the nth macroblock of the tth frame, '. "For the image area for statistics, mean is the mean function.
3、 如权利要求 2所述的帧层量化参数调整方法, 其特征在于,  3. The frame layer quantization parameter adjustment method according to claim 2, wherein:
所述 Contrast _ static n t = sum {δ {Contrast i j t ) \ pi j t e M n t ) The Contrast _ static nt = sum {δ {Contrast ijt ) \ p ijt e M nt )
1 , f(x) > Thresf{x) else 而 -r T^hre 1 , f(x) > Thres f{x) else and -r T^hre
其中 ^s w为相应的判定阈值;  Where ^s w is the corresponding decision threshold;
ContmSt t帧第 n个宏块的静态对比度信息, Q^ ^. 为第 t帧图像第 i行第 j列的像素的对比度, 为 Β ί中第 t帧图像第 i行第 j 列的像素; ContmSt t frame n-th static contrast information of the macro block, Q ^ ^ the contrast of pixels in the t th frame image of the i-th row j-th column, is Β ί pixels in the t th frame image of the i-th row j-th column.;
Contrasti t - max( fe(5 * Contrast k— 3 * Contrast 5i ^^k )) / 15 其中 Contrasti jt ^% t帧图像第 i行第 j列的像素 Α·.'·. '的对比度, Contrast _ , j t k 为像素 A 的三邻接第 k种模式, Q^raw_5^ 为像素 的五邻接第 k种模 式。 Contrast it - max( fe(5 * Contrast k — 3 * Contrast 5 i ^^ k )) / 15 where Contrast i jt ^% t frame image i-th row j-th column pixel Α ·.'·. 'Contrast, Contrast _ , jtk is the three adjacent k- th pattern of pixel A, Q^ ra w_5^ is the pixel of five Adjacent to the kth mode.
4、 如权利要求 3 所述的帧层量化参数调整方法, 其特征在于, 所述 Contrast _3ι ,.^具体为:  The frame layer quantization parameter adjustment method according to claim 3, wherein the Contrast _3ι , .
Pi ,t Contrast Pi , t Contrast
的三邻接第一种模式: - ^i,],t,\ = Pi-l,j,t + Pi-l +l,t The first mode of the three adjacencies: - ^i,],t,\ = Pi-l,j,t + Pi-l + l,t
Pi ,, Cont Pi ,, Cont
的三邻接第二种模式: rast -  The third adjacency second mode: rast -
P 的三邻接第三种模式: Contrast The third mode of P's three adjacencies: Contrast
Pi ,t的三邻接第四种模式: Contrast ―
Figure imgf000018_0001
'J,'A _ Pi +ΪΛ + + Pi+l ,,
Pi, t three adjacencies fourth mode: Contrast ―
Figure imgf000018_0001
'J,'A _ Pi +ΪΛ + + Pi + l ,,
Pi ,t Contrast Pi , t Contrast
的三邻接第五种模式: ~ Pi + Pi+l,j,t + Pi+W The third mode of the third adjacency: ~ Pi + Pi+l,j,t + P i+W
Pi ,t Contrast Pi , t Contrast
的三邻接第六种模式: _ Pi+l,j,l + P -l,t + Pi -l,t  The third mode of the third adjacency: _ Pi+l,j,l + P -l,t + Pi -l,t
Pi ,, Contrast Pi ,, Contrast
的三邻接第七种模式: ― Pi+l,j-l,t + Pi -l,t + Pi  The seventh mode of the three adjacencies: ― Pi+l,j-l,t + Pi -l,t + Pi
Pi ,t Contrast Pi , t Contrast
的.三邻接第八种模式: = Pi'j—l't + Pi-l,j-l,t + Pi-u,t 所述 Contrast _5i j tk具体为:The third mode of the third adjacency: = Pi'j - l't + Pi-l, jl, t + Pi-u, t The Contrast _5 ij tk is specifically:
u,的五邻接第 种模式: Contrast >ijtk = sumijt -Contrast _ Μ 其中, L = Pi-w + Pi-u,t + A— P -i,t + PiJ+i,t + PM - + Pi+u,t + ΡΜ, Λ , T 表示图像在视频序列中的时间序号, i、 j分别表示当前像素仔图像中的行、 列标号, 像素 为当前宏块中第 t帧图像第 i行第 j列的像素。 The fifth mode of u, the adjacent mode: Contrast > ijtk = sum ijt - Contrast _ Μ where L = Pi-w + Pi-u, t + A - P -i, t + P iJ + i, t + PM - + P i+ u, t + ΡΜ, Λ , T denotes the time serial number of the image in the video sequence, i and j respectively represent the row and column labels in the current pixel image, and the pixel is the i-th row of the t-th frame image in the current macroblock. The pixel of the jth column.
5、 如权利要求 1所述的帧层量化参数调整方法, 其特征在于,  5. The frame layer quantization parameter adjustment method according to claim 1, wherein:
所述当前帧动态对比度信息为:  The current frame dynamic contrast information is:
Contrast moving t = meaniContrast moving n t ) | Mbn t e region, j = \or2) Contrast moving t = meaniContrast moving nt ) | Mb nt e region, j = \or2)
其中, Contrast— mOVingt为第 t帧图像的动态对比度信息; Mt帧第 n 个宏块, 为进行统计的图像区域, mean 为取均值函数; Contrast _ movingjn t表示用不同方法求取的第 t帧第 n个宏块的动态对比度信息, j=l时, 表示不使用运动矢量 mv信息时第 t帧第 n个宏块 M 的动态对比度, j=2时, 表示使用运动矢量 mv信息时第 t帧第 n个宏块 „ 的动态对比度; Where Contrast—m OV ing t is the dynamic contrast information of the t-th frame image; M is the n-th macroblock of the t- frame, and for the statistical image region, mean is the mean value function; Contrast _ movingj nt represents the dynamic contrast information of the nth macroblock of the tth frame obtained by different methods, and j=l indicates the dynamic contrast of the nth macroblock M of the tth frame when the motion vector mv information is not used, When j=2, it indicates the dynamic contrast of the nth macroblock „ of the tth frame when the motion vector mv information is used;
Contrast _ moving\n t = sum{d{Contrasti j t) | pi ] t e Mbn t & & pi ] t = pi ] t— p ',—] 其中 Contrast i } t = max(abs(5 * Contrast _ 3;. ; t k -3 * Contrast _5t jtk))l\5 Contrast _ moving\ nt = sum{d{Contrast i j t ) | p i ] t e Mb nt && p i ] t = p i ] t — p ', —] where Contrast i } t = max(abs( 5 * Contrast _ 3 ; . ; tk -3 * Contrast _5 t jtk ))l\5
Contrast i j t为 t帧图像第 i行第 j列的像素 P", '的对比度, Contrast >u,t,k 为像素 P"' '的三邻接第 k种模式, C0"m^_5 为像素 '的五邻接第 k种模 式; Contrast ijt is the contrast of the pixel P", ' of the i-th row and the j-th column of the t-frame image, Contrast > u , t , k is the three adjacent k- th pattern of the pixel P"'', and C 0 "m^_5 is the pixel 'five adjacency kth mode;
Contrast moving! n t - sum(d(mvxn t + mvyn t )) | mvn t e Mbn t) Contrast moving! nt - sum(d(mvx nt + mvy nt )) | mv nt e Mb nt )
其中 mvxBi表示第 t†贞第 n个宏块的运动矢量的水平分量, m 表示第 t 帧第 n个宏块的运动矢量的垂直分量。 Where mvx Bi represents the horizontal component of the motion vector of the nth macroblock of the tth, and m represents the vertical component of the motion vector of the nth macroblock of the tth frame.
6、 如权利要求 1所述的帧层量化参数调整方法, 其特征在于, 所述确定 帧层量化参数的最终调整函数具体包括以下步骤:  The frame layer quantization parameter adjustment method according to claim 1, wherein the determining the final adjustment function of the frame layer quantization parameter comprises the following steps:
根据帧率及图像的编码序号, 确定图像组波动周期;  Determining the image group fluctuation period according to the frame rate and the code serial number of the image;
根据所述图像组波动周期确定帧层量化参数的初始调整函数;  Determining an initial adjustment function of the frame layer quantization parameter according to the image group fluctuation period;
根据当前帧的所述静态对比度信息、所述动态对比度信息和所述初始调整 函数获取帧层量化参数修正函数;  Obtaining a frame layer quantization parameter correction function according to the static contrast information of the current frame, the dynamic contrast information, and the initial adjustment function;
根据当前比特或码率控制输出的量化参数情况,调整所述帧层量化参数修 正函数, 获取所述帧层量化参数的最终调整函数。  And adjusting the frame layer quantization parameter correction function according to a current bit or code rate control output quantization parameter to obtain a final adjustment function of the frame layer quantization parameter.
7、 如权利要求 6所述的帧层量化参数调整方法, 其特征在于, 所述图像组波动周期为:  The frame layer quantization parameter adjustment method according to claim 6, wherein the image group fluctuation period is:
period = f。 (idt , fps) Period = f. (id t , fps)
其中, period为图像组波动周期, 为第 t帧的编码序号, 加)为由 帧率加及图像的编码顺序 id'确定的图像组波动周期函数; f0 (idt , fps) = ki , Thres < fps < Threst & 8ddt e Ω? 其中 为根据不同帧率和编码序号 集合划分确定的统计常量, 7¾r%— ^77»^.为相应的门限值, Ω, 为编码序号的类别 集合; Where period is the image group fluctuation period, which is the coding sequence number of the t-th frame, plus) Coding sequence plus the frame rate and image id 'image group determined as a function fluctuation cycle; f 0 (id t, fps ) = k i, Thres <fps <Thres t & 8dd t e Ω? Wherein is a statistical constant determined according to different frame rates and a set of coding sequence numbers, 73⁄4r% - ^77»^. is a corresponding threshold value, Ω, which is a category set of coding sequence numbers;
所述帧层量化参数初始调整函数为:  The initial adjustment function of the frame layer quantization parameter is:
dQPx t = fx(id period ) (x,y) ; o dQP xt = f x (id period ) (x,y) ; o
其中/ ! y)满足, dx , A(x + ky,y) = Ά y) , dQp为第 t帧量化参数 初始调整函数, k为周期常数, 3是求偏导; 所述帧层量化参数修正函数为: Where / ! y) satisfies, d x , A(x + ky, y) = Ά y) , d Q p is the initial adjustment function of the quantization parameter of the t-th frame, k is a period constant, and 3 is a partial derivative; The layer quantization parameter correction function is:
dQP2 t = f2 (Contrast _ static t , Contrast _ moving t , dQPl t ) 表示第 t 帧量化参数修正函数; /2(^2)满足3/^,^) < 0 , dx 其中 3是求偏导,
Figure imgf000020_0001
dQP 2 t = f 2 (Contrast _ static t , Contrast _ moving t , dQP lt ) represents the t-frame quantization parameter correction function; / 2 ( ^ 2) satisfies 3/ ^, ^) < 0 , dx where 3 is Partial guidance,
Figure imgf000020_0001
amj为不同波动周期和编码序号的划分集合, 为根据上述划分集合确定的 统计调整常量; 所述帧层量化参数最终调整函数为: a m j is a division set of different fluctuation periods and coding sequence numbers, and is a statistical adjustment constant determined according to the above division set; the final adjustment function of the frame layer quantization parameter is:
dQPr = MdQP2l,QPt,bitt) /3^,2)满足^ ^〉0^ ^〉0, /3(w,z) = /3 z)je Q 的函数, 其 dQPr = MdQP 2l , QP t , bit t ) / 3 ^, 2) a function satisfying ^ ^ > 0 ^ ^ > 0 , / 3( w, z) = / 3 z) j e Q ,
OX OZ  OX OZ
中 W为第 t帧量化参数最终调整函数, Bitt为当前比特值。 Medium W is the final adjustment function of the t-frame quantization parameter, and Bitt is the current bit value.
8、 一种帧层量化参数调整系统, 其特征在于, 所述系统包括: 当前帧静态和动态对比度信息提耳 ^莫块,用于提取当前帧的静态对比度信 息和动态对比度信息; 帧层量化参数的最终调整函数获取模块,用于根据当前帧的所述静态对比 度信息、所述动态对比度信息及码率控制输出的量化参数,确定帧层量化参数 的最终调整函数; 8. A frame layer quantization parameter adjustment system, wherein the system comprises: a current frame static and dynamic contrast information, and is used for extracting static contrast information and dynamic contrast information of a current frame; a final adjustment function obtaining module of the parameter, configured to determine a frame layer quantization parameter according to the static contrast information of the current frame, the dynamic contrast information, and a quantization parameter of a code rate control output Final adjustment function;
帧层新量化参数获取模块,用于根据当前帧的所述码率控制输出的量化参 数和所述最终调整函数的和得出帧层新的量化参数。  The frame layer new quantization parameter obtaining module is configured to obtain a new quantization parameter of the frame layer according to the sum of the quantization parameter outputted by the code rate control of the current frame and the final adjustment function.
9、 如权利要求 8所述的帧层量化参数调整系统, 其特征在于, 所述帧层 量化参数的最终调整函数获取模块包括: 图像组波动周期确定模块, 用于根据帧率及图像的编码序号,确定图像组 波动周期;  The frame layer quantization parameter adjustment system according to claim 8, wherein the final adjustment function acquisition module of the frame layer quantization parameter comprises: an image group fluctuation period determining module, configured to encode according to a frame rate and an image. Sequence number, determining the fluctuation period of the image group;
帧层量化参数初始调整函数确定模块,用于根据所述图像组波动周期确定 帧层量化参数的初始调整函数;  a frame layer quantization parameter initial adjustment function determining module, configured to determine an initial adjustment function of the frame layer quantization parameter according to the image group fluctuation period;
帧层量化参数修正函数确定模块, 用于根据当前帧的所述静态对比度信 息、 所述动态对比度信息和所述初始调整函数获取帧层量化参数修正函数; 帧层量化参数最终调整函数确定模块,用于根据当前比特或码率控制输出 的量化参数情况,调整所述帧层量化参数修正函数, 获取所述帧层量化参数的 最终调整函数。  a frame layer quantization parameter correction function determining module, configured to acquire a frame layer quantization parameter correction function according to the static contrast information of the current frame, the dynamic contrast information, and the initial adjustment function; a frame layer quantization parameter final adjustment function determining module, And configured to adjust the frame layer quantization parameter correction function according to a current bit or a code rate control output quantization parameter to obtain a final adjustment function of the frame layer quantization parameter.
10、 一种宏块层量化参数调整方法, 其特征在于, 所述方法包括: 提取当前宏块及当前帧的静态对比度信息和动态对比度信息; A method for adjusting a macroblock layer quantization parameter, the method comprising: extracting static contrast information and dynamic contrast information of a current macroblock and a current frame;
由帧层量化参数及当前宏块、当前帧的静态对比度信息和动态对比度信息 确定当前宏块的量化参数。  The quantization parameter of the current macroblock is determined by the frame layer quantization parameter and the current macroblock, the static contrast information of the current frame, and the dynamic contrast information.
11、 如权利要求 10所述的宏块层量化参数调整方法, 其特征在于, 所述当前宏块的量化参数为: The macroblock layer quantization parameter adjustment method according to claim 10, wherein the quantization parameter of the current macroblock is:
+ f ^^S^^ + f ^^S^"^  + f ^^S^^ + f ^^S^"^
其中 为当前宏块的量化参数, ^为原始第 t帧的量化参数, , ^ightmb movms , 分别为静态对比度信息和动态对比度信息的权重; (Contrast — static n t, Contrast —static t、, 为基于静态对比度信息的量 ^匕Where is the quantization parameter of the current macroblock, ^ is the quantization parameter of the original t-th frame, and ^ight mb movms is the weight of the static contrast information and the dynamic contrast information, respectively; (Contrast — static nt , Contrast —static t ,, is the amount based on static contrast information ^匕
^L (x,y) ;0 dfmb static(x,y) ^L (x,y) ;0 df mb static (x,y)
参数调整函数, , ^ ^ ^ ; Parameter adjustment function, , ^ ^ ^ ;
膨 (Contrast _ moving/^ Contrast _ moving t )? 为基于动态对比度信息的量化 Swelling (Contrast _ moving / ^ Contrast _ moving t)? Dynamic contrast information based on a quantization
( , y) ΐ0 dfmb x,y) ( , y) ΐ0 df mb x,y)
参数调整函数, ^ , ^ 。 Parameter adjustment function, ^ , ^ .
12、 一种宏块层量化参数调整系统, 其特征在于, 所述系统包括: 当前宏块及帧的动态和静态对比度信息提取模块,用于提取当前宏块及当 前帧的静态对比度信息和动态对比度信息;  12. A macroblock layer quantization parameter adjustment system, wherein the system comprises: a dynamic and static contrast information extraction module of a current macroblock and a frame, configured to extract static contrast information and dynamics of a current macroblock and a current frame. Contrast information;
当前宏块的量化参数获取模块, 用于由帧层量化参数及当前宏块、 当前帧 的静态对比度信息和动态对比度信息, 确定当前宏块的量化参数。  The quantization parameter obtaining module of the current macroblock is configured to determine a quantization parameter of the current macroblock by the frame layer quantization parameter and the current macroblock, the static contrast information of the current frame, and the dynamic contrast information.
PCT/CN2011/072822 2010-09-27 2011-04-14 Method and system for adjusting quantization parameters of frame level and macroblock level WO2012041055A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010294847.7 2010-09-27
CN201010294847.7A CN102420980B (en) 2010-09-27 2010-09-27 Frame-layer and macroblock-layer quantization parameter adjusting method and system

Publications (1)

Publication Number Publication Date
WO2012041055A1 true WO2012041055A1 (en) 2012-04-05

Family

ID=45891878

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/072822 WO2012041055A1 (en) 2010-09-27 2011-04-14 Method and system for adjusting quantization parameters of frame level and macroblock level

Country Status (2)

Country Link
CN (1) CN102420980B (en)
WO (1) WO2012041055A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106559671B (en) * 2015-09-30 2019-08-23 展讯通信(上海)有限公司 A kind of display method for compressing image and system
CN110365983B (en) * 2019-09-02 2019-12-13 珠海亿智电子科技有限公司 Macroblock-level code rate control method and device based on human eye vision system
CN111586411B (en) * 2020-05-06 2022-07-12 深圳市梦网视讯有限公司 Low-contrast video coding method, system and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5844607A (en) * 1996-04-03 1998-12-01 International Business Machines Corporation Method and apparatus for scene change detection in digital video compression
CN101389012A (en) * 2008-09-28 2009-03-18 湖北科创高新网络视频股份有限公司 Method and device for rate distortion rate control
CN101466035A (en) * 2007-12-21 2009-06-24 深圳市融合视讯科技有限公司 Method for distributing video image set bit based on H.264

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8374237B2 (en) * 2001-03-02 2013-02-12 Dolby Laboratories Licensing Corporation High precision encoding and decoding of video images
CN1696975A (en) * 2004-05-14 2005-11-16 蒲恬 Method for enhancing digital image
CN101582991B (en) * 2008-05-13 2011-02-09 华为终端有限公司 Method and device for processing image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5844607A (en) * 1996-04-03 1998-12-01 International Business Machines Corporation Method and apparatus for scene change detection in digital video compression
CN101466035A (en) * 2007-12-21 2009-06-24 深圳市融合视讯科技有限公司 Method for distributing video image set bit based on H.264
CN101389012A (en) * 2008-09-28 2009-03-18 湖北科创高新网络视频股份有限公司 Method and device for rate distortion rate control

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TANG, TIANYE ET AL.: "One rate control method of video for consistent picture quality.", COMPUTER APPLICATIONS., vol. 25, no. 11, 30 November 2005 (2005-11-30), pages 2592 - 2593 *

Also Published As

Publication number Publication date
CN102420980B (en) 2014-08-27
CN102420980A (en) 2012-04-18

Similar Documents

Publication Publication Date Title
CN101711481B (en) Method and apparatus for video coding using prediction data refinement
CN105049850B (en) HEVC bit rate control methods based on area-of-interest
JP5303470B2 (en) Distortion estimation
CN101547349B (en) Method for controlling code rate of secondary AVS encoding of video signal
CN101795415B (en) Method and device for controlling code rate in video coding
JP5559139B2 (en) Video encoding and decoding method and apparatus
TWI715508B (en) Image encoding device, image encoding method, image decoding device, and image decoding method
JP2009528738A (en) Method and apparatus for determining bit allocation for groups of pixel blocks in an image in image signal encoding
CN103124353A (en) Motion prediction method and video coding method
RU2633179C1 (en) Device, method and program of coding moving images, and device, method and program of decoding moving images
CN107071422B (en) Low complex degree HEVC rate adaption transformation coding method based on image correlation model
CN105681793A (en) Very-low delay and high-performance video coding intra-frame code rate control method based on video content complexity adaption
CN108200431B (en) Bit allocation method for video coding code rate control frame layer
Liu et al. Low-complexity rate control based on ρ-domain model for scalable video coding
Hu et al. Adaptive quantization-parameter clip scheme for smooth quality in H. 264/AVC
CN102215389A (en) Video coding and decoding methods and devices capable of realizing local luminance compensation
CN1502207A (en) Method of performing video encoding rate control using bit budget
WO2012041055A1 (en) Method and system for adjusting quantization parameters of frame level and macroblock level
WO2022228375A1 (en) Video coding method and apparatus, and electronic device
CN115695799A (en) Zero-delay panoramic video code rate control method considering time domain distortion propagation
CN104954793A (en) GOP-level QP-Offset setting method
WO2022194103A1 (en) Decoding method and apparatus, encoding method and apparatus, device, and storage medium
CN103391439B (en) A kind of H.264/AVC bit rate control method hidden based on active macro block
CN112218084B (en) High-efficiency video coding standard frame-level code rate control method facing surveillance video
WO2020019354A1 (en) Video encoding method and device, and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11827951

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 08-08-2013

122 Ep: pct application non-entry in european phase

Ref document number: 11827951

Country of ref document: EP

Kind code of ref document: A1