raa_prime_encode: rework is_z_seq() to improve performanceChange-Id: I43f4a85102114b51a8f2d9fa8fe3b941800b56fa