If you have plans to repaint a room but have discovered mildew stains, you definitely need to treat the mildew before you paint, because it will bleed through the new layer of paint.
You can use a commercially available product to treat mildew on walls, the most commonly used one called Kilz. However, you can make your own mildew treatment at home to wash and treat mildew before painting.
In a bucket, mix 1 part bleach with 3 parts warm water. Using a rag or sponge, clean the affected area, as well as a foot or two on each side, to take care of any mildew that isn’t easily visible. Once dry, paint as normal.