CN109076212A - The method and code device of code rate control - Google Patents
The method and code device of code rate control Download PDFInfo
- Publication number
- CN109076212A CN109076212A CN201780018104.7A CN201780018104A CN109076212A CN 109076212 A CN109076212 A CN 109076212A CN 201780018104 A CN201780018104 A CN 201780018104A CN 109076212 A CN109076212 A CN 109076212A
- Authority
- CN
- China
- Prior art keywords
- image
- encoded
- frame
- parameter
- complexity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/103—Selection of coding mode or of prediction mode
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/146—Data rate or code amount at the encoder output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/176—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
A kind of image processing method and device are provided, this method comprises: receiving the image complexity of image to be encoded, which obtained by the image processor being connected with encoder;Determine the pre-arranged code bit of the image to be encoded;According to the image complexity and the pre-arranged code bit, the quantization parameter of the image to be encoded is obtained;According to the quantization parameter of the image to be encoded, which is encoded, the computation complexity of code rate control accuracy and encoder can be taken into account.
Description
Technical field
This application involves coding and decoding video fields, and more specifically, are related to the method and coding of a kind of code rate control
Device.
Background technique
Visual information is one of the most important source that the mankind obtain external information, but camera acquisition gained is uncompressed
The memory space that occupies of original video data it is very huge, be 1920 × 1080, frame per second with resolution ratio be that 30 frames are per second, duration
For 10 minutes videos, the memory space that the video needs to occupy 104.28G byte is stored in the case where no compression.In order to
It reduces video and stores and transmits occupied bandwidth, need to carry out encoding compression processing to video data.
Video coding process includes prediction, transformation, code rate control, quantization and entropy coding.Wherein, code rate control exists
Play very important role in video coding process.Since the content and feature of different video sequence are all different, if
The bit rate output and different degrees of video distortion that coding will create a difference very big are carried out using same coding parameter, in order to
Overcome this problem, just proposes code rate control.
Rate control algorithm is to be adaptively adjusted coding parameter according to the feature of different video image.Generally, based on mark
Quasi- video encoder has very big flexibility in the selecting party face of coding parameter, after the selection of coding parameter may be to coding
The code rate of video code flow has a great impact.Rate control algorithm can make, and encoder can be in a series of coding parameter collection
Suitable coding parameter is selected between conjunction, to realize that actual coding bit approaches pre-assigned coded-bit.
In the industry cycle in existing rate control algorithm, some algorithms will lead to code rate control inaccuracy, some algorithms are solving
It certainly will increase the computation complexity of encoder while code rate control inaccuracy again.
It is, therefore, desirable to provide a kind of coding staff for the computation complexity that can be compatible with code rate control accuracy and encoder
Method.
Summary of the invention
The application provides a kind of bit rate control method and device, and code rate precise control can be taken into account in rate control process
The computation complexity of degree and encoder.
In a first aspect, providing a kind of method of code rate control, the method is applied to video encoder, the method packet
It includes: receiving the image complexity of image to be encoded, described image complexity is obtained by the image processor being connected with encoder
's;Determine the pre-arranged code bit of the image to be encoded;According to described image complexity and the pre-arranged code bit, obtain
The quantization parameter of the image to be encoded;According to the quantization parameter of the image to be encoded, the image to be encoded is compiled
Code.
Second aspect provides a kind of code device, and the code device includes: Transmit-Receive Unit, for receiving figure to be encoded
The image complexity of picture, described image complexity are obtained by the image processor being connected with encoder;Processing unit is used for
Determine the pre-arranged code bit of the image to be encoded;According to described image complexity and the pre-arranged code bit, institute is obtained
State the quantization parameter of image to be encoded;According to the quantization parameter of the image to be encoded, the image to be encoded is encoded.
The third aspect provides a kind of code device, and the code device includes memory and processor, and the memory is used
In store instruction, the processor is used to execute the instruction of the memory storage, and to the finger stored in the memory
The execution of order is so that the processor executes the method that first aspect provides.
Fourth aspect provides a kind of chip, and the chip includes processing module and communication interface, and the processing module is used for
It controls the communication interface to be communicated with outside, the processing module is also used to realize the method that first aspect provides.
5th aspect, provides a kind of computer readable storage medium, is stored thereon with computer program, the computer journey
Realize the computer in any possible implementation of first aspect or first aspect
Method.Specifically, the computer can be above-mentioned * * equipment.
6th aspect, provides a kind of computer program product comprising instruction, makes when described instruction is computer-executed
The computer realizes the method that first aspect provides.
In conclusion the embodiment of the present invention when carrying out code rate control, is obtained by the image processor outside encoder
Image complexity, a large amount of calculate that can will likely occur are completed by the image processor (such as ISP) except encoder, thus
The calculation amount and implementation complexity of encoder can be reduced, and then secondary coding bring coding can be carried out to avoid encoder and prolonged
Late.Meanwhile the embodiment of the present invention is by obtaining quantization parameter according to image complexity and pre-arranged code bit, so as to one
Determine to guarantee rate control accuracy in degree.Therefore, the scheme of the embodiment of the present invention can be before not sacrificing rate control accuracy
It puts, the calculation amount and implementation complexity of encoder can be reduced, so as to improve code efficiency.
Detailed description of the invention
Fig. 1 is the schematic flow chart of video coding process.
Fig. 2 is the schematic block diagram of the image processing system of the embodiment of the present invention.
Fig. 3 is the schematic flow chart of the method for the code rate control of the embodiment of the present invention.
Fig. 4 is the schematic diagram that full frame image is divided into several image blocks in the embodiment of the present invention.
Fig. 5 is the schematic diagram of the block of pixels in the embodiment of the present invention.
Fig. 6 is another schematic flow chart of the method for the code rate control of the embodiment of the present invention.
Fig. 7 is the schematic block diagram of the code device of the embodiment of the present invention.
Fig. 8 is another schematic block diagram of the code device of the embodiment of the present invention.
Specific embodiment
In order to facilitate understanding with the scheme of description the application, Fig. 1 is combined to describe the process of Video coding first below.
As shown in Figure 1, video coding process includes prediction, transformation, quantization and entropy coding.The explanation of these steps
It is as follows.
Prediction it is intended that removing the redundancy of current image block to be encoded using prediction block message.Prediction packet
Include intra prediction and inter-prediction two types.Intra prediction is the information acquisition prediction block data using this frame image.For example,
Intra prediction is using the spatial information (si) of current encoded frame for eliminating redundancy.Inter-prediction utilizes the information acquisition of reference frame
Prediction block data.For example, the time domain frame information adjacent with before and after current encoded frame can be used for eliminating redundancy in inter-prediction
Information.The process of inter-prediction includes: firstly, image block to be encoded is divided into several subimage blocks;Then, for each
Subimage block, search is with the most matched image block of current subimage block as prediction block in reference frame;Thereafter, by the subgraph
The respective pixel values of block and the prediction block subtract each other to obtain residual error, and by the corresponding residual error combination of obtained each subimage block one
It rises, obtains the residual error of image block to be encoded.
In Video coding processing, it is referred to as I frame using only the video frame of intra prediction mode;It can be used preceding to reference
The video frame that frame carries out inter-prediction is known as P frame;The video frame that bi-directionally referenced frame can be possessed is known as B frame.
The purpose of transformation is to remove the redundancy of image block.Specifically, transformation matrix removal image block can be used
Residual error correlation, that is, remove image block redundancy, to improve code efficiency.The transformation of data block is logical in image block
Frequently with two-dimensional transform, i.e., the residual information of data block is multiplied with a transformation matrix and its transposed matrix respectively, is multiplied it
What is obtained afterwards is transformation coefficient.
The purpose of quantization is, obtains quantization parameter according to variation coefficient.Specifically, according to quantization parameter to transformation coefficient
Quantified, obtains corresponding quantization parameter.
The purpose of entropy coding is, by carrying out entropy coding to quantization parameter, obtains bit stream.
As shown in Figure 1, in an encoding process, inverse quantization and inverse transformation will also include.What inverse quantization referred to be exactly with
The opposite process of quantizing process.What inverse transformation referred to is exactly the process opposite with conversion process.
Coding side after completing image coding, can the coding mode by bit stream that entropy coding obtains and after being encoded believe
Breath, such as intra prediction mode, motion vector information, are stored or are sent to decoding end.
In decoding end, after obtaining entropy coding bit stream, firstly, carrying out entropy decoding to the bit stream, obtain corresponding residual
Difference;Then, according to the coding mode informations such as obtained motion vector or intra prediction are decoded, forecast image block is obtained;Finally, root
It is predicted that the residual error of image block and image block obtains the value of each pixel in current subimage block.
In video coding process, in addition to above-mentioned prediction, transformation, quantization and entropy coding and etc. other than, code rate control
Play very important role.
Its content of different video sequences and feature are all different.If using same coding parameter to different videos
Sequence is encoded, the bit rate output and different degrees of video distortion that can create a difference very big.In order to overcome this problem,
It needs to be adaptively adjusted coding parameter according to the feature of different video image, the process of this adjustment coding parameter is known as code
Rate control.
The purpose of code rate control is, by dynamically adjusting coding parameter, to make under the premise of guaranteeing certain picture quality
Compressed video code flow can be by the channel real-time Transmission of fixed-bandwidth, or meets ASCII stream file ASCII after the interior compression of specific time
It must be smaller than the constraint of some predetermined size.
It is realized in general, rate control algorithm can be divided into following two step:
The first step allocates coded-bit in advance before each encoded hierarchy coding.
Encoded hierarchy is from high in the end successively are as follows: picture group (group of pictures, GOP) grade, single video frame level and base
This subimage block grade.
In this step, can also consider encoder buffer takes degree.
Second step, in the cataloged procedure of each encoded hierarchy, by adjusting coding parameter, so that actual coding bit
It matches with the pre-assigned coded-bit of the first step.
The coding parameter dynamically adjusted in rate control process includes: the direction mode of intra prediction, the fortune of inter-prediction
Dynamic vector, the coding parameters such as quantization parameter in quantizing process.
In quantizing process, the scaling of transformation coefficient, Input transformation coefficient, output quantization system are realized by quantization parameter
Number, shown in the following formula of the process:
Wherein, quantizedCoeff indicates quantization parameter;TransformedCoeff indicates transformation coefficient;QP expression amount
Change parameter;F (QP) indicates quantization step, is the scalar determined by quantization parameter QP.
Binary code stream can be further encoded into entropy coder since quantization parameter enters, and the ratio of coded quantization coefficient
Spy's amount accounting in the code stream that entire video is encoded into is very high, and the amplitude range of quantization parameter is controlled by quantization step, amount
Change step-length directly determined by quantization parameter, therefore the size of quantization parameter by determine coding video frames after bit rate output size.
In the case where other coding parameters are fixed, when larger quantization parameter normally results in encoder coding same video output compared with
Small code rate, on the contrary biggish code rate is exported when lesser quantization parameter will lead to encoder coding same video.
Therefore, in rate control process, the coding parameter that frequently uses first is that quantization parameter.
In the industry cycle in existing rate control algorithm, in order to improve the accuracy of code rate control, start to encode in encoder
Before, the characteristic information that some images are obtained by pretreatment is controlled for code rate.But before encoding, encoder executes pre-
The process of processing can bring coding delay, to influence the speed of service of encoder, be unfavorable for real-time coding realization.
In view of the above-mentioned problems, the application proposes the method and code device of a kind of code rate control, code rate control can be taken into account
The computation complexity of accuracy and encoder.
In this application, firstly, image complexity is introduced rate control algorithm.Secondly, by the image outside encoder
Processor, such as image-signal processor (image signal processor, ISP) generate the image complexity of image to be encoded
Spend information.
Due to executing the calculating of image complexity without encoder, it can thus be avoided introducing additional meter for encoder
Calculate complexity and coding time.Simultaneously as vision signal is after camera acquires, then is transferred to before video encoder,
The processing of image processor (such as ISP) can be first passed around, therefore, image complexity information is generated by image processor, it will not
Additional component is introduced in image processing system.
Fig. 2 is the configuration diagram of the image processing system of the embodiment of the present invention.The system includes 210 He of image processor
Code device 220.Code device 220 includes prediction module 221, conversion module 222, rate control module 223, quantization modules
224 with entropy code module 225.
Image processor 210 is used for, and receives image sequence to be encoded, calculates its image complexity, and image is complicated
Degree is input in rate control module 223.
Specifically, image processor 210 is ISP.
Prediction module 221 is used for, and is received image sequence to be encoded, is predicted it, and corresponding residual signals are obtained.
Variation module 222 is used for, and is received the residual signals that prediction module 221 exports, is converted to it, obtains corresponding
Transformation parameter.
Rate control module is used for, and 223 is complicated according to pre-arranged code bit and the image from the acquisition of image processor 210
Degree, obtains corresponding quantization parameter.
Quantization modules 224 are used for, the amount that the transformation parameter and rate control module 223 for receiving variation module 222 export
Change parameter, and running parameter is quantified using quantization parameter, obtains corresponding quantization parameter.
Entropy code module 225 is used for, and receives the quantization parameter that quantization modules 224 export, and carry out entropy volume to quantization parameter
Code obtains coded bit stream.
As shown in Fig. 2, further including inverse transform block and inverse quantization module in system.The function and transformation mould of inverse transform block
The function of block is opposite.The function of inverse quantization module and the function of quantization modules are opposite.
In embodiments of the present invention, image complexity is calculated by the image processor outside encoder, is encoded in image
In the process, code rate control is carried out using the image complexity.On the one hand, guarantee rate control accuracy to a certain extent;It is another
Aspect, it would be possible to a large amount of calculate of appearance is completed by the image processor outside encoder, can reduce encoder calculating and
Implementation complexity.
Fig. 3 is the schematic flow chart of the method for the code rate control of the embodiment of the present invention.This method can be by Video coding
Device executes, such as is executed by code device 220 shown in Fig. 2.As shown in figure 3, this method comprises the following steps.
310, the image complexity of image to be encoded is received, which is the image procossing by being connected with encoder
What device obtained.
Specifically, image processor obtains the image complexity of image to be encoded, and then, encoder connects from image processor
Receive the image complexity of image to be encoded.The image processor is located at the outside of encoder.For example, the image processor is ISP.
Specifically, the image complexity of the image to be encoded is obtained according to the texture information of the image to be encoded.It answers
Understand, the image complexity that the texture information by calculating image obtains can characterize the information content of the image.Alternatively, should be wait compile
The image complexity of code image is to determine that is, this is to be encoded according to the fluctuation severe degree of the image inner region pixel to be encoded
The image complexity of image indicates the fluctuation severe degree of the image inner region pixel to be encoded.
320, determine the pre-arranged code bit of the image to be encoded.
Specifically, pre-arranged code ratio refers in particular to, before image coding, pre-assigned coded-bit.
330, according to the image complexity and the pre-arranged code bit, obtain the quantization parameter of the image to be encoded.
It should be understood that image complexity can characterize the information content of image before encoding, and pre-arranged code bit indicates encoded
The information content of compressed images, therefore it is to close that the method by combining image complexity and pre-arranged code bit, which calculates quantization parameter,
Reason is effective.
340, according to the quantization parameter of the image to be encoded, which is encoded.
It should be understood that above-mentioned steps 310 to step 330 belongs to rate control process.Specifically, step 310 to step 330 can
To be executed by the rate control module of decoder internal, step 340 can be by the coding module of decoder internal (for example, realizing
The module of entropy coding) it executes.
It is complicated that the embodiment of the present invention obtains image when carrying out code rate control, through the image processor outside encoder
Degree, a large amount of calculate that can will likely occur are completed by the image processor (such as ISP) except encoder, can reduce coding
The calculation amount and implementation complexity of device, so as to avoid the coding delay of encoder from influencing the speed of service of encoder, in turn
It is advantageously implemented real-time coding.Meanwhile the embodiment of the present invention is quantified by being obtained according to image complexity and pre-arranged code bit
Parameter, so as to guarantee rate control accuracy to a certain extent.Therefore, the scheme of the embodiment of the present invention can not sacrifice
Under the premise of rate control accuracy, the calculation amount and implementation complexity of encoder can be reduced, so as to improve code efficiency.
Optionally, in some embodiments, image to be encoded is an image block in picture frame.
Specifically, encoder is when encoding a frame image, first by full frame image be divided into several 64 × 64
Image block indicates that a size is 64 × 64 for each piece in Fig. 4 as shown in figure 4, a frame image is divided into 128 image blocks
Image block.Then, encoder in order successively encodes each image block.
Optionally, in some embodiments, image to be encoded can also directly be a frame image.
For ease of description with understanding, hereafter retouched so that image to be encoded is an image block in picture frame as an example
It states, but the embodiment of the present invention is not construed as limiting this.
Optionally, in some embodiments, the picture frame where the image to be encoded is I frame.
Specifically, in Video coding processing, it is referred to as I frame using only the video frame of intra prediction mode.
The residual signals of I frame image are generated by I picture signal estimation when due to coding, pass through getting frame
The complexity information of interior image is beneficial for rate control algorithm.
Optionally, in some embodiments, the picture frame where the image to be encoded is P frame.
Specifically, in Video coding processing, it is known as P frame using the video frame that forward reference frame carries out inter-prediction.
Optionally, in some embodiments, step 330 specifically includes: the quantization parameter is calculated using first function model,
It does not include exponent arithmetic in the first function model, the independent variable of the first function model includes the image complexity and this is default
Coded-bit.
Optionally, in some embodiments, the first function model only include logarithm operation, multiplying, addition and/or
Subtraction, the independent variable of the first function model include the image complexity and the pre-arranged code bit.
Specifically, logarithm operation as mentioned in the embodiments of the present invention can be various forms of logarithm operations, for example, with e
For the logarithm operation at bottom, denary logarithm operation, alternatively, being using other numerical value as the logarithm operation of the truth of a matter, the present invention is real
It applies example and this is not construed as limiting.
Optionally, in some embodiments, the coefficient in the first function model includes at least one following parameter: work multiplies
First parameter of method operation, the second parameter for making multiplying and the third parameter for making addition and/or subtraction, this first
Parameter, second parameter and the third parameter are the parameter for code rate control.
Specifically, first parameter, rate control module that second parameter and the third parameter are decoder internal from
Some code rate control parameters.
Specifically, the quantization parameter of the coded image is calculated using first function model, comprising: calculate according to the following formula
The quantization parameter of the coded image:
QP=A1log (complexity)+A2log (targetBits)+B (2)
Wherein, QP indicates that the quantization parameter, complexity indicate described image complexity, and targetBits indicates institute
Pre-arranged code bit is stated, A1 indicates first parameter, and A2 indicates second parameter, and B indicates the third parameter, log ()
Indicate logarithm operation.
Optionally, in some embodiments, the absolute value of the first parameter A1 and the second parameter A2 are identical.
Optionally, in some embodiments, the image complexity of image to be encoded is the texture according to the image to be encoded
What information obtained.In other words, the image processor outside encoder (such as ISP) calculates image according to the texture information of image
Complexity.
Specifically, it is assumed that the image to be encoded includes M block of pixels, and the size of the block of pixels is that N × N, M and N are positive
The image complexity of integer, the image to be encoded isSADjFor the pixel of j-th of block of pixels in M block of pixels
The sum of poor absolute value, andAvejFor the pixel average of j-th of block of pixels, and Indicate the pixel in j-th of block of pixels.
As an example, a width complete image (being denoted as picture frame) is divided into the image that several sizes are 64 × 64
Block.By taking resolution ratio is 1920 × 1080 picture frame as an example, 510 (30 × 17) a image blocks can be divided into.With size for 2 × 2
Block of pixels as calculate image complexity minimum unit, be made of as shown in Figure 5 four pixels x0, x1, x2, x3
Block of pixels.It should be understood that including 1024 block of pixels in an image block.
Firstly, calculating the pixel average average of a block of pixels according to the following formula2×2:
average2×2=(x0+x1+x2+x3)/4 (3)
Secondly, calculating the sum of the pixel difference absolute value of block of pixels SAD according to the following formula2×2:
Wherein, xi indicates the pixel value of ith pixel in the block of pixels.
Then, the image complexity complexity of an image block is calculated according to the following formula64×64:
Wherein, SAD2x2iIndicate the sum of the pixel difference absolute value of ith pixel block in the image block.
In other words, by by the sum of the pixel difference absolute value of all pixels block in same image block SAD2×2It is added, obtains
Obtain the image complexity of the image block.
The image complexity of picture frame can be added by the image complexity of all image blocks in the picture frame and be obtained.
The image complexity of image block can be described as block grade image complexity.The image complexity of picture frame can be described as frame level figure
As complexity.
It should be understood that the above-mentioned description in conjunction with Fig. 5 is merely illustrative and non-limiting.It, can be as the case may be in practical application
Determine the minimum unit for calculating image complexity.
Optionally, in some embodiments, the image complexity of image to be encoded indicates image inner region pixel to be encoded
Fluctuation severe degree.
As a kind of optional implementation, the image complexity of image to be encoded is obtained by frequency-domain calculations method.
For example, discrete (just) cosine transform or the transformation of Hadamard transform of the image processor by statistics image to be encoded
Coefficient determines the image complexity of image to be encoded.
As another optional implementation, the image complexity of image to be encoded is obtained by pixel domain calculation method
?.
For example, image processor determines image to be encoded by the variance or standard deviation of pixel in calculating image to be encoded
Image complexity.
Optionally, in some embodiments, image to be encoded is an image block in picture frame, and step 320 is specifically wrapped
Include: according to the image complexity of frame level pre-arranged code bit, frame level image complexity and the image to be encoded, determining should be wait compile
The pre-arranged code bit of code image, wherein frame level pre-arranged code bit indicates the pre-arranged code bit of the picture frame, frame level image
Complexity refers to the sum of the image complexity of all image blocks in the picture frame.
Specifically, it is assumed that the image to be encoded is i-th of image block in picture frame, and calculating according to the following formula should be wait compile
The pre-arranged code bit targetBits of code imagei:
Wherein, targetBits indicates frame level pre-arranged code bit, complexityiIndicate i-th of figure in picture frame
As the image complexity of block (i.e. the image to be encoded), ∑jcomplexityjIndicate frame level image complexity, i.e., institute in picture frame
There is the sum of the image complexity of image block.
Specifically, the process for calculating image complexity refers to description in conjunction with Fig. 5, and which is not described herein again.
Specifically, the picture frame in the present embodiment is I frame.
It is alternatively possible to before coding begins, distribute pre-arranged code bit in advance for each image block in picture frame.
Optionally, in some embodiments, image to be encoded is an image block in picture frame, which is P frame,
Step 320 specifically includes: determining the default of the image to be encoded according to the product of the frame level predetermined bit of the P frame and the first coefficient
Bit, wherein first coefficient is determined according at least one of following: institute in the overview image complexity of the P frame, the P frame
There is the frame level of the sum of weight of image block, the image complexity of the image to be encoded, the weight of the image to be encoded and the P frame
Predetermined bit, wherein the weight is determined by the code rate control parameter of the P frame.
Specifically, which is the overview image complexity that the P frame is accounted for according to the image complexity of the image to be encoded
The product of the ratio of degree and the second coefficient accounts for the sum of weight of all image blocks in the P frame with the weight of the image to be encoded
What ratio and the sum of products of third coefficient determined, wherein second coefficient and the third coefficient are all larger than the 0, and second coefficient
With third coefficient and be equal to 1.
As an example, it is assumed that the image to be encoded is i-th of image block in picture frame, is calculated according to the following formula
The pre-arranged code bit targetBits of the image to be encodedi:
Wherein, targetBits indicates frame level pre-arranged code bit;complexityiIndicate i-th in the picture frame
The image complexity of image block (i.e. the image to be encoded);∑jcomplexityjIndicate frame level image complexity, the i.e. picture frame
The sum of the image complexity of interior all image blocks;weightiIndicate i-th image block (i.e. the image to be encoded) in picture frame
Weight, ∑jweightjIndicate the sum of the weight of all image blocks in the picture frame;C1 indicates that the second coefficient, C2 indicate third system
Number.For example, the second coefficient C1 is 1/4, third coefficient C2 is 3/4.In this example, the weight of image block is the code rate according to P frame
The weight that control parameter determines.
Specifically, the process for calculating image complexity refers to description in conjunction with Fig. 5, and which is not described herein again.
It is alternatively possible to before coding begins, distribute pre-arranged code bit in advance for each image block in picture frame.
From formula (6) and formula (7) it is found that in scheme provided by the present application, for I frame and P frame, pre-arranged code is determined
The method of bit is different.In other words, the Rate Control Schem used when I frame encodes and the code rate used when P frame encodes
Control strategy is different, is conducive to the accuracy for improving code rate control in this way, and reason is as follows.
Prediction residual is generated since I frame does not depend on the reference information of time domain, the residual error letter obtained when encoding I frame
What breath indicated is certain coded sub-blocks and the difference between its space adjacent image.And the residual information obtained when encoding P frame is more
Ground indicates current encoded frame and the difference of reference frame in the time domain.In other words, it is obtained in I frame coding and P frame coding residual
Poor information is different, accordingly, also should be corresponding different to the Rate Control Schem of P frame for I frame in code rate control.In industry
In the existing some rate control algorithms in boundary, Rate Control Schem identical with P frame is used in I frame coding, it is this to do
Method will lead to code rate control inaccuracy, to influence the quality of encoded video.
Therefore, the application is encoded by using different Rate Control Schem processing I frame codings with P frame, so as to mention
High code rate precise control.
Optionally, in certain embodiments, one in picture frame of the image to be encoded where the image to be encoded
Image block, this method further include: according to the frame level image complexity of the picture frame and frame level pre-arranged code bit, obtain the image
The quantization parameter of frame.Step 340 specifically includes: according to the quantization parameter of the quantization parameter of the image to be encoded and the picture frame
Size relation determines the quantization parameter for being encoded to the image to be encoded, then utilizes finally determining quantization parameter
The image to be encoded is encoded.
Optionally, in certain embodiments, model of the quantization parameter of the image to be encoded in the quantization parameter of the picture frame
In enclosing, step 340 is specifically included: according to the quantization parameter of the image to be encoded, encoding to the image to be encoded.
Optionally, in certain embodiments, the quantization parameter of the image to be encoded is not in the quantization parameter of the picture frame
In range, step 340 is specifically included: the quantization parameter of the image to be encoded is cut out to the range of the quantization parameter of the picture frame
Interior, the quantization parameter of the image to be encoded after being cut out according to this encodes the image to be encoded.
Optionally, in some embodiments, which indicates the image block in full frame image.In other words, with
Image block is the coding that minimum code unit carries out full frame image.
Specifically, full frame image is first divided into several image blocks, then in order successively to each image block according to
Step 310 to step 340 is encoded, and when completing the coding of all image blocks in picture frame, completes the coding of full frame image.
Optionally, in some embodiments, after the coding for completing the picture frame where the image to be encoded, this method is also
Include: the frame level actual coding bit and frame level pre-arranged code bit according to the picture frame, update the third parameter, the frame level is real
Border coded-bit indicates the actual coding bit of the picture frame, which indicates that the frame level of the picture frame is default
Coded-bit.
Specifically, according to second function model, updated third parameter, the independent variable packet of the second function model are obtained
Include the third parameter before the frame level actual coding bit, the frame level pre-arranged code bit and update, the second function model
Comprise at least one of the following operation: logarithm operation, multiplying, addition and/or subtraction.
As an example, the third parameter B of update is obtained according to the following formulanew:
Bnew=Bold+k·A1·(log(actualBits)-log(targetBits)) (8)
Wherein, the third parameter before indicating to update, i.e., upper one is completed third parameter used by the picture frame of coding;
Indicate the first parameter;K indicates renewal rate, such as can be taken as empirical value 2;ActualBits indicates frame level actual coding ratio
It is special;TargetBits indicates frame level pre-arranged code bit.
It should be understood that code rate control parameter A1 (i.e. the first parameter), code rate control parameter B (i.e. third parameter) are in encoder
The own parameter of portion's rate control module, the characteristics of to make rate control module more adapt to different video image, in cataloged procedure
In, after every coding for completing a frame image, code rate control parameter B can be according to frame level actual coding bit and frame level pre-arranged code ratio
Special gap carries out adaptive iteration update.
The present embodiment, by the way that after the coding for completing a frame image, iteration updates code rate control parameter, so that
The accuracy of code rate control can be improved in the characteristics of rate control module in encoder more adapts to different video image in this way.
It should be understood that the separate equations described herein are merely illustrative and non-limiting.For example, the parameter or coefficient in formula can
To determine according to actual needs.
Fig. 6 is another schematic flow chart of the image encoding method of the embodiment of the present invention, and this method is executed by encoder.
In the description of the present embodiment, by the image complexity of image block, pre-arranged code bit, actual coding bit, quantization parameter point
It is not denoted as: block grade image complexity, block grade pre-arranged code bit, block grade actual coding bit, block level quantized parameter.By whole frame figure
Image complexity, pre-arranged code bit, actual coding bit, the quantization parameter of picture are denoted as respectively: frame level image complexity, frame level
Pre-arranged code bit, frame level actual coding bit, frame level quantization parameter.As shown in fig. 6, this method comprises the following steps.
6001, block grade image complexity is obtained from image processor, which is located at the outside of encoder.
6002, determine block grade pre-arranged code bit.
6003, the block grade pre-arranged code ratio that the block grade image complexity and step 6002 determined according to step 6001 determines
Spy, and code rate control parameter (the first parameter, the second parameter and third parameter in such as foregoing embodiments) is combined, calculation block grade amount
Change parameter.
6004, frame level image complexity is obtained from image processor.
6005, determine frame level pre-arranged code bit.
6006, the frame level pre-arranged code ratio that the frame level image complexity and step 6005 determined according to step 6004 determines
Spy, and code rate control parameter (the first parameter, the second parameter and third parameter in such as foregoing embodiments) is combined, calculate frame level amount
Change parameter.
6007, the frame level quantization parameter whether the block level quantized parameter that judgment step 6003 obtains obtains in step 6006
In range, if so, step 6008 is gone to, if it is not, going to step 6009.
6008, the block level quantized parameter that step 6003 obtains is cut out the one of the frame level quantization parameter obtained to step 6006
Determine in range, goes to step 6009.
6009, the coding of image block will be carried out in finally obtained piece of level quantized parameter input quantization modules.
Specifically, if the judging result of step 6007 is block level quantized parameter input quantity yes, that step 6003 is obtained
Change in module;If the judging result of step 6007 be it is no, will be defeated by the block level quantized parameter after cutting out in step 6008
Enter in quantization modules.
6010, judge whether the coding for completing to work as former frame complete image, if so, step 6011 is gone to, if it is not, going to step
Rapid 6012.
6011, according to the frame level actual coding bit and frame level pre-arranged code bit of the current picture frame for completing coding, more
The code rate control parameter used in new step 6006.Go to step 6006.
Specifically, the third parameter as described in foregoing embodiments is updated, associated description as detailed above is no longer superfluous here
It states.
6012, according to the block grade actual coding bit and block grade pre-arranged code bit of the current image block for completing coding, be
Next image block to be encoded distributes block grade pre-arranged code bit.Go to step 6002.
Specifically, it after the completion of an image block coding, can be compiled according to the actual coding bit of the image block with default
The difference of code bit distributes pre-arranged code bit for next image block to be encoded.
It should be understood that can guarantee the same of rate control accuracy by setting frame level quantization parameter and block level quantized parameter
When make stable image quality in a frame.
It should also be understood that step 6001, step 6002, step 6004 in the above process, between step 6005 without stringent
Ordinal relation.
In conclusion the embodiment of the present invention when carrying out code rate control, is obtained by the image processor outside encoder
Image complexity, a large amount of calculate that can will likely occur are completed by the image processor (such as ISP) except encoder, thus
The calculation amount and implementation complexity of encoder can be reduced, and then secondary coding bring coding can be carried out to avoid encoder and prolonged
Late.Meanwhile the embodiment of the present invention is by obtaining quantization parameter according to image complexity and pre-arranged code bit, so as to one
Determine to guarantee rate control accuracy in degree.Therefore, the scheme of the embodiment of the present invention can be before not sacrificing rate control accuracy
It puts, the calculation amount and implementation complexity of encoder can be reduced, so as to improve code efficiency.
Described above is the present processes embodiments, and the Installation practice of the application is described below.It should be understood that device
The description of embodiment is corresponded to each other with the description of embodiment of the method, and therefore, the content being not described in detail may refer to previous methods
Embodiment, for sake of simplicity, which is not described herein again.
Fig. 7 is the schematic block diagram of code device 700 provided in an embodiment of the present invention, which includes:
Transmit-Receive Unit 710, for receiving the image complexity of image to be encoded, the image complexity be by with encoder phase
What image processor even obtained;
Processing unit 720, for determining the pre-arranged code bit of the image to be encoded;It is pre- with this according to the image complexity
If coded-bit, the quantization parameter of the image to be encoded is obtained;According to the quantization parameter of the image to be encoded, to the figure to be encoded
As being encoded.
Optionally, in some embodiments, which is specifically used for, and calculates the amount using first function model
Change parameter, which only includes logarithm operation, multiplying, addition and/or subtraction, the first function model
Independent variable include the image complexity and the pre-arranged code bit.
Optionally, in some embodiments, the coefficient in the first function model includes at least one following parameter: work multiplies
First parameter of method operation, the second parameter for making multiplying and the third parameter for making addition and/or subtraction, this first
Parameter, second parameter and the third parameter are the parameter for code rate control.
Optionally, in some embodiments, the first function model are as follows: the logarithm operation value of the image complexity and this
The product of one parameter, the product of the logarithm operation value of the pre-arranged code bit and the third parameter, with second parameter and.
Optionally, in some embodiments, first parameter is identical with the absolute value of second parameter.
Optionally, in some embodiments, after the coding for completing the picture frame where the image to be encoded, the processing list
Member 720 is also used to: according to the frame level actual coding bit of the picture frame and frame level pre-arranged code bit, the third parameter is updated,
The frame level actual coding bit indicates the actual coding bit of the picture frame, which indicates the picture frame
Frame level pre-arranged code bit.
Optionally, in some embodiments, which is specifically used for, and according to second function model, is updated
Third parameter afterwards, the independent variable of the second function model include the frame level actual coding bit, the frame level pre-arranged code bit,
And the third parameter before updating, which comprises at least one of the following operation: logarithm operation, multiplying,
Addition and/or subtraction.
Optionally, in some embodiments, second function model are as follows: the logarithm operation value of the frame level actual coding bit
And the product of the difference of the logarithm operation value of the frame level pre-arranged code bit and renewal rate value and first parameter, with update
The sum of preceding third parameter.
Optionally, in some embodiments, one in picture frame of the image to be encoded where the image to be encoded
Image block;The processing unit 720 is specifically used for, according to the frame level pre-arranged code bit of the picture frame, the frame level figure of the picture frame
As complexity and the image complexity of the image to be encoded, the pre-arranged code bit of the image to be encoded is determined.
Optionally, in some embodiments, which is specifically used for, multiple according to the image of the image to be encoded
Miscellaneous to spend the ratio for accounting for the frame level image complexity of the picture frame, the product with the frame level pre-arranged code bit of the picture frame determines
The pre-arranged code bit of the image to be encoded.
Optionally, in some embodiments, one in picture frame of the image to be encoded where the image to be encoded
Image block;The processing unit 720 is also used to, and according to the image complexity of the picture frame and frame level pre-arranged code bit, obtaining should
The quantization parameter of picture frame;When encoding to the image to be encoded, which is specifically used for, when this is to be encoded
When the quantization parameter of image is in the range of the quantization parameter of the picture frame, according to the quantization parameter of the image to be encoded, to this
Image to be encoded is encoded.
Optionally, in some embodiments, when encoding to the image to be encoded, which is specifically used
In when in the range of quantization parameter of the quantization parameter of the image to be encoded not in the picture frame, by the image to be encoded
Quantization parameter is cut out to the quantization parameter of the picture frame, the quantization ginseng of the image to be encoded after being cut out according to this
It is several that the image to be encoded is encoded.
Optionally, in some embodiments, the picture frame where the image to be encoded is I frame.
Optionally, in some embodiments, the picture frame where the image to be encoded is P frame, which is the P
An image block in frame;The processing unit 720 is specifically used for, according to the frame level predetermined bit of the P frame and multiplying for the first coefficient
Product determines the predetermined bit of the image to be encoded, wherein first coefficient is determined according at least one of following: the P frame
The sum of weight of all image blocks in overview image complexity, the P frame, the image to be encoded image complexity, this is to be encoded
The frame level predetermined bit of the weight of image and the P frame, wherein the weight is determined by the code rate control parameter of the P frame.
Optionally, in some embodiments, which is specifically used for, which is to be encoded according to this
The image complexity of image accounts for the ratio of the overview image complexity of the P frame and the product of the second coefficient, with the image to be encoded
Weight account for what the sum of products of the ratio of the sum of weight of all image blocks and third coefficient in the P frame determined, wherein this
It is that two coefficients and the third coefficient are all larger than the 0, and second coefficient and third coefficient and be equal to 1.
Optionally, in some embodiments, the image complexity of the image to be encoded is the line according to the image to be encoded
Reason information obtains.
Optionally, in some embodiments, the image complexity of the image to be encoded indicates the image inner region to be encoded
The fluctuation severe degree of pixel.
Optionally, in some embodiments, the image complexity of the image to be encoded is by counting the image to be encoded
It is discrete just/transformation coefficient of cosine transform or Hadamard transform obtains.
Optionally, in some embodiments, the image complexity of the image to be encoded is by calculating the image to be encoded
What the variance or standard deviation of interior pixel obtained.
Optionally, in some embodiments, which is image-signal processor ISP.
Processing unit 710 in the present embodiment specifically includes: code rate control unit, predicting unit, converter unit, inverse transformation
Unit, quantifying unit, inverse quantization unit, entropy code unit.Wherein, code rate control unit is for realizing code rate control, for quantization
Unit provides quantization parameter.Specifically, code rate control unit is used to receive image complexity from image processor, then according to figure
As complexity and pre-arranged code bit, quantization parameter is calculated.
As shown in figure 8, the embodiment of the present invention also provides a kind of code device 800, processor 810 and memory 820, this is deposited
For storing instruction, which is used to execute the instruction of the memory 820 storage to reservoir 820, and to the memory
The execution of the instruction stored in 820 so that, the method which is used to execute embodiment of the method above.
Specifically, which further includes transceiver 830, for connecing from external image processor (such as ISP)
Receive image complexity information.
The embodiment of the present invention also provides a kind of computer storage medium, is stored thereon with computer program, the computer journey
Make when sequence is computer-executed, the method which executes embodiment of the method above.
The embodiment of the present invention also provides a kind of computer program product comprising instruction, which is characterized in that the instruction is counted
The method that calculation machine makes computer execute embodiment of the method above when executing.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any other combination real
It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or
It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
User's line (digital subscriber line, DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another
Web-site, computer, server or data center are transmitted.The computer readable storage medium can be computer capacity
Any usable medium enough accessed either includes that the data such as one or more usable mediums integrated server, data center are deposited
Store up equipment.The usable medium can be magnetic medium (for example, floppy disk, hard disk, tape), optical medium (such as digital video light
Disk (digital video disc, DVD)) or semiconductor medium (such as solid state hard disk (solid state disk,
SSD)) etc..
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
Scope of the present application.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with
It realizes by another way.For example, code device embodiment described above is only schematical, for example, the list
Member division, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or
Component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point is shown
The mutual coupling, direct-coupling or communication connection shown or discussed can be through some interfaces, between device or unit
Coupling or communication connection are connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any
Those familiar with the art within the technical scope of the present application, can easily think of the change or the replacement, and should all contain
Lid is within the scope of protection of this application.Therefore, the protection scope of the application should be based on the protection scope of the described claims.
Claims (43)
1. a kind of method of code rate control, which is characterized in that the method is applied to video encoder, which comprises
The image complexity of image to be encoded is received, described image complexity is obtained by the image processor being connected with encoder
's;
Determine the pre-arranged code bit of the image to be encoded;
According to described image complexity and the pre-arranged code bit, the quantization parameter of the image to be encoded is obtained;
According to the quantization parameter of the image to be encoded, the image to be encoded is encoded.
2. the method according to claim 1, wherein described according to described image complexity and the pre-arranged code
Bit obtains the quantization parameter of the image to be encoded, comprising:
Calculate the quantization parameter using first function model, the first function model only include logarithm operation, multiplying,
Addition and/or subtraction, the independent variable of the first function model include described image complexity and the pre-arranged code ratio
It is special.
3. according to the method described in claim 2, it is characterized in that, the coefficient in the first function model include it is following at least
One parameter: make the first parameter of multiplying, make the second parameter of multiplying and make the of addition and/or subtraction
Three parameters, first parameter, second parameter and the third parameter are the parameter for code rate control.
4. according to the method described in claim 3, it is characterized in that, the first function model includes: described image complexity
Logarithm operation value and the product of first parameter, the logarithm operation value of the pre-arranged code bit and the third parameter
Product, with second parameter and.
5. the method according to claim 3 or 4, which is characterized in that first parameter and second parameter it is absolute
It is worth identical.
6. method according to any one of claim 3 to 5, which is characterized in where completing the image to be encoded
Picture frame coding after, the method also includes:
According to the frame level actual coding bit of described image frame and frame level pre-arranged code bit, the third parameter is updated, it is described
Frame level actual coding bit indicates that the actual coding bit of described image frame, the frame level pre-arranged code bit indicate described image
The frame level pre-arranged code bit of frame.
7. according to the method described in claim 6, it is characterized in that, the frame level actual coding bit according to described image frame
With frame level pre-arranged code bit, the third parameter is updated, comprising:
According to second function model, updated third parameter is obtained, the independent variable of the second function model includes the frame
Third parameter before grade actual coding bit, the frame level pre-arranged code bit and update, the second function model packet
Include following at least one operation: logarithm operation, multiplying, addition and/or subtraction.
8. being compiled the method according to the description of claim 7 is characterized in that the second function model includes: that the frame level is practical
Difference and the renewal rate value of the logarithm operation value of the logarithm operation value and frame level pre-arranged code bit of code bit and described
The product of first parameter, with the third parameter before update and.
9. the method according to any one of claims 1 to 5, which is characterized in that the image to be encoded is described wait compile
An image block in picture frame where code image;
The pre-arranged code bit of the determination image to be encoded, comprising:
According to the frame level pre-arranged code bit of described image frame, the frame level image complexity of described image frame and described to be encoded
The image complexity of image determines the pre-arranged code bit of the image to be encoded.
10. according to the method described in claim 9, it is characterized in that, the pre-arranged code ratio of the determination image to be encoded
Spy specifically includes:
The ratio that the frame level image complexity of described image frame is accounted for according to the image complexity of the image to be encoded, with the figure
As the product of the frame level pre-arranged code bit of frame, the pre-arranged code bit of the image to be encoded is determined.
11. according to claim 1 to method described in any one of 5,9 or 10, which is characterized in that the image to be encoded is institute
State an image block in the picture frame where image to be encoded;
The method also includes:
According to the image complexity of described image frame and frame level pre-arranged code bit, the quantization parameter of described image frame is obtained;
The quantization parameter according to the image to be encoded, encodes the image to be encoded, comprising:
When the quantization parameter of the image to be encoded is in the range of the quantization parameter of described image frame, according to described to be encoded
The quantization parameter of image encodes the image to be encoded.
12. according to the method for claim 11, which is characterized in that the quantization parameter according to the image to be encoded,
The image to be encoded is encoded, further includes:
It, will be described to be encoded when the quantization parameter of the image to be encoded is not in the range of the quantization parameter of described image frame
The quantization parameter of image is cut out to the quantization parameter of described image frame, according to described to be encoded after described cut out
The quantization parameter of image encodes the image to be encoded.
13. method according to any one of claim 1 to 12, which is characterized in that the figure where the image to be encoded
As frame is I frame.
14. the method according to claim 1, wherein the picture frame where the image to be encoded is P frame, institute
Stating image to be encoded is an image block in the P frame;
The pre-arranged code bit of the determination image to be encoded, comprising:
The predetermined bit of the image to be encoded is determined according to the product of the frame level predetermined bit of the P frame and the first coefficient,
In, first coefficient is determined according at least one of following: being owned in the overview image complexity of the P frame, the P frame
The sum of weight of image block, the image complexity of the image to be encoded, the weight of the image to be encoded and the P frame
Frame level predetermined bit, wherein the weight is determined by the code rate control parameter of the P frame.
15. according to the method for claim 14, which is characterized in that first coefficient is according to the image to be encoded
Image complexity accounts for the ratio of the overview image complexity of the P frame and the product of the second coefficient, with the image to be encoded
Weight accounts for what the ratio of the sum of weight of all image blocks and the sum of products of third coefficient in the P frame determined, wherein described
Second coefficient and the third coefficient are all larger than 0, and second coefficient and third coefficient and be equal to 1.
16. according to claim 1 to method described in any one of 15, which is characterized in that the image of the image to be encoded is multiple
Miscellaneous degree is obtained according to the texture information of the image to be encoded.
17. according to claim 1 to method described in any one of 15, which is characterized in that the image of the image to be encoded is multiple
Miscellaneous degree indicates the fluctuation severe degree of the image inner region pixel to be encoded.
18. according to the method for claim 17, which is characterized in that the image complexity of the image to be encoded is to pass through system
Count the image to be encoded it is discrete just/transformation coefficient of cosine transform or Hadamard transform obtains.
19. according to the method for claim 17, which is characterized in that the image complexity of the image to be encoded is to pass through meter
What the variance or standard deviation for calculating the pixel in the image to be encoded obtained.
20. according to claim 1 to method described in any one of 19, which is characterized in that described image processor is image letter
Number processor ISP.
21. a kind of code device characterized by comprising
Transmit-Receive Unit, for receiving the image complexity of image to be encoded, described image complexity is by being connected with encoder
What image processor obtained;
Processing unit, for determining the pre-arranged code bit of the image to be encoded;According to described image complexity with it is described pre-
If coded-bit, the quantization parameter of the image to be encoded is obtained;According to the quantization parameter of the image to be encoded, to it is described to
Coded image is encoded.
22. code device according to claim 21, which is characterized in that the processing unit is specifically used for, and utilizes first
Function model calculates the quantization parameter, and the first function model only includes logarithm operation, multiplying, addition and/or subtracts
Method operation, the independent variable of the first function model include described image complexity and the pre-arranged code bit.
23. code device according to claim 22, which is characterized in that the coefficient in the first function model include with
At least one lower parameter: make the first parameter of multiplying, make the second parameter of multiplying and make addition and/or subtraction fortune
The third parameter of calculation, first parameter, second parameter and the third parameter are the parameter for code rate control.
24. code device according to claim 23, which is characterized in that the first function model includes: described image
The product of the logarithm operation value of complexity and first parameter, the logarithm operation value of the pre-arranged code bit and the third
The product of parameter, with second parameter and.
25. the code device according to claim 23 or 24, which is characterized in that first parameter and second parameter
Absolute value it is identical.
26. the code device according to any one of claim 22 to 25, which is characterized in that complete the figure to be encoded
As the picture frame at place coding after, the processing unit is also used to:
According to the frame level actual coding bit of described image frame and frame level pre-arranged code bit, the third parameter is updated, it is described
Frame level actual coding bit indicates that the actual coding bit of described image frame, the frame level pre-arranged code bit indicate described image
The frame level pre-arranged code bit of frame.
27. code device according to claim 26, which is characterized in that the processing unit is specifically used for, according to second
Function model, obtains updated third parameter, and the independent variable of the second function model includes the frame level actual coding ratio
Third parameter before special, the described frame level pre-arranged code bit and update, the second function model includes following at least one
Kind operation: logarithm operation, multiplying, addition and/or subtraction.
28. code device according to claim 27, which is characterized in that the second function model includes: the frame level
The difference of the logarithm operation value of actual coding bit and the logarithm operation value of the frame level pre-arranged code bit and renewal rate value with
And the product of first parameter, with the third parameter before update and.
29. the code device according to any one of claim 21 to 25, which is characterized in that the image to be encoded is institute
State an image block in the picture frame where image to be encoded;
The processing unit is specifically used for, according to the frame level pre-arranged code bit of described image frame, the frame level figure of described image frame
As complexity and the image complexity of the image to be encoded, the pre-arranged code bit of the image to be encoded is determined.
30. code device according to claim 29, which is characterized in that the processing unit is specifically used for, according to described
The image complexity of image to be encoded accounts for the ratio of the frame level image complexity of described image frame, pre- with the frame level of described image frame
If the product of coded-bit, the pre-arranged code bit of the image to be encoded is determined.
31. the code device according to any one of claim 21 to 25,29 or 30, which is characterized in that described to be encoded
An image block of the image in the picture frame where the image to be encoded;
The processing unit is also used to, according to the image complexity of described image frame and frame level pre-arranged code bit, described in acquisition
The quantization parameter of picture frame;
When encoding to the image to be encoded, the processing unit is specifically used for, when the quantization of the image to be encoded
When parameter is in the range of the quantization parameter of described image frame, according to the quantization parameter of the image to be encoded, to described wait compile
Code image is encoded.
32. code device according to claim 31, which is characterized in that when being encoded to the image to be encoded,
The processing unit is specifically used for, when the quantization parameter of the image to be encoded is not in the range of the quantization parameter of described image frame
When interior, the quantization parameter of the image to be encoded is cut out to the quantization parameter of described image frame, is cut according to described
The quantization parameter of the image to be encoded after sanction encodes the image to be encoded.
33. the code device according to any one of claim 21 to 32, which is characterized in where the image to be encoded
Picture frame be I frame.
34. code device according to claim 21, which is characterized in that the picture frame where the image to be encoded is P
Frame, the image to be encoded are an image block in the P frame;
The processing unit is specifically used for, according to the product of the frame level predetermined bit of the P frame and the first coefficient determine it is described to
The predetermined bit of coded image, wherein first coefficient is determined according at least one of following: the overall pattern of the P frame
As the sum of weight of all image blocks in complexity, the P frame, the image complexity, described to be encoded of the image to be encoded
The frame level predetermined bit of the weight of image and the P frame, wherein the weight is determined by the code rate control parameter of the P frame.
35. code device according to claim 34, which is characterized in that first coefficient is according to the figure to be encoded
The image complexity of picture accounts for the ratio of the overview image complexity of the P frame and the product of the second coefficient, with the figure to be encoded
The weight of picture accounts for what the ratio of the sum of weight of all image blocks and the sum of products of third coefficient in the P frame determined, wherein
Second coefficient and the third coefficient are all larger than 0, and second coefficient and third coefficient and be equal to 1.
36. the code device according to any one of claim 21 to 35, which is characterized in that the figure of the image to be encoded
As complexity is obtained according to the texture information of the image to be encoded.
37. the code device according to any one of claim 21 to 36, which is characterized in that the figure of the image to be encoded
As complexity indicates the fluctuation severe degree of the image inner region pixel to be encoded.
38. the code device according to claim 37, which is characterized in that the image complexity of the image to be encoded is logical
Cross count the image to be encoded it is discrete just/transformation coefficient of cosine transform or Hadamard transform obtains.
39. the code device according to claim 37, which is characterized in that the image complexity of the image to be encoded is logical
Cross what the variance for calculating the pixel in the image to be encoded or standard deviation obtained.
40. the code device according to any one of claim 21 to 39, which is characterized in that described image processor is figure
As signal processor ISP.
41. a kind of code device characterized by comprising memory and processor, the memory for storing instruction, institute
Processor is stated for executing the instruction of memory storage, and the execution to the instruction stored in the memory so that,
The processor is used to execute the method as described in any one of claims 1 to 20.
42. a kind of computer storage medium, which is characterized in that be stored thereon with computer program, the computer program is counted
Calculation machine makes when executing, and the computer executes the method as described in any one of claims 1 to 20.
43. a kind of computer program product comprising instruction, which is characterized in that make to calculate when described instruction is computer-executed
Machine executes the method as described in any one of claims 1 to 20.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/119111 WO2019127136A1 (en) | 2017-12-27 | 2017-12-27 | Bit rate control method and encoding device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109076212A true CN109076212A (en) | 2018-12-21 |
Family
ID=64812361
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201780018104.7A Pending CN109076212A (en) | 2017-12-27 | 2017-12-27 | The method and code device of code rate control |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109076212A (en) |
WO (1) | WO2019127136A1 (en) |
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110536168A (en) * | 2019-09-11 | 2019-12-03 | 北京达佳互联信息技术有限公司 | Video method for uploading, device, electronic equipment and storage medium |
CN110740324A (en) * | 2019-09-11 | 2020-01-31 | 浙江大华技术股份有限公司 | Coding control method and related device |
CN111247800A (en) * | 2019-01-25 | 2020-06-05 | 深圳市大疆创新科技有限公司 | Method and device for determining image information quantity |
CN111264062A (en) * | 2019-02-21 | 2020-06-09 | 深圳市大疆创新科技有限公司 | Encoder, encoding system and encoding method |
CN111279697A (en) * | 2019-01-25 | 2020-06-12 | 深圳市大疆创新科技有限公司 | Code rate allocation method and device |
CN111447446A (en) * | 2020-05-15 | 2020-07-24 | 西北民族大学 | A HEVC rate control method based on the importance analysis of human visual area |
CN112218083A (en) * | 2020-10-16 | 2021-01-12 | 西安邮电大学 | Intra-frame image bit rate estimation method for high efficiency video coding standard |
CN112492305A (en) * | 2020-11-18 | 2021-03-12 | 腾讯科技(深圳)有限公司 | Data processing method and device and computer readable storage medium |
CN113438488A (en) * | 2021-06-18 | 2021-09-24 | 北京锐马视讯科技有限公司 | Low-bit-rate video optimization coding method, device, equipment and storage medium |
CN113453001A (en) * | 2020-03-24 | 2021-09-28 | 合肥君正科技有限公司 | Method for improving H264 coding efficiency by using ISP information to adaptively allocate QP |
CN113784126A (en) * | 2021-09-17 | 2021-12-10 | Oppo广东移动通信有限公司 | Image coding method, apparatus, device and storage medium |
WO2022012183A1 (en) * | 2020-07-17 | 2022-01-20 | Oppo广东移动通信有限公司 | Encoding method, encoder and computer readable storage medium |
TWI774383B (en) * | 2021-03-22 | 2022-08-11 | 瑞昱半導體股份有限公司 | Encoder and associated signal processing method |
WO2022252222A1 (en) * | 2021-06-04 | 2022-12-08 | 深圳市大疆创新科技有限公司 | Encoding method and encoding device |
WO2023019910A1 (en) * | 2021-08-20 | 2023-02-23 | 上海商汤智能科技有限公司 | Video processing method and apparatus, electronic device, storage medium, computer program and computer program product |
CN116095335A (en) * | 2022-01-21 | 2023-05-09 | 杭州海康威视数字技术股份有限公司 | Video decoding method, device and storage medium |
WO2024051299A1 (en) * | 2022-09-08 | 2024-03-14 | 华为技术有限公司 | Encoding method and apparatus, and decoding method and apparatus |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101094411A (en) * | 2007-07-03 | 2007-12-26 | 芯瀚电子技术(上海)有限公司 | Code rate control method of video code |
CN101127909A (en) * | 2007-09-29 | 2008-02-20 | 华为技术有限公司 | A control method and device for image code rate |
CN101754003A (en) * | 2008-12-11 | 2010-06-23 | 北京威速科技有限公司 | Code rate control method for stabilizing video quality |
CN102067610A (en) * | 2008-06-16 | 2011-05-18 | 杜比实验室特许公司 | Rate control model adaptation based on slice dependencies for video coding |
CN102938840A (en) * | 2012-11-26 | 2013-02-20 | 南京邮电大学 | Key frame quantization parameter selecting method applied to multi-viewpoint video coding system |
CN104754335A (en) * | 2015-03-09 | 2015-07-01 | 湖南国科微电子有限公司 | Video coding rate control method |
US20150189297A1 (en) * | 2011-10-04 | 2015-07-02 | Thomson Licensing | Device and method for intra-encoding image blocks, storage medium carrying and use of a processing device for decoding intra-encoded image blocks |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040120404A1 (en) * | 2002-11-27 | 2004-06-24 | Takayuki Sugahara | Variable length data encoding method, variable length data encoding apparatus, variable length encoded data decoding method, and variable length encoded data decoding apparatus |
US8265142B2 (en) * | 2007-03-14 | 2012-09-11 | Nippon Telegraph And Telephone Corporation | Encoding bit-rate control method and apparatus, program therefor, and storage medium which stores the program |
CN102036062B (en) * | 2009-09-29 | 2012-12-19 | 华为技术有限公司 | Video coding method and device and electronic equipment |
JP6094956B2 (en) * | 2012-09-26 | 2017-03-15 | パナソニックIpマネジメント株式会社 | Image encoding apparatus, captured image recording system, imaging apparatus, image encoding method, and image encoding program |
CN105208390B (en) * | 2014-06-30 | 2018-07-20 | 杭州海康威视数字技术股份有限公司 | The bit rate control method and its system of Video coding |
-
2017
- 2017-12-27 CN CN201780018104.7A patent/CN109076212A/en active Pending
- 2017-12-27 WO PCT/CN2017/119111 patent/WO2019127136A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101094411A (en) * | 2007-07-03 | 2007-12-26 | 芯瀚电子技术(上海)有限公司 | Code rate control method of video code |
CN101127909A (en) * | 2007-09-29 | 2008-02-20 | 华为技术有限公司 | A control method and device for image code rate |
CN102067610A (en) * | 2008-06-16 | 2011-05-18 | 杜比实验室特许公司 | Rate control model adaptation based on slice dependencies for video coding |
CN101754003A (en) * | 2008-12-11 | 2010-06-23 | 北京威速科技有限公司 | Code rate control method for stabilizing video quality |
US20150189297A1 (en) * | 2011-10-04 | 2015-07-02 | Thomson Licensing | Device and method for intra-encoding image blocks, storage medium carrying and use of a processing device for decoding intra-encoded image blocks |
CN102938840A (en) * | 2012-11-26 | 2013-02-20 | 南京邮电大学 | Key frame quantization parameter selecting method applied to multi-viewpoint video coding system |
CN104754335A (en) * | 2015-03-09 | 2015-07-01 | 湖南国科微电子有限公司 | Video coding rate control method |
Cited By (31)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111279697A (en) * | 2019-01-25 | 2020-06-12 | 深圳市大疆创新科技有限公司 | Code rate allocation method and device |
CN111247800B (en) * | 2019-01-25 | 2022-07-19 | 深圳市大疆创新科技有限公司 | Method and device for determining the amount of image information |
CN111247800A (en) * | 2019-01-25 | 2020-06-05 | 深圳市大疆创新科技有限公司 | Method and device for determining image information quantity |
WO2020168520A1 (en) * | 2019-02-21 | 2020-08-27 | 深圳市大疆创新科技有限公司 | Encoder, encoding system, and encoding method |
CN111264062A (en) * | 2019-02-21 | 2020-06-09 | 深圳市大疆创新科技有限公司 | Encoder, encoding system and encoding method |
CN110536168A (en) * | 2019-09-11 | 2019-12-03 | 北京达佳互联信息技术有限公司 | Video method for uploading, device, electronic equipment and storage medium |
CN110740324B (en) * | 2019-09-11 | 2023-03-31 | 浙江大华技术股份有限公司 | Coding control method and related device |
CN110536168B (en) * | 2019-09-11 | 2021-09-17 | 北京达佳互联信息技术有限公司 | Video uploading method and device, electronic equipment and storage medium |
CN110740324A (en) * | 2019-09-11 | 2020-01-31 | 浙江大华技术股份有限公司 | Coding control method and related device |
CN113453001A (en) * | 2020-03-24 | 2021-09-28 | 合肥君正科技有限公司 | Method for improving H264 coding efficiency by using ISP information to adaptively allocate QP |
CN111447446A (en) * | 2020-05-15 | 2020-07-24 | 西北民族大学 | A HEVC rate control method based on the importance analysis of human visual area |
CN111447446B (en) * | 2020-05-15 | 2022-08-23 | 西北民族大学 | HEVC (high efficiency video coding) rate control method based on human eye visual region importance analysis |
WO2022012183A1 (en) * | 2020-07-17 | 2022-01-20 | Oppo广东移动通信有限公司 | Encoding method, encoder and computer readable storage medium |
CN112218083A (en) * | 2020-10-16 | 2021-01-12 | 西安邮电大学 | Intra-frame image bit rate estimation method for high efficiency video coding standard |
CN112218083B (en) * | 2020-10-16 | 2021-09-17 | 西安邮电大学 | Method for estimating intra-frame image code rate of high-efficiency video coding standard |
CN112492305A (en) * | 2020-11-18 | 2021-03-12 | 腾讯科技(深圳)有限公司 | Data processing method and device and computer readable storage medium |
CN112492305B (en) * | 2020-11-18 | 2022-02-11 | 腾讯科技(深圳)有限公司 | Data processing method and device and computer readable storage medium |
TWI774383B (en) * | 2021-03-22 | 2022-08-11 | 瑞昱半導體股份有限公司 | Encoder and associated signal processing method |
CN115118985A (en) * | 2021-03-22 | 2022-09-27 | 瑞昱半导体股份有限公司 | Encoder and related signal processing method |
US11523117B2 (en) | 2021-03-22 | 2022-12-06 | Realtek Semiconductor Corp. | Encoder using coding tree unit level adaptive quantization mode to adjust frame level quantization parameter and associated signal processing method |
WO2022252222A1 (en) * | 2021-06-04 | 2022-12-08 | 深圳市大疆创新科技有限公司 | Encoding method and encoding device |
CN113438488A (en) * | 2021-06-18 | 2021-09-24 | 北京锐马视讯科技有限公司 | Low-bit-rate video optimization coding method, device, equipment and storage medium |
WO2023019910A1 (en) * | 2021-08-20 | 2023-02-23 | 上海商汤智能科技有限公司 | Video processing method and apparatus, electronic device, storage medium, computer program and computer program product |
CN113784126A (en) * | 2021-09-17 | 2021-12-10 | Oppo广东移动通信有限公司 | Image coding method, apparatus, device and storage medium |
CN116095335A (en) * | 2022-01-21 | 2023-05-09 | 杭州海康威视数字技术股份有限公司 | Video decoding method, device and storage medium |
WO2023138532A1 (en) * | 2022-01-21 | 2023-07-27 | 杭州海康威视数字技术股份有限公司 | Video decoding method and apparatus, video decoder and storage medium |
CN117221564A (en) * | 2022-01-21 | 2023-12-12 | 杭州海康威视数字技术股份有限公司 | Video decoding method, device and storage medium |
TWI838089B (en) * | 2022-01-21 | 2024-04-01 | 大陸商杭州海康威視數字技術股份有限公司 | Video decoding method, apparatus, video decoding and storage medium |
CN116095335B (en) * | 2022-01-21 | 2025-01-07 | 杭州海康威视数字技术股份有限公司 | Video decoding method, device and storage medium |
CN117221564B (en) * | 2022-01-21 | 2025-01-17 | 杭州海康威视数字技术股份有限公司 | Video decoding method, device and storage medium |
WO2024051299A1 (en) * | 2022-09-08 | 2024-03-14 | 华为技术有限公司 | Encoding method and apparatus, and decoding method and apparatus |
Also Published As
Publication number | Publication date |
---|---|
WO2019127136A1 (en) | 2019-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109076212A (en) | The method and code device of code rate control | |
CN106716997A (en) | Video encoding method using in-loop filter parameter prediction and apparatus therefor, and video decoding method and apparatus therefor | |
US6160846A (en) | Apparatus and method for optimizing the rate control in a coding system | |
CN104602010B (en) | Method and apparatus for encoding and decoding coding unit of picture boundary | |
CN110199522A (en) | Processing is used for the reference sample of image block intra prediction | |
JP2000511366A (en) | Apparatus and method for variable block size motion estimation based on quadrant tree | |
CN109792540A (en) | The hardware-accelerated method for video coding and system controlled using every frame parameter | |
JP4949836B2 (en) | System and method for encoding and decoding enhancement layer data using descriptive model parameters | |
CN108200431B (en) | Bit allocation method for video coding code rate control frame layer | |
CN106688232A (en) | Perceptual optimization for model-based video encoding | |
CN106170092A (en) | Fast encoding method for lossless coding | |
CN108353177A (en) | For reducing the system and method for slice boundaries visual artifacts in compression DSC is flowed in display | |
CN107667528A (en) | Method and system for the adaptive reference frame buffer of coding and decoding video | |
CN107005713A (en) | Apply the method for video coding and equipment and video encoding/decoding method and equipment of edge type skew | |
WO2022062369A1 (en) | Point cloud encoding and decoding method and system, and point cloud encoder and point cloud decoder | |
CN107846593A (en) | A kind of Rate-distortion optimization method and device | |
CN108028933A (en) | Video coding and decoding method and device | |
CN104754335B (en) | A kind of code rate controlling method for video coding | |
CN110419215A (en) | Support the bit-rate control method and its device based on bit predictions of the Video coding process of offline CABAC | |
CN108040256A (en) | It is a kind of based on bit rate control method H.265, system and device | |
CN110392265A (en) | Inter frame motion estimation method, apparatus, electronic equipment and readable storage medium storing program for executing | |
CN108781298A (en) | Encoder, image processing system, unmanned plane and coding method | |
CN107666472B (en) | Method and apparatus for hybrid digital-analog coding | |
JPH08275157A (en) | Video signal encoding device | |
CN100425079C (en) | Video Compression Rate Control Method Based on Low Memory Consumption Lookup Table |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20181221 |
|
WD01 | Invention patent application deemed withdrawn after publication |