From 82658c703fa22defda534a8ba91f3ba10864fd34 Mon Sep 17 00:00:00 2001 From: robo-mop Date: Fri, 15 Sep 2023 16:15:00 +0530 Subject: [PATCH] Refactor variable names for clarity --- src/features/encoders/avif/client/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/features/encoders/avif/client/index.tsx b/src/features/encoders/avif/client/index.tsx index 3a1594d1..15303c8b 100644 --- a/src/features/encoders/avif/client/index.tsx +++ b/src/features/encoders/avif/client/index.tsx @@ -48,6 +48,7 @@ interface State { * We display it as 'effort' to the user since it conveys the speed-size tradeoff * much better: speed = 10 - effort */ +const MAX_QUALITY = 100; const MAX_EFFORT = 10; export class Options extends Component { @@ -127,10 +128,10 @@ export class Options extends Component { }; const newOptions: EncodeOptions = { - cqLevel: optionState.lossless ? 100 : optionState.quality, + cqLevel: optionState.lossless ? MAX_QUALITY : optionState.quality, cqAlphaLevel: optionState.lossless || !optionState.separateAlpha - ? -1 + ? -1 // default AVIF alphaLevel : optionState.alphaQuality, // Always set to 4:4:4 if lossless subsample: optionState.lossless ? 3 : optionState.subsample, @@ -190,7 +191,7 @@ export class Options extends Component {
@@ -314,7 +315,7 @@ export class Options extends Component {