The rate control module 1835 controls the bitrate of the encoded video bitstream by controlling the QP values that are used by the quantization module 1815 (and the inverse quantization module 1825). In some embodiments, the rate control module 1835 supplies different QP values to the quantization module 1815 for different quantization groups. In order to identify QP values (for luma and chroma) that are the most suitable for quantization (e.g., an optimal balance between quality and bitrate for a given video sequence), the rate control module 1835 in some embodiments performs at least some of the analysis described in Section II above in order to arrive at a luma QP value for each luma quantization group and a set of chroma QP offset values for each chroma quantization group. In some embodiments, the rate controller 1835 also uses the analysis for identifying regions and assigning the (luma and chroma) quantization groups.
In some embodiments, the rate controller 1835 dissolves the set of chroma QP offset values into sets of chroma QP offset values at various levels of the video coding hierarchy. In some of these embodiments, at least some sets of chroma QP offset values are further dissolved into predicted values between the two chroma components as shown in Equations (1)-(7) above. In some embodiments, lower level QP offset values are identified by subtracting higher level QP offset values from the overall chroma QP offset values. For example, some embodiments compute quantization group level chroma QP offsets as: QPoffset_quant_group[i]=QPchroma[i]?QPluma?QPoffset_pps[i]?QPoffset_slice[i]??(8)