From: Anton Mitrofanov Date: Wed, 20 Jul 2011 18:54:43 +0000 (+0400) Subject: Allow setting a wider range of chroma QP offsets X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5e21b60fe4422c85b9f27eda6f45d7a5517e160;p=libx264 Allow setting a wider range of chroma QP offsets This allows use of the full range of chroma QP offsets, even in combination with the automatic psy-based adjustments. --- diff --git a/encoder/encoder.c b/encoder/encoder.c index 927e4226..7d112ec0 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -721,7 +721,6 @@ static int x264_validate_parameters( x264_t *h, int b_open ) h->param.analyse.inter &= ~X264_ANALYSE_I8x8; h->param.analyse.intra &= ~X264_ANALYSE_I8x8; } - h->param.analyse.i_chroma_qp_offset = x264_clip3(h->param.analyse.i_chroma_qp_offset, -12, 12); h->param.analyse.i_trellis = x264_clip3( h->param.analyse.i_trellis, 0, 2 ); h->param.rc.i_aq_mode = x264_clip3( h->param.rc.i_aq_mode, 0, 2 ); h->param.rc.f_aq_strength = x264_clip3f( h->param.rc.f_aq_strength, 0, 3 ); @@ -766,6 +765,7 @@ static int x264_validate_parameters( x264_t *h, int b_open ) h->param.analyse.f_psy_trellis = x264_clip3f( h->param.analyse.f_psy_trellis, 0, 10 ); h->mb.i_psy_rd = h->param.analyse.i_subpel_refine >= 6 ? FIX8( h->param.analyse.f_psy_rd ) : 0; h->mb.i_psy_trellis = h->param.analyse.i_trellis ? FIX8( h->param.analyse.f_psy_trellis / 4 ) : 0; + h->param.analyse.i_chroma_qp_offset = x264_clip3(h->param.analyse.i_chroma_qp_offset, -32, 32); /* In 4:4:4 mode, chroma gets twice as much resolution, so we can halve its quality. */ if( b_open && i_csp >= X264_CSP_I444 && i_csp < X264_CSP_BGR && h->param.analyse.b_psy ) h->param.analyse.i_chroma_qp_offset += 6;