Skip to content

Commit

Permalink
version 0.2.3 - better pre_processing
Browse files Browse the repository at this point in the history
  • Loading branch information
rcanut committed Sep 15, 2022
1 parent b2104c3 commit 6583185
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 14 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.2.2 *
* last update: $ 08242022 nhw exp $ *
* version: 0.2.3 *
* last update: $ 09152022 nhw exp $ *
* *
****************************************************************************
****************************************************************************
Expand Down Expand Up @@ -543,6 +543,18 @@ void pre_processing(image_buffer *im)
{
if (count>0) im->im_jpeg[scan]++;else im->im_jpeg[scan]--;
}

if (abs(res)>sharpness && abs(res)<=(sharpness+20) && abs(count)>sharpness && abs(count)<=(sharpness+20) )
{
if (res>0 && count>0)
{
if (res>=count) im->im_jpeg[scan-1]++;else im->im_jpeg[scan]++;
}
else if (res<0 && count<0)
{
if (res<=count) im->im_jpeg[scan-1]--;else im->im_jpeg[scan]--;
}
}
}

if (im->setup->quality_setting>LOW6 || (im->setup->quality_setting<=LOW10 && im->setup->quality_setting>LOW13))
Expand Down Expand Up @@ -803,7 +815,6 @@ void pre_processing(image_buffer *im)
{
j+=3;scan+=3;t=0;e=0;f=0;
}

}
}
}
Expand Down
4 changes: 2 additions & 2 deletions encoder/nhw_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
****************************************************************************
* NHW Image Codec *
* file: nhw_encoder.c *
* version: 0.2.2 *
* last update: $ 08242022 nhw exp $ *
* version: 0.2.3 *
* last update: $ 09152022 nhw exp $ *
* *
****************************************************************************
****************************************************************************
Expand Down

0 comments on commit 6583185

Please sign in to comment.