/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* x264handler.c
- * Copyright (C) John Stebbins 2008 <stebbins@stebbins>
+ * Copyright (C) John Stebbins 2008-2011 <stebbins@stebbins>
*
* x264handler.c is free software.
*
{x264_decimate_syns, "x264_no_dct_decimate", "0", X264_OPT_BOOL},
{x264_cabac_syns, "x264_cabac", "1", X264_OPT_BOOL},
{x264_aq_strength_syns, "x264_aq_strength", "1", X264_OPT_DOUBLE},
- {x264_psy_syns, "x264_psy_rd", "1,0", X264_OPT_PSY},
- {x264_psy_syns, "x264_psy_trell", "1,0", X264_OPT_PSY},
+ {x264_psy_syns, "x264_psy_rd", "1|0", X264_OPT_PSY},
+ {x264_psy_syns, "x264_psy_trell", "1|0", X264_OPT_PSY},
{x264_mbtree_syns, "x264_mbtree", "1", X264_OPT_BOOL_NONE},
};
#define X264_OPT_MAP_SIZE (sizeof(x264_opt_map)/sizeof(struct x264_opt_map_s))
static void
x264_parse_psy(const gchar *psy, gdouble *psy_rd, gdouble *psy_trell)
{
- gchar *val;
- gchar *trell_val = NULL;
- gchar *end;
-
*psy_rd = 0.;
*psy_trell = 0.;
if (psy == NULL) return;
- val = g_strdup(psy);
- gchar *pos = strchr(val, ',');
- if (pos != NULL)
+ if (2 == sscanf(psy, "%lf|%lf", psy_rd, psy_trell) ||
+ 2 == sscanf(psy, "%lf,%lf", psy_rd, psy_trell))
{
- trell_val = pos + 1;
- *pos = 0;
}
- *psy_rd = g_strtod (val, &end);
- if (trell_val != NULL)
- {
- *psy_trell = g_strtod (trell_val, &end);
- }
- g_free(val);
}
static void
gchar *result;
rd = ghb_settings_get_double(ud->settings, "x264_psy_rd");
trell = ghb_settings_get_double(ud->settings, "x264_psy_trell");
- result = g_strdup_printf("%g,%g", rd, trell);
+ result = g_strdup_printf("%g|%g", rd, trell);
return result;
}
x264_parse_psy(pos+1, &psy_rd, &psy_trell);
}
g_free(split[psy]);
- split[psy] = g_strdup_printf("psy-rd=%g,0", psy_rd);
+ split[psy] = g_strdup_printf("psy-rd=%g|0", psy_rd);
}
}
gint bframes = ghb_settings_get_int(ud->settings, "x264_bframes");