[x264-devel] Warn users when using --(psnr|ssim) without --tune (psnr|ssim)

Jason Garrett-Glaser jason at x264.com
Sun Apr 17 07:48:24 CEST 2011


On Sat, Apr 16, 2011 at 5:31 PM, Takashi Mochizuki
<mochi at da2.so-net.ne.jp> wrote:
> Hello,
> I have a question about --tune psnr behavior.
>
> //
>
> encoder/encoder.c - x264_validate_parameters()
>  775     h->param.rc.i_aq_mode = x264_clip3( h->param.rc.i_aq_mode, 0, 2 );
>  776     h->param.rc.f_aq_strength = x264_clip3f( h->param.rc.f_aq_strength, 0, 3 );
>  777     if( h->param.rc.f_aq_strength == 0 )
>  778         h->param.rc.i_aq_mode = 0;
>  779     /* MB-tree requires AQ to be on, even if the strength is zero. */
>  780     if( !h->param.rc.i_aq_mode && h->param.rc.b_mb_tree )
>  781     {
>  782         h->param.rc.i_aq_mode = 1;
>  783         h->param.rc.f_aq_strength = 0;
>  784     }
>
> Thus, when I use --tune psnr with mb_tree, it forces aq_mode on, and I will get
>
> [libx264 @ 0x24404a00] --psnr used with AQ on: results will be invalid!
> [libx264 @ 0x24404a00] --tune psnr should be used if attempting to benchmark psnr!
>
> So, it seems to require that mbtree should be off when using --tune psnr.
> Is this intended behavior?
>
> If so, I think it is better to turn mbtree off in x264_param_apply_tune.
>
> common/common.c - x264_param_apply_tune()
>  345         else if( !strncasecmp( s, "psnr", 4 ) )
>  346         {
>  347             if( psy_tuning_used++ ) goto psy_failure;
>  348             param->rc.i_aq_mode = X264_AQ_NONE;
>  349             param->analyse.b_psy = 0;
>  350         }

I can't replicate this.  I get no warning with --tune psnr and MB-tree.

Jason


More information about the x264-devel mailing list