Skip to content

Commit

Permalink
version 0.3.0-rc39
Browse files Browse the repository at this point in the history
Continue to fine-tune the nhw_kernel weights
  • Loading branch information
rcanut committed Dec 5, 2024
1 parent 10a0a5b commit c695f3d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
33 changes: 25 additions & 8 deletions encoder/image_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
****************************************************************************
* NHW Image Codec *
* file: image_processing.c *
* version: 0.3.0-rc38 *
* last update: $ 11282024 nhw exp $ *
* version: 0.3.0-rc39 *
* last update: $ 12052024 nhw exp $ *
* *
****************************************************************************
****************************************************************************
Expand Down Expand Up @@ -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,t15,t16,t17,t18,t19;
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,t16,t17,t18,t19,t20;
int nps,w1,w2,w3,w4,w5,w6,w7,w8;
short *nhw_process, *nhw_kernel;
char lower_quality_setting_on, *nhw_sharp_on;
Expand Down Expand Up @@ -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,t15=0,t16=0,t17=0,t18=8,t19=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,t16=0,t17=0,t18=8,t19=0,t20=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++)
{
Expand Down Expand Up @@ -849,10 +849,22 @@ void pre_processing(image_buffer *im)
{
nhw_kernel[scan-1] = 0;

if (!t19 && abs(res)>(sharpness+96) && t6>0 && i>(4*IM_DIM))
if (t19<(4*IM_SIZE) && abs(res)>(sharpness+96) && t6>0 && i>(4*IM_DIM))
{
t6++;

if (t19>0 && t20>2)
{
t6--;

t19 = (8*IM_SIZE);
}

if (!t19)
{
t6++;

t20 = 1;
}

t19++;
}
}
Expand Down Expand Up @@ -998,7 +1010,12 @@ void pre_processing(image_buffer *im)
if (t15>9) t15 = 0;
}

if (t6>15 && t7<4) t6 = 0;
if (t6>15 && t7<4)
{
t6 = 0;

if (t19>0) t20++;
}
}

t4 = 0;
Expand Down
7 changes: 4 additions & 3 deletions encoder/nhw_encoder_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
****************************************************************************
* NHW Image Codec *
* file: nhw_encoder_cli.c *
* version: 0.3.0-rc38 *
* last update: $ 11282024 nhw exp $ *
* version: 0.3.0-rc39 *
* last update: $ 12052024 nhw exp $ *
* *
****************************************************************************
****************************************************************************
Expand Down Expand Up @@ -43,14 +43,15 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "codec.h"

#define PROGRAM "nhw-enc"
#define VERSION "0.3.0-rc38"
#define VERSION "0.3.0-rc39"

#define NHW_QUALITY_MIN LOW20
#define NHW_QUALITY_MAX HIGH3
Expand Down

0 comments on commit c695f3d

Please sign in to comment.