From 1574b14b4f91e3687a771d1ac4b1505f56a5d9bb Mon Sep 17 00:00:00 2001 From: cubicibo <55701024+cubicibo@users.noreply.github.com> Date: Wed, 22 May 2024 20:36:32 +0200 Subject: [PATCH] Push version, fix readme, reduce default quality to 99. --- README.rst | 9 +++++---- ass2bdnxml.c | 8 ++++---- common.h | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index de0a219..0a8aae4 100644 --- a/README.rst +++ b/README.rst @@ -117,9 +117,9 @@ Below are parameters to tune libimagequant (LIQ). Those shall only be used along | ``--liq-speed`` | LIQ speed. Lower value are slower but higher quality. | | | Choices: value within [1; 10] incl. Default: ``4`` | +--------------------+--------------------------------------------------------+ -| ``--liq-quality`` | Quantization quality. Values < 100 can be visually | -| | lossless and will compress way better as PGS. | -| | Default: ``100`` but 90~97 is recommended in general. | +| ``--liq-quality`` | Quantization quality. 100 is best, < 100 is generally | +| | visually lossless and will compress way better as PGS. | +| | Default: ``99`` but 85~100 is recommended in general. | +--------------------+--------------------------------------------------------+ | ``--liq-dither`` | Dithering level, value must be within [0; 1.0] incl. | | | Default: ``1.0``. Disable: ``0``. LIQ dithering is soft| @@ -155,8 +155,9 @@ Moreover, the last table has debugging parameters. These should not have any pra Basic Scenarist BD example -------------------------- +:: -:: ass2bdnxml -f 29.97 -v 1080i -s 2 -q 255 -r --liq-quality 98 subtitle.ass + ass2bdnxml -f 29.97 -v 1080i -s 2 -q 255 -r --liq-quality 98 subtitle.ass - 1080i29.97 (``-v 1080i -f 29.97``) - quantize with a maximum of 255 colours (``-q 255``) diff --git a/ass2bdnxml.c b/ass2bdnxml.c index 133d504..ac15683 100644 --- a/ass2bdnxml.c +++ b/ass2bdnxml.c @@ -27,7 +27,7 @@ #include "common.h" -#define A2B_VERSION_STRING "0.7c" +#define A2B_VERSION_STRING "0.7e" frate_t frates[] = { {"23.976",24, 24000, 1001}, @@ -242,7 +242,7 @@ int main(int argc, char *argv[]) memset(offset_vals, 0, sizeof(offset_vals)); opts_t args; - liqopts_t liqargs = {.dither=1.0f, .speed=4, .max_quality=100}; + liqopts_t liqargs = {.dither=1.0f, .speed=4, .max_quality=99}; memset(&args, 0, sizeof(args)); @@ -314,9 +314,9 @@ int main(int argc, char *argv[]) printf("Dimming coefficient not a valid percentage.\n"); exit(1); } else { - args.dim_flag = 1; + args.dim_flag = args.dimf > 0.0; + args.dimf = MAX(0.0f, MIN(1.0f, 1.0f - (args.dimf/100.0f))); } - args.dimf = MAX(0.0f, MIN(1.0f, 1.0f - (args.dimf/100.0f))); break; case OPT_ARG_DVD_MODE: args.dvd_mode = 1; diff --git a/common.h b/common.h index 09ff8a4..c4dbaa6 100644 --- a/common.h +++ b/common.h @@ -52,7 +52,7 @@ typedef struct opts_s { uint32_t fullscreen : 1; uint32_t square_px : 1; uint32_t downsampled : 4; - uint32_t dim_flag : 1; + uint32_t dim_flag : 1; //8 uint32_t _bpad1 : 16; const char *fontdir; } opts_t;