Patent ID: 8423371

Claim:
An encoding apparatus comprising: a first encoder that encodes an input signal and generates first encoded information; a decoder that decodes the first encoded information and generates a decoded signal; a characteristic deciding processor that analyzes a stability of a harmonic structure of the input signal and generates harmonic characteristic information showing an analysis result; and a second encoder that generates second encoded information by encoding a difference of the decoded signal with respect to the input signal, and, based on the harmonic characteristic information, changes a number of bits to allocate to a plurality of parameters forming the second encoded information, wherein the second encoder comprises a gain encoder that encodes a gain of the input final using a gain codebook comprising a plurality of code vectors; and the gain encoder decreases a number of code vectors used to encode the gain when the harmonic characteristic information is equal to or greater than a first threshold, or increases the number of code vectors used to encode the gain when the harmonic characteristic information is less than the first threshold.