remove unnecessary ternary expressions
diff --git a/src/reformat.c b/src/reformat.c index a5438b5..28906e1 100644 --- a/src/reformat.c +++ b/src/reformat.c
@@ -190,8 +190,8 @@ const float kr = state->kr; const float kg = state->kg; const float kb = state->kb; - const uint32_t maxUVI = (image->width > 1) ? ((image->width+state->formatInfo.chromaShiftX) >> state->formatInfo.chromaShiftX) - 1 : 0; - const uint32_t maxUVJ = (image->height > 1) ? ((image->height+state->formatInfo.chromaShiftY) >> state->formatInfo.chromaShiftY) - 1 : 0; + const uint32_t maxUVI = ((image->width + state->formatInfo.chromaShiftX) >> state->formatInfo.chromaShiftX) - 1; + const uint32_t maxUVJ = ((image->height + state->formatInfo.chromaShiftY) >> state->formatInfo.chromaShiftY) - 1; float maxChannel = (float)((1 << image->depth) - 1); uint8_t ** rgbPlanes = image->rgbPlanes; @@ -288,8 +288,8 @@ const float kr = state->kr; const float kg = state->kg; const float kb = state->kb; - const uint32_t maxUVI = (image->width > 1) ? ((image->width+state->formatInfo.chromaShiftX) >> state->formatInfo.chromaShiftX) - 1 : 0; - const uint32_t maxUVJ = (image->height > 1) ? ((image->height+state->formatInfo.chromaShiftY) >> state->formatInfo.chromaShiftY) - 1 : 0; + const uint32_t maxUVI = ((image->width + state->formatInfo.chromaShiftX) >> state->formatInfo.chromaShiftX) - 1; + const uint32_t maxUVJ = ((image->height + state->formatInfo.chromaShiftY) >> state->formatInfo.chromaShiftY) - 1; float maxChannel = (float)((1 << image->depth) - 1); uint8_t ** rgbPlanes = image->rgbPlanes;