--- plugin_lumimasking.c 2004/03/22 22:36:24 1.2 +++ plugin_lumimasking.c 2006/05/06 04:37:15 1.6 @@ -20,13 +20,14 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: plugin_lumimasking.c,v 1.2 2004/03/22 22:36:24 edgomez Exp $ + * $Id: plugin_lumimasking.c,v 1.6 2006/05/06 04:37:15 syskin Exp $ * ****************************************************************************/ #include #include "../xvid.h" +#include "../global.h" #include "../portab.h" #include "../utils/emms.h" @@ -203,8 +204,8 @@ /* Normalize the global luminance accumulator */ global /= data->mb_width*data->mb_height; - DarkThres = DarkThres*global/127.0; - BrightThres = BrightThres*global/127.0; + DarkThres = DarkThres*global/127.0f; + BrightThres = BrightThres*global/127.0f; /* Apply luminance masking only to frames where the global luminance is @@ -227,7 +228,7 @@ data->dquant, data->mb_width*data->mb_height, data->quant, - data->quant + data->quant/2); + MAX(2,data->quant + data->quant/2)); /* Plugin job finished */ return(0);