def __window_ss_fill(x, win_sq, n_frames, hop_length):
    """Helper function for window sum-square calculation."""
    n = len(x)
    n_fft = len(win_sq)
    for i in range(n_frames):
        sample = i * hop_length
        x[sample:min(n, sample + n_fft)] += win_sq[:max(0, min(n_fft, n -
            sample))]
