In this note, we study square integrable representations of a real reductive Lie group with admissible restriction to some reductive subgroup. We give a simple condition which insures admissibility of the restriction, and which allows to compute the branching numbers in a simple explicit manner by means of partition functions, generalizing the multiplicity formulas due to Kostant-Heckman and Hecht-Schmid. We consider also the semi-classical analogue of these results for coadjoint orbits.