Skip to content

Commit

Permalink
version 0.3.0-rc18
Browse files Browse the repository at this point in the history
Continue to fine-tune the nhw_kernel weights
  • Loading branch information
rcanut committed Aug 26, 2024
1 parent 701d82a commit 959cd1b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
38 changes: 32 additions & 6 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-rc17 *
* last update: $ 08182024 nhw exp $ *
* version: 0.3.0-rc18 *
* last update: $ 08262024 nhw exp $ *
* *
****************************************************************************
****************************************************************************
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;i<((4*IM_SIZE)-(2*IM_DIM));i+=(2*IM_DIM))
for (i=(2*IM_DIM),t1=0,t2=0,t3=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 @@ -839,18 +839,44 @@ void pre_processing(image_buffer *im)
{
if (!t1)
{
t2 = 0;

if (abs(res)>sharpness)
{
if (res>0) im->im_jpeg[scan-1]+=2;else im->im_jpeg[scan-1]-=2;

if (abs(count)>sharpn2) nhw_kernel[scan-1]=0;

t2 = 1;
}

if (abs(count)>sharpness)
{
if (count>0) im->im_jpeg[scan]+=2;else im->im_jpeg[scan]-=2;

if (abs(res)>sharpn2) nhw_kernel[scan]=0;
if (t2==1)
{
if (!t3)
{
if (count>0) im->im_jpeg[scan]++;else im->im_jpeg[scan]--;

t3 = 1;
}
else
{
if (count>0) im->im_jpeg[scan]+=2;else im->im_jpeg[scan]-=2;

if (abs(res)>sharpn2) nhw_kernel[scan]=0;

if (t3==1) t3 = 2;
else if (t3==2) t3 = 3;
else t3 = 0;
}
}
else
{
if (count>0) im->im_jpeg[scan]+=2;else im->im_jpeg[scan]-=2;

if (abs(res)>sharpn2) nhw_kernel[scan]=0;
}
}

t1 = 1;
Expand Down
6 changes: 3 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-rc17 *
* last update: $ 08182024 nhw exp $ *
* version: 0.3.0-rc18 *
* last update: $ 08262024 nhw exp $ *
* *
****************************************************************************
****************************************************************************
Expand Down Expand Up @@ -50,7 +50,7 @@
#include "codec.h"

#define PROGRAM "nhw-enc"
#define VERSION "0.3.0-rc17"
#define VERSION "0.3.0-rc18"

#define NHW_QUALITY_MIN LOW20
#define NHW_QUALITY_MAX HIGH3
Expand Down

0 comments on commit 959cd1b

Please sign in to comment.