WO2009143783A1 - 码率控制方法及装置 - Google Patents

码率控制方法及装置 Download PDF

Info

Publication number
WO2009143783A1
WO2009143783A1 PCT/CN2009/072045 CN2009072045W WO2009143783A1 WO 2009143783 A1 WO2009143783 A1 WO 2009143783A1 CN 2009072045 W CN2009072045 W CN 2009072045W WO 2009143783 A1 WO2009143783 A1 WO 2009143783A1
Authority
WO
WIPO (PCT)
Prior art keywords
target bit
output target
type
output
frame
Prior art date
Application number
PCT/CN2009/072045
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP09753501.7A priority Critical patent/EP2293568B1/en
Publication of WO2009143783A1 publication Critical patent/WO2009143783A1/zh
Priority to US12/956,532 priority patent/US8565300B2/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/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • 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/115Selection of the code volume for a coding unit prior to 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/146Data rate or code amount at the encoder output
    • H04N19/149Data rate or code amount at the encoder output by estimating the code amount by means of a model, e.g. mathematical model or statistical model
    • 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/146Data rate or code amount at the encoder output
    • H04N19/152Data rate or code amount at the encoder output by measuring the fullness of the transmission buffer
    • 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/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

Definitions

  • the present invention relates to video communication technologies, and in particular, to a code rate control method, a rate control device, and a transcoder.
  • the video communication technology which is an important part of multimedia technology, has also been greatly developed and applied. Due to the huge amount of data in the video sequence, the video must be compressed before the network transmission.
  • the commonly used video compression standards are MPEG-2 for DVB, HDTV, DVD (by Moving Picture Experts Group: Moving Picture Exper ts Group, MPEG has developed standards, MPEG-4 standards for streaming media services in the network, H.263 for video telephony and video services (developed by the International Telecommunications Union: ITU) standards and the latest H 264/AVC (by the Joint Video Team: Joint Video Team, JVT) standards, etc.
  • ITU International Telecommunications Union
  • H264/AVC by the Joint Video Team: Joint Video Team, JVT
  • Transcoding is the technique of processing a standard and format compressed video stream into a compressed video stream that is more adaptive to another standard and format for a particular application.
  • Video transcoding performs end-to-end processing on the compressed video stream, so that the transcoded compressed code stream can better adapt to the transmission channel bandwidth and the receiving end requirements.
  • the main techniques of video transcoding can be divided into rate conversion, resolution conversion, frame rate conversion and syntax conversion.
  • rate control is usually required.
  • the rate control is to avoid network congestion while making full use of network resources and ensuring video quality. When the end-to-end delay is as low as possible, buffer is guaranteed.
  • a flow control mechanism in which the zone does not overflow or underflow.
  • the rate control further determines the quantization parameter of the frame to be encoded by assigning a target bit to the frame to be encoded, thereby controlling the code output by the transcoder.
  • Rate The rate control can be divided into two control methods: frame layer rate control and macroblock layer rate control.
  • the prior art provides a frame layer rate control method adaptable in the transcoding process from the MPEG-2 compression standard to the MPEG-4 compression standard.
  • information of the input bit stream for example, image type, number of bits used per frame, average quantization parameter, etc., are collected for rate control of the output of the transcoder.
  • the prior art first calculates the target bit rate ratio, and the target bit rate ratio per frame is equal to the target bit N of the frame output. j is the bit number of the frame, and j is the number of the frame.
  • the direct factor determining the number of coded allocation bits is the quantization parameter used in the quantization of the obtained DCT coefficients after performing the discrete cosine transform (DCT).
  • the quantization parameter reflects the spatial detail compression. If the quantization parameter is small, most of the details will be preserved and the code rate is high. If the quantization parameter is large, some details are discarded, the code rate is reduced, but the image distortion is large and the quality is not High, that is, the relationship between the quantization parameter and the bit rate is inversely proportional.
  • the basic method of rate control in the transcoding process is to control the code rate of the transcoder output code stream by adjusting the quantization parameter.
  • is the quantization parameter of the current input MPEG-2 video frame of the transcoder
  • is the quantization parameter of the current input MPEG-2 video frame of the transcoder
  • the video frame output target quantization parameter obtained by the 1-2 type is
  • the coefficient "is modified" the coefficient "equal to the ratio of the cumulative complexity of the transcoder output code stream and the input code stream.
  • a J ⁇ ( 1 - 4 ) where j is the sequence number of the frame, ⁇ 3 ⁇ 4 is the actual number of coded bits of the jth output frame, and N is the jth input. The actual number of bits of the frame.
  • the parameter is equal to the parameter ⁇ , which is equal to the ratio of the actual accumulated bit number of the encoded output frame to the actual accumulated bit of the corresponding input frame, compared with the current output frame.
  • the ratio of the target bit to the current input frame bit is equal to the parameter ⁇ , which is equal to the ratio of the actual accumulated bit number of the encoded output frame to the actual accumulated bit of the corresponding input frame, compared with the current output frame.
  • the target quantization parameter is finally obtained.
  • Encoding is performed according to the obtained target quantization parameter, and the code stream after the rate control is obtained.
  • the prior art adopts a linear rate control model which is not applicable to MPEG-2/MPEG-4/H.261/H.263 to H
  • the expected quantization parameter cannot be obtained by the model, which results in the output stream quality obtained by the transcoder according to the quantization parameter is low, and the rate control is inaccurate.
  • Embodiments of the present invention provide a rate control method, a rate control apparatus, and a transcoder, which are capable of controlling a code rate more accurately while satisfying a target bandwidth and a guaranteed code stream quality.
  • an embodiment of the present invention provides a rate control method capable of simultaneously satisfying a target bandwidth and a guaranteed code stream quality, and accurately controlling a code rate.
  • a code rate control method includes: acquiring an output target bit of a current frame, where the current frame is a currently processed input frame;
  • a target quantization parameter is acquired using the nonlinear rate control model according to the output target bit.
  • an embodiment of the present invention provides a rate control apparatus capable of simultaneously satisfying a target bandwidth and a guaranteed code stream quality, and accurately controlling a code rate.
  • a code rate control device the device includes: An output target bit obtaining unit, configured to acquire an output target bit of the current frame, where the current frame is a currently processed input frame;
  • a quantization parameter obtaining unit configured to acquire the target quantization parameter by using the nonlinear code rate control model according to the output target bit acquired by the output target bit acquiring unit.
  • an embodiment of the present invention provides a transcoder capable of simultaneously satisfying a target bandwidth and a guaranteed code stream quality, and accurately controlling a code rate.
  • a transcoder includes:
  • a decoding device configured to acquire input transcoding information of the input video code stream
  • a rate control device configured to obtain an output target bit according to the output transcoding information and the input transcoding information acquired by the decoding device, and obtain the target quantization parameter of the output end according to the nonlinear code rate control model by using the output target bit ;
  • an encoding device configured to encode according to the target quantization parameter acquired by the rate control device to generate an output code stream.
  • the difference of the coding modes of different coding standards is fully considered, and by using the nonlinear rate control model, the more accurate target quantization parameters can be obtained, and the prior art is solved.
  • the obtained target quantization parameter has large error, and the acquired code stream quality is not high.
  • the technical solution provided by the embodiment of the present invention can simultaneously satisfy the target bandwidth and the guaranteed code stream quality and accurately control the code rate when performing transcoding.
  • FIG. 1 is a flowchart of a code rate control method according to Embodiment 1 of the present invention.
  • FIG. 2 is a flowchart of a code rate control method according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic diagram of a code rate control apparatus according to Embodiment 1 of the present invention.
  • FIG. 4 is a schematic diagram of a code rate control apparatus according to Embodiment 2 of the present invention.
  • FIG. 5 is a schematic diagram of a transcoder according to an embodiment of the present invention.
  • the embodiment of the invention provides a code rate control method, a rate control device and a transcoder, which can simultaneously satisfy the target bandwidth and the guaranteed code stream quality, and accurately control the code rate.
  • the embodiments of the present invention are described in detail below.
  • a code rate control method as shown in FIG. 1, the method includes the following steps:
  • Step 11 Acquire an output target bit of the current frame, where the current frame is a currently processed input frame.
  • Step 12 Acquire a target quantization parameter by using a nonlinear rate control model according to the output target bit.
  • the difference of the coding modes of different coding standards is fully considered, and by using the nonlinear rate control model, the more accurate target quantization parameters can be obtained, and the prior art is solved.
  • the obtained target quantization parameter has large error, and the acquired code stream quality is not high.
  • the technical solution provided by the embodiment of the present invention can simultaneously satisfy the target bandwidth and the guaranteed code stream quality and accurately control the code rate when performing transcoding.
  • the MPEG-2 video compression standard is mainly adopted, and the formed code stream has a large code rate and a high required bandwidth, and the H.264 video compression standard can have the same signal-to-noise ratio. With higher compression ratio and good network interface characteristics, the H.264 standard becomes an important choice for video protocols.
  • the embodiment of the present invention is described by taking the code rate control in the transcoding process from MPEG-2, MPEG-4, H.261, H.263 to H.264 as an example.
  • Step 11 Acquire an output target bit of the current frame, where the current frame is a currently processed input frame.
  • N 0 J is the initial output target bit of the current frame
  • N is the input bit of the current frame. It can be configured by the system or user, and N/ can get information from the input stream.
  • the output target bit described in the embodiment of the present invention is the number of bits required to be set for the output code stream of the transcoder before transcoding.
  • step 11 specifically includes:
  • Step 110 Acquire an initial output target bit according to the bandwidth and the input bit of the current frame:
  • the embodiment of the present invention takes into account the characteristics of each frame of the image, reflects the instantaneousness of the image, and uses the input bits of each frame of the image to obtain the initial output target bit of each frame of the image, when the image The input bits are not the same at the same time, so that the obtained initial output target bits are more reasonable.
  • the embodiment of the present invention considers various factors, such as the code rate fluctuation of the image, the complexity of the image, etc., and the obtained initial output.
  • the target bit is optimized to obtain the output target bit, which mainly includes the following steps:
  • Step 111 Acquire, according to the initial output target bit and the first type of optimization parameter, the first type of output target bit, which specifically includes:
  • the first type of optimization parameters are:
  • ( / ⁇ ) / ( ⁇ / ⁇ ) , where the first optimization parameter of the current frame image is represented, j is the sequence number of the frame, and ⁇ and ⁇ are the encoded front J'-frame output and input respectively.
  • the average actual number of bits; or, y j (N / ⁇ Q step IN; -, ⁇ Qstepj 1 ), where ⁇ represents the current frame image complexity,
  • N ⁇ - 1 ⁇ Qstepi 1 represents the average complexity of the encoded pre-j-1 frame; for the sake of clarity, the embodiment of the present invention uses the first output target bit, the second output target bit, etc.
  • the parameters are optimized to distinguish the results obtained by the initial output target bits, and the words do not strictly indicate the order in which they are optimized.
  • a frame or a frame with a high complexity scene, N; -Qstep ⁇ is N; - Qstep - 1 , so more bits are allocated to the frame, and fewer bits are allocated for low complexity frames.
  • N/ ⁇ Qstepj I ⁇ (- ⁇ ⁇ Qstepl 1 can effectively reflect the complexity variation of each frame in the entire sequence, the detection of scene changes and bit allocation are easy to perform.
  • N -Qstepi can The coding complexity of the I, P, and B frames is distinguished, so the bit allocation of the three types of frames can be uniformly adopted.
  • the third output target bit obtained in step 112 is the first output target bit and the second output target bit combination, which is 0.25 in the embodiment of the present invention
  • the third output target bit obtained in step 112 is the product of the second output target bit or the first output target bit and the third optimization parameter (0 or 1).
  • Step 113 Acquire a third type of output target bit.
  • the third type of optimization target parameter is selected, the second type of output target bit is optimized, and the third type of output target bit is obtained as an example for description.
  • the embodiment of the present invention uses the fourth output target bit, the fifth output target bit, and the like to distinguish the result obtained by optimizing the second type of output target bit by using an optimized parameter, which is not strict.
  • the sequence of the optimization is used.
  • the sequence of the three types of optimization parameters is used, which is only one of the technical solutions provided by the embodiments of the present invention.
  • the specific method is as follows:
  • the third type of optimization parameter may be:
  • Ratio] R. If. 1 ⁇ , where, /.
  • Ratio 1 further considers that the output frame rate is the same as the input frame rate, and the input frame rate information is directly obtained from the input code stream,
  • the third type of optimization parameter may also be:
  • the optimization of this step can reduce the influence of the deviation on the subsequent frame and reduce the error of the actual output bit and the target bit of the subsequent frame.
  • the third type of optimization parameter may be:
  • the third type of output target bit obtained is the sixth output target bit N.
  • J 6 N o J 5 ⁇ Para.
  • the third type of output target bit obtained by the embodiment of the present invention is not limited thereto, and includes the initial output target bit or the first type output target bit or the second type output target bit and at least one third According to the third type of optimization parameter, the third type of output target bit ⁇ obtained is: according to the product of the initial output target bit and the at least one third type of optimization parameter, the third type of output target bit obtained is:
  • N o J p N 0 J ⁇ Ratio J or N.
  • p N 0 J ⁇ Ratio J ⁇ ⁇ ] or N.
  • J p N 0 J ⁇ Ratio j ⁇ ⁇ ] ⁇ para or N.
  • J p N 0 J ⁇ ⁇ ] or N.
  • p N 0 J ⁇ ⁇ ] ⁇ para or N.
  • p N 0 J ⁇ para; or, according to the product of the first type of output target bit and the at least one third type of optimization parameter, the third type of output target bit obtained is:
  • N o J p N o J l ⁇ Ratio J or N.
  • p N o J l ⁇ Ratio J ⁇ ⁇ ] or N.
  • p N o J l ⁇ Ratio j ⁇ ⁇ ] ⁇ para or N.
  • p N o J l ⁇ 6 j or N.
  • p N o J l ⁇ 6 j ⁇ para or N.
  • p N o ] l ⁇ para; or N.
  • J p N o J 2 ⁇ Ratio J or N.
  • p N o J 2 ⁇ Ratio J ⁇ ⁇ ] or N.
  • J p N o J 2 ⁇ para; or, obtaining a third type of output target bit according to a product of the second type of output target bit and at least one third type of optimization parameter.
  • N. J p N o J 3 ⁇ Ratio J or N.
  • J p N o J 3 ⁇ Ratio J ⁇ ⁇ ] or N.
  • J p N o J 3 ⁇ Ratio j ⁇ ⁇ ] ⁇ para or N.
  • ] p N.
  • the embodiment of the present invention further includes:
  • Step 114 Obtain a fourth type of output target bit, where the step specifically includes:
  • Step S1 Obtain an upper limit initial value of the output target bit [/(0), where p is a parameter, a value range is [0.5, 1], and Bs is a buffer capacity. In the embodiment of the present invention, p takes 0. 8;
  • the upper limit of the bit where is the upper limit of the output target bit of the jth frame, the upper limit of the output target bit of the j-1th frame, and N ⁇ is the actual number of bits of the encoded J'-frame output,
  • Step S4 using the lower limit initial value and ! ;! ; - ⁇ + //. - ⁇ ; 1 , Get the lower limit of the target bit of the current frame, where ⁇ is the lower limit of the output target bit of the jth frame, (-1) is the lower limit of the output target bit of the j-1 frame, and N ⁇ 1 is encoded The actual number of bits of the J'-frame output,
  • Step S5 Acquiring a fourth type of output target bit by using an upper limit, a lower limit, and the initial output target bit or the first type of output target bit or the second type of output target bit or the third type of output target bit of the current frame target bit,
  • the output target bit is the initial output target bit or the first type output target bit or the second type output target bit or the third type output target bit or the fourth type output target bit.
  • the output target bit is the initial output target bit or the first type output target bit or the second type output target bit or the third type output target bit or the fourth type output target bit.
  • the basic idea of the technical solution provided by the present invention when acquiring the output target bit is to first acquire the initial output target bit, because the factors considered in obtaining the initial output target bit are not comprehensive enough, and the initial output target bit is not ideal.
  • the embodiment of the present invention considers various factors, for example, the code rate fluctuation of the image, the complexity of the image, etc., using the first The class optimization parameter, the weight coefficient or the second type of optimization parameter optimizes the initial output target bit to obtain an output target bit.
  • the technical solution provided by the present invention includes, but is not limited to, a method for obtaining the output target bit, which is described in the foregoing method embodiment.
  • the first type of optimization parameter, the weight coefficient, and the third type of optimization parameter include a total of six.
  • Optimizing parameters selecting at least one of the operations from the initial output target bit to obtain a first selectable output target bit, where the first selectable output target bit includes the first and second types of output target bits and The third type of output target bit obtains a fourth type of output target bit according to the first selectable output target bit or the initial output target bit. If a plurality of optimization parameters are selected, there is no strict order limitation when the initial output target bits are successively optimized by using the selected optimization parameters, and there is no strict limit on the number of selected optimization parameters. However, the more comprehensive the influencing factors are considered, the more optimized parameters are selected, and the more reasonable the output target bits are.
  • Step 12 Acquire a target quantization parameter by using a nonlinear rate control model according to the output target bit.
  • Step 12 specifically includes:
  • the target quantization parameter includes a corresponding sequence number of the quantization step size in the quantization parameter table.
  • the compression format of the input code stream is one of MPEG-2, MPEG-4, H.261 or H.263, and the compression format of the output code stream is H.264.
  • the difference of the coding modes of different coding standards is fully considered, and by using the nonlinear rate control model, the more accurate target quantization parameters can be obtained, and the prior art is solved.
  • the obtained target quantization parameter has large error, and the acquired code stream quality is not high.
  • the technical solution provided by the embodiment of the present invention can simultaneously satisfy the target bandwidth and the guaranteed code stream quality and accurately control the code rate when performing transcoding.
  • the embodiment of the invention further provides a code rate control device, which can simultaneously satisfy the target bandwidth and ensure the quality of the code stream, and accurately control the code rate.
  • a code rate control device as shown in FIG. 3, the device includes:
  • An output target bit obtaining unit 31 configured to acquire an output target bit of the current frame, where the current frame is a currently processed input frame;
  • the quantization parameter obtaining unit 32 is configured to acquire the target quantization parameter by using the nonlinear code rate control model according to the output target bit acquired by the output target bit acquiring unit 31.
  • the difference of the coding modes of different coding standards is fully considered, and by using the nonlinear rate control model, the more accurate target quantization parameters can be obtained, and the prior art is solved.
  • the obtained target quantization parameter has large error, and the acquired code stream quality is not high.
  • the technical solution provided by the embodiment of the present invention can simultaneously satisfy the target bandwidth and the guaranteed code stream quality and accurately control the code rate when performing transcoding.
  • the output target bit obtaining unit 31 includes: an initial output target bit obtaining module 311, configured to obtain an initial output target bit according to a bandwidth and an input bit of a current frame: N. J ⁇ N , where is the initial output target bit of the current frame, and N/ is the input bit of the current frame.
  • an initial output target bit obtaining module 311 configured to obtain an initial output target bit according to a bandwidth and an input bit of a current frame: N. J ⁇ N , where is the initial output target bit of the current frame, and N/ is the input bit of the current frame.
  • the initial output target bits are optimized to obtain output target bits.
  • the output target bit obtaining unit 31 further includes:
  • the first type of output target bit obtaining module 312 is configured to obtain a first type of output target bit according to the initial output target bit and the first type of optimization parameter.
  • the first type of optimization parameters are:
  • ( / ⁇ ) / ( / ⁇ ), where, ⁇ represents the first optimization parameter of the current frame image, j represents the serial number of the frame, ⁇ and ⁇ are the average of the encoded pre-J'-frame output and input respectively Actual number of bits; or, Qstep
  • N wide 1 ⁇ Qstep 1 represents the average complexity of the encoded pre-j-1 frame
  • the obtained first type of output target bits are:
  • the output target bit obtaining unit 31 further includes:
  • the second type of output target bit obtaining module 313 is configured to obtain a second type of output target bit according to the first type of output target bit weight.
  • the second type of output target bit is ⁇ + ⁇ ⁇ - ), where is a combined weight, and the value range is [0, 1].
  • the output target bit obtaining unit 31 further includes:
  • the third type of output target bit obtaining module 314 is configured to obtain a third type of output target bit according to the product of the at least one third type of optimization parameter of the initial output target bit, where the third type of optimization parameter is:
  • Ratio j where, /.
  • the third type of optimization parameter is:
  • is the average number of output target bits of the encoded pre-j-1 frame
  • the third type of output target bit obtained is ::
  • the third type of output target bit obtaining module 314 is further configured to obtain a third type of output target bit according to a product of the first type of output target bit and the at least one third type of optimization parameter;
  • the third type of optimization parameters are:
  • Ratio j where, /.
  • the third type of optimization parameter is:
  • the third type of output target bits obtained are:
  • N o J p N o J l ⁇ Ratio J or N.
  • p N o J l ⁇ Ratio J ⁇ ⁇ ] or N.
  • p N o J l ⁇ Ratio j ⁇ ⁇ ] ⁇ para
  • the third type output target bit obtaining module 314 is further configured to obtain a third type of output target bit according to a product of the second type output target bit and at least one third type optimization parameter.
  • the third type of optimization parameter is:
  • Ratio j where, /.
  • the third type of optimization parameter is:
  • Para m-[RR 0 /t]xn , where m, t, n are parameters, m has a value range of [0.8, 1.0], ⁇ is a positive number not greater than 0.1, and t is a positive integer, [ ] means taking an integer.
  • the third type of output target bit obtained is ::
  • N o J p N o J 3 ⁇ Ratio j or N.
  • p N o J 3 ⁇ Ratio j ⁇ ⁇ ] or N.
  • p N o J 3 ⁇ Ratio j ⁇ ⁇ ] ⁇ para
  • the output target bit obtaining unit 31 further includes:
  • the fourth type of output target bits are: N ⁇ maxminN ⁇ t/ )), / ⁇ )), where N is the initial output target bit or the first type of output target bit or the second type of output target bit or the third type of output target bit One of them.
  • the output target bit obtaining unit 31 includes the initial output target bit obtaining module 311, the first type output target bit obtaining module 312, the second type output target bit obtaining module 313, and the third type output target bit acquiring module 314. At least one of the fourth type of output target bit acquisition modules 315.
  • the schematic diagram of the apparatus for rate control provided by the embodiment of the present invention as shown in FIG. 4 includes only In one case, all five modules mentioned above are included.
  • the quantization parameter obtaining unit 32 includes:
  • An optimization obtaining module configured to optimize the initial target quantization step size, to obtain an optimization target quantization step size
  • an obtaining module configured to search the quantization parameter table according to the initial target quantization step size or the optimized target quantization step size, to obtain the target quantization parameter.
  • the difference of the coding modes of different coding standards is fully considered, and by using the nonlinear rate control model, the more accurate target quantization parameters can be obtained, and the prior art is solved.
  • the obtained target quantization parameter has large error, and the acquired code stream quality is not high.
  • the technical solution provided by the embodiment of the present invention can simultaneously satisfy the target bandwidth and the guaranteed code stream quality and accurately control the code rate when performing transcoding.
  • the embodiment of the invention further provides a transcoder capable of simultaneously satisfying the target bandwidth and ensuring the quality of the code stream, and accurately controlling the code rate.
  • the transcoder includes:
  • a decoding device 51 configured to acquire input transcoding information of an input video code stream
  • the rate control device 52 is configured to obtain an output target bit according to the output transcoding information and the input transcoding information acquired by the decoding device 51, and obtain the target quantization parameter of the output end according to the nonlinear code rate control model by using the output target bit;
  • the encoding device 53 is configured to perform encoding according to the target quantization parameter acquired by the code rate control device 52 to generate an output code stream.
  • the input transcoding information includes a bandwidth of the input code stream, a frame rate, a number of bits of each frame, and a quantization step size.
  • the output transcoding information includes a bandwidth of the output code stream, a frame rate, a target bit number of each frame, and Target amount a step size, wherein the bandwidth in the output transcoding information is configured by a system or a user, and the frame rate is determined by the system or the user or determined according to the input code stream, and the target bit number and the target quantization step size of each frame are determined by the code rate.
  • Control device 52 is provided.
  • the nonlinear rate control model is a square product invariant model of the code rate and the quantization step size:
  • the compression format of the input code stream is one of MPEG-2, MPEG-4, H.261 or H.263, and the compression format of the output code stream is H.264.
  • the difference of the coding modes of different coding standards is fully considered, and by using the nonlinear rate control model, the more accurate target quantization parameters can be obtained, and the prior art is solved.
  • the obtained target quantization parameter has large error, and the acquired code stream quality is not high.
  • the technical solution provided by the embodiment of the present invention can simultaneously satisfy the target bandwidth and the guaranteed code stream quality and accurately control the code rate when performing transcoding.
  • rate control method of the present invention can also be applied to an encoder which can be derived from the result of the last encoding output of the encoder described above for the operation of the secondary encoding.
  • rate control method can be applied to any scene in which rate control is required.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Algebra (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

码率控制方法及装置
本申请要求于 2008年 5月 31日提交中国专利局、申请号为 200810109867.5 , 发明名称为"量化参数的获取方法、装置及转码器"的中国专利申请的优先权,其 全部内容通过引用结合在本申请中。
技术领域
本发明涉及视频通信技术, 尤其涉及一种码率控制方法、 码率控制装置及 转码器。
背景技术
随着信息技术的飞跃, 多媒体技术在网络中的应用得到了空前发展, 作为 多媒体技术重要组成部分的视频通信技术也得到了极大的发展和应用。 由于视 频序列的数据量巨大, 在进行网络传输之前要先对视频进行压缩, 常用的视频 压缩标准有,针对 DVB、 HDTV, DVD的 MPEG-2(由运动图像专家组: Moving Picture Exper t s Group , MPEG制定)标准、 针对网络中流媒体服务开发的 MPEG-4标准、 针对视频电话和视频业务提出的 H. 263 (由国际电信联合会: Internat iona l Telecommunicat ion Union, ITU制定)标准及最新的 H. 264/AVC (由联合视频 专家组: Joint Video Team, JVT制定)标准等。 为了使视频数据能够在异构的 网络之间、 不同类的接入设备之间以及不同标准的媒体数据格式之间透明的交 换, 压缩视频之间的转码成为数字视频中的热点研究方向。
转码就是将一种标准和格式的压缩视频码流处理成更适应于某特定应用的 另一种标准和格式的压缩视频码流的技术。 视频转码对压缩的视频码流进行端 到端的处理, 使得转码后的压缩码流更能适应传输信道带宽以及接收端的要求。
视频转码的主要技术可分为码率转换、 分辨率转换、 帧率转换和语法转换。 在转换的过程中通常需要进行码率控制, 码率控制是在充分利用网络资源和保 证视频质量的同时, 尽可能避免网络拥塞; 在端到端时延尽可能低的情况下, 保证緩冲区既不上溢也不下溢的一种流量控制机制。 码率控制通过给待编码帧 分配目标比特, 进一步确定该待编码帧的量化参数, 从而控制转码器输出的码 率。 码率控制可以分为帧层码率控制和宏块层码率控制两种控制方法。 现有技术提供了一种从 MPEG-2压缩标准到 MPEG-4压缩标准的转码过程中 可适应的帧层码率控制方法。 在转码器的解码端, 输入比特流的信息, 例如, 图像类型、 每帧使用比特数、 平均量化参数等被收集起来, 用于进行转码器编 码端输出的码率控制。
现有技术首先计算目标比特率比例, 每帧的目标比特率比例等于该帧输出 的目标比特 N。j比上该帧输入的比特 N , j表示帧的序号。
Figure imgf000004_0001
在视频编码过程中, 决定编码分配比特数的直接因素是进行离散余弦变换 ( D i s c re te Cos i ne Trans form , DCT )后, 对获得的 DCT系数量化时采用的量 化参数。 量化参数反映了空间细节压缩情况, 如果量化参数小, 大部分的细节 都会被保留, 码率较高; 如果量化参数大, 部分细节被丟弃, 码率降低, 但图 像失真较大、 质量不高, 即量化参数和比特率成反比的关系, 在转码过程中码 率控制的基本方法就是通过调整量化参数, 控制转码器输出码流的码率。
现有技术利用上述获得的目标比特率比例, 根据下式建立码率控制模型:
Figure imgf000004_0002
其中, ρ 为转码器当前输入 MPEG-2视频帧的量化参数 , ρ。为转码器当前 输出 MPEG-4视频帧的目标量化参数。
由 1-2式可得视频帧输出目标量化参数为
Qj = Ql · N I Nj = ρ l rj ( 1 ~3 )
为了使得到的目标量化参数更精确, 使用系数《 对其进行修正, 系数《 等 于转码器输出码流和输入码流的累积复杂度之比。 a J = ^ ( 1—4 ) 其中, j表示帧的序号, Λ¾为第 j输出帧实际编码比特数, N为第 j输入 帧实际编码比特数。
利用系数《 进一步得到目标量化参数为
QJ = α^ - Q l rj ( 1~5 )
为使得到的目标量化参数可以由实际编码比特自适应的控制,弓 ]入参数 β , 该参数等于已编码输出帧实际累积比特数与相应输入帧实际累积比特之比, 比 上当前输出帧的目标比特与当前输入帧比特之比。
Figure imgf000005_0001
根据参数 y¾最终得到目标量化参数为
Q - β^ - Q! i r1 ( 1-7 )
根据获得的目标量化参数进行编码, 获取进行码率控制后的码流。
在实现本发明的过程中, 发明人发现现有技术中至少存在如下问题: 现有技术采用线性的码率控制模型不适用于 MPEG-2/MPEG-4/H. 261 /H. 263 到 H. 264的转码过程, 由该模型无法得出预期的量化参数, 导致转码器根据该量 化参数编码获得的输出码流质量较低、 码率控制不准确。
发明内容 本发明实施例提供了一种码率控制方法、 码率控制装置和转码器, 能够在 满足目标带宽和保证码流质量的情况下, 较准确地控制码率。
一方面, 本发明实施例提供了一种码率控制方法,能够同时满足目标带宽和 保证码流质量, 准确控制码率。
本发明实施例采用的技术方案如下: 一种码率控制方法,该方法包括: 获取当前帧的输出目标比特, 所述当前帧为当前处理的输入帧;
根据所述输出目标比特利用非线性码率控制模型获取目标量化参数。
另一方面, 本发明实施例提供了一种码率控制装置, 能够同时满足目标带 宽和保证码流质量, 准确控制码率。
本发明实施例采用的技术方案如下: 一种码率控制装置, 该装置包括: 输出目标比特获取单元, 用于获取当前帧的输出目标比特, 所述当前帧为 当前处理的输入帧;
量化参数获取单元, 用于根据所述输出目标比特获取单元获取的输出目标 比特利用非线性码率控制模型获取目标量化参数。
再一方面, 本发明实施例提供了一种转码器, 能够同时满足目标带宽和保 证码流质量, 准确控制码率。
本发明实施例采用的技术方案如下: 一种转码器, 包括:
解码装置, 用于获取输入视频码流的输入转码信息;
码率控制装置, 用于才艮据输出转码信息和所述解码装置获取的输入转码信 息, 获取输出目标比特, 利用所述输出目标比特根据非线性码率控制模型获取 输出端的目标量化参数;
编码装置, 用于根据所述码率控制装置获取的目标量化参数进行编码以生 成输出码流。
本发明实施例在进行视频转码时, 充分考虑到不同的编码标准在编码方式 上的差异, 通过采用非线性码率控制模型, 能够获取较精确的目标量化参数, 解决了现有技术中在进行从 MPEG-2、 MPEG-4、 H. 261、 H. 263至 H. 264的转码时, 因采用线性码率控制模型, 获取的目标量化参数误差较大, 获取的码流质量不 高, 码率控制不准确的问题, 从而, 本发明实施例提供的技术方案在进行转码 时, 能够同时满足目标带宽和保证码流质量, 准确控制码率。 附图说明
图 1为本发明实施例一提供的码率控制方法流程图;
图 2为本发明实施例二提供的码率控制方法流程图;
图 3为本发明实施例一提供的码率控制装置示意图;
图 4为本发明实施例二提供的码率控制装置示意图;
图 5为本发明实施例提供的转码器示意图。
具体实施方式 为了更清楚地说明本发明实施例的技术方案, 下面将结合附图对本发明的 实施例进行详细的介绍, 下面的描述仅仅是本发明的一些实施例, 对于本领域 普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可以根据这些实施例 获得本发明的其他的实施方式。
本发明实施例提供了一种码率控制方法、 码率控制装置及转码器, 能够同 时满足目标带宽和保证码流质量, 准确控制码率。 下面对本发明实施例进行详 细说明。
本发明实施例采用的技术方案包括: 一种码率控制方法, 如图 1 所示, 该 方法包括如下步骤:
步骤 11、 获取当前帧的输出目标比特, 所述当前帧为当前处理的输入帧; 步骤 12、 根据所述输出目标比特利用非线性码率控制模型获取目标量化参 数。
本发明实施例在进行视频转码时, 充分考虑到不同的编码标准在编码方式 上的差异, 通过采用非线性码率控制模型, 能够获取较精确的目标量化参数, 解决了现有技术中在进行从 MPEG-2、 MPEG-4、 H. 261、 H. 263至 H. 264的转码时, 因采用线性码率控制模型, 获取的目标量化参数误差较大, 获取的码流质量不 高, 码率控制不准确的问题, 从而, 本发明实施例提供的技术方案在进行转码 时, 能够同时满足目标带宽和保证码流质量, 准确控制码率。
在目前的数字电视视频中主要采用 MPEG-2视频压缩标准, 形成的码流码率 较大, 要求的带宽较高, 而 H. 264视频压缩标准, 能够在保持相同信噪比的前 提下具有更高的压缩率和良好的网络接口特性, 所以 H. 264标准成为视频协议 的一个重要选择。 本发明实施例以从 MPEG-2、 MPEG-4、 H. 261、 H. 263到 H. 264 转码过程中的码率控制为例进行说明。
步骤 11、 获取当前帧的输出目标比特, 所述当前帧为当前处理的输入帧。 本发明实施例为获取当前帧的初始输出目标比特, 首先确定了输出带宽与 当前帧初始输出目标比特比: Ro IN0 J = Ι^ ΙΝί , 其中 。为输出码流的目标带宽, 为输入码流的带宽, N0 J为当前帧的初始输出目标比特, N为当前帧的输入比 特, 。可由系统或用户配置, 和 N/可从输入码流中获取信息。 在本发明实施 例中所述的输出目标比特是转码前为转码器的输出码流设定的所需占用的比特 数。
如图 2所示, 步骤 11具体包括:
步骤 110、 根据带宽和当前帧的输入比特获取初始输出目标比特:
本发明实施例在获取初始输出目标比特时, 考虑到了每帧图像各自的特征, 反映了图像的瞬时性, 利用每帧图像的输入比特, 获取的每帧图像的初始输出 目标比特, 当该图像的输入比特不同时也不相同, 从而使获取的初始输出目标 比特更加合理。
为了使获取的输出目标比特更加准确, 从而使对视频帧的比特分配更加合 理, 本发明实施例考虑多种因素, 例如, 图像的码率波动、 图像的复杂度变化 等, 对获得的初始输出目标比特进行优化, 获取输出目标比特, 主要包括如下 步骤:
步骤 111、根据所述初始输出目标比特和第一类优化参数, 获取第一类输出 目标比特, 具体包括:
所述的第一类优化参数为:
· = ( /^Ρ) / (^ /^) , 式中, 表示当前帧图像的第一优化参数, j表示 帧的序号, ^和^分别为已编码的前 J'- 帧输出和输入的平均实际比特数; 或者, yj = (N/ · Qstep I N;-、 · Qstepj 1 ) , 式中, ^表示当前帧图像复杂度,
N{-1 · Qstepi 1表示已编码的前 j-1帧的平均复杂度; 为了便于清楚说明, 本发明实施例采用第一输出目标比特、 第二输出目标 比特等字样, 对利用一种优化参数优化所述初始输出目标比特获得的结果进行 区分, 该字样并不严格表明在优化时的先后顺序。 利用所述的第一类优化参数获取的所述第一类输出目标比特为: 第一输出目标比特 A^=N/.L^, 或者, 第二输出目标比特 N。J 2 =N{-^-yj , 其中, = (N/ · Qstepj / N( l -Qstepj ' , 式 ]N 'Qstepi IN^.Qstep—1指出了当前帧的复杂程度。 对于场景发生变化的帧或 具有高复杂度场景的帧, N; -Qstep^于 N;- Qstep -1 , 因此对该帧分配较多的比 特, 而对于低复杂度的帧则分配较少的比特。
由于 N/ · Qstepj I Ν(-χ · Qstepl 1可以有效地反映每一帧在整个序列中的复杂度 变化情况, 因而场景变化的检测和比特分配都很容易进行。并且, 于 N -Qstepi 能够区分 I、 P、 B帧的编码复杂度, 因此这三种类型帧的比特分配可以统一采 用该方法。
步骤 112、 根据所述第一类输出目标比特加权组合获取第二类输出目标比 特,所述第二类输出目标比特为第三输出目标比特 Λ^3 =Λ^· + 2.(1- ),其中, 为组合权重, 取值范围为 [0,1]。
当义的取值不为 0或 1时,步骤 112获取的第三输出目标比特为所述第一输 出目标比特和第二输出目标比特组合, 在本发明实施例中 取 0.25;
当 的取值为 0或 1时,步骤 112获取的第三输出目标比特为所述第二输出 目标比特或第一输出目标比特与所述第三优化参数( 0或 1 ) 的乘积。
步骤 113、 获取第三类输出目标比特。
在本发明实施例中, 以选择三种第三类优化参数, 对所述第二类输出目标 比特进行优化, 获取第三类输出目标比特为例进行说明。 为了便于清楚说明, 本发明实施例采用第四输出目标比特、 第五输出目标比特等字样, 对利用一种 优化参数优化所述第二类输出目标比特获得的结果进行区分, 该字样并不严格 表明在优化时的先后顺序, 本发明实施例中进行优化时, 使用三种第三类优化 参数的顺序, 只是本发明实施例提供的技术方案中的一种, 具体方法如下: 所述的第三类优化参数可以为:
Ratio] =R。 If。1^ , 式中, /。为输出目标帧率, 采用此种第三类优化参数 进行优化时, 获取的第三类输出目标比特为第四输出目标比特^4=^3.^^/', 即: N。J4 =Nj -^-(gj -λ + yj · (1 - λ)) · Ratio1 此外考虑到输出帧率同输入帧率, 而输入帧率信息直接从输入码流中获取,
R NJ~l
则: Ratioj =R f No J A l = R01 {Rt I N(—、 ) I No J A l = 0 '· 。 或者, 为了进一步优化输出目标比特, 考虑到实际输出比特和目标比特的 误差, 所述的第三类优化参数还可以为:
0J
Figure imgf000010_0001
式中, ^为已编码的前 j-1帧的平均输出目标比特数, 采用此种第三类优化参数再次进行优化时, 获取的第三类输出目标比特为第五 输出目标比特 No J 5 = No J 4 · θ]
当某帧的实际输出比特和目标比特突然发生不期望的背离时, 该步骤的优 化, 能够降低这种背离对后续帧的影响, 降低后续帧实际输出比特和目标比特 的误差。
或者, 为了使实际得到的码率与输出目标码率更接近, 所述的第三类优化 参数可以为:
Para = m-[R R0/t]xn , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0.1的正数, t取正整数, [ ]表示取整数,在本发明实施例中 m取 0.90, t取 4, n取 0.05。
采用此种第三类优化参数再次进行优化时, 获取的第三类输出目标比特为 第六输出目标比特 N。J 6 = No J 5 · Para。
本发明实施例获取的第三类输出目标比特不限于此, 包括所述初始输出目 标比特或所述第一类输出目标比特或所述第二类输出目标比特和至少一种第三 根据所述第三类优化参数, 获取的第三类输出目标比特 Λ 为: 根据所述初始输出目标比特和至少一种第三类优化参数的乘积, 获取的第 三类输出目标比特为:
No J p = N0 J · RatioJ或 N。] p = N0 J · RatioJ · θ]或 N。J p = N0 J · Ratioj · θ] · para 或 N。J p = N0 J · θ]或 N。] p = N0 J · θ] · para或 N。] p = N0 J · para; 或者, 根据所述第一类输出目标比特和至少一种第三类优化参数的乘积, 获取的第三类输出目标比特为:
No J p = No J l · RatioJ或 N。] p = No J l · RatioJ · θ]或 N。] p = No J l · Ratioj · θ] · para 或 N。] p = No J l · 6j或 N。] p = No J l · 6j · para或 N。]p = No ] l · para; 或 N。J p = No J 2 · RatioJ或 N。] p = No J 2 · RatioJ · θ]或 N。] p = No J 2 · RatioJ · θ] · para 或 = No J 2 · Θ1或 Np = No J 2 · Θ1 · para或 N。J p = No J 2 · para; 或者, 根据所述第二类输出目标比特和至少一种第三类优化参数的乘积, 获取第三类输出目标比特。 或 N。J p = No J 3 · RatioJ或 N。J p = No J 3 · RatioJ · θ]或 N。J p = No J 3 · Ratioj · θ] · para 或 N。] p = N。] 3 · 6j或 N。] p = No J 3 · 6j · para或 N。J p = No J 3 · para。 为了进一步优化输出目标比特, 考虑到緩冲区的影响, 本发明实施例还包 括:
步骤 114、 获取第四类输出目标比特, 该步骤具体包括:
步骤 Sl、 获取输出目标比特的上限初始值 [/(0) 其中, p为参数, 取值范围为 [0.5,1], Bs为緩冲器容量, 在本发明实施例中, p取 0. 8;
步骤 S2、 获取输出目标比特的下限初始值£(0) = //。, 此外考虑到输出帧率同输入帧率, 而输入帧率信息直接从输入码流中获取, 则: = R0 lf0 = R0 lfi = N) -^ ; 步骤 S3、 利用所述上限初始值和 [/( ) = [/( ·-1) + 获取当前帧目标 比特的上限, 其中, 为第 j帧的输出目标比特的上限, 为第 j-1帧 的输出目标比特的上限, N^为已编码的第 J'- 帧输出的实际比特数,
此外考虑到输出帧率同输入帧率, 而输入帧率信息直接从输入码流中获取, 则:
U{j) =
Figure imgf000012_0001
;
步骤 S4、利用所述下限初始值和 !; !; -^ + //。-^;1 ,获取当前帧目标 比特的下限,其中, ^ 为第 j帧的输出目标比特的下限, ( -1)为第 j-1帧的 输出目标比特的下限, N^1为已编码的第 J'- 帧输出的实际比特数,
此外考虑到输出帧率同输入帧率, 而输入帧率信息直接从输入码流中获取, 则:
L{j) = L(j - i) + R f0 - NiA x = L(j - 1) + - Nj = L(j - 1) + R0 /( · I N ) - ; 步骤 S5、 利用所述当前帧目标比特的上限、 下限和所述初始输出目标比特 或第一类输出目标比特或第二类输出目标比特或第三类输出目标比特获取第四 类输出目标比特, 所述的第四类输出目标比特为: No J T = max(min(N^ , U( j)), L(j)) , 其中 N^为初始输出目标比特或第一类输出目标比特或第二类输出目标比特或第 三类输出目标比特中的一种。
在本发明实施例中, 所述的输出目标比特为上述的初始输出目标比特或第 一类输出目标比特或第二类输出目标比特或第三类输出目标比特或第四类输出 目标比特中的一种。
本发明提供的技术方案在获取所述输出目标比特时的基本构思为, 首先获 取初始输出目标比特, 因为获取初始输出目标比特时考虑的因素不够全面, 所 述初始输出目标比特不够理想。 为了使获取的输出目标比特更加准确, 从而使 对视频帧的比特分配更加合理, 本发明实施例考虑多种因素, 例如, 图像的码 率波动、 图像的复杂度变化等, 采用所述第一类优化参数、 权重系数或第二类 优化参数对初始输出目标比特进行优化, 获取输出目标比特。 本发明提供的技术方案包括但不仅限于包括上述方法实施例中描述的获取 所述输出目标比特的方法, 例如, 所述的第一类优化参数、 权重系数和第三类 优化参数共包括了六种优化参数, 从其中选择至少一种与所述初始输出目标比 特进行运算, 获取第一可选输出目标比特, 该第一可选输出目标比特包括了上 述的第一、 二类输出目标比特和第三类输出目标比特, 根据该第一可选输出目 标比特、 或初始输出目标比特获取第四类输出目标比特。 若选用了多种优化参 数, 则利用所选优化参数逐次对初始输出目标比特进行优化时, 并无严格的顺 序上的限定, 并且对所选择的多种优化参数在数量上也无严格的限定, 但考虑 的影响因素越全面, 选择的优化参数越多, 获取的输出目标比特越合理。
本发明实施例还包括:
步骤 12、 根据所述输出目标比特利用非线性码率控制模型获取目标量化参 数。
在本发明实施例中, 所述的非线性码率控制模型为码率与量化步长的平方 积不变模型: (Qstepi†■ No J T = ( step † . N , 其中, ρ^φ 为当前帧的初始目标量化 步长, No J T为当前帧的输出目标比特, Qstepi为当前帧的输入量化步长, N为当 前帧的输入比特。
步骤 12具体包括:
步骤 Tl、 根据所述非线性码率控制模型获取初始目标量化步长 Qstepi = QstepjiNl I No J T)1'2; 步骤 T2、 对所述初始目标量化步长进行优化, 获取优化目标量化步长 QStepo J l = Qstep0 J - aJ - J , 其 中 , a1 = Qstep^ · (No J A 12 1 Qstepj 1 · (N;-†1 ,
Figure imgf000013_0001
步骤 T3、根据所述初始目标量化步长或优化目标量化步长查找量化参数表, 获取所述目标量化参数。
根据获取的初始或优化目标量化步长查找 H. 264标准中的量化参数表, 找 出所述量化参数表中与获取的初始或优化目标量化参数最接近的量化步长, 所 述目标量化参数包括该量化步长在量化参数表中对应的序号。
在本发明实施例中,输入码流的压缩格式为 MPEG-2、MPEG-4、 H. 261或 H. 263 中的一种, 输出码流的压缩格式为 H. 264。
本发明实施例在进行视频转码时, 充分考虑到不同的编码标准在编码方式 上的差异, 通过采用非线性码率控制模型, 能够获取较精确的目标量化参数, 解决了现有技术中在进行从 MPEG-2、 MPEG-4、 H. 261、 H. 263至 H. 264的转码时, 因采用线性码率控制模型, 获取的目标量化参数误差较大, 获取的码流质量不 高, 码率控制不准确的问题, 从而, 本发明实施例提供的技术方案在进行转码 时, 能够同时满足目标带宽和保证码流质量, 准确控制码率。
本发明实施例还提供了一种码率控制装置, 能够同时满足目标带宽和保证 码流质量,准确控制码率。
一种码率控制装置, 如图 3所示, 该装置包括:
输出目标比特获取单元 31 , 用于获取当前帧的输出目标比特, 所述当前帧 为当前处理的输入帧;
量化参数获取单元 32 ,用于根据所述输出目标比特获取单元 31获取的输出 目标比特利用非线性码率控制模型获取目标量化参数。
本发明实施例在进行视频转码时, 充分考虑到不同的编码标准在编码方式 上的差异, 通过采用非线性码率控制模型, 能够获取较精确的目标量化参数, 解决了现有技术中在进行从 MPEG-2、 MPEG-4、 H. 261、 H. 263至 H. 264的转码时, 因采用线性码率控制模型, 获取的目标量化参数误差较大, 获取的码流质量不 高, 码率控制不准确的问题, 从而, 本发明实施例提供的技术方案在进行转码 时, 能够同时满足目标带宽和保证码流质量, 准确控制码率。
在本发明实施例中, 如图 4所示, 所述输出目标比特获取单元 31包括: 初始输出目标比特获取模块 311 ,用于根据带宽和当前帧的输入比特获取初 始输出目标比特: N。J ^ N , 其中 为当前帧的初始输出目标比特, N/为当 前帧的输入比特, 。为输出目标带宽, 为输入带宽。 为了使获取的输出目标比特更加准确, 从而使对视频帧的比特分配更加合 理, 对所述的初始输出目标比特进行优化, 获得输出目标比特。
如图 4所示, 所述输出目标比特获取单元 31还包括:
第一类输出目标比特获取模块 312,用于根据所述初始输出目标比特和第一 类优化参数, 获取第一类输出目标比特。 所述的第一类优化参数为:
^ =( /^)/( /^), 式中, ·表示当前帧图像的第一优化参数, j表示 帧的序号, ^和^分别为已编码的前 J'- 帧输出和输入的平均实际比特数; 或者, Qstep
Figure imgf000015_0001
I N;-1 · Qstepj 1 ) , 式中, 表示当前帧图像复杂度,
N广1 · Qstep 1表示已编码的前 j-1帧的平均复杂度;
获取的所述第一类输出目标比特为:
Ν0 ] 1=Ν!-^-ς 或者, NX ·γ]。 所述输出目标比特获取单元 31还包括:
第二类输出目标比特获取模块 313,用于根据所述第一类输出目标比特加权 获取第二类输出目标比特。 所述第二类输出目标比特为^^^^ + ^ ^- ), 其中, 为组合权重, 取值范围为 [0,1]。
所述输出目标比特获取单元 31还包括:
第三类输出目标比特获取模块 314,用于根据所述初始输出目标比特至少一 种第三类优化参数的乘积, 获取第三类输出目标比特, 其中, 所述的第三类优 化参数为:
Ratioj
Figure imgf000015_0002
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
0J
Figure imgf000015_0003
式中, ^为已编码的前 j-1帧的平均输出目标比特数; 或者, 所述的第三类优化参数为:
Para = m-[R R0/t]xn , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0. 1的正数, t取正整数, [ ]表示取整数;
获取的第三类输出目标比特 Λ 为:
No J p = N0 J · RatioJ或 N。] p = N0 J · RatioJ · θ]或 N。J p = N0 J · Ratioj · θ] · para
或 N。J p = N0 J · θ]或 N。] p = N0 J · θ] · para或 N。] p = N0 J · para;
或者, 第三类输出目标比特获取模块 314 ,还用于根据所述第一类输出目标 比特和至少一种第三类优化参数的乘积, 获取第三类输出目标比特;
所述的第三类优化参数为:
Ratioj
Figure imgf000016_0001
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
=^/^ , 式中, ^为已编码的前 j-1帧的平均输出目标比特数; 或者, 所述的第三类优化参数为:
Para = m - [R R0 /t] x n , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0. 1的正数, t取正整数, [ ]表示取整数;
获取的第三类输出目标比特 为:
No J p = No J l · RatioJ或 N。] p = No J l · RatioJ · θ]或 N。] p = No J l · Ratioj · θ] · para
或 N p = No J l · θ]或 N p = No J l · θ] · para或 N。] p = No J l · para;
或 N。J p = No J 2 · RatioJ或 N。] p = No J 2 · RatioJ · θ]或 N。] p = No J 2 · RatioJ · θ] · para
或 = No J 2 · Θ1或 N p = No J 2 · Θ1 · para或 N。J p = No J 2 · para。
或者, 所述第三类输出目标比特获取模块 314 , 还用于根据所述第二类输出 目标比特和至少一种第三类优化参数的乘积, 获取第三类输出目标比特。
其中, 所述的第三类优化参数为:
Ratioj
Figure imgf000016_0002
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
=^/^ , 式中, ^为已编码的前 j-1帧的平均输出目标比特数; 或者, 所述的第三类优化参数为:
Para = m-[R R0/t]xn , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0.1的正数, t取正整数, [ ]表示取整数。
获取的第三类输出目标比特 Λ 为:
No J p = No J 3 · Ratioj或 N。] p = No J 3 · Ratioj · θ]或 N。] p = No J 3 · Ratioj · θ] · para
或 N。] p = N。] 3 · 6j或 N。] p = No J 3 · 6j · para或 N。J p = No J 3 · para。
所述输出目标比特获取单元 31还包括:
第四类输出目标比特获取模块 315, 用于获取输出目标比特的上限初始值 U(0) = Bsxp, 其中, p为参数, 取值范围为 [0.5,1], Bs 为緩冲器容量; 获取输出 目标比特的下限初始值 L(0) = R f0;
利用所述上限初始值和 [7(') = [/('-l) + ?。//。-N^, 获取当前帧目标比特的上 限, 其中, 为第 j帧的输出目标比特的上限, 为第 i帧的输出目 标比特的上限, N^1为已编码的第 J'- 帧输出的实际比特数;
利用所述下限初始值和 ()= ( -1) + ^//。-^;1 ,获取当前帧目标比特的下 限,其中, £( 为第 j帧的输出目标比特的下限, 为第 j-1帧的输出目标 比特的下限, 为已编码的第 J'- 帧输出的实际比特数;
利用所述当前帧目标比特的上限、 下限和所述初始输出目标比特或第一类 输出目标比特或第二类输出目标比特或第三类输出目标比特获取第四类输出目 标比特, 所述的第四类输出目标比特为: N^ maxminN^t/ )),/^)), 其中 N 为 初始输出目标比特或第一类输出目标比特或第二类输出目标比特或第三类输出 目标比特中的一种。
所述的输出目标比特获取单元 31 包括上述的初始输出目标比特获取模块 311、 第一类输出目标比特获取模块 312、 第二类输出目标比特获取模块 313、 第三类输出目标比特获取模块 314、第四类输出目标比特获取模块 315中的至少 一种。 如图 4 中所示的本发明实施例提供的码率控制的装置示意图只包括了其 中的一种情况, 包括了上述的所有五种模块。
在本发明实施例中, 所述的量化参数获取单元 32包括:
初始目标量化步长获取模块, 用于根据所述非线性码率控制模型获取初始 目标量化步长 = Qstepj iNl I No J T2
优化获取模块, 用于对所述初始目标量化步长进行优化, 获取优化目标量 化步长 Qstep = Qstepi - aj - βύ , 其中, α = Qstep^ · (N^1)172 1 Qstepj 1 · (N 1)172 ,
获取模块, 用于根据所述初始目标量化步长或优化目标量化步长查找量化 参数表, 获取所述目标量化参数。
本发明实施例在进行视频转码时, 充分考虑到不同的编码标准在编码方式 上的差异, 通过采用非线性码率控制模型, 能够获取较精确的目标量化参数, 解决了现有技术中在进行从 MPEG-2、 MPEG-4、 H. 261、 H. 263至 H. 264的转码时, 因采用线性码率控制模型, 获取的目标量化参数误差较大, 获取的码流质量不 高, 码率控制不准确的问题, 从而, 本发明实施例提供的技术方案在进行转码 时, 能够同时满足目标带宽和保证码流质量, 准确控制码率。
本发明实施例还提供了一种转码器, 能够同时满足目标带宽和保证码流质 量,准确控制码率。
一种转码器, 如图 5所示, 该转码器包括:
解码装置 51 , 用于获取输入视频码流的输入转码信息;
码率控制装置 52 ,用于根据输出转码信息和解码装置 51获取的输入转码信 息, 获取输出目标比特, 利用所述输出目标比特根据非线性码率控制模型获取 输出端的目标量化参数;
编码装置 53 ,用于根据所述码率控制装置 52获取的目标量化参数进行编码 以生成输出码流。
所述的输入转码信息包括输入码流的带宽、 帧率、 各帧比特数和量化步长; 所述的输出转码信息包括输出码流的带宽、 帧率、 各帧的目标比特数和目标量 化步长, 其中, 所述输出转码信息中的带宽由系统或用户进行配置, 帧率由系 统或用户配置或根据输入码流确定, 各帧的目标比特数和目标量化步长由码率 控制装置 52设置。
所述的非线性码率控制模型为码率与量化步长的平方积不变模型:
(Qstepif - No J T = (Qstepif - Nj , 其中 , Qstep0 j为当前处理帧的初始目标量化步长, Νο ] Τ 为当前处理帧的输出目标比特, ρ^^/为当前处理帧的输入量化步长, Ν 为当 前处理帧的输入比特。
在本发明实施例中,输入码流的压缩格式为 MPEG-2、MPEG-4、H. 261或 H. 263 中的一种, 输出码流的压缩格式为 H. 264。
本发明实施例在进行视频转码时, 充分考虑到不同的编码标准在编码方式 上的差异, 通过采用非线性码率控制模型, 能够获取较精确的目标量化参数, 解决了现有技术中在进行从 MPEG-2、 MPEG-4、 H. 261、 H. 263至 H. 264的转码时, 因采用线性码率控制模型, 获取的目标量化参数误差较大, 获取的码流质量不 高, 码率控制不准确的问题, 从而, 本发明实施例提供的技术方案在进行转码 时, 能够同时满足目标带宽和保证码流质量, 准确控制码率。
应当注意到, 本发明所述码率控制方法还可应用于编码器中, 上述输入视 频码流可以来自上述编码器的上一次编码输出的结果, 用于二次编码的操作。 但不限于此, 上述码率控制方法可应用于任何需要进行码率控制的场景。
本领域普通技术人员可以理解实现上述实施例中的全部或部分步骤, 可以 通过程序来指令相关硬件完成。 所述实施例对应的软件可以存储在一个计算机 可存储读取的介质中。
当然, 本发明的实施例还可有很多种, 在不背离本发明的实施例精神及其 和变形, 但这些相应的改变和变形都应属于本发明的实施例所附的权利要求的 保护范围。

Claims

权利要求 书
1、 一种码率控制方法, 其特征在于, 该方法包括:
获取当前帧的输出目标比特, 所述当前帧为当前处理的输入帧;
根据所述输出目标比特利用非线性码率控制模型获取目标量化参数。
2、 根据权利要求 1所述的码率控制方法, 其特征在于, 所述的非线性码率 控制模型为码率与量化步长的平方积不变模型: (Qstepi)1 'N。] T= (Qstepi 1 'Ν , 其 中, Qstep 为当前帧的初始目标量化步长, N 为当前帧的输出目标比特, Qstep 为当前帧的输入量化步长, N为当前帧的输入比特。
3、 根据权利要求 1所述的码率控制方法, 其特征在于, 所述的获取当前帧 的输出目标比特的步骤包括: 根据带宽和当前帧的输入比特获取初始输出目标比特: N0 J
Figure imgf000020_0001
,其中 N 为当前帧的初始输出目标比特, N/为当前帧的输入比特, 。为输出目标带宽, A为输入带宽。
4、 根据权利要求 3所述的码率控制方法, 其特征在于, 还包括:
根据所述初始输出目标比特和第一类优化参数, 获取第一类输出目标比特; 所述的第一类优化参数为:
·=( /^Ρ)/(^/^), 式中, 表示当前帧图像的第一优化参数, j表示 帧的序号, ^和^分别为已编码的前 J'- 帧输出和输入的平均实际比特数;
Nj -Qstepj iNl '-QstepjA , 式中, 表示 当前帧图像复杂度, Ni- · Qstepi 1表示已编码的前 J' 帧的平均复杂度; 获取的所述第一类输出目标比特为第一输出目标比特^ =N/. ; 或者, 所述第一类输出目标比特为第二输出目标比特 2=N/.L 。
5、 根据权利要求 4所述的码率控制方法, 其特征在于, 还包括: 根据所述第一类输出目标比特加权组合获取第二类输出目标比特, 所述第 二类输出目标比特为 3 =N^ + N。 (l ), 其中, 为组合权重, 取值范围为 [0,1]。
6、 根据权利要求 3所述的码率控制方法, 其特征在于, 还包括:
根据所述初始输出目标比特和至少一种第三类优化参数的乘积, 获取第三 类输出目标比特;
所述的第三类优化参数为:
RatioJ
Figure imgf000021_0001
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
0J= ^/^,式中, ^为已编码的前 帧的平均输出目标比特数; 或 者, 所述的第三类优化参数为:
Para = m-[R R0/t]xn , 式中, m、 t、 n为参数, m的取值范围为 [0.8,1.0] , n 为不大于 0.1的正数, t取正整数, [ ]表示取整数;
获取的第三类输出目标比特 Λ 为:
No J p = N0 J · RatioJ或 N。] p = N0 J · RatioJ · θ]或 N。J p = N0 J · Ratioj · θ] · para
或 N。J p = N0 J · θ]或 N。] p = N0 J · θ] · para或 N。] p = N0 J · para。
7、 根据权利要求 4所述的码率控制方法, 其特征在于, 还包括:
根据所述第一类输出目标比特和至少一种第三类优化参数的乘积, 获取第 三类输出目标比特;
所述的第三类优化参数为:
RatioJ
Figure imgf000021_0002
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
0J= ^/^,式中, ^为已编码的前 帧的平均输出目标比特数; 或 者, 所述的第三类优化参数为:
Para = m-[R R0/t]xn , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0.1的正数, t取正整数, [ ]表示取整数;
获取的第三类输出目标比特 Λ 为:
No J p = No J l · RatioJ或 N。] p = No J l · RatioJ · θ]或 N。] p = No J l · Ratioj · θ] · para
或 N。] p = No J l · 6j或 N。] p = No J l · 6j · para或 N。]p = No J l · para;
或 N。J p = No J 2 · RatioJ或 N。] p = No J 2 · RatioJ · θ]或 N。] p = No J 2 · RatioJ · θ] · para
或 = No J 2 · Θ1或 Np = No J 2 · Θ1 · para或 N。J p = No J 2 · para。
8、 根据权利要求 5所述的码率控制方法, 其特征在于, 还包括:
根据所述第二类输出目标比特和至少一种第三类优化参数的乘积, 获取第 三类输出目标比特;
所述的第三类优化参数为:
RatioJ =
Figure imgf000022_0001
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
0J = ^/^, 式中, ^为已编码的前 帧的平均输出目标比特数; 或 者, 所述的第三类优化参数为:
Para = m-[R R0/t]xn , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0.1的正数, t取正整数, [ ]表示取整数;
获取的第三类输出目标比特 Λ 为:
No J p = No J 3 · Ratioj或 N。] p = No J 3 · Ratioj · θ]或 N。] p = No J 3 · Ratioj · θ] · para
或 N。] p = N。] 3 · 6j或 N。] p = No J 3 · 6j · para或 N。J p = No J 3 · para。
9、 根据权利要求 6或 7或 8所述的码率控制方法, 其特征在于, 还包括: 获取输出目标比特的上限初始值 [/(0) = &χρ, 其中, ρ为参数, 取值范围为
[0.5,1], Bs为緩冲器容量;
获取输出目标比特的下限初始值 L(0) = R f0;
利用所述上限初始值和 [/(^ [/( -i ^/y^-N^1, 获取当前帧目标比特的上 限, 其中, 为第 j帧的输出目标比特的上限, 为第 i帧的输出目 标比特的上限, N^1为已编码的第 J'- 帧输出的实际比特数;
利用所述下限初始值和 ()= ( -1) + ^//。-^;1 ,获取当前帧目标比特的下 限,其中, £( 为第 j帧的输出目标比特的下限, 为第 j-1帧的输出目标 比特的下限, N^为已编码的第 J'- 帧输出的实际比特数;
利用所述当前帧目标比特的上限、 下限和所述初始输出目标比特或所述第 一类输出目标比特或第二输出类目标比特或第三类输出目标比特获取第四类输 出目标比特, 所述的第四类输出目标比特为: No J T = msoi(miri(N ,U(jy),L(jy) , 其中 N 为初始输出目标比特或第一类输出目标比特或第二类输出目标比特或第三类 输出目标比特。
10、 根据权利要求 9 所述的码率控制方法, 其特征在于, 所述的输出目标 比特为初始输出目标比特或第一类输出目标比特或第二类输出目标比特或第三 类输出目标比特或第四类输出目标比特中的一种。
11、 根据权利要求 10所述的码率控制方法, 其特征在于, 所述根据所述输 出目标比特利用非线性码率控制模型获取目标量化参数的步骤包括:
根据所述非线性码率控制模型获取初始目标量化步长 =e^^/(N /N ) 1/2; 对所述初始 目 标量化步长进行优化, 获取优化目 标量化步长
QStepo J l =Qstep0 J-aJ - J , 其 中 , a1 = Qstep^ · (No J A 121 Qstepj 1 · (N;-†1 ,
Figure imgf000023_0001
根据所述初始目标量化步长或优化目标量化步长查找量化参数表, 获取所 述目标量化参数。
12、 根据权利要求 11所述的码率控制方法, 其特征在于, 输入码流的压缩 格式为 MPEG-2、MPEG-4、H.261或 H.263中的一种,输出码流的压缩格式为 H.264。
13、 一种码率控制装置, 其特征在于, 该装置包括:
输出目标比特获取单元, 用于获取当前帧的输出目标比特, 所述当前帧为 当前处理的输入帧;
量化参数获取单元, 用于根据所述输出目标比特获取单元获取的所述输出 目标比特利用非线性码率控制模型获取目标量化参数。
14、 根据权利要求 13所述的码率控制装置, 其特征在于, 所述输出目标比 特获取单元包括:
初始输出目标比特获取模块, 用于根据带宽和当前帧的输入比特获取初始 输出目标比特: N0 J = Ni ,其中 为当前帧的初始输出目标比特, N/为当前 帧的输入比特, 。为输出目标带宽, A为输入带宽。
15、 根据权利要求 14所述的码率控制装置, 其特征在于, 所述输出目标比 特获取单元还包括:
第一类输出目标比特获取模块, 用于根据所述初始输出目标比特和第一类 优化参数, 获取第一类输出目标比特, 其中, 所述的第一类优化参数为:
^ =( /^)/( /^), 式中, ·表示当前帧图像的第一优化参数, j表示 帧的序号, ^和^分别为已编码的前 J'- 帧输出和输入的平均实际比特数; 或者, 所述的第一类优化参数为 γ =(N; -QstepllNi1 -Qstepf1 , 式中, .表 示当前帧图像复杂度, ΝΓ1 -Qstepl 1表示已编码的前 J'_ 帧的平均复杂度;
获取的所述第一类输出目标比特为:
Νί、=Ν - -ς」 , 或者, N2=N;- - 。
16、 根据权利要求 15所述的码率控制装置, 其特征在于, 所述输出目标比 特获取单元还包括:
第二类输出目标比特获取模块, 用于根据所述第一类输出目标比特加权组 合获取第二类输出 目 标比特, 其中, 所述第二类输出 目 标比特为 Ν^=Ν^.λ + Ν^-(— λ) , 其中, 为组合权重, 取值范围为 [0,1]。
17、 根据权利要求 14所述的码率控制装置, 其特征在于, 所述输出目标比 特获取单元还包括:
第三类输出目标比特获取模块, 用于根据所述初始输出目标比特和至少一 种第三类优化参数的乘积, 获取第三类输出目标比特;
所述的第三类优化参数为:
Ratioj =
Figure imgf000025_0001
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
=^/^ , 式中, ^为已编码的前 帧的平均输出目标比特数; 或 者, 所述的第三类优化参数为:
Para = m - [R R0/t] x n , 式中, m、 t、 n为参数, m的取值范围为 [0.8,1.0] , n 为不大于 0. 1的正数, t取正整数, [ ]表示取整数;
获取的第三类输出目标比特 Λ 为:
N。J p = N0 J · Ratio1或 Ν。] ρ = N0 J · Ratio4 · θ]或 N。J p = N0 J · Ratio1 · Θ1 · para
或 N。] p = N0 J · θ]或 Np = N0 J · θ] · para或 N。J p = N0 J · para;
18、 根据权利要求 15所述的码率控制装置, 其特征在于, 所述输出目标比 特获取单元包括:
第三类输出目标比特获取模块, 还用于根据所述第一类输出目标比特和至 少一种第三类优化参数的乘积, 获取第三类输出目标比特;
所述的第三类优化参数为:
RatioJ =
Figure imgf000025_0002
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
=^/^ , 式中, ^为已编码的前 帧的平均输出目标比特数; 或 者, 所述的第三类优化参数为:
Para = m - [R R0/t] x n , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0. 1的正数, t取正整数, [ ]表示取整数;
获取的第三类输出目标比特 Λ 为: No J p = No J i · Ratio3或 N。J p = No J l · Ratio3 · Θ3或 N。J p = No J l · Ratio3 · Θ3 · para
或 Np = No J l · θ]或 Np = No J l · θ] · para或 N。] p = No J l · para;
或 N。J p = No J 2 · RatioJ或 N。] p = No J 2 · RatioJ · θ]或 N。] p = No J 2 · RatioJ · θ] · para
或 = No J 2 · Θ1或 Np = No J 2 · Θ1 · para或 N。J p = No J 2 · para。
19、 根据权利要求 16所述的码率控制装置, 其特征在于, 所述输出目标比 特获取单元还包括:
第三类输出目标比特获取模块, 还用于根据所述第二类输出目标比特和至 少一种第三类优化参数的乘积, 获取第三类输出目标比特。
其中, 所述的第三类优化参数为:
RatioJ =
Figure imgf000026_0001
, 式中, /。为输出目标帧率;
或者, 所述的第三类优化参数为:
0J =
Figure imgf000026_0002
, 式中, ^为已编码的前 帧的平均输出目标比特数; 或 者, 所述的第三类优化参数为:
Para = m - [R R0/t] x n , 式中, m、 t、 n 为参数, m 的取值范围为 [0.8,1.0] , η 为不大于 0. 1的正数, t取正整数, [ ]表示取整数,
获取的第三类输出目标比特 Λ 为:
No J p = No J 3 · Ratioj或 N。] p = No J 3 · Ratioj · θ]或 N。] p = No J 3 · Ratioj · θ] · para
或 N。] p = N。] 3 · 6j或 N。] p = No J 3 · 6j · para或 N。J p = No J 3 · para。
20、 根据权利要求 14至 19所述的任一码率控制装置, 其特征在于, 所述 输出目标比特获取单元还包括:
第四类输出目标比特获取模块, 用于获取输出目标比特的上限初始值 U(0) = Bs x p , 其中, p为参数, 取值范围为 [0.5,1], Bs 为緩冲器容量; 获取输出 目 标 比特的 下 限初始值 L G) = Ro l fo ; 利用 所述上限初始值和 U{j) = U{j -l) + Ro lfo -Nj , 获取当前帧目标比特的上限, 其中, 为第 j帧的 输出目标比特的上限, 为第 j-1帧的输出目标比特的上限, N^1为已编码 的 第 卜 1 帧 输 出 的 实 际 比特数 ; 利 用 所述下 限初始值和 L(j) = L(j -
Figure imgf000027_0001
获取当前帧目标比特的下限, 其中, ( 为第 j帧的 输出目标比特的下限, ( -1)为第 j-1帧的输出目标比特的下限, N^为已编码 的第 J' 帧输出的实际比特数; 利用所述当前帧目标比特的上限、 下限和所述 初始输出目标比特或第一类输出目标比特或第二类输出目标比特或第三类输出 目标比特获取第四类输出 目标比特, 所述的第四类输出 目标比特为: No J T = max(min(N ,U(j >,L(j ) ,其中 N 为初始输出目标比特或第一类输出目标比特 或第二类输出目标比特或第三类输出目标比特中的一种。
21、 根据权利要求 20所述的码率控制装置, 其特征在于, 所述量化参数获 取单元包括:
初始目标量化步长获取模块, 用于根据所述非线性码率控制模型获取初始 目标量化步长 = QstepjiNl I No J T2
优化获取模块, 用于对所述初始目标量化步长进行优化, 获取优化目标量 化步长 Qstepo J l = Qstepi - aj - β] , 其中, α〗 = Qstep^ · (N^1)172 1 Qstepj 1 · (N 1)172 , β] = {Ν^ Ι ΝΤ1) Ι (Νο ] Τ Ι Ν{) 0
获取模块, 用于根据所述初始目标量化步长或优化目标量化步长查找量化 参数表, 获取所述目标量化参数。
22、 根据权利要求 21所述的码率控制装置, 其特征在于, 输入码流的压缩 格式为 MPEG-2、MPEG-4、H. 261或 H. 263中的一种,输出码流的压缩格式为 H. 264。
23、 一种转码器, 其特征在于, 包括:
解码装置, 用于获取输入视频码流的输入转码信息;
码率控制装置, 用于根据输出转码信息和所述解码装置获取的输入转码信 息, 获取输出目标比特, 利用所述输出目标比特根据非线性码率控制模型获取 输出目标量化参数; 编码装置, 用于根据所述码率控制装置获取的目标量化参数进行编码以生 成输出码流。
24、 根据权利要求 23所述的转码器, 其特征在于, 所述的非线性码率控制 模型为码率与量化步长的平方积不变模型: (QstepH NKQstepH N , 其中, ρ^^'为当前处理帧的初始目标量化步长, N^为当前处理帧的输出目标比特, Qstepj为当前处理帧的输入量化步长, N为当前处理帧的输入比特。
25、 根据权利要求 23或 24所述的转码器, 其特征在于, 输入码流的压缩 格式为 MPEG-2、MPEG-4、H. 261或 H. 263中的一种,输出码流的压缩格式为 H. 264。
PCT/CN2009/072045 2008-05-31 2009-05-31 码率控制方法及装置 WO2009143783A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP09753501.7A EP2293568B1 (en) 2008-05-31 2009-05-31 Method and device for controlling code rate
US12/956,532 US8565300B2 (en) 2008-05-31 2010-11-30 Transcoder, method and device for controlling code rate

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810109867.5 2008-05-31
CN2008101098675A CN101594525B (zh) 2008-05-31 2008-05-31 量化参数的获取方法、装置及转码器

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/956,532 Continuation US8565300B2 (en) 2008-05-31 2010-11-30 Transcoder, method and device for controlling code rate

Publications (1)

Publication Number Publication Date
WO2009143783A1 true WO2009143783A1 (zh) 2009-12-03

Family

ID=41376622

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/072045 WO2009143783A1 (zh) 2008-05-31 2009-05-31 码率控制方法及装置

Country Status (4)

Country Link
US (1) US8565300B2 (zh)
EP (1) EP2293568B1 (zh)
CN (1) CN101594525B (zh)
WO (1) WO2009143783A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8565300B2 (en) 2008-05-31 2013-10-22 Huawei Technologies Co., Ltd. Transcoder, method and device for controlling code rate

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102098502B (zh) * 2009-12-14 2015-06-03 无锡中星微电子有限公司 一种编码格式转化的方法及装置
CN102647586B (zh) * 2011-02-16 2015-07-08 富士通株式会社 用在视频编码系统中的码率控制方法和装置
KR101894420B1 (ko) * 2011-04-15 2018-09-03 에스케이플래닛 주식회사 적응적 비디오 트랜스코딩 방법 및 시스템
JP2012253722A (ja) * 2011-06-07 2012-12-20 Sony Corp 画像符号化装置と画像復号装置およびその方法とプログラム
US9794375B2 (en) * 2013-03-14 2017-10-17 Openwave Mobility, Inc. Method, apparatus, and non-transitory computer medium for obtaining a required frame size for a compressed data frame
CN103763559B (zh) * 2014-01-09 2017-12-29 能力天空科技(北京)有限公司 一种视频文件转码方法
KR102274747B1 (ko) 2014-11-24 2021-07-07 삼성전자주식회사 코덱과 이를 포함하는 시스템 온 칩, 및 상기 시스템 온 칩을 포함하는 데이터 처리 시스템
CN107371027A (zh) * 2016-05-11 2017-11-21 晨星半导体股份有限公司 比特率控制方法及视频编码装置
CN107371028B (zh) * 2017-08-22 2018-10-19 南京惟初信息科技有限公司 一种适应带宽的高质量视频编码方法
CN109660825B (zh) * 2017-10-10 2021-02-09 腾讯科技(深圳)有限公司 视频转码方法、装置、计算机设备及存储介质
CN110278460A (zh) * 2018-03-16 2019-09-24 上海小麦互动企业发展有限公司 内容控制系统及其控制方法
CN109348244B (zh) * 2018-11-20 2021-05-18 浙江齐聚科技有限公司 视频编码参数的配置方法、装置、设备和存储介质
CN110753242B (zh) * 2019-11-01 2021-10-12 深圳市梦网视讯有限公司 一种转码片源帧层量化参数调整方法和系统
CN113453020B (zh) * 2020-03-26 2023-12-19 瑞昱半导体股份有限公司 位元率控制方法与视频处理装置
CN111488985B (zh) * 2020-04-08 2023-11-14 华南理工大学 深度神经网络模型压缩训练方法、装置、设备、介质
CN111586350B (zh) * 2020-04-19 2021-11-09 国网辽宁省电力有限公司电力科学研究院 基于带宽、优先级和无操作时间调节码率的方法
CN113905200B (zh) * 2021-10-08 2023-07-11 山东亚华电子股份有限公司 一种基于统计的视频处理方法及设备

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1700771A (zh) * 2005-05-23 2005-11-23 上海广电(集团)有限公司中央研究院 一种增强像素域码流转换方法
CN101102494A (zh) * 2007-07-23 2008-01-09 武汉大学 一种视频转码中宏块级码率控制方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5231484A (en) * 1991-11-08 1993-07-27 International Business Machines Corporation Motion video compression system with adaptive bit allocation and quantization
US7356079B2 (en) * 2001-11-21 2008-04-08 Vixs Systems Inc. Method and system for rate control during video transcoding
US9544602B2 (en) * 2005-12-30 2017-01-10 Sharp Laboratories Of America, Inc. Wireless video transmission system
CN101594525B (zh) 2008-05-31 2011-08-10 华为技术有限公司 量化参数的获取方法、装置及转码器

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1700771A (zh) * 2005-05-23 2005-11-23 上海广电(集团)有限公司中央研究院 一种增强像素域码流转换方法
CN101102494A (zh) * 2007-07-23 2008-01-09 武汉大学 一种视频转码中宏块级码率控制方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHANG, WEI ET AL.: "Quality Smoothing Adaptive Quantization Algorithm for High Bit-Rate.", JOURNAL OF SHANGHAI JIAOTONG UNIVERSITY., vol. 37, no. 8, August 2003 (2003-08-01), pages 1312 - 1314, XP008147472 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8565300B2 (en) 2008-05-31 2013-10-22 Huawei Technologies Co., Ltd. Transcoder, method and device for controlling code rate

Also Published As

Publication number Publication date
US8565300B2 (en) 2013-10-22
CN101594525B (zh) 2011-08-10
CN101594525A (zh) 2009-12-02
US20110069754A1 (en) 2011-03-24
EP2293568B1 (en) 2016-01-27
EP2293568A1 (en) 2011-03-09
EP2293568A4 (en) 2011-08-03

Similar Documents

Publication Publication Date Title
WO2009143783A1 (zh) 码率控制方法及装置
TWI586177B (zh) 基於場景之適應性位元率控制
JP5410549B2 (ja) 事前計算動き情報を用いたビデオ・エンコード
CN102450014B (zh) 用于质量感知视频优化的方法和视频优化器
US8675728B2 (en) Transmitting apparatus and method, and receiving apparatus and method
US20110252265A1 (en) Delay controller, control method, and communication system
US20120039194A1 (en) Information processing device and method, and program
CN103957389A (zh) 基于压缩感知的3g视频传输方法及系统
WO2008067108A2 (en) Network-based dynamic encoding
US20130128963A1 (en) Multiple-Pass Rate Control for Video Coding Applications
RU2009116472A (ru) Динамическая модификация свойств видео
JP2010530673A (ja) ビデオ符号化において、フレームの複雑さ、バッファレベル、およびイントラフレームの位置を利用するバッファベースのレート制御
CN1605209A (zh) 视频编码方法
WO2011054208A1 (zh) 一种媒体文件的压缩方法和系统
JP2005260935A (ja) 圧縮ビデオ・ビットストリームにおいて平均イメージ・リフレッシュ・レートを増加させる方法及び装置
WO2007109993A1 (en) Error control system, method, encoder and decoder for video coding
US20050089092A1 (en) Moving picture encoding apparatus
JP5527603B2 (ja) 情報処理装置および情報処理方法
CN101699867A (zh) 一种视频数据传输速率动态调整方法
CN102316313B (zh) 嵌入式实时视频压缩系统中的低复杂度的比特率控制方法
TW201906412A (zh) 執行具有切片邊界預測之固定尺寸切片編碼之方法與裝置
CN102625104B (zh) 一种视频编码方法
CN115474063A (zh) 一种流媒体后端解码方法、装置及存储介质
TW201330625A (zh) 用於數位視訊處理的裝置及方法
CN101296166B (zh) 基于索引的多媒体数据的测量方法

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: 09753501

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2009753501

Country of ref document: EP