Skip to content

Commit

Permalink
using renamed clip_8b function
Browse files Browse the repository at this point in the history
instead of function from dec.c
  • Loading branch information
MajorMurphy committed Jan 26, 2024
1 parent 3d0b681 commit 0c79e74
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@ typedef struct {
} SmoothParams;

//------------------------------------------------------------------------------
#ifndef JUCE_API
#define CLIP_8b_MASK (int)(~0U << (8 + DFIX))
static WEBP_INLINE uint8_t clip_8b(int v) {
static WEBP_INLINE uint8_t clip_8b_quant_levels(int v) {
return (!(v & CLIP_8b_MASK)) ? (uint8_t)(v >> DFIX) : (v < 0) ? 0u : 255u;
}
#undef CLIP_8b_MASK
#endif


// vertical accumulation
static void VFilter(SmoothParams* const p) {
Expand Down Expand Up @@ -146,9 +145,9 @@ static void ApplyFilter(SmoothParams* const p) {
if (v < p->max_ && v > p->min_) {
const int c = (v << DFIX) + correction[average[x] - (v << LFIX)];
#if defined(USE_DITHERING)
dst[x] = clip_8b(c + dither[x % DSIZE]);
dst[x] = clip_8b_quant_levels(c + dither[x % DSIZE]);
#else
dst[x] = clip_8b(c);
dst[x] = clip_8b_quant_levels(c);
#endif
}
}
Expand Down

0 comments on commit 0c79e74

Please sign in to comment.