QuadCopter Throttle and PID mixing to motor speed

Hi,

How can we determine speed of motor based on throttle and PID mixing to motor speed ?

The Below Code is from Brokking.net - Project YMFC-AL - The Arduino auto-level quadcopter - Downloads.

    esc_1 = throttle - pid_output_pitch + pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 1 (front-right - CCW)
    esc_2 = throttle + pid_output_pitch + pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 2 (rear-right - CW)
    esc_3 = throttle + pid_output_pitch - pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 3 (rear-left - CCW)
    esc_4 = throttle - pid_output_pitch - pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 4 (front-left - CW)

This is 'X' Quad

and Another One is https://github.com/benripley/Arduino-Quadcopter/blob/master/Quadcopter/Control.ino

  // yaw control disabled for stabilization testing...
  m0 = throttle + pid_pitch_out ;//+ pid_yaw_out;
  m1 = throttle + pid_roll_out ;//- pid_yaw_out;
  m2 = throttle - pid_pitch_out ;//+ pid_yaw_out;
m3 = throttle - pid_roll_out ;//- pid_yaw_out;

I think this is '+' Quad

any explanation for both of these ?

Anyone who is looking for explanation check this link

http://www.rcindia.org/multirotors/arduino-quadcopter/new/#new