From 882badfe748f8190c6716472b8c8841b227093c1 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Wed, 20 Jul 2011 22:54:43 +0400 Subject: [PATCH] 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. --- encoder/encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoder/encoder.c b/encoder/encoder.c index 1cc19187..72d4d3aa 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; -- 2.47.3