mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 23:40:26 +00:00
vcomp/cmpto_j2k: print opt hint in help
+ use unit_evaluate_dbl (instead of unit_evaluate) - **also** in decompress
This commit is contained in:
@@ -92,7 +92,7 @@ unit_evaluate(const char *str, const char **endptr)
|
||||
* Converts units in format <val>[.<val>][kMG] to floating point representation.
|
||||
*
|
||||
* @param str string to be parsed, suffix following SI suffix is ignored (as in 1ms or 100MB)
|
||||
* @param case_sensitive should 'm' be considered as mega
|
||||
* @param case_sensitive if true 'm' will be considered as milli, otherwise mega
|
||||
* @param endptr if not NULL, point to suffix after parse
|
||||
* @returns positive floating point representation of the string
|
||||
* @returns NAN if error
|
||||
|
||||
@@ -483,11 +483,13 @@ static void usage() {
|
||||
<< " - use CPU for pixfmt conversion (useful if GPU\n\t\tis fully "
|
||||
"occupied by the encoder; an option for decoder exists as "
|
||||
"well)\n";
|
||||
color_printf("\nOption prefixes (eg. 'q=' for quality) can be used. SI "
|
||||
"suffixes are recognized (eg. 'r=7.5M').\n");
|
||||
}
|
||||
|
||||
#define ASSIGN_CHECK_VAL(var, str, minval) \
|
||||
do { \
|
||||
long long val = unit_evaluate(str, nullptr); \
|
||||
long long val = unit_evaluate_dbl(str, false, nullptr); \
|
||||
if (val < (minval) || val > UINT_MAX) { \
|
||||
LOG(LOG_LEVEL_ERROR) \
|
||||
<< "[J2K] Wrong value " << (str) \
|
||||
|
||||
@@ -242,8 +242,8 @@ static void * j2k_decompress_init(void)
|
||||
|
||||
auto *s = new state_decompress_j2k(queue_len, encoder_in_frames);
|
||||
if (get_commandline_param("j2k-dec-mem-limit") != nullptr) {
|
||||
s->req_mem_limit = unit_evaluate(
|
||||
get_commandline_param("j2k-dec-mem-limit"), nullptr);
|
||||
s->req_mem_limit = unit_evaluate_dbl(
|
||||
get_commandline_param("j2k-dec-mem-limit"), false, nullptr);
|
||||
}
|
||||
|
||||
if (get_commandline_param("j2k-dec-tile-limit") != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user