From 39ed5e7b9d3740e8c99f1f3fee4360dd06c4cd93 Mon Sep 17 00:00:00 2001 From: Antoine Lorence <antoine.lorence@insa-rennes.fr> Date: Tue, 18 Nov 2014 17:53:26 +0100 Subject: [PATCH] [MICD] Apply quantification on generated error image --- app/Operations/MICD.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Operations/MICD.cpp b/app/Operations/MICD.cpp index be8e85b..9d9035f 100644 --- a/app/Operations/MICD.cpp +++ b/app/Operations/MICD.cpp @@ -128,14 +128,15 @@ string MICD::execute( const GrayscaleImage *im, Prediction prediction_alg, image } depth_default_t thePixel = reconstructed_image->getPixelAt(j, i); - ier = (int) thePixel - pred; + ier = thePixel - pred; + ier = quantdef->valueOf(ier); - codec(0,ier,&icode,&ireco); + codec(0, ier, &icode, &ireco); pi[ier+255]++; /* proba associe a l'erreur de prdiction */ nbpt++; - error_prediction_image->setPixelAt(j, i, ier + 128); + error_prediction_image->setPixelAt(j, i, ier); int tempvalue = pred + ireco; // Crop the value in [0,255] -- GitLab