# HG changeset patch # User gpoirier # Date 1117918489 0 # Node ID 189da3c3116b85f9a1a5bffecdf6ada7a06172b7 # Parent d9aec92f6d12760c70f1bae43388d6dc0fc85019 Add XviD's luminance masking (option name: lumi_mask) diff -r d9aec92f6d12 -r 189da3c3116b ChangeLog --- a/ChangeLog Sat Jun 04 19:33:06 2005 +0000 +++ b/ChangeLog Sat Jun 04 20:54:49 2005 +0000 @@ -41,7 +41,7 @@ * audio encoding modularized * AAC (FAAC) audio encoding * border processing adaptive quantization in libavcodec - * XviD's encoding zones + * XviD's encoding zones and luminance masking Ports: * improved timer function on Mac OS X diff -r d9aec92f6d12 -r 189da3c3116b DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Sat Jun 04 19:33:06 2005 +0000 +++ b/DOCS/man/en/mplayer.1 Sat Jun 04 20:54:49 2005 +0000 @@ -7593,6 +7593,17 @@ .PD 1 . .TP +.B (no)lumi_mask +Adaptive quantization allows each macroblock quantizer to vary inside +each frame. +This is a 'psychosensory' setting that is supposed to make use of the +fact that the human eye tends to notice fewer details in very bright +and very dark parts of the picture. +It compresses those areas more strongly than medium ones, which will +save bits that can be spent again on other frames, raising overall +subjective quality and possibly reducing PSNR. +. +.TP .B min_iquant=<0\-31> minimum I-frame quantizer (default: 2) . diff -r d9aec92f6d12 -r 189da3c3116b libmpcodecs/ve_xvid4.c --- a/libmpcodecs/ve_xvid4.c Sat Jun 04 19:33:06 2005 +0000 +++ b/libmpcodecs/ve_xvid4.c Sat Jun 04 20:54:49 2005 +0000 @@ -169,6 +169,7 @@ static int xvidenc_max_key_interval = 0; /* Let xvidcore set a 10s interval by default */ static int xvidenc_frame_drop_ratio = 0; static int xvidenc_greyscale = 0; +static int xvidenc_luminance_masking = 0; static int xvidenc_debug = 0; static int xvidenc_psnr = 0; @@ -245,6 +246,8 @@ {"max_key_interval", &xvidenc_max_key_interval, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, {"greyscale", &xvidenc_greyscale, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"nogreyscale", &xvidenc_greyscale, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"lumi_mask", &xvidenc_luminance_masking, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nolumi_mask", &xvidenc_luminance_masking, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"turbo", &xvidenc_turbo, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"debug", &xvidenc_debug, CONF_TYPE_INT , 0 ,0,-1,NULL}, {"stats", &xvidenc_stats, CONF_TYPE_FLAG, 0, 0, 1, NULL}, @@ -1049,6 +1052,13 @@ create->num_plugins++; doZones = 1; } + + if (xvidenc_luminance_masking) { + create->plugins[create->num_plugins].func = xvid_plugin_lumimasking; + create->plugins[create->num_plugins].param = NULL; + create->num_plugins++; + } + // parse zones if (xvidenc_zones != NULL && doZones > 0) // do not apply zones in CQ, and first pass mode (xvid vfw doesn't allow them in those modes either) {