Brake horsepower (bhp) is the measure of an engine's horsepower without the loss in power caused by the gearbox, alternator, differential, water pump, and other auxiliary components such as power steering pump, muffled exhaust system, etc. Brake refers to a device which was used to load an engine and hold it at a desired RPM. During testing, the output torque and rotational speed were measured to determine the brake horsepower.
The above part is taken from Wikipedia
The engine develops some power , but due to resistance from various friction , 100% engine power is not got at the wheels . This is bhp and ps in German calculation.
Literally power is calculated in watt.
The method of calculation which you asked - i too don't know .
Simple they measure with a device. The procedure , i don't know