@@ -64,8 +64,9 @@ int stft_process_source_s32(struct stft_comp_data *cd, struct sof_source *source
6464 }
6565
6666 /* One of the buffers needs a wrap (or end of data), so check for wrap */
67- x = (x >= x_end ) ? x - x_size : x ;
6867 w = stft_process_buffer_wrap (ibuf , w );
68+ if (x >= x_end )
69+ x -= x_size ;
6970
7071 /* Update processed samples count for next loop iteration. */
7172 frames_left -= n ;
@@ -131,8 +132,9 @@ int stft_process_sink_s32(struct stft_comp_data *cd, struct sof_sink *sink, int
131132 }
132133
133134 /* One of the buffers needs a wrap (or end of data), so check for wrap */
134- y = (y >= y_end ) ? y - y_size : y ;
135135 r = stft_process_buffer_wrap (obuf , r );
136+ if (y >= y_end )
137+ y -= y_size ;
136138
137139 /* Update processed samples count for next loop iteration. */
138140 frames_remain -= n ;
@@ -206,8 +208,9 @@ int stft_process_source_s16(struct stft_comp_data *cd, struct sof_source *source
206208 }
207209
208210 /* One of the buffers needs a wrap (or end of data), so check for wrap */
209- x = (x >= x_end ) ? x - x_size : x ;
210211 w = stft_process_buffer_wrap (ibuf , w );
212+ if (x >= x_end )
213+ x -= x_size ;
211214
212215 /* Update processed samples count for next loop iteration. */
213216 frames_left -= n ;
@@ -273,8 +276,9 @@ int stft_process_sink_s16(struct stft_comp_data *cd, struct sof_sink *sink, int
273276 }
274277
275278 /* One of the buffers needs a wrap (or end of data), so check for wrap */
276- y = (y >= y_end ) ? y - y_size : y ;
277279 r = stft_process_buffer_wrap (obuf , r );
280+ if (y >= y_end )
281+ y -= y_size ;
278282
279283 /* Update processed samples count for next loop iteration. */
280284 frames_remain -= n ;
0 commit comments