Commit aad44376 authored by Fiona Glaser's avatar Fiona Glaser

Add tune for still image compression

There has been some demand for this from companies looking to use x264 for still image compression (it can outperform JPEG or JPEG-2000 by a factor of 2 or more).
Still image compression is a bit different; because temporal stability isn't an issue, we can get away with far more powerful psy settings.
parent 774dbb47
......@@ -309,6 +309,15 @@ static int x264_param_apply_tune( x264_param_t *param, const char *tune )
param->analyse.i_luma_deadzone[1] = 6;
param->rc.f_qcompress = 0.8;
}
else if( !strncasecmp( s, "stillimage", 5 ) )
{
if( psy_tuning_used++ ) goto psy_failure;
param->i_deblocking_filter_alphac0 = -3;
param->i_deblocking_filter_beta = -3;
param->analyse.f_psy_rd = 2.0;
param->analyse.f_psy_trellis = 0.7;
param->rc.f_aq_strength = 1.2;
}
else if( !strncasecmp( s, "psnr", 4 ) )
{
if( psy_tuning_used++ ) goto psy_failure;
......
......@@ -336,6 +336,9 @@ static void Help( x264_param_t *defaults, int longhelp )
" --deblock -2:-2 --ipratio 1.1 \n"
" --pbratio 1.1 --psy-rd <unset>:0.25\n"
" --qcomp 0.8\n"
" - stillimage (psy tuning):\n"
" --aq-strength 1.2 --deblock -3:-3\n"
" --psy-rd 2.0:0.7\n"
" - psnr (psy tuning):\n"
" --aq-mode 0 --no-psy\n"
" - ssim (psy tuning):\n"
......@@ -346,7 +349,8 @@ static void Help( x264_param_t *defaults, int longhelp )
" - zerolatency:\n"
" --bframes 0 --force-cfr --rc-lookahead 0\n"
" --sync-lookahead 0 --sliced-threads\n" );
else H0( " - psy tunings: film,animation,grain,psnr,ssim\n"
else H0( " - psy tunings: film,animation,grain,\n"
" stillimage,psnr,ssim\n"
" - other tunings: fastdecode,zerolatency\n" );
H2( " --slow-firstpass Don't force these faster settings with --pass 1:\n"
" --no-8x8dct --me dia --partitions none --ref 1\n"
......
......@@ -35,7 +35,7 @@
#include <stdarg.h>
#define X264_BUILD 90
#define X264_BUILD 91
/* x264_t:
* opaque handler for encoder */
......@@ -432,7 +432,7 @@ static const char * const x264_preset_names[] = { "ultrafast", "veryfast", "fast
* 100 times faster than placebo!
*
* Currently available tunings are: */
static const char * const x264_tune_names[] = { "film", "animation", "grain", "psnr", "ssim", "fastdecode", "zerolatency", 0 };
static const char * const x264_tune_names[] = { "film", "animation", "grain", "stillimage", "psnr", "ssim", "fastdecode", "zerolatency", 0 };
/* Multiple tunings can be used if separated by a delimiter in ",./-+",
* however multiple psy tunings cannot be used.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment