From c78021062466ca7d519f4ef1dfccc744e570fa93 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 7 Jun 2024 11:53:41 +0200 Subject: [PATCH] [rfx,dwt] cleanup variables --- libfreerdp/codec/rfx_dwt.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/libfreerdp/codec/rfx_dwt.c b/libfreerdp/codec/rfx_dwt.c index 521de26e6..466f3246a 100644 --- a/libfreerdp/codec/rfx_dwt.c +++ b/libfreerdp/codec/rfx_dwt.c @@ -28,16 +28,6 @@ static INLINE void rfx_dwt_2d_decode_block(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT idwt, size_t subband_width) { - INT16* dst = NULL; - INT16* l = NULL; - INT16* h = NULL; - INT16* l_dst = NULL; - INT16* h_dst = NULL; - INT16* hl = NULL; - INT16* lh = NULL; - INT16* hh = NULL; - INT16* ll = NULL; - const size_t total_width = subband_width << 1; /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. @@ -46,13 +36,13 @@ static INLINE void rfx_dwt_2d_decode_block(INT16* WINPR_RESTRICT buffer, INT16* /* The lower part L uses LL(3) and HL(0). */ /* The higher part H uses LH(1) and HH(2). */ - ll = buffer + subband_width * subband_width * 3; - hl = buffer; - l_dst = idwt; + const INT16* ll = buffer + subband_width * subband_width * 3; + const INT16* hl = buffer; + INT16* l_dst = idwt; - lh = buffer + subband_width * subband_width; - hh = buffer + subband_width * subband_width * 2; - h_dst = idwt + subband_width * subband_width * 2; + const INT16* lh = buffer + subband_width * subband_width; + const INT16* hh = buffer + subband_width * subband_width * 2; + INT16* h_dst = idwt + subband_width * subband_width * 2; for (size_t y = 0; y < subband_width; y++) { @@ -91,9 +81,9 @@ static INLINE void rfx_dwt_2d_decode_block(INT16* WINPR_RESTRICT buffer, INT16* /* Inverse DWT in vertical direction, results are stored in original buffer. */ for (size_t x = 0; x < total_width; x++) { - l = idwt + x; - h = idwt + x + subband_width * total_width; - dst = buffer + x; + const INT16* l = idwt + x; + const INT16* h = idwt + x + subband_width * total_width; + INT16* dst = buffer + x; *dst = *l - ((*h * 2 + 1) >> 1);