为了进一步提高H.264中码率控制的性能,提出了自适应预测残差和量化矩阵的码率控制.首先根据宏块梯度方向权值和简化率失真模型,确定是否对宏块进行离散余弦变换(DCT);然后通过新的比特分配模型计算宏块的量化参数,并通过坡度加权确定宏块的坡度系数,最终根据得到的量化参数(QP)和坡度系数计算宏块的量化矩阵,并使用该量化矩阵对宏块进行编码.仿真结果表明,与H.264基本单元层码率控制算法相比,本算法在严格控制编码时间和输出码率的情况下,使重建图像的峰值信噪比(PSNR)值提高0.21dB.
A rate control algorithm for adaptive prediction error and quantization matrix is proposed in order to improve the performance of rate control in H. 264 further. Firstly, the new algorithm determines whether discrete cosine transform (DCT) is applied to the macroblock according to the gradient directional weight of maeroblock and to the simplified rate distortion model. Secondly, the quantization parameter (QP) is calculated through a new dual target bits allocation model, and then the slope coefficient is calculated by the weighted average of slope in the macroblock. Finally, the macrobloek is quantized by the quantization matrix determined according to QP and slope coefficient. Simulation shows that, compared with rate control algorithm of basic-unit in H. 264, the proposed algorithm restricts coding time dramatically and controls bitrate precisely. Moreover, the peak signal noise ratio (PSNR) is increased with 0.21 dB in the proposed algorithm.