Although numerous algorithms have been proposed for background subtraction with demonstrated success, it remains a challenging problem. One of the main reasons is the lack of effective background model to account for the complex variations of backgrounds. Although researchers have strived to obtain a background model effectively attenuating false positives from dynamic background variations, their methods are still sensitive to structured motion patterns of background (e. g., waving leaves, rippling water, spouting fountain, etc.). In this paper, inspired by the bag-of-features framework, we present a simple, novel, yet powerful approach for background subtraction. It relies on the hypothesis that texture variations in the background scenes can be well attenuated by effectively encoding the local color and texture information. Specifically, the proposed method adopts joint domain-range features, which are encoded in the soft-assignment coding procedure. We also propose a novel method for deciding the appropriate kernel variances in the soft-assignment coding, which result in strong adaptability and robustness to dynamic scenes compared to employing fixed kernel variances. Experimental results demonstrate that our proposed method is able to handle severe textural variations of backgrounds and perform favorably against the state-of-the-art methods.