Skip to content

Commit

Permalink
Simplify this check
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaaa123456789 committed Jan 15, 2022
1 parent 764f77f commit 7de1440
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/jpegwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ void calculate_JPEG_quantization_tables (struct context * context, uint8_t lumin
score += current;
for (current = context -> source -> height; current > 4; current >>= 1) score += 2;
score += current;
if (score < 24)
score = 2;
else
score -= 22;
score = (score > 24) ? score - 22 : 2;
// adjust the chrominance accuracy based on the color depth
current = get_true_color_depth(context -> source);
uint_fast32_t adjustment = 72 - (current & 0xff) - ((current >> 8) & 0xff) - ((current >> 16) & 0xff);
Expand Down

0 comments on commit 7de1440

Please sign in to comment.