FIG. 15 illustrates the implementation of the pseudo code for a transform unit 1500 that is able to specify chroma QP offset values for a quantization group using any of three different methods. When the method flag “chroma_qp_offset_method” is set to 0 (at line 1512), the transform unit 1500 uses the index “cu_chroma_qp_offset_table_index” to select an entry from the table 890 for computing chroma QP offset values of QG 821 as in FIG. 12. When the method flag is set to 1 (at line 1514), the transform unit 1500 encodes two independent chroma QP offset values for two chroma components (using both magnitude and sign flags) as in FIG. 5. When the method flag is set to 2 (at line 1522), the transform unit 1500 encodes only one chroma QP offset value for both chroma components as in FIG. 6.
II. Assigning Additional Chroma Qp Offsets
Encoders in different embodiments use different methods for identifying and assigning the additional chroma QP offset values. In some embodiments, the encoder analyzes images in a video sequence in order to identify the most suitable QP values for quantization (e.g., for optimally balancing quality and bitrate). Some embodiments analyze various regions of the image in order to identify quantization groups that can be optimally encoded by a common set of chroma QP values.