An encoding apparatus, characterized in that the apparatus comprises a polarization splitter-rotator, PSR, a polarization rotation structure, and a modulator, wherein the PSR has three ports, and is configured to receive an input signal light by using a first port of the PSR, split the input signal light into a first polarized light and a second polarized light, send the first polarized light to the polarization rotation structure by using a second port of the PSR, and send the second polarized light to the modulator by using a third port of the PSR, wherein a polarization mode of the first polarized light is the same as a polarization mode of the second polarized light, by rotation of only one of the first and second polarized lights; the polarization rotation structure is configured to rotate a polarization direction of the first polarized light by 180 degrees to obtain a rotated first polarized light, and send the rotated first polarized light to the modulator; the modulator is configured to modulate the rotated first polarized light to obtain a first signal light, and send the first signal light to the third port of the PSR; and is further configured to modulate the second polarized light to obtain a second signal light, and send the second signal light to the polarization rotation structure; the polarization rotation structure is further configured to send the second signal light without applying any rotation to the second port of the PSR; and the PSR is further configured to combine the first signal light and the second signal light to obtain an output signal light, and send the output signal light by using the first port of the PSR, wherein a polarization direction of the output signal light is perpendicular to a polarization direction of the input signal light. the PSR has three ports, and is configured to receive an input signal light by using a first port of the PSR, split the input signal light into a first polarized light and a second polarized light, send the first polarized light to the polarization rotation structure by using a second port of the PSR, and send the second polarized light to the modulator by using a third port of the PSR, wherein a polarization mode of the first polarized light is the same as a polarization mode of the second polarized light, by rotation of only one of the first and second polarized lights; the polarization rotation structure is configured to rotate a polarization direction of the first polarized light by 180 degrees to obtain a rotated first polarized light, and send the rotated first polarized light to the modulator; the modulator is configured to modulate the rotated first polarized light to obtain a first signal light, and send the first signal light to the third port of the PSR; and is further configured to modulate the second polarized light to obtain a second signal light, and send the second signal light to the polarization rotation structure; the polarization rotation structure is further configured to send the second signal light without applying any rotation to the second port of the PSR; and the PSR is further configured to combine the first signal light and the second signal light to obtain an output signal light, and send the output signal light by using the first port of the PSR, wherein a polarization direction of the output signal light is perpendicular to a polarization direction of the input signal light.