Add a new log to record QP.
Update calculation of PREV_QP_y.