CN117880511A - Code rate control method based on video buffer verification - Google Patents
Code rate control method based on video buffer verification Download PDFInfo
- Publication number
- CN117880511A CN117880511A CN202311855800.7A CN202311855800A CN117880511A CN 117880511 A CN117880511 A CN 117880511A CN 202311855800 A CN202311855800 A CN 202311855800A CN 117880511 A CN117880511 A CN 117880511A
- Authority
- CN
- China
- Prior art keywords
- frame
- bit
- sad
- vbv
- lcu
- 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
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000012795 verification Methods 0.000 title claims abstract description 14
- 230000008569 process Effects 0.000 claims abstract description 12
- 238000013139 quantization Methods 0.000 claims abstract description 9
- 238000004364 calculation method Methods 0.000 claims description 7
- 230000008859 change Effects 0.000 claims description 4
- 230000003247 decreasing effect Effects 0.000 claims description 3
- 238000007906 compression Methods 0.000 description 6
- 230000006835 compression Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 238000000638 solvent extraction Methods 0.000 description 3
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000013144 data compression Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
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/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/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
- H04N19/152—Data rate or code amount at the encoder output by measuring the fullness of the transmission buffer
-
- 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/154—Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a code rate control method based on video buffer verification, which comprises the following steps: the code rate control module predicts the coding bit and adjusts the frame-level coding quantization parameter QP according to the absolute error and distortion SAD of the current frame and the VBV state of the video buffer verifier; estimating the coded bit according to the complexity of SAD representation, the estimated QP value and the code rate control prediction model, and dynamically adjusting the QP value according to the VBV state to enable the estimated bit to be in a reasonable range; after the frame is coded, if the frame is not completely consistent with the previous coded frame, namely, the frame is not repeated, updating frame-level prediction model parameters and VBV states according to actual coded bit and QP values; in the process of encoding a frame, according to the bit of the actual encoded LCU and the SAD of the unencoded LCU, a line-level prediction model is used for more accurately predicting the encoded bit of the current frame, and the condition that VBV overflows due to inaccurate frame-level prediction is prevented by adjusting the QP of the LCU in the process of encoding.
Description
Technical Field
The invention belongs to the technical field of video coding, and particularly relates to a code rate control method based on video buffer verification.
Background
The motion picture expert group (Moving Picture Experts Group, MPEG) and the video coding expert group (Video Coding Experts Group, VCEG) jointly formulate a series of video coding standards including advanced video coding (Advanced Video Coding, AVC, i.e., h.264), high efficiency video coding (High Efficiency Video Coding, HEVC, i.e., h.265), and new generation video coding standards (multi-function video coding Versatile Video Coding, VVC, i.e., h.266), each of which improves compression efficiency nearly one time as compared to its previous generation coding standard, providing effective assistance for limited network bandwidth transmission of clearer video content.
The video encoding and decoding technology has two sets of standards, namely H.261, and international union (ITU-T) standards H.263, H.263+ and the like; there are also ISO MPEG standards MPEG-1, MPEG-2, MPEG-4, etc. h.264/AVC is the latest standard that two large organizations have jointly deduced the advantages of h.263+ and MPEG-4, the most valuable part being certainly the higher data compression ratio. Under the same image quality condition, the data compression ratio of H.264 is 2 times higher than that of H.263 and 1.5 times higher than that of MPEG-4. HEVC is a new video compression standard used to replace the h.264/AVC coding standard, month 1, 2013, and formally becoming an international standard.
The audio-video coding standard (Audio Video coding Standard, AVS) is an abbreviation of the series standard of advanced audio-video coding of information technology, is a second generation source coding standard with independent intellectual property rights in China, and is also a common basic standard of the digital audio-video industry. The digital audio and video coding and decoding technical standard working group (AVS working group for short) is approved by the national institute of information industry science and technology in month 6 of 2002. Since establishment, the AVS workgroup established coding standards for proprietary property rights in some columns, such as AVS1, AVS-S, AVS, and the like, as well as new generation AVS3 video coding standards. Compared with the previous generation of coding standard AVS2, AVS3 is aimed at improving compression efficiency by one time while guaranteeing video quality, and AVS3 will be widely used in compression processing of video media having an ultra-large data volume, such as 8K, VR. While improving compression efficiency, various complex encoding algorithms are also applied to efficient compression processing of AVS3, resulting in a significant reduction in encoding speed of AVS 3. The scalable video technology-AVS 3 (Scalable Video Technology of AVS, SVT-AVS 3), by combining with the Scalable Video Technology (SVT) of Intel, each flow of the AVS3 encoder is modularized and fully decoupled, and the high parallel encoding of better frame level and segment level is realized in the multi-core processor, so that the encoding speed of the AVS3 is effectively improved.
The SVT-AVS3 adopts a mixed coding framework, and the whole coding process comprises the modules of intra-frame prediction, inter-frame prediction, transformation quantization, inverse quantization inverse transformation, loop filtering, entropy coding and the like. For the application scene of the ultra-high definition video, the block division of the SVT-AVS3 comprises a Quadtree (QT), a Binary Tree (BT) and an enhanced quadtree (Extended Quad Tree, EQT), and different division types are used for adapting to different texture directions so as to improve the coding efficiency. Meanwhile, SVT-AVS3 uses Coding Unit (CU), prediction Unit (PU) and Transform Unit (TU), wherein the size of CU supports recursive partitioning from 128x128 to 4x4, flexible CU partitioning to match the texture complexity of the image itself.
SVT-AVS3 adds a number of key technologies, in addition to more flexible block partitioning, adaptive motion vector precision (Adaptive Motion Vector Resolution, AMVR), history-based motion vector prediction (History-based Motion Vector Prediction, HMVP), advanced motion vector expression (Ultimate Motion Vector Expression, UMVE), affine motion compensation (Affine Motion Compensation), and position-based transforms (Position Based Transform, PBT), among other coding techniques are used to improve coding efficiency.
By modularizing the AVS3 coding flow, each module is responsible for corresponding coding tasks and mutually independent, and the coding speed of SVT-AVS3 is greatly improved due to high parallelization. SVT-AVS3 assigns different encoding tasks to different kernels (Kernel), each Kernel can be assigned one or more threads, and the work between Kernel is independent of each other. The method comprises an image analysis core (Picture Analysis Kernel), a code rate control core (Rate Control Kernel), an image decision core (Picture Decision Kernel), a motion estimation core (Motion Estimation Kernel), a coding and decoding core (EncDecKernel), an entropy coding core (Entropy Coding Kernel) and the like, wherein each Kernel performs corresponding processing after receiving a task and sends a processing result to the next Kernel through a queue for processing in the next step, so that the division of work among the kernels is clear and the parallelism is improved.
The high parallelism of SVT-AVS3 accelerates the encoding process of AVS3, so that SVT-AVS3 is widely applied to low-delay encoding scenes, such as 8K event live broadcast and the like. However, the code rate control model of the SVT-AVS3 encoder has unsatisfactory control on the accuracy of the coding code rate and the code rate fluctuation, so that the wide application of the SVT-AVS3 encoder in low-delay live broadcast scenes is limited.
Disclosure of Invention
In view of the above problems, the invention provides a code rate control method based on video buffer verification, which is used for strictly controlling code rate fluctuation under the condition of improving the code rate control precision, so that the code rate fluctuation is in a reasonable range, and the coding delay is reduced.
In order to solve the technical problems, the invention adopts the following technical scheme:
a code rate control method based on video buffer verification comprises the following steps:
the code rate control module predicts the coding bit and adjusts the frame-level coding quantization parameter QP according to the absolute error and distortion SAD of the current frame and the VBV state of the video buffer verifier;
when QP is allocated to the frame by the code rate control module before actual encoding, firstly judging whether the average SAD value of each maximum coding unit LCU is smaller than 10, if so, judging that the frame is a repeated frame, and allocating fixed and relatively reasonable QP value 32; otherwise, judging the frame as a common frame, estimating the coded bit according to the complexity of SAD representation, the estimated QP value and the code rate control prediction model, and dynamically adjusting the QP value according to the VBV state to enable the estimated bit to be in a reasonable range;
after the frame is coded, if the frame is not completely consistent with the previous coded frame, namely, the frame is not repeated, updating frame-level prediction model parameters and VBV states according to actual coded bit and QP values; if the frame is judged to be a repeated frame, skipping the updating of the frame-level prediction model parameters;
in the process of encoding a frame, according to the bit of the actual encoded LCU and the SAD of the unencoded LCU, a line-level prediction model is used for more accurately predicting the encoded bit of the current frame, and the condition that VBV overflows due to inaccurate frame-level prediction is prevented by adjusting the QP of the LCU in the process of encoding.
In a possible implementation manner, the code rate control module predicts the encoded bit through a frame level prediction model and adjusts the frame level encoded quantization parameter QP according to the absolute error and distortion SAD of the current frame and the VBV state of the video buffer verifier specifically includes:
the frame-level code rate control takes the sequence number of the current frame as a starting point, a certain number of uncoded frames are seen from the time domain backwards, and the prediction relation between the bits PredBit, predBit of the future uncoded frames in the time domain and Qsacle is predicted by the frame-level prediction model through the initial Qsacle value and the SAD of the current frame, as shown in the formula (1):
wherein the coefficient coeff pic Offset pic Count pic Parameters of a frame-level prediction model are respectively adjusted in real time according to the difference between an actual coding bit Actualbit and a prediction PredBIT, SAD represents absolute error and distortion of a current frame or LCU, qsample represents coding parameters related to QP, and the relation between QP and Qsample is shown in a formula (2);
Qscale=0.85*pow(2.0,(QP-12.0)/6.0) (2)
according to the PredBI of each frame, predicting the change condition of the VBV state of the video buffer verifier after a certain number of time domain future frames, skipping the calculation of the current Qsave and correspondingly increasing or decreasing the Qsave value every time the VBV state is about to underflow or overflow, and carrying out the PredBI prediction of each frame again; after the VBV state is affected by the PredBIT of a certain number of uncoded frames, the VBV state is between 0.4 and 0.8, namely, the optimal coding QP of the current frame is found, and the relation between the QP and the Qsave is shown as a formula (3):
QP=12+6.0×log2(Qscale/0.85) (3)
after determining the current frame optimal Qsave and PredBI, update the VBV state vbvBufferfill as shown in equation (4):
vbvBufferfill-=PredBit (4)
in a possible implementation manner, the bit of the uncoded LCU is predicted by a line-level prediction model as shown in a formula (5), and finally the whole-frame predicted bit of the line level is obtained, and the calculation is as shown in a formula (6):
PredBit=PredBit uncoded +Bit encoded (6)
wherein coeff row 、offset row 、count row Coefficient, offset and count parameters, SAD, respectively, of a line-level prediction model encoded Sum SAD (sum of differences) uncoded SAD sum of LCU coded by current frame and SAD sum of LCU not coded by current frame are respectively represented, predBIT uncoded And Bit encoded The current frame encodes the sum of bit predictions of the uncoded LCU and the sum of consumed bits of the coded LCU, respectively.
In a possible implementation manner, whether the current frame is a repeated frame is judged by a formula (7), frame-level prediction model parameters are updated by formulas (8) - (11) for non-repeated frames, and due to errors between a predicted bit and an actually encoded bit, a VBV state is updated according to a formula (12) for QP allocation of a subsequent uncoded frame:
offset temp =ActualBit×Qscale-coeff temp ×SAD (9)
coeff new =coeff o1d ×0.5+coeff temp (10)
offset new =offset o1d ×0.5+offset temp (11)
vbvBufferfill+=PredBit-ActualBit (12)
wherein SAD LCU-avg The average SAD and the buffer rate of the LCU of the current frame are represented as the average bit and the actual bit of each frame under the target code rate, and the actual bit represents the actual consumption bit and coeff of the current coding frame old 、offset old Representing the original coefficient and original offset parameter corresponding to the frame type in the code control prediction model, coeff temp 、offset temp Coeff, a temporary variable related to coefficients and offset parameters new 、offset new The code control model coefficient and the offset parameter are updated according to the actual bit.
The invention has the following beneficial effects: under the condition of improving the code rate control precision, the code rate fluctuation is strictly controlled, so that the code rate fluctuation is in a reasonable range, and the coding delay is reduced. The code rate control model based on VBV is divided into frame level and LCU level code rate control, and the frame level QP and LCU level QP are adjusted according to SAD and VBV states, so that code rate overflow and underflow are prevented. In addition, because the influence on the prediction parameters is caused by the occurrence of repeated frames of some scenes, whether the current frame is the repeated frame or not is detected when the model prediction parameters are updated, and the prediction parameters are updated only for non-repeated frames, so that the situation that the instantaneous code rate fluctuation is large due to large prediction errors is prevented.
Drawings
Fig. 1 is a flowchart illustrating steps of a rate control method based on video buffer verification according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flowchart of a code rate control method based on video buffer verification according to an embodiment of the present invention is shown, including the following steps:
s10, the code rate control module predicts the coding bit and adjusts the frame-level coding quantization parameter QP through the frame-level prediction model according to the absolute error and distortion SAD of the current frame and the VBV state of the video buffer verifier;
s20, when QP is allocated to the frame by a code rate control module before actual coding, firstly judging whether the average SAD value of each maximum coding unit LCU is smaller than 10, if so, judging that the frame is a repeated frame, and allocating a fixed and relatively reasonable QP value 32; otherwise, judging the frame as a common frame, estimating the coded bit according to the complexity of SAD representation, the estimated QP value and the code rate control prediction model, and dynamically adjusting the QP value according to the VBV state to enable the estimated bit to be in a reasonable range;
s30, after the frame is coded, if the frame is not completely consistent with the previous coded frame, namely, the frame is not repeated, updating frame-level prediction model parameters and VBV states according to actual coded bit and QP values; if the frame is judged to be a repeated frame, skipping the updating of the frame-level prediction model parameters;
s40, in the process of encoding a frame, according to the bit of the actual encoded LCU and the SAD of the unencoded LCU, a line-level prediction model is used for more accurately predicting the encoded bit of the current frame, and the condition that VBV overflows due to inaccurate frame-level prediction is prevented by adjusting the QP of the LCU in the process of encoding.
In a further embodiment of the present invention, a code rate control method based on video buffer verification, wherein in S10, a code rate control module predicts a coded bit through a frame-level prediction model and adjusts a frame-level coding quantization parameter QP according to an absolute error and distortion SAD of a current frame and a VBV state of a video buffer verifier, specifically includes:
the frame-level code rate control takes the sequence number of the current frame as a starting point, a certain number of uncoded frames are seen from the time domain backwards, and the initial Qsample value and the SAD of the current frame are used for predicting the bit PredBI of the future uncoded frames of the time domain through a frame-level prediction model, wherein Qsample represents coding parameters related to QP, predBI represents the prediction bit of the prediction model, and the prediction relation between the PredBI and the Qsample is shown as a formula (1):
wherein the coefficient coeff pic Offset pic Count pic Parameters of a frame-level prediction model are respectively adjusted in real time according to the difference between an actual coding bit Actualbit and a prediction PredBIT, SAD represents absolute error and distortion of a current frame or LCU, qsample represents coding parameters related to QP, and the relation between QP and Qsample is shown in a formula (2);
Qscale=0.85*pow(2.0,(QP-12.0)/6.0) (2)
according to the PredBI of each frame, predicting the change condition of the VBV state of the video buffer verifier after a certain number of time domain future frames, skipping the calculation of the current Qsave and correspondingly increasing or decreasing the Qsave value every time the VBV state is about to underflow or overflow, and carrying out the PredBI prediction of each frame again; after the VBV state is affected by the PredBIT of a certain number of uncoded frames, the VBV state is between 0.4 and 0.8, namely, the optimal coding QP of the current frame is found, and the relation between the QP and the Qsave is shown as a formula (3):
QP=12+6.0×log2(Qscale/0.85) (3)
after determining the current frame optimal Qsave and PredBI, update the VBV state vbvBufferfill as shown in equation (4):
vbuBufferfill-=PredBit (4)。
according to the code rate control method based on video buffer verification, bits of an uncoded LCU are predicted according to a line-level prediction model and are shown in a formula (5), the whole frame prediction bits of a line level are finally obtained, and the calculation is shown in a formula (6):
PredBit=PredBit uncoded +Bit encoded (6)
wherein coeff row 、offset row 、count row Coefficient, offset and count parameters, SAD, respectively, of a line-level prediction model encoded Sum SAD (sum of differences) uncoded SAD sum of LCU coded by current frame and SAD sum of LCU not coded by current frame are respectively represented, predBIT uncoded And Bit encoded The current frame encodes the sum of bit predictions of the uncoded LCU and the sum of consumed bits of the coded LCU, respectively.
In the code rate control method based on the video buffer verification of the still another embodiment of the invention, whether the current frame is a repeated frame is judged through a formula (7), frame-level prediction model parameters are updated for non-repeated frames through formulas (8) to (11), and as the predicted bit and the actual encoded bit have errors, the VBV state is updated according to a formula (12) finally, and the VBV state is used for QP distribution of the subsequent uncoded frames:
offset temp =ActualBit×Qscale-coeff temp ×SAD (9)
coeff new =coeff o1d ×0.5+coeff temp (10)
offset new =offset o1d ×0.5+offset temp (11)
vbvBufferfill+=PredBit-ActualBit (12)
wherein SAD LCU-avg The average SAD and the buffer rate of the LCU of the current frame are represented as the average bit and the actual bit of each frame under the target code rate, and the actual bit represents the actual consumption bit and coeff of the current coding frame old 、offset old Representing the original coefficient and original offset parameter corresponding to the frame type in the code control prediction model, coeff temp 、offset temp Coeff, a temporary variable related to coefficients and offset parameters new 、offset new The code control model coefficient and the offset parameter are updated according to the actual bit.
In order to verify the effectiveness of the method, the method is applied to an SVT-AVS3 encoder, and in RateControlKernel, looking back at a lookahead frame to find the optimal Qscale according to the SAD and VBV states of the current frame, wherein the frame prediction bit is calculated by a formula (1). And after finding the optimal Qscale of the current frame, calculating a corresponding QP value according to a formula (2), and updating the VBV state by a formula (4). In EncDecKernel, the sum of the bits and SAD of the LCU encoded for the current frame is counted each time the LCU is encoded to the diagonal LCU, and the line-level prediction model is updated. And then calculating the sum of SADs of the uncoded LCUs, predicting bits of the uncoded LCUs through a line-level prediction model, and finally obtaining line-level whole-frame prediction bits as shown in a formula (5), wherein the calculation is shown in a formula (6). And adjusting QP of the uncoded LCU according to the predicted bit of the line level to avoid overflow and underflow of VBV state. The actual bit consumption of the frame is fed back to RateControlKernel after the EntropyCodingKernel entropy codes the complete frame, and the actual coding average QP and average SAD value of the frame are calculated in LCU units after the RateControlKernel receives the feedback bit. Judging whether the current frame is a repeated frame or not through a formula (7), and updating frame-level prediction model parameters for non-repeated frames through (8) - (11). And finally updating the VBV state according to the formula (12) for QP distribution of the subsequent uncoded frames due to errors of the predicted bit and the actual coded bit.
Part ClassA, classB universal test sequence test using HEVC. The hardware of the experimental platform is configured as Intel (R) Core (TM) i5-6400@2.70Ghz, the memory is 16G, and the windows10 bit operating system. The coding parameter is GOP length=25, b frame number=7, reference frame number=2. In order to compare the influence of different code rate control models on the code rate fluctuation, an output Buffer is set to observe the change of the code rate in the coding process, wherein each frame is coded, the Buffer subtracts the coding bit of the frame and adds the average bit of each frame under the target code rate. The buffersize=target code rate, the initial buffersill=0.7×buffersize, and the coding effect difference of different code rate control models is counted for each 1000 coded frames of each sequence.
Table 1 shows the results of the rate control accuracy and rate fluctuation of each test sequence encoded by the method of the present invention compared with the original SVT-AVS3 encoder. It can be seen that under the condition of ensuring the same coding quality, the code rate control precision of the proposed method is far higher than that of the original SVT-AVS3 encoder, wherein the average code rate control precision of the original SVT-AVS3 encoder in a test sequence is 89.88%, the control precision is lower, and the average code rate control precision in the test sequence is 99.46%, so that the code rate control precision of the proposed method can be more accurate than that of the code rate control model of the original SVT-AVS3 encoder.
And comparing the influence of different code rate control models on the code rate fluctuation by setting an output Buffer. Wherein, maxBuffer represents the largest Buffer status of output Buffer in the whole sequence coding process, and corresponding MinBuffer represents the smallest Buffer status. It should be noted that, when the continuous encoded frame bit is larger than the average bit, the output Buffer continuously drops until a negative value appears, and at this time, an underflow condition appears, and a blocking phenomenon is easily caused, so that the user experience is reduced; when the continuous coded frame bit is smaller than the average bit, the output Buffer continuously rises to overflow, but the overflow condition does not cause obvious user experience reduction. Comparing the method of the invention with the code rate fluctuation condition of the original SVT-AVS3 encoder, the method can see that the code rate has great fluctuation under the code rate control model coding of the original SVT-AVS3 encoder, the average fluctuation of the tested sequence reaches 2685.34ms, and the underflow condition is all generated.
Table 1 comparison of the inventive method with the code rate control results of the original SVT-AVS3 encoder
The code rate fluctuation under the coding of the method is obviously reduced, the average fluctuation of the tested sequence is only 267.34ms, and the conditions of overflow and underflow are not generated. In addition, the method has little influence on the computational complexity of the encoder, and the encoding speed is almost the same as that of the original SVT-AVS3 encoder. The method of the invention effectively improves the code rate control precision and the code rate fluctuation condition of the SVT-AVS3 encoder under the condition of ensuring the coding quality, and has higher value for low-delay application scenes of the SVT-AVS3 encoder.
It should be understood that the exemplary embodiments described herein are illustrative and not limiting. Although one or more embodiments of the present invention have been described with reference to the accompanying drawings, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present invention as defined by the following claims.
Claims (4)
1. The code rate control method based on the video buffer verification is characterized by comprising the following steps:
the code rate control module predicts the coding bit and adjusts the frame-level coding quantization parameter QP according to the absolute error and distortion SAD of the current frame and the VBV state of the video buffer verifier;
when QP is allocated to the frame by the code rate control module before actual encoding, firstly judging whether the average SAD value of each maximum coding unit LCU is smaller than 10, if so, judging that the frame is a repeated frame, and allocating fixed and relatively reasonable QP value 32; otherwise, judging the frame as a common frame, estimating the coded bit according to the complexity of SAD representation, the estimated QP value and the code rate control prediction model, and dynamically adjusting the QP value according to the VBV state to enable the estimated bit to be in a reasonable range;
after the frame is coded, if the frame is not completely consistent with the previous coded frame, namely, the frame is not repeated, updating frame-level prediction model parameters and VBV states according to actual coded bit and QP values; if the frame is judged to be a repeated frame, skipping the updating of the frame-level prediction model parameters;
in the process of encoding a frame, according to the bit of the actual encoded LCU and the SAD of the unencoded LCU, a line-level prediction model is used for more accurately predicting the encoded bit of the current frame, and the condition that VBV overflows due to inaccurate frame-level prediction is prevented by adjusting the QP of the LCU in the process of encoding.
2. The method according to claim 1, wherein the code rate control module predicts the encoded bit and adjusts the frame-level encoded quantization parameter QP according to the absolute error and distortion SAD of the current frame and the VBV state of the video buffer verifier by using a frame-level prediction model specifically comprises:
the frame-level code rate control takes the sequence number of the current frame as a starting point, a certain number of uncoded frame frames are seen from the time domain backwards, and the prediction relation between the bits PredBit, predBit of the uncoded frame in the time domain and Qsave is predicted by the frame-level prediction model through the initial Qsave value and the SAD of the current frame, as shown in the formula (1):
wherein the coefficient coeff pic Offset pic Count pic Parameters of a frame-level prediction model are respectively adjusted in real time according to the difference between an actual coding bit Actualbit and a prediction PredBIT, SAD represents absolute error and distortion of a current frame or LCU, qsample represents coding parameters related to QP, and the relation between QP and Qsample is shown in a formula (2);
Qscale=0.85*pow(2.0,(QP-12.0)/6.0) (2)
according to the PredBI of each frame, predicting the change condition of the VBV state of the video buffer verifier after a certain number of time domain future frames, skipping the calculation of the current Qsave and correspondingly increasing or decreasing the Qsave value every time the VBV state is about to underflow or overflow, and carrying out the PredBI prediction of each frame again; after the VBV state is affected by the PredBIT of a certain number of uncoded frames, the VBV state is between 0.4 and 0.8, namely, the optimal coding QP of the current frame is found, and the relation between the QP and the Qsave is shown as a formula (3):
QP=12+6.0×log2(Qscale/0.85) (3)
after determining the current frame optimal Qsave and PredBI, update the VBV state vbvBufferfill as shown in equation (4):
vbvBufferfill-=PredBit (4)
3. the method for controlling the code rate based on the video buffer verification according to claim 2, wherein the bit of the uncoded LCU is predicted by a line-level prediction model as shown in formula (5), and the whole frame prediction bit of the line level is finally obtained, and the calculation is as shown in formula (6):
PredBit=PredBituncoded+Bit encoded (6)
wherein coeff row 、offset row 、count row Coefficient, offset and count parameters, SAD, respectively, of a line-level prediction model encoded Sum SAD (sum of differences) uncoded SAD sum of LCU coded by current frame and SAD sum of LCU not coded by current frame are respectively represented, predBIT uncoded And Bit encoded The current frame encodes the sum of bit predictions of the uncoded LCU and the sum of consumed bits of the coded LCU, respectively.
4. The video buffer verification-based rate control method of claim 1, wherein whether the current frame is a repeated frame is determined by the formula (7), frame-level prediction model parameters are updated for non-repeated frames by the formulas (8) to (11), and since there is an error between the predicted bit and the actually encoded bit, the VBV state is updated according to the formula (12), and the VBV state is used for QP allocation of the subsequent non-encoded frame:
offset temp =AtualBit×Qscale-coeff temp ×SAD (9)
coeff new =coeff old ×0.5+coeff temp (10)
offset new =offset old ×0.5+offset temp (11)
vbvBufferfill+=PredBit-ActualBit (12)
wherein SAD LCU-avg The average SAD and the buffer rate of the LCU of the current frame are represented as the average bit and the actual bit of each frame under the target code rate, and the actual bit represents the actual consumption bit and coeff of the current coding frame old 、offset old Representing the original coefficient and original offset parameter corresponding to the frame type in the code control prediction model, coeff temp 、offset temp Coeff, a temporary variable related to coefficients and offset parameters new 、offset new The code control model coefficient and the offset parameter are updated according to the actual bit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311855800.7A CN117880511A (en) | 2023-12-29 | 2023-12-29 | Code rate control method based on video buffer verification |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311855800.7A CN117880511A (en) | 2023-12-29 | 2023-12-29 | Code rate control method based on video buffer verification |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117880511A true CN117880511A (en) | 2024-04-12 |
Family
ID=90585812
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311855800.7A Pending CN117880511A (en) | 2023-12-29 | 2023-12-29 | Code rate control method based on video buffer verification |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117880511A (en) |
-
2023
- 2023-12-29 CN CN202311855800.7A patent/CN117880511A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103402099B (en) | The method and system that the picture-level rate of Video coding controls | |
JP5180294B2 (en) | Buffer-based rate control that utilizes frame complexity, buffer level, and intra-frame location in video encoding | |
US7653129B2 (en) | Method and apparatus for providing intra coding frame bit budget | |
KR100949917B1 (en) | Fast Encoding Method and System Via Adaptive Intra Prediction | |
KR20190043930A (en) | Image encoder using machine learning and data processing method thereof | |
US20150288965A1 (en) | Adaptive quantization for video rate control | |
KR20080012753A (en) | Transcoder and coded image conversion method | |
US10958912B2 (en) | Bit prediction based bit rate control method and apparatus for video coding process supporting offline CABAC | |
US20060256858A1 (en) | Method and system for rate control in a video encoder | |
CN113747154B (en) | Code rate control method and encoder | |
JP6373033B2 (en) | Encoding apparatus and encoding method | |
WO2002096120A1 (en) | Bit rate control for video compression | |
JP2011172137A (en) | Encoding apparatus, encoding method, and encoding program | |
US20060222251A1 (en) | Method and system for frame/field coding | |
JP5649296B2 (en) | Image encoding device | |
US8687710B2 (en) | Input filtering in a video encoder | |
JP2009094644A (en) | Moving image encoding apparatus and method for controlling the same | |
Xu et al. | Low-complexity encoder framework for window-level rate control optimization | |
JP2000358247A (en) | Rate controller, rate control method and coder | |
CN117880511A (en) | Code rate control method based on video buffer verification | |
JP2007306277A (en) | Moving image coding method, device and program, and recording medium therefor | |
US8265141B2 (en) | System and method for open loop spatial prediction in a video encoder | |
CN100486335C (en) | Bit rate automatic regulating device | |
Tsai | Rate control for low-delay video using a dynamic rate table | |
KR20090025538A (en) | Method for decision initial quantization parameter |
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 |