1. A coding method, comprising: acquiring, by an encoder, characteristic parameters of an input signal, wherein the encoder is implemented by hardware; determining, by the encoder, a type of the input signal according to the characteristic parameters, wherein the type of the input signal comprises a periodic characteristic or a white noise characteristic; obtaining, by the encoder, vectors to be quantified according to the characteristic parameters; and performing, by the encoder, a codebook search on the vectors to be quantified with a codebook search algorithm corresponding to the type of the input signal, wherein the codebook search algorithm comprises a first-class codebook search algorithm when the type of the input signal comprises the periodic characteristic wherein the codebook search algorithm comprises a second-class codebook search algorithm when the type of the input signal comprises the white noise characteristic and wherein a computation complexity of the first-class codebook search algorithm is lower than a computation complexity of the second-class search algorithm.