Skip to content

Commit

Permalink
version 0.3.0-rc2
Browse files Browse the repository at this point in the history
Better weights for nhw_kernel
  • Loading branch information
rcanut committed Sep 21, 2023
1 parent aa3aa91 commit 3299ea5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
25 changes: 22 additions & 3 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-rc1 *
* last update: $ 04182023 nhw exp $ *
* version: 0.3.0-rc2 *
* last update: $ 09212023 nhw exp $ *
* *
****************************************************************************
****************************************************************************
Expand Down Expand Up @@ -601,11 +601,30 @@ void pre_processing(image_buffer *im)
{
for (scan=i+1,j=1;j<((2*IM_DIM)-1);j++,scan++)
{
nhw_kernel[scan] = (nhw_process[scan]<<3) -
res = (nhw_process[scan]<<3) -
nhw_process[scan-1]-nhw_process[scan+1]-
nhw_process[scan-(2*IM_DIM)]-nhw_process[scan+(2*IM_DIM)]-
nhw_process[scan-(2*IM_DIM+1)]-nhw_process[scan+(2*IM_DIM-1)]-
nhw_process[scan-(2*IM_DIM-1)]-nhw_process[scan+(2*IM_DIM+1)];

count = abs(nhw_process[scan]-nhw_process[scan-1]) +
abs(nhw_process[scan]-nhw_process[scan+1]) +
abs(nhw_process[scan]-nhw_process[scan-(2*IM_DIM)]) +
abs(nhw_process[scan]-nhw_process[scan+(2*IM_DIM)]) +
abs(nhw_process[scan]-nhw_process[scan-(2*IM_DIM-1)]) +
abs(nhw_process[scan]-nhw_process[scan-(2*IM_DIM+1)]) +
abs(nhw_process[scan]-nhw_process[scan+(2*IM_DIM-1)]) +
abs(nhw_process[scan]-nhw_process[scan+(2*IM_DIM+1)]);

if (res<0)
{
nhw_kernel[scan] = - (((15*abs(res))+count)>>4);
}
else if (res>0)
{
nhw_kernel[scan] = (((15*res)+count)>>4);
}
else nhw_kernel[scan]=0;
}
}

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-rc1 *
* last update: $ 04182023 nhw exp $ *
* version: 0.3.0-rc2 *
* last update: $ 09212023 nhw exp $ *
* *
****************************************************************************
****************************************************************************
Expand Down Expand Up @@ -50,7 +50,7 @@
#include "codec.h"

#define PROGRAM "nhw-enc"
#define VERSION "0.3.0-rc1"
#define VERSION "0.3.0-rc2"

#define NHW_QUALITY_MIN LOW20
#define NHW_QUALITY_MAX HIGH3
Expand Down

0 comments on commit 3299ea5

Please sign in to comment.