A novel scheme for ultrahigh-speed all-optical encoder based on four-wave mixing (FWM) in semiconductor optical amplifiers (SOAs) with PolSK modulated signals is proposed. Considering the polarization dependency of SOA, a comprehensive polarization-dependent broad-band dynamic model is presented. By numerical simulation, this kind of all-optical encoder is theoretically realized, and the effects of two input signal powers, injected current, and polarization dependency of SOA on the output performance of the encoder are analyzed.