# Research on VVC Intra-Frame Bit Allocation Scheme Based on Significance Detection
## 3 Model and Proposed Method  
### Analysis of Rate Control Model  
The rate control problem for a video sequence can be described as determining the optimal quantization parameters for each coding unit such that the total distortion is minimized under the condition that the total number of coded bits is less than or equal to \(R_{c}\), i.e.,  
\[Q^{*}=(Q^{*}_{1},\ldots,Q^{*}_{N})=arg\min_{(Q_{1},\ldots,Q_{N})}\sum_{i=1}^{N}D _{i}\,s.t.\sum_{i=1}^{N}R_{i}\leq R_{c} \tag{1}\]  
Take the image as a coding unit as an example, where \(N\) is the number of images contained in the sequence, \(D_{i}\) is the distortion of the ith image, \(Q^{*}=(Q^{*}_{1},\ldots,Q^{*}_{N})\) is the optimal quantization parameter for each image. However, the complexity of determining the quantization parameters of the coding unit directly based on (1) is extremely high, so [PERSON] et al. [4] developed the R-\(\lambda\) and \(\lambda\)-QP models and proposed the K0103 code rate control proposal. The classical R-\(\lambda\) model in this proposal is followed in the code rate control algorithm of VVC. Therefore, the code rate control scheme is usually divided into two parts:  
* Target Bit Allocation: Considering the correlation of video in the air and time domains, the optimal number of target bits for each coding unit is determined according to the total number of target bits in accordance with the levels of GOP, Frame, Slice, CTU, and so on. * Quantization parameter decision: based on the model of the relationship between coding rate and quantization parameter, its quantization parameter is determined independently for each coding unit according to its target bit number. where the number of target bits for each CTU is determined by (2). For an image containing \(N_{L}\) CTUs, the target bit number \(T_{L}(m)\) of the m-th CTU to be coded is:  
\[T_{L}(m)=\frac{T_{f}-H_{f}-R_{L,c}}{\sum_{k=m}^{N_{L}}\omega_{L}(k)}\omega_{L} (m) \tag{2}\]  
\(T_{f}\) is the bit cost allocated by the encoder for the current frame. \(R_{L,c}\) is the sum of the actual bit costs used by all encoded CTUs in the current frame, \(H_{f}\) is the predicted value of the number of bits of header information for this image, and \(\omega_{L}(m)\) is the weight assigned to the bits of each CTU. Experiments in the literature [4] have shown that the hyperbolic function can express the relationship between code rate and distortion well:  
\[D(R)=C^{-K}_{R} \tag{3}\]  
where \(C\) and \(K\) are model parameters related to video content characteristics, and the Lagrange factor \(\lambda\) is:  
\[\lambda=-\frac{\partial D}{\partial R}=CKR^{-K-1}=\alpha\cdot R^{\beta} \tag{4}\]  
The rate R is defined in practical coding as the number of bits per pixel (bpp) assigned to a particular coding unit. However, for improved intra-coding bitrate control, the VVC standard incorporates the complexity measure \(C\) of the coding unit into the R-\(\lambda\) model, which is founded on the SATD, i.e.,  
\[\lambda=\alpha\cdot\left(\frac{C}{bpp}\right)^{\beta} \tag{5}\]  
As an example, a 128 \(\times\) 128 CTU contains 16,384 pixels and corresponding transform coefficients inside. In order to calculate the coding complexity of this CTU, we need to perform the following steps:* Apply the Hadamard transform to the original CTU, traversing each pixel within this CTU and taking the absolute value of the resulting transform coefficients for each pixel. * The sum of the absolute values of the transform coefficients of all pixels within the CTU yields the codestream complexity of the CTU. Assuming that the result of the calculation is SATD. * Calculate the code rate complexity for each pixel. Divide the code stream complexity \(N\) by the square of the number of pixels within this CTU, i.e., by 16,384 \(\times\) 16,384, to obtain the per-pixel code rate complexity \(C\).