Signal encoding method and device and signal decoding method and device
A spectrum encoding method includes selecting an important spectral component in band units for a normalized spectrum and encoding information of the selected important spectral component for a band, based on a number, a position, a magnitude and a sign thereof. A spectrum decoding method includes obtaining from a bitstream, information about an important spectral component for a band of an encoded spectrum and decoding the obtained information of the important spectral component, based on a number, a position, a magnitude and a sign of the important spectral component.
1. An encoding apparatus for an audio signal, the encoding apparatus comprising:
a memory storing instructions; and
at least one processor configured to execute the instructions to:
perform scaling on a normalized spectrum based on bit allocation of a band;
select at least one important spectral component from the scaled spectrum of the band; and
encode a magnitude of the selected at least one important spectral component, and at least one of a number, a position and a sign of the selected at least one important spectral component,
wherein the magnitude of the selected at least one important spectral component is encoded using one selected from trellis coded quantization and uniform scalar quantization,
wherein the at least one of the number, the position and the sign of the selected important spectral component is encoded using an arithmetic coding,
wherein if an average number of bits for samples in the band is greater than or equal to a predetermined value, the uniform scalar quantization is selected, and
wherein if the average number of bits for samples in the band is less than the predetermined value, the trellis coded quantization is selected.
2. The encoding apparatus of claim 1 , wherein the trellis coded quantization uses an 8-state 4-coset trellis structure with 2 zero levels.
3. The encoding apparatus of claim 1 , wherein if the bit allocation for the band is zero, all samples included in the band are encoded to zero.
4. A decoding apparatus for an audio signal, the decoding apparatus comprising:
a memory storing instructions; and
at least one processor configured to execute the instructions to:
obtain, from a bitstream, information about at least one important spectral component for a normalized spectrum of a band; and
decode the obtained information of the at least one important spectral component based on a magnitude of the at least one important spectral component, and at least one of a number, a position and a sign of the at least one important spectral component to recover spectral components,
wherein the magnitude of the at least one important spectral component is decoded by using a dequantization scheme which is one selected from trellis coded quantization and uniform scalar quantization,
wherein the at least one of the number, the position and the sign of the at least one important spectral component is decoded by using an arithmetic decoding,
wherein the recovered spectral components are inverse-scaled,
wherein if an average number of bits for samples in the band is greater than or equal to a predetermined value, the uniform scalar quantization is selected, and
wherein if the average number of bits for samples in the band is less than the predetermined value, the trellis coded quantization is selected.
5. The decoding apparatus of claim 4 , wherein the trellis coded quantization uses an 8-state 4-coset trellis structure with 2 zero levels.
6. The decoding apparatus of claim 4 , wherein if a bit allocation for the band is zero, all samples included in the band are decoded to zero.