add fast quality calculate function