From: Andre Noll Date: Thu, 8 Dec 2016 23:22:57 +0000 (+0100) Subject: wmadec: Remove two pointless variables. X-Git-Tag: v0.5.7~11^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=83155daccd3c33663ebf419315142c2d26bb59cf;ds=sidebyside wmadec: Remove two pointless variables. The local variables n and incr of wma_decode_frame() shadow the values of their counterparts in struct private_wmadec_data, and they remain constant within the function. Referring directly to the private structure instead makes the code shorter and improves readability. --- diff --git a/wmadec_filter.c b/wmadec_filter.c index cb366057..31a13c50 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -1028,7 +1028,7 @@ static inline int16_t av_clip_int16(int a) /* Decode a frame of frame_len samples. */ static int wma_decode_frame(struct private_wmadec_data *pwd, int16_t *samples) { - int ret, i, n, ch, incr; + int ret, i, ch; int16_t *ptr; float *iptr; @@ -1043,15 +1043,13 @@ static int wma_decode_frame(struct private_wmadec_data *pwd, int16_t *samples) } /* convert frame to integer */ - n = pwd->frame_len; - incr = pwd->ahi.channels; for (ch = 0; ch < pwd->ahi.channels; ch++) { ptr = samples + ch; iptr = pwd->frame_out[ch]; - for (i = 0; i < n; i++) { + for (i = 0; i < pwd->frame_len; i++) { *ptr = av_clip_int16(lrintf(*iptr++)); - ptr += incr; + ptr += pwd->ahi.channels; } /* prepare for next block */ memmove(&pwd->frame_out[ch][0], &pwd->frame_out[ch][pwd->frame_len],