From be48d800a6f1cf32e5307053b7ef3d2b9dc45851 Mon Sep 17 00:00:00 2001 From: Raphael Canut Date: Tue, 15 Oct 2024 17:45:24 +0200 Subject: [PATCH] version 0.3.0-rc30 Continue to fine-tune the nhw_kernel weights --- encoder/image_processing.c | 32 +++++++++++++++++++++++++++----- encoder/nhw_encoder_cli.c | 6 +++--- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/encoder/image_processing.c b/encoder/image_processing.c index 68b294b..497336d 100644 --- a/encoder/image_processing.c +++ b/encoder/image_processing.c @@ -2,8 +2,8 @@ **************************************************************************** * NHW Image Codec * * file: image_processing.c * -* version: 0.3.0-rc29 * -* last update: $ 10102024 nhw exp $ * +* version: 0.3.0-rc30 * +* last update: $ 10152024 nhw exp $ * * * **************************************************************************** **************************************************************************** @@ -557,7 +557,7 @@ void im_recons_wavelet_band(image_buffer *im) void pre_processing(image_buffer *im) { - int i,j,scan,res,res2,res3,res4,count,e=0,f=0,a=0,sharpness=0,sharpn2=0,n1,t,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14; + int i,j,scan,res,res2,res3,res4,count,e=0,f=0,a=0,sharpness=0,sharpn2=0,n1,t,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15; int nps,w1,w2,w3,w4,w5,w6,w7,w8; short *nhw_process, *nhw_kernel; char lower_quality_setting_on, *nhw_sharp_on; @@ -767,7 +767,7 @@ void pre_processing(image_buffer *im) if (im->setup->quality_setting<=LOW4) nhw_sharp_on=(char*)calloc(4*IM_SIZE,sizeof(char)); - for (i=(2*IM_DIM),t1=0,t2=0,t3=0,t4=0,t5=0,t6=8,t7=0,t8=0,t9=0,t10=10,t11=15,t12=0,t13=0,t14=0;i<((4*IM_SIZE)-(2*IM_DIM));i+=(2*IM_DIM)) + for (i=(2*IM_DIM),t1=0,t2=0,t3=0,t4=0,t5=0,t6=8,t7=0,t8=0,t9=0,t10=10,t11=15,t12=0,t13=0,t14=0,t15=0;i<((4*IM_SIZE)-(2*IM_DIM));i+=(2*IM_DIM)) { for (scan=i+1,j=1;j<((2*IM_DIM)-2);j++,scan++) { @@ -852,7 +852,7 @@ void pre_processing(image_buffer *im) if (abs(count)>sharpness) { - if (t2==1 || t12==1) + if ((t2==1 || t12==1) && !t14) { if (!t3) { @@ -891,6 +891,11 @@ void pre_processing(image_buffer *im) if (abs(res)>sharpn2) nhw_kernel[scan]=0; } } + + if (t14==1) + { + t14 = 0; + } t1 = 1; } @@ -915,6 +920,8 @@ void pre_processing(image_buffer *im) if (!t6) { t6 = 1; + + t14 = 0; t7++; } @@ -923,6 +930,21 @@ void pre_processing(image_buffer *im) t6++; t1++; + + if (!t15) + { + t14 = 1; + + t15 = 1; + } + else + { + t14 = 0; + + t15++; + + if (t15>9) t15 = 0; + } if (t6>15 && t7<4) t6 = 0; } diff --git a/encoder/nhw_encoder_cli.c b/encoder/nhw_encoder_cli.c index 2673a69..4099a83 100644 --- a/encoder/nhw_encoder_cli.c +++ b/encoder/nhw_encoder_cli.c @@ -2,8 +2,8 @@ **************************************************************************** * NHW Image Codec * * file: nhw_encoder_cli.c * -* version: 0.3.0-rc29 * -* last update: $ 10102024 nhw exp $ * +* version: 0.3.0-rc30 * +* last update: $ 10152024 nhw exp $ * * * **************************************************************************** **************************************************************************** @@ -50,7 +50,7 @@ #include "codec.h" #define PROGRAM "nhw-enc" -#define VERSION "0.3.0-rc29" +#define VERSION "0.3.0-rc30" #define NHW_QUALITY_MIN LOW20 #define NHW_QUALITY_MAX HIGH3