Input-output model of pulsed quantum optics