Pull up the carpet to an extent that you can make a tent of it.
place several fans to direct under the tent to dry out the area.
You may have to pull up the pads and I would recommend it. Pad are cheap and I would consider just putting in a new pad in the affected area.
Spray the area with lysol disenfectant and also sprinkly alot of baking soda in the area. One will kill the mildew and the other will absorb any odors.
You need to allow alot of air to circulate under the carpet.
In most cases the odor will leave and the carpet itself will be ok. do change out the pad in the affected area only.