diff --git a/app/Operations/MICD.cpp b/app/Operations/MICD.cpp index be8e85b6099497a628e025c553795ccc66ab0cb3..9d9035f13d4aa271176347801b1e9ca725c58640 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]