Audio encoding method and audio encoding device

Through the use of band extended encoding and spectrum retention flags, the problem of low encoding efficiency of audio signals is solved, and efficient encoding and transmission of audio signals is realized.

CN113808596BActive Publication Date: 2025-01-03HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010480925.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-30
Publication Date
2025-01-03
Estimated Expiration
2040-05-30

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve the encoding efficiency of audio signals, especially when transmitting audio signals under limited bandwidth. How to improve the encoding efficiency of audio signals has become a technical problem that needs to be solved urgently.

Method used

By acquiring the current frame of the audio signal, band spread encoding is performed, and the high-band signal is secondly encoded according to the spectrum reservation flag to avoid repeated encoding of the tone components that have been retained in the band spread encoding, thereby improving encoding efficiency.

Benefits of technology

It improves the encoding efficiency of audio signals, reduces the redundancy of code streams, and optimizes the transmission performance of audio signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113808596B_ABST
    Figure CN113808596B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an audio coding method and an audio coding device for improving the coding efficiency of an audio signal. In the audio coding method, a current frame of an audio signal is obtained, the current frame includes a high-frequency band signal and a low-frequency band signal; the high-frequency band signal and the low-frequency band signal are first coded to obtain a first coding parameter of the current frame, the first coding includes a band extension coding; a spectrum reservation flag of each frequency point of the high-frequency band signal is determined, the spectrum reservation flag is used to indicate whether the first spectrum corresponding to the frequency point is reserved in the second spectrum corresponding to the frequency point; the high-frequency band signal is second coded according to the spectrum reservation flag of each frequency point of the high-frequency band signal to obtain a second coding parameter of the current frame, the second coding parameter is used to represent information of a target tone component of the high-frequency band signal; the first coding parameter and the second coding parameter are multiplexed to obtain a coded code stream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of audio signal encoding, and in particular to an audio encoding method and an audio encoding device. Background Art

[0002] As the quality of life improves, people's demand for high-quality audio continues to increase. In order to better transmit audio signals using limited bandwidth, it is necessary to encode the audio signal first, and then transmit the encoded bit stream to the decoder. The decoder decodes the received bit stream to obtain the decoded audio signal, which is used for playback.

[0003] Among them, how to improve the coding efficiency of audio signals has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present application provide an audio encoding method and an audio encoding device for improving the encoding efficiency of audio signals.

[0005] To solve the above technical problems, the present application provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides an audio encoding method, comprising: acquiring a current frame of an audio signal, the current frame comprising a high-frequency band signal and a low-frequency band signal; performing a first encoding on the high-frequency band signal and the low-frequency band signal to obtain a first encoding parameter of the current frame, the first encoding comprising a frequency band extension encoding; determining a spectrum reservation flag for each frequency point of the high-frequency band signal, the spectrum reservation flag being used to indicate whether a first spectrum corresponding to the frequency point is reserved in a second spectrum corresponding to the frequency point, wherein the first spectrum comprises a spectrum before the frequency band extension encoding corresponding to the frequency point, and the second spectrum comprises a spectrum after the frequency band extension encoding corresponding to the frequency point; performing a second encoding on the high-frequency band signal according to the spectrum reservation flag for each frequency point of the high-frequency band signal to obtain a second encoding parameter of the current frame, the second encoding parameter being used to represent information of a target tone component of the high-frequency band signal, the tone component information comprising position information, quantity information, and amplitude information or energy information of the tone component; performing code stream multiplexing on the first encoding parameter and the second encoding parameter to obtain an encoded code stream. In an embodiment of the present application, the first encoding process includes frequency band extension coding, and a spectrum retention flag of each frequency point of the high-band signal can be determined based on the spectrum of the high-band signal before and after the frequency band extension coding. The spectrum retention flag indicates whether the spectrum of the frequency point in the high-band signal from before the frequency band extension coding to after the frequency band extension coding is retained. The high-band signal is secondly encoded based on the spectrum retention flag of each frequency point of the high-band signal. The spectrum retention flag of each frequency point of the high-band signal can be used to avoid repeated encoding of the tone components that have been retained in the frequency band extension coding, thereby improving the coding efficiency of the tone components.

[0007] In a possible implementation, the spectrum reservation mark of each frequency point of the high-frequency band signal is determined, including: according to the first spectrum, the second spectrum, and the frequency range of the band extension coding, the spectrum reservation mark of each frequency point of the high-frequency band signal is determined. In the above scheme, in the process of band extension coding, the signal spectrum before the band extension coding (i.e. the first spectrum), the signal spectrum after the band extension coding (i.e. the second spectrum), and the frequency range of the band extension coding can be obtained. The frequency range of the band extension coding can be the frequency point range of the band extension coding, for example, the frequency range of the band extension coding includes: the starting frequency point and the cut-off frequency point of the intelligent gap filling process. The frequency range of the band extension coding can also be characterized in other ways, for example, according to the starting frequency value and the cut-off frequency value of the band extension coding, the frequency range of the band extension coding is characterized.

[0008] In a possible implementation, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; the second encoding of the high frequency band signal according to the spectrum retention flag of each frequency point of the high frequency band signal to obtain the second encoding parameter of the current frame includes: performing a peak search according to the high frequency band signal of the current frequency region to obtain the peak information of the current frequency region, and the peak information of the current frequency region includes: the peak quantity information, peak position information, and peak amplitude information or peak energy information of the current frequency region; performing peak screening on the peak information of the current frequency region according to the spectrum retention flag of each frequency point of the current frequency region to obtain the information of the candidate tone components of the current frequency region; obtaining the information of the target tone components of the current frequency region according to the information of the candidate tone components of the current frequency region; obtaining the second encoding parameter of the current frequency region according to the information of the target tone components of the current frequency region. In the above scheme, according to the spectrum retention flag of each frequency point in the current frequency region, the peak information of the current frequency region is peak screened to obtain the information of the candidate tone components in the current frequency region. The spectrum retention flag of each frequency point of the high-frequency band signal can be used to avoid repeated encoding of the tone components that have been reserved in the band extension coding, thereby improving the coding efficiency of the tone components.

[0009] In a possible implementation, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; when the first frequency point in the current frequency region does not belong to the frequency range of the band extension coding, the value of the spectrum reservation flag of the first frequency point is a first preset value; or, when the second frequency point in the current frequency region belongs to the frequency range of the band extension coding, if the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point meet the preset condition, the value of the spectrum reservation flag of the second frequency point is a second preset value; or, if the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point do not meet the preset condition, the value of the spectrum reservation flag of the second frequency point is a third preset value. Specifically, the audio encoding device first determines whether one or more frequency points in the current frequency region belong to the frequency range of the band extension coding, for example, defines the first frequency point as a frequency point in the current frequency region that does not belong to the frequency range of the band extension coding, and defines the second frequency point as a frequency point in the current frequency region that belongs to the frequency range of the band extension coding. Then the value of the spectrum reservation flag of the first frequency point is the first preset value, and the value of the spectrum reservation flag of the second frequency point has two values, for example, the second preset value and the third preset value, specifically, when the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point meet the preset conditions, the value of the spectrum reservation flag of the second frequency point is the second preset value, and when the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point do not meet the preset conditions, the value of the spectrum reservation flag of the second frequency point is the third preset value. There are many ways to implement the preset conditions, which are not limited here. For example, the preset conditions are conditions set for the spectrum values ​​before the band extension coding and the spectrum values ​​after the band extension coding, which can be determined in combination with the application scenario.

[0010] In a possible implementation, the current frequency region includes at least one sub-band, and the peak information of the current frequency region is peak screened according to the spectrum retention flag of each frequency point in the current frequency region to obtain information about candidate tone components in the current frequency region, including: obtaining the spectrum retention flag of each sub-band in the current frequency region according to the spectrum retention flag of each frequency point in the current frequency region; and peak screening the peak information of the current frequency region according to the spectrum retention flag of each sub-band in the current frequency region to obtain information about candidate tone components in the current frequency region. In an embodiment of the present application, the spectrum retention flag of each sub-band in the current frequency region can be used to avoid repeated encoding of tone components that have been reserved in band extension coding, thereby improving the coding efficiency of tone components.

[0011] In a possible implementation, the at least one subband includes a current subband; the obtaining of the spectrum reservation flag of each subband in the current frequency region according to the spectrum reservation flag of each frequency point in the current frequency region includes: if the number of frequency points whose values ​​of the spectrum reservation flag in the current subband are equal to the second preset value is greater than a preset threshold, determining the value of the spectrum reservation flag of the current subband to be a first flag value, wherein if the spectrum value before band extension coding and the spectrum value after band extension coding corresponding to a frequency point meet a preset condition, the value of the spectrum reservation flag of the frequency point is the second preset value; or, if the number of frequency points whose values ​​of the spectrum reservation flag in the current subband are equal to the second preset value is less than or equal to the preset threshold, determining the value of the spectrum reservation flag of the current subband to be a second flag value. The first flag value is used to indicate that the number of frequency points whose values ​​of the spectrum reservation flag in the current subband are equal to the second preset value is greater than a preset threshold, and if the spectrum value before band extension coding and the spectrum value after band extension coding corresponding to a frequency point meet a preset condition, the value of the spectrum reservation flag of the frequency point is the second preset value, and the frequency point is a frequency point in the current subband. The second flag value is used to indicate that the number of frequency points where the value of the spectrum reservation flag in the current sub-band is equal to the second preset value is less than or equal to the preset threshold. The spectrum reservation flag of the current sub-band may have multiple values, for example, the spectrum reservation flag of the current sub-band is the first flag value, or the spectrum reservation flag of the current sub-band is the second flag value, which may be specifically determined based on the number of frequency points where the spectrum reservation flag in the current sub-band is equal to the second preset value.

[0012] In a possible implementation, the peak information of the current frequency region is peak filtered according to the spectrum reservation flag of each sub-band in the current frequency region to obtain the information of the candidate tone components of the current frequency region, including: obtaining the sub-band sequence number corresponding to the peak position of the current frequency region according to the peak position information of the current frequency region; performing peak filtering on the peak information of the current frequency region according to the sub-band sequence number corresponding to the peak position of the current frequency region and the spectrum reservation flag of each sub-band in the current frequency region to obtain the information of the candidate tone components of the current frequency region. Wherein, according to the sub-band sequence number corresponding to the peak position of the current frequency region and the spectrum reservation flag of each sub-band in the current frequency region, the peak information of the current frequency region is peak filtered to obtain the peak quantity information, peak position information and peak amplitude information or energy information after filtering in the current frequency region as the information of the candidate tone components of the current frequency region. In the embodiment of the present application, the spectrum reservation flag of each sub-band in the current frequency region can be used to avoid repeated encoding of the tone components that have been reserved in the band extension coding, thereby improving the coding efficiency of the tone components.

[0013] In a possible implementation, if the value of the spectrum reservation flag of the current sub-band is the second flag value, the peak in the current sub-band is a candidate tone component. The second flag value is used to indicate that the number of frequency points whose value of the spectrum reservation flag in the current sub-band is equal to the second preset value is less than or equal to a preset threshold value. If the value of the spectrum reservation flag of the current sub-band is the second flag value, it means that the spectrum of the current sub-band is not reserved in the frequency band extension coding. Therefore, the candidate tone component can be determined by the value of the spectrum reservation flag of the current sub-band being the second flag value.

[0014] In a possible implementation, the preset condition includes: the spectrum value before the band extension coding corresponding to the frequency point is equal to the spectrum value after the band extension coding. Specifically, the preset condition may be that the spectrum value before the band extension coding corresponding to the frequency point is equal to the spectrum value after the band extension coding. Among them, the preset condition may be that the spectrum value before and after the band extension coding does not change, that is, the spectrum value before the band extension coding corresponding to the frequency point is equal to the spectrum value after the band extension coding. For another example, the preset condition may also be that the absolute value of the difference between the spectrum value before the band extension coding corresponding to the frequency point and the spectrum value after the band extension coding is less than or equal to a preset threshold. Among them, the preset condition is based on the fact that there may be a certain difference between the spectrum values ​​before and after the band extension coding, but the spectrum information has been retained, that is, the difference between the spectrum value before the band extension coding corresponding to the frequency point and the spectrum value after the band extension coding is less than the preset threshold. In the embodiment of the present application, the spectrum retention flag of each frequency point of the high-frequency band signal is determined by judging the preset conditions. According to the spectrum retention flag of each frequency point of the high-frequency band signal, it is possible to avoid repeated encoding of the tone components that have been reserved in the band extension coding, thereby improving the coding efficiency of the tone components.

[0015] In a second aspect, an embodiment of the present application further provides an audio encoding device, comprising: an acquisition module, used to acquire a current frame of an audio signal, the current frame comprising a high-frequency band signal and a low-frequency band signal; a first encoding module, used to perform a first encoding on the high-frequency band signal and the low-frequency band signal to obtain a first encoding parameter of the current frame, the first encoding comprising a frequency band extension encoding; a flag determination module, used to determine a spectrum reservation flag for each frequency point of the high-frequency band signal, the spectrum reservation flag being used to indicate whether a first spectrum corresponding to the frequency point is reserved in a second spectrum corresponding to the frequency point, wherein the first spectrum comprises a spectrum before the frequency band extension encoding corresponding to the frequency point, and the second spectrum comprises a spectrum after the frequency band extension encoding corresponding to the frequency point; a second encoding module, used to perform a second encoding on the high-frequency band signal according to the spectrum reservation flag of each frequency point of the high-frequency band signal to obtain a second encoding parameter of the current frame, the second encoding parameter being used to represent information of a target tone component of the high-frequency band signal, the tone component information comprising position information, quantity information, and amplitude information or energy information of the tone component; a code stream multiplexing module, used to perform code stream multiplexing on the first encoding parameter and the second encoding parameter to obtain a coded code stream. In an embodiment of the present application, the first encoding process includes frequency band extension coding, and a spectrum retention flag of each frequency point of the high-band signal can be determined based on the spectrum of the high-band signal before and after the frequency band extension coding. The spectrum retention flag indicates whether the spectrum of the frequency point in the high-band signal from before the frequency band extension coding to after the frequency band extension coding is retained. The high-band signal is secondly encoded based on the spectrum retention flag of each frequency point of the high-band signal. The spectrum retention flag of each frequency point of the high-band signal can be used to avoid repeated encoding of the tone components that have been retained in the frequency band extension coding, thereby improving the coding efficiency of the tone components.

[0016] In a possible implementation, the flag determination module is specifically configured to determine a spectrum reservation flag of each frequency point of the high-band signal according to the first spectrum, the second spectrum, and a frequency range of the frequency band extension coding.

[0017] In a possible implementation, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; the second encoding module is specifically used to: perform peak search according to the high frequency band signal of the current frequency region to obtain peak information of the current frequency region, and the peak information of the current frequency region includes: peak quantity information, peak position information, and peak amplitude information or peak energy information of the current frequency region; perform peak screening on the peak information of the current frequency region according to the spectrum retention flag of each frequency point of the current frequency region to obtain information of candidate tone components of the current frequency region; obtain information of target tone components of the current frequency region according to the information of candidate tone components of the current frequency region; obtain second encoding parameters of the current frequency region according to the information of target tone components of the current frequency region.

[0018] In a possible implementation, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; when a first frequency point in the current frequency region does not belong to the frequency range of the band extension coding, the value of the spectrum reservation flag of the first frequency point is a first preset value; or, when a second frequency point in the current frequency region belongs to the frequency range of the band extension coding, if the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point meet a preset condition, the value of the spectrum reservation flag of the second frequency point is a second preset value; or, if the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point do not meet the preset condition, the value of the spectrum reservation flag of the second frequency point is a third preset value.

[0019] In one possible implementation, the current frequency region includes at least one subband, and the second encoding module is specifically used to: obtain a spectrum retention flag of each subband in the current frequency region according to a spectrum retention flag of each frequency point in the current frequency region; and perform peak screening on peak information of the current frequency region according to the spectrum retention flag of each subband in the current frequency region to obtain information on candidate tone components of the current frequency region.

[0020] In a possible implementation, the at least one subband includes a current subband; the second encoding module is specifically used to: if the number of frequency points whose value of the spectrum reservation flag in the current subband is equal to a second preset value is greater than a preset threshold, determine that the value of the spectrum reservation flag of the current subband is a first flag value, wherein if the spectrum value before band extension coding and the spectrum value after band extension coding corresponding to a frequency point meet a preset condition, determine that the value of the spectrum reservation flag of the frequency point is the second preset value; or, if the number of frequency points whose value of the spectrum reservation flag in the current subband is equal to the second preset value is less than or equal to the preset threshold, the value of the spectrum reservation flag of the current subband is the second flag value.

[0021] In a possible implementation, the second encoding module is specifically used to: obtain the subband sequence number corresponding to the peak position of the current frequency region based on the peak position information of the current frequency region; perform peak screening on the peak information of the current frequency region based on the subband sequence number corresponding to the peak position of the current frequency region and the spectrum retention flag of each subband in the current frequency region to obtain information on candidate tonal components of the current frequency region.

[0022] In a possible implementation manner, if the value of the spectrum reservation flag of the current sub-band is the second flag value, the peak value in the current sub-band is a candidate tone component.

[0023] In a possible implementation manner, the preset condition includes: a spectrum value before frequency band extension coding corresponding to a frequency point is equal to a spectrum value after frequency band extension coding.

[0024] In the second aspect of the present application, the constituent modules of the audio encoding device may also execute the steps described in the aforementioned first aspect and various possible implementations. For details, please refer to the aforementioned description of the first aspect and various possible implementations.

[0025] In a third aspect, an embodiment of the present application provides an audio encoding device, comprising: a non-volatile memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to perform a method as described in any one of the above-mentioned first aspects.

[0026] In a fourth aspect, an embodiment of the present application provides an audio encoding device, comprising: an encoder, wherein the encoder is used to execute a method as described in any one of the above-mentioned first aspects.

[0027] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising a computer program, wherein when the computer program is executed on a computer, the computer executes any one of the methods described in the first aspect.

[0028] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising a coded bit stream obtained according to any one of the methods in the first aspect above.

[0029] In a seventh aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by a computer, it is used to execute any one of the methods in the first aspect above.

[0030] In an eighth aspect, the present application provides a chip comprising a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute a method as described in any one of the above-mentioned first aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of an example of an audio encoding and decoding system in an embodiment of the present application;

[0032] Figure 2 A schematic diagram of an audio coding application in an embodiment of the present application;

[0033] Figure 3 A schematic diagram of an audio coding application in an embodiment of the present application;

[0034] Figure 4 A flowchart of an audio encoding method according to an embodiment of the present application;

[0035] Figure 5 A flowchart of another audio encoding method according to an embodiment of the present application;

[0036] Figure 6 A flowchart of another audio encoding method according to an embodiment of the present application;

[0037] Figure 7 A flowchart of an audio decoding method according to an embodiment of the present application;

[0038] Figure 8 A schematic diagram of an audio encoding device according to an embodiment of the present application;

[0039] Fig. 9 A schematic diagram of an audio encoding device according to an embodiment of the present application. DETAILED DESCRIPTION

[0040] The embodiments of the present application provide an audio encoding method and an audio encoding device for improving the encoding efficiency of audio signals.

[0041] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0042] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0043] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single, multiple, or partly single and partly multiple.

[0044] The following describes the system architecture used in the embodiments of the present application. Figure 1 , Figure 1 A schematic block diagram of an audio encoding and decoding system 10 used in an embodiment of the present application is given as an example. Figure 1As shown, the audio encoding and decoding system 10 may include a source device 12 and a destination device 14, the source device 12 generating encoded audio data, and therefore, the source device 12 may be referred to as an audio encoding device. The destination device 14 may decode the encoded audio data generated by the source device 12, and therefore, the destination device 14 may be referred to as an audio decoding device. Various implementations of the source device 12, the destination device 14, or both may include one or more processors and a memory coupled to the one or more processors. The memory may include, but is not limited to, a random access memory (RAM), a read only memory (ROM), an electrically erasable programmable read only memory (EEPROM), a flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures that can be accessed by a computer, as described herein. Source device 12 and destination device 14 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, speakers, digital media players, video game consoles, in-vehicle computers, wireless communication devices, or the like.

[0045] Although Figure 1 The source device 12 and the destination device 14 are depicted as separate devices, but device embodiments may also include both the source device 12 and the destination device 14 or the functionality of both, i.e., the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality. In such embodiments, the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.

[0046] The source device 12 and the destination device 14 may be connected in communication via a link 13, and the destination device 14 may receive the encoded audio data from the source device 12 via the link 13. The link 13 may include one or more media or devices capable of moving the encoded audio data from the source device 12 to the destination device 14. In one example, the link 13 may include one or more communication media that enable the source device 12 to transmit the encoded audio data directly to the destination device 14 in real time. In this example, the source device 12 may modulate the encoded audio data according to a communication standard (e.g., a wireless communication protocol), and may transmit the modulated audio data to the destination device 14. The one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from the source device 12 to the destination device 14.

[0047] The source device 12 includes an encoder 20. Optionally, the source device 12 may also include an audio source 16, a preprocessor 18, and a communication interface 22. In a specific implementation, the encoder 20, the audio source 16, the preprocessor 18, and the communication interface 22 may be hardware components in the source device 12, or may be software programs in the source device 12. They are described as follows:

[0048] The audio source 16 may include or may be any type of sound capture device, for example, for capturing real-world sounds, and / or any type of audio generation device. The audio source 16 may be a microphone for capturing sounds or a memory for storing audio data, and the audio source 16 may also include any type of (internal or external) interface for storing previously captured or generated audio data and / or acquiring or receiving audio data. When the audio source 16 is a microphone, the audio source 16 may be, for example, a local or integrated microphone integrated in the source device; when the audio source 16 is a memory, the audio source 16 may be, for example, a local or integrated memory integrated in the source device. When the audio source 16 includes an interface, the interface may be, for example, an external interface for receiving audio data from an external audio source, and the external audio source may be, for example, an external sound capture device, such as a microphone, an external memory, or an external audio generation device. The interface may be any type of interface according to any proprietary or standardized interface protocol, such as a wired or wireless interface, an optical interface.

[0049] In the embodiment of the present application, the audio data transmitted from the audio source 16 to the pre-processor 18 may also be referred to as original audio data 17 .

[0050] The preprocessor 18 is used to receive the original audio data 17 and perform preprocessing on the original audio data 17 to obtain preprocessed audio 19 or preprocessed audio data 19. For example, the preprocessing performed by the preprocessor 18 may include filtering or denoising.

[0051] The encoder 20 (or audio encoder 20) is used to receive the pre-processed audio data 19 and to execute the various embodiments described below to implement the application of the audio encoding method described in this application on the encoding side.

[0052] The communication interface 22 can be used to receive the encoded audio data 21 and transmit the encoded audio data 21 to the destination device 14 or any other device (such as a memory) through the link 13 for storage or direct reconstruction. The other device can be any device for decoding or storage. The communication interface 22 can, for example, be used to encapsulate the encoded audio data 21 into a suitable format, such as a data packet, for transmission on the link 13.

[0053] The destination device 14 includes a decoder 30. Optionally, the destination device 14 may also include a communication interface 28, an audio post-processor 32, and a speaker device 34. They are described as follows:

[0054] The communication interface 28 can be used to receive the encoded audio data 21 from the source device 12 or any other source, such as a storage device, such as an encoded audio data storage device. The communication interface 28 can be used to transmit or receive the encoded audio data 21 via the link 13 between the source device 12 and the destination device 14 or via any type of network, such as a direct wired or wireless connection, any type of network, such as a wired or wireless network or any combination thereof, or any type of private and public network, or any combination thereof. The communication interface 28 can be used, for example, to decapsulate the data packets transmitted by the communication interface 22 to obtain the encoded audio data 21.

[0055] Both communication interface 28 and communication interface 22 may be configured as unidirectional communication interfaces or bidirectional communication interfaces and may be used, for example, to send and receive messages to establish connections, confirm and exchange any other information related to communication links and / or data transmissions such as encoded audio data transmissions.

[0056] The decoder 30 (or audio decoder 30) is used to receive the encoded audio data 21 and provide decoded audio data 31 or decoded audio 31. In some embodiments, the decoder 30 can be used to execute the various embodiments described below to implement the application of the audio encoding method described in this application on the decoding side.

[0057] The audio post-processor 32 is used to perform post-processing on the decoded audio data 31 (also called reconstructed audio data) to obtain post-processed audio data 33. The post-processing performed by the audio post-processor 32 may include, for example, rendering, or any other processing, and may also be used to transmit the post-processed audio data 33 to a speaker device 34.

[0058] A speaker device 34 is used to receive the post-processed audio data 33 to play the audio to, for example, a user or viewer. The speaker device 34 may be or include any type of speaker for presenting the reconstructed sound.

[0059] Although, Figure 1 The source device 12 and the destination device 14 are depicted as separate devices, but device embodiments may also include both the source device 12 and the destination device 14 or the functionality of both, i.e., the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality. In such embodiments, the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.

[0060] It is obvious to a person skilled in the art based on the description that the functionality or Figure 1 The presence and (accurate) division of the functionality of the source device 12 and / or destination device 14 shown may vary depending on the actual device and application. The source device 12 and the destination device 14 may include any of a variety of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, a mobile phone, a smart phone, a tablet or tablet computer, a video camera, a desktop computer, a set-top box, a television, a camera, a car device, a stereo, a digital media player, an audio game console, an audio streaming device (such as a content service server or a content distribution server), a broadcast receiver device, a broadcast transmitter device, smart glasses, a smart watch, etc., and may not use or use any type of operating system.

[0061] Both the encoder 20 and the decoder 30 may be implemented as any of a variety of suitable circuits, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the technology is partially implemented in software, the device may store the instructions of the software in a suitable non-transitory computer-readable storage medium, and may use one or more processors to execute the instructions in hardware to perform the technology of the present disclosure. Any of the foregoing (including hardware, software, a combination of hardware and software, etc.) may be considered one or more processors.

[0062] In some cases, Figure 1 The audio encoding and decoding system 10 shown in is only an example, and the technology of the present application can be applied to audio encoding settings (e.g., audio encoding or audio decoding) that do not necessarily include any data communication between encoding and decoding devices. In other examples, data can be retrieved from local storage, streamed on a network, etc. The audio encoding device can encode data and store the data in a memory, and / or the audio decoding device can retrieve data from a memory and decode the data. In some examples, encoding and decoding are performed by devices that do not communicate with each other but only encode data to a memory and / or retrieve data from a memory and decode data.

[0063] The encoder may be a multi-channel encoder, for example, a stereo encoder, a 5.1-channel encoder, or a 7.1-channel encoder, etc. Of course, it is understandable that the encoder may also be a mono encoder.

[0064] The above-mentioned audio data may also be referred to as an audio signal. The audio signal in the embodiment of the present application refers to an input signal in an audio encoding device. The audio signal may include multiple frames. For example, the current frame may specifically refer to a certain frame in the audio signal. The encoding and decoding of the current frame audio signal is used as an example in the embodiment of the present application. The previous frame or the next frame of the current frame in the audio signal can be encoded and decoded accordingly according to the encoding and decoding method of the current frame audio signal. The encoding and decoding process of the previous frame or the next frame of the current frame in the audio signal is no longer described one by one. In addition, the audio signal in the embodiment of the present application may be a monophonic audio signal, or it may be a multi-channel signal, for example, a stereo signal. Among them, the stereo signal may be an original stereo signal, or it may be a stereo signal composed of two signals (left channel signal and right channel signal) included in the multi-channel signal, or it may be a stereo signal composed of two signals generated by at least three signals included in the multi-channel signal, which is not limited in the embodiment of the present application.

[0065] For example, Figure 2 As shown, in this embodiment, the encoder 20 is arranged in the mobile terminal 230, and the decoder 30 is arranged in the mobile terminal 240. The mobile terminal 230 and the mobile terminal 240 are independent electronic devices with audio signal processing capabilities, such as mobile phones, wearable devices, virtual reality (VR) devices, or augmented reality (AR) devices, etc., and the mobile terminal 230 and the mobile terminal 240 are connected via a wireless or wired network.

[0066] Optionally, the mobile terminal 230 may include the audio source 16, the preprocessor 18, the encoder 20 and the channel encoder 232, wherein the audio source 16, the preprocessor 18, the encoder 20 and the channel encoder 232 are connected.

[0067] Optionally, the mobile terminal 240 may include a channel decoder 242, a decoder 30, an audio post-processor 32 and a speaker device 34, wherein the channel decoder 242, the decoder 30, the audio post-processor 32 and the speaker device 34 are connected.

[0068] After the mobile terminal 230 obtains the audio signal through the audio source 16, the audio is preprocessed by the preprocessor 18, and then the audio signal is encoded by the encoder 20 to obtain an encoded code stream; then, the encoded code stream is encoded by the channel encoder 232 to obtain a transmission signal.

[0069] The mobile terminal 230 sends the transmission signal to the mobile terminal 240 via a wireless or wired network.

[0070] After receiving the transmission signal, the mobile terminal 240 decodes the transmission signal through the channel decoder 242 to obtain a coded stream; decodes the coded stream through the decoder 30 to obtain an audio signal; processes the audio signal through the audio post-processor 32, and then plays the audio signal through the speaker device 34. It can be understood that the mobile terminal 230 can also include the various functional modules included in the mobile terminal 240, and the mobile terminal 240 can also include the functional modules included in the mobile terminal 230.

[0071] For example, Figure 3 As shown, the encoder 20 and the decoder 30 are set in a network element 350 with audio signal processing capability in the same core network or wireless network as an example for explanation. The network element 350 can implement transcoding, for example, converting the coded stream of other audio encoders (non-multi-channel encoders) into the coded stream of the multi-channel encoder. The network element 350 can be a media gateway, a transcoding device, or a media resource server of a wireless access network or a core network.

[0072] Optionally, the network element 350 includes a channel decoder 351, other audio decoders 352, an encoder 20 and a channel encoder 353. The channel decoder 351, other audio decoders 352, an encoder 20 and a channel encoder 353 are connected.

[0073] After receiving the transmission signal sent by other devices, the channel decoder 351 decodes the transmission signal to obtain a first coded stream; decodes the first coded stream through the other audio decoder 352 to obtain an audio signal; encodes the audio signal through the encoder 20 to obtain a second coded stream; and encodes the second coded stream through the channel encoder 353 to obtain a transmission signal. That is, the first coded stream is transcoded into the second coded stream.

[0074] The other device may be a mobile terminal with audio signal processing capability; or may be other network elements with audio signal processing capability, which is not limited in this embodiment.

[0075] Optionally, in the embodiment of the present application, the device equipped with the encoder 20 may be referred to as an audio encoding device. In actual implementation, the audio encoding device may also have an audio decoding function, which is not limited in the implementation of the present application.

[0076] Optionally, in the embodiment of the present application, the device equipped with the decoder 30 may be referred to as an audio decoding device. In actual implementation, the audio decoding device may also have an audio encoding function, which is not limited in the implementation of the present application.

[0077] The above-mentioned encoder can execute the audio encoding method of the embodiment of the present application, wherein the first encoding process includes frequency band extension coding, and the spectrum retention flag of each frequency point of the high-frequency band signal can be determined according to the spectrum of the high-frequency band signal before and after the frequency band extension coding and the frequency range of the frequency band extension coding. The spectrum retention flag is used to indicate whether the spectrum value of a certain frequency point in the high-frequency band signal from before the frequency band extension coding to after the frequency band extension coding is retained. The high-frequency band signal is secondly encoded according to the spectrum retention flag of each frequency point of the high-frequency band signal. The spectrum retention flag of each frequency point of the high-frequency band signal can be used to avoid repeated encoding of the tone components that have been retained in the frequency band extension coding, thereby improving the encoding efficiency of the tone components.

[0078] For example, the above-mentioned encoder or the core encoder inside the encoder includes band extension coding when performing the first coding on the high-band signal and the low-band signal, so that the spectrum reservation mark of each frequency point of the high-band signal can be recorded, that is, the spectrum reservation mark of each frequency point of the high-band signal is used to determine whether the spectrum of each frequency point changes before and after the band expansion. The spectrum reservation mark of each frequency point of the high-band signal can be used to avoid repeated coding of the tone components that have been reserved in the band extension coding, thereby improving the coding efficiency of the tone components. The specific implementation method can be found in the following Figure 4 Detailed explanation of the illustrated embodiment.

[0079] Figure 4 is a flowchart of an audio encoding method according to an embodiment of the present application. The execution subject of the embodiment of the present application may be the above-mentioned encoder or a core encoder inside the encoder, such as Figure 4 As shown, the method of this embodiment may include:

[0080] 401. Obtain a current frame of an audio signal, where the current frame includes a high-frequency band signal and a low-frequency band signal.

[0081] Among them, the current frame can be any frame in the audio signal, and the current frame can include high-frequency band signals and low-frequency band signals. The division of high-frequency band signals and low-frequency band signals can be determined by a frequency band threshold. For example, a signal higher than the frequency band threshold is a high-frequency band signal, and a signal lower than the frequency band threshold is a low-frequency band signal. The determination of the frequency band threshold can be determined based on the transmission bandwidth, the data processing capabilities of the audio encoding device and the audio decoding device, and is not limited here.

[0082] Among them, the high-frequency band signal and the low-frequency band signal are relative, for example, the signal below a certain frequency threshold is a low-frequency band signal, and the signal above the frequency threshold is a high-frequency band signal (the signal corresponding to the frequency threshold can be classified as both a low-frequency band signal and a high-frequency band signal). The frequency threshold varies depending on the bandwidth of the current frame. For example, when the current frame is a broadband signal with a signal bandwidth of 0-8 kHz, the frequency threshold can be 4kHz; when the current frame is an ultra-wideband signal with a signal bandwidth of 0-16kHz, the frequency threshold can be 8kHz.

[0083] It should be noted that, in the embodiment of the present invention, the high-frequency band signal may be part or all of the signal in the high-frequency region. Specifically, the high-frequency region may vary depending on the signal bandwidth of the current frame and may also vary depending on the frequency threshold. For example, when the signal bandwidth of current frame is 0-8kHz, and the frequency threshold value is 4kHz, and the high-frequency region is 4-8kHz, then the high-frequency band signal can be the signal of 4-8kHz covering the whole high-frequency region, and it can also be the signal that only covers part of high-frequency region, for example, the high-frequency band signal can be 4-7kHz, 5-8kHz, 5-7kHz, or 4-6kHz and 7-8kHz (being that the high-frequency band signal can be discontinuous in frequency domain), etc.; when the signal bandwidth of current frame is 0-16kHz, and the frequency threshold value is 8kHz, and the high-frequency region is 8-16kHz, then the high-frequency band signal can be the signal of 8-16kHz covering the whole high-frequency region, and it can also be the signal that only covers part of high-frequency region, for example, the high-frequency band signal can be 8-15kHz, 9-16kHz, 9-15kHz, or 8-10kHz and 11-16kHz (being that the high-frequency band signal can be discontinuous in frequency domain), etc. It is understandable that the frequency range covered by the high-frequency band signal can be set as required, or the frequency range for subsequent second encoding can be adaptively determined as required, for example, the frequency range for tone component detection can be adaptively determined as required.

[0084] 402. Perform first encoding on the high-frequency band signal and the low-frequency band signal to obtain first encoding parameters of a current frame, where the first encoding includes frequency band extension encoding.

[0085] After acquiring the high-band signal and the low-band signal, the audio encoding device can perform a first encoding on the high-band signal and the low-band signal, wherein the first encoding can include band extension encoding, which can also be referred to as "band extension". Band extension encoding (i.e., audio band extension encoding, hereinafter referred to as band extension) is introduced in the first encoding process. Band extension coding parameters (referred to as band extension parameters) can be obtained through band extension coding. The decoding end can reconstruct the high-frequency information in the audio signal according to the band extension coding parameters, thereby expanding the effective bandwidth of the audio signal and improving the quality of the audio signal.

[0086] In the embodiment of the present application, the high-frequency band signal and the low-frequency band signal are encoded in the first encoding process to obtain the first encoding parameter of the current frame, and the first encoding parameter can be used for code stream multiplexing.

[0087] In some embodiments, the first encoding may include, in addition to the frequency band extension encoding, time domain noise shaping, frequency domain noise shaping, or spectrum quantization, etc.; accordingly, the first encoding parameters may include, in addition to the frequency band extension encoding parameters, time domain noise shaping parameters, frequency domain noise shaping parameters, or spectrum quantization parameters, etc. The first encoding process will not be described in detail in the embodiments of the present application.

[0088] 403. Determine a spectrum reservation flag for each frequency point of the high-frequency band signal, where the spectrum reservation flag is used to indicate whether a first spectrum corresponding to the frequency point is reserved in a second spectrum corresponding to the frequency point, wherein the first spectrum includes the spectrum of the high-frequency band signal before frequency band extension coding corresponding to the frequency point, and the second spectrum includes the spectrum of the high-frequency band signal after frequency band extension coding corresponding to the frequency point.

[0089] In an embodiment of the present application, the high-frequency signal is band-extended encoded in the first encoding, and for each frequency point in the high-frequency signal, a record can be made based on whether the spectrum before and after the band-extended encoding changes. For example, the first spectrum is the spectrum of the high-frequency band signal before the band-extended encoding corresponding to the frequency point, and the second spectrum is the spectrum of the high-frequency band signal after the band-extended encoding corresponding to the frequency point. The audio encoding device can generate a spectrum retention flag for each frequency point of the high-frequency band signal, and the spectrum retention flag for each frequency point in the high-frequency band signal is used to indicate whether the first spectrum corresponding to the frequency point is retained in the second spectrum corresponding to the frequency point.

[0090] It should be noted that the spectrum reservation mark of each frequency point of the high-frequency band signal is determined in step 403, wherein each frequency point of the high-frequency band signal refers to each frequency point of the spectrum reservation mark that needs to be determined in the high-frequency band signal, if the frequency range that needs to be detected by the tone component is predetermined, then the frequency range that needs to be determined in the high-frequency band signal to retain the mark is not the frequency range of the whole high-frequency band signal, therefore it is also possible to only obtain the spectrum reservation mark of each frequency point in the frequency range that needs to be detected by the tone component. In addition, the high-frequency band signal in step 403 can also be the high-frequency band signal in the frequency range that needs to be detected by the tone component. Wherein, the frequency range that needs to be detected by the tone component can be determined according to the quantity of the frequency region that needs to be detected by the tone component, and specifically, the quantity of the frequency region that needs to be detected by the tone component can be pre-specified.

[0091] In some embodiments of the present application, step 403 determines the spectrum reservation flag of each frequency point of the high-frequency band signal, including:

[0092] A spectrum reservation flag of each frequency point of the high-band signal is determined according to the first spectrum, the second spectrum, and the frequency range of the frequency band extension coding.

[0093] In the process of band extension coding, the signal spectrum before band extension coding (i.e., the first spectrum), the signal spectrum after band extension coding (i.e., the second spectrum), and the frequency range of band extension coding can be obtained. The frequency range of band extension coding can be the frequency point range of band extension coding, for example, the frequency range of band extension coding includes: the starting frequency point and the cutoff frequency point of intelligent gap filling (IGF) processing. The frequency range of band extension coding can also be characterized in other ways, for example, according to the starting frequency value and the cutoff frequency value of band extension coding to characterize the frequency range of band extension coding.

[0094] In the first encoding process provided in the embodiment of the present application, the high frequency band can be divided into K frequency regions (for example, the frequency regions are represented as tiles), and each frequency region is further divided into M frequency bands, and there is no limitation on the values ​​of K and M. The determination of the frequency range of the frequency band extension coding can be performed in units of frequency regions or in units of frequency bands.

[0095] The audio encoding device may obtain the value of the spectrum reservation flag of each frequency point in the high-frequency band signal in a variety of ways, which will be described in detail below.

[0096] In some embodiments of the present application, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region;

[0097] When the first frequency point in the current frequency region does not belong to the frequency range of the frequency band extension coding, the value of the spectrum reservation flag of the first frequency point is a first preset value; or,

[0098] When the second frequency point in the current frequency area belongs to the frequency range of band extension coding, if the spectrum value before band extension coding and the spectrum value after band extension coding corresponding to the second frequency point meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the second preset value; or, if the spectrum value before band extension coding and the spectrum value after band extension coding corresponding to the second frequency point do not meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the third preset value.

[0099] Among them, the first preset value is used to indicate that the first frequency point in the current frequency region does not belong to the frequency range of the band extension coding, the second preset value is used to indicate that the second frequency point in the current frequency region belongs to the frequency range of the band extension coding, and the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point meet the preset conditions, and the third preset value is used to indicate that the second frequency point in the current frequency region belongs to the frequency range of the band extension coding, and the spectrum value before the band extension coding and the spectrum value after the band extension coding corresponding to the second frequency point do not meet the preset conditions.

[0100] Specifically, the audio encoding device first determines whether one or more frequency points in the current frequency region belong to the frequency range of the frequency band extension coding, for example, the first frequency point is defined as a frequency point in the current frequency region that does not belong to the frequency range of the frequency band extension coding, and the second frequency point is defined as a frequency point in the current frequency region that belongs to the frequency range of the frequency band extension coding. Then the value of the spectrum reservation mark of the first frequency point is the first preset value, and the value of the spectrum reservation mark of the second frequency point has two values, for example, the second preset value and the third preset value, respectively. Specifically, when the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point meet the preset condition, the value of the spectrum reservation mark of the second frequency point is the second preset value, and when the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point do not meet the preset condition, the value of the spectrum reservation mark of the second frequency point is the third preset value. There are many ways to implement the preset condition, which are not limited here. For example, the preset condition is a condition set for the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding, which can be determined in combination with the application scenario.

[0101] In some embodiments of the present application, the preset condition includes: a spectrum value before frequency band extension coding corresponding to the second frequency point is equal to a spectrum value after frequency band extension coding.

[0102] Specifically, the preset condition can be that the spectrum value before the band extension coding corresponding to the second frequency point is equal to the spectrum value after the band extension coding. Wherein, the preset condition is that the spectrum value before and after the band extension coding does not change, that is, the spectrum value before the band extension coding corresponding to the second frequency point is equal to the spectrum value after the band extension coding. For example, the preset condition can also be that the absolute value of the difference between the spectrum value before the band extension coding corresponding to the second frequency point and the spectrum value after the band extension coding is less than or equal to a preset threshold value. Wherein, the preset condition is based on the spectrum value before and after the band extension coding, which may have a certain difference, but the spectrum information has been retained, that is, the difference between the spectrum value before the band extension coding corresponding to the second frequency point and the spectrum value after the band extension coding is less than the preset threshold value. In the embodiment of the present application, the spectrum reservation mark of each frequency point of the high frequency band signal is determined by the judgment of the preset condition. According to the spectrum reservation mark of each frequency point of the high frequency band signal, it is possible to avoid repeating the encoding of the tone component retained in the band extension coding, thereby improving the coding efficiency of the tone component.

[0103] An example is given below: for a frequency point that is not within the frequency range of the frequency band extension coding, the value of the spectrum reservation flag corresponding to the frequency point is set to the first preset value. For a frequency point that is within the frequency range of the frequency band extension coding, if the spectrum value before the frequency band extension coding corresponding to the frequency point is equal to the spectrum value after the frequency band extension coding, the value of the spectrum reservation flag of the frequency point is set to the second preset value; if the spectrum value before the frequency band extension coding corresponding to the frequency point is not equal to the spectrum value after the frequency band extension coding, the value of the spectrum reservation flag of the frequency point is set to the third preset value.

[0104] In a specific embodiment of the present application, the signal spectrum before band extension coding, that is, the modified discrete cosine transform (MDCT) spectrum before intelligent gap filling (IGF) is recorded as mdctSpectrumBeforeIGF. The signal spectrum after band extension coding, that is, the mdct spectrum after IGF is recorded as mdctSpectrumAfterIGF. The spectrum reservation flag of the frequency point is recorded as igfActivityMask. For example, the first preset value is -1, the second preset value is 1, and the third preset value is 0. The value of igfActivityMask is -1, indicating that the frequency point is outside the frequency band processed by IGF (that is, in the frequency range of band extension coding), the value of igfActivityMask is 0, indicating that the frequency point is not reserved (that is, it has been cleared during band extension coding), and the value of igfActivityMask is 1, indicating that the frequency point is reserved (that is, the spectrum value remains unchanged before and after band extension coding).

[0105] Specifically, the method to obtain igfActivityMask is as follows:

[0106] igfActivityMask[sb]=–1,sb∈[0,igfBgn)

[0107] igfActivityMask[sb]

[0108]

[0109] sb∈[igfBgn,igfEnd).

[0110] igfActivityMask[sb]=–1, sb∈[igfEnd, blockSize).

[0111] Among them, sb is the frequency point number, igfBgn and igfEnd are the starting frequency point and the end frequency point of IGF processing respectively, and blockSize is the maximum frequency point number of the high frequency band.

[0112] 404. Perform a second encoding on the high-band signal according to a spectrum reservation flag of each frequency point of the high-band signal to obtain a second encoding parameter of a current frame, wherein the second encoding parameter is used to represent information of a target tone component of the high-band signal, and the tone component information includes position information, quantity information, and amplitude information or energy information of the tone component.

[0113] In the embodiment of the present application, after the audio coding device obtains the spectrum reservation mark of each frequency point of the above-mentioned high-frequency band signal, the high-frequency band signal can be secondly encoded according to the spectrum reservation mark of each frequency point of the high-frequency band signal. In the second encoding process, the audio coding device can determine which frequencies have changed before and after the band extension by parsing the spectrum reservation mark of each frequency point, and which frequencies have not changed before and after the band extension, that is, the audio coding device can determine whether each frequency point of the high-frequency band signal has been encoded in the first encoding process, and for the frequency point of the high-frequency band signal that has been encoded in the first encoding process, it can no longer be encoded in the second encoding process. Therefore, the spectrum reservation mark of each frequency point of the high-frequency band signal can be used to avoid repeated encoding of the tonal component that has been retained in the band extension encoding, thereby improving the coding efficiency of the tonal component.

[0114] Specifically, the audio encoding device can obtain the second encoding parameters of the current frame through the aforementioned second encoding, and the second encoding parameters are used to represent the information of the target tone component of the high-frequency band signal, wherein the target tone component refers to the tone component obtained through the second encoding in the high-frequency band signal, for example, the target tone component can specifically refer to one or some tone components in the high-frequency band signal. In the embodiment of the present application, the information of the target tone component is multiple, for example, the information of the target tone component may include the position information, quantity information, and amplitude information or energy information of the target tone component. Among them, the amplitude information or energy information may include only one of them in the target tone component, for example, the information of the target tone component may include the position information, quantity information, and amplitude information of the target tone component, and for example, the information of the target tone component may include the position information, quantity information, and energy information of the target tone component.

[0115] In some embodiments of the present application, the second encoding parameter includes a position quantity parameter of the target tone component, and an amplitude parameter or an energy parameter of the target tone component. The position quantity parameter is used to indicate the position information and quantity information of the target tone component of the high-frequency band signal, the amplitude parameter is used to indicate the amplitude information of the target tone component of the high-frequency band signal, and the energy parameter is used to indicate the energy information of the target tone component of the high-frequency band signal.

[0116] For example, the second coding parameter includes a position and quantity parameter of the tone component, and an amplitude parameter or an energy parameter of the tone component. The position and quantity parameter indicates that the position and quantity of the tone component are represented by the same parameter. In another embodiment, the second coding parameter includes a position parameter of the tone component, a quantity parameter of the tone component, and an amplitude parameter or an energy parameter of the tone component, in which case the position and quantity of the tone component can be represented by different parameters.

[0117] In a specific embodiment, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region. According to the high frequency band signal of the current frequency region in the at least one frequency region and the spectral line retention mark of each frequency point of the current frequency region, the position quantity parameter of the target tone component of the current frequency region and the amplitude parameter or energy parameter of the target tone component of the current frequency region are determined.

[0118] An example is given below. According to the spectrum line retention mark of each frequency point in the current frequency region, the peak information of the current frequency region is peak filtered to obtain the information of the candidate tone components in the current frequency region. The information of the candidate tone components includes the quantity information, position information, and amplitude information or energy information of the candidate tone components. For example, the quantity information of the candidate tone components can be the peak quantity information after peak filtering, the position information of the candidate tone components can be the peak position information after peak filtering, the amplitude information of the candidate tone components can be the peak amplitude information after peak filtering, and the energy information of the candidate tone components can be the peak energy information after peak filtering. The position quantity parameters, amplitude parameters or energy parameters of the target tone components in the current frequency region can be obtained through the information of the candidate tone components.

[0119] Specifically, the information of the candidate tone components includes the quantity information, position information, and amplitude information or energy information of the candidate tone components. For example, the quantity information, position information, and amplitude information or energy information of the candidate tone components are used as the quantity information, position information, amplitude information or energy information of the target tone components in the current frequency region; based on the quantity information, position information, amplitude information or energy information of the target tone components in the current frequency region, the position quantity parameter, and amplitude parameter or energy parameter of the target tone components in the current frequency region are obtained.

[0120] For another example, other processing can be performed based on the quantity information, position information, amplitude information or energy information of the candidate tone components to obtain the quantity information, position information, amplitude information or energy information of the processed candidate tone components; the quantity information, position information, amplitude information or energy information of the processed candidate tone components are used as the quantity information, position information, amplitude information or energy information of the target tone components in the current frequency region; based on the quantity information, position information, amplitude information or energy information of the target tone components in the current frequency region, the position quantity parameters, amplitude parameters or energy parameters of the target tone components in the current frequency region are obtained. Among them, the other processing can be one or more of merging processing, quantity screening, inter-frame continuity correction and other processing. The embodiments of the present application do not limit whether other processing is performed and the types and methods of other processing.

[0121] 405. Perform code stream multiplexing on the first coding parameter and the second coding parameter to obtain a coded code stream.

[0122] In the above embodiment, the audio encoding device obtains the first encoding parameter through step 402, obtains the second encoding parameter through the above step 404, and finally multiplexes the first encoding parameter and the second encoding parameter to obtain an encoded code stream, for example, the encoded code stream may be a payload code stream. The payload code stream may carry specific information of each frame of the audio signal, for example, information of the tone components of each frame.

[0123] In some embodiments of the present application, the encoded code stream may further include a configuration code stream, which may carry configuration information common to each frame in the audio signal. The payload code stream and the configuration code stream may be independent code streams or included in the same code stream, that is, the payload code stream and the configuration code stream may be different parts of the same code stream.

[0124] An example is given below, where the first coding parameter and the second coding parameter are multiplexed to obtain a coded bitstream. The audio coding device of the present application determines the spectrum reservation flag information of the frequency band extension coding, and in the process of obtaining the second coding parameter, according to the spectrum reservation flag information of each frequency point of the high-frequency band signal, avoids repeated encoding of the tone components that have been reserved in the frequency band extension coding, thereby improving the coding efficiency of the tone components.

[0125] The audio encoding device sends the encoded code stream to the audio decoding device, and the audio decoding device demultiplexes the encoded code stream to obtain the encoding parameters, thereby accurately obtaining the current frame of the audio signal.

[0126] Through the examples of the above embodiments for illustrating the present application, it can be known that a current frame of an audio signal is obtained, the current frame includes a high-frequency band signal and a low-frequency band signal, and a first encoding is performed on the high-frequency band signal and the low-frequency band signal to obtain a first encoding parameter of the current frame, the first encoding includes a frequency band extension encoding, and a spectrum reservation flag of each frequency point of the high-frequency band signal is determined, and the spectrum reservation flag is used to indicate whether a first spectrum corresponding to the frequency point is retained in a second spectrum corresponding to the frequency point, wherein the first spectrum is the spectrum of the high-frequency band signal before the frequency band extension encoding corresponding to the frequency point, and the second spectrum is the spectrum of the high-frequency band signal after the frequency band extension encoding corresponding to the frequency point, and the high-frequency band signal is second-encoded according to the spectrum reservation flag of each frequency point of the high-frequency band signal to obtain a second encoding parameter of the current frame, the second encoding parameter is used to represent information of a target tone component of the high-frequency band signal, and the information of the target tone component includes position information, quantity information, and amplitude information or energy information of the target tone component, and the first encoding parameter and the second encoding parameter are multiplexed to obtain an encoded code stream. In the embodiment of the present application, the first encoding process includes frequency band extension coding. The spectrum retention flag of each frequency point of the high-frequency band signal can be determined according to the spectrum of the high-frequency band signal before and after the frequency band extension coding and the frequency range of the frequency band extension coding. The spectrum retention flag is used to indicate whether the spectrum values ​​of one or more frequency points in the high-frequency band signal from before the frequency band extension coding to after the frequency band extension coding are retained. The high-frequency band signal is secondly encoded according to the spectrum retention flag of each frequency point of the high-frequency band signal. The spectrum retention flag of each frequency point of the high-frequency band signal can be used to avoid repeated encoding of the tone components that have been retained in the frequency band extension coding, thereby improving the coding efficiency of the tone components.

[0127] Next, please refer to other embodiments provided in this application, such as Figure 5 As shown, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the aforementioned step 404 performs a second encoding on the high frequency band signal according to the spectrum reservation flag of each frequency point of the high frequency band signal to obtain a second encoding parameter of the current frame, including:

[0128] 4041. Perform peak search based on the high frequency band signal of the current frequency region to obtain peak information of the current frequency region, where the peak information of the current frequency region includes: peak quantity information, peak position information, and peak amplitude information or peak energy information of the current frequency region.

[0129] Among them, the audio encoding device can perform peak search based on the high-frequency band signal of the current frequency region, for example, searching whether there is a peak in the current frequency region. The peak number information, peak position information and peak amplitude information or energy information of the current frequency region can be obtained through peak search.

[0130] Specifically, the power spectrum of the high-frequency band signal of the current frequency region can be obtained according to the high-frequency band signal of the current frequency region; the peak of the power spectrum can be searched according to the power spectrum of the high-frequency band signal of the current frequency region (referred to as the current region), and the number of peaks can be used as the peak number information of the current region, the frequency point number corresponding to the peak can be used as the peak position information of the current region, and the amplitude or energy of the peak can be used as the peak amplitude information or energy information of the current region. The power spectrum ratio of the current frequency point of the current frequency region can also be obtained according to the high-frequency band signal of the current frequency region, and the power spectrum ratio of the current frequency point is the ratio of the power spectrum value of the current frequency point to the average value of the power spectrum of the current frequency region; the peak search is performed in the current frequency region according to the power spectrum ratio of the current frequency point to obtain the peak number information, peak position information, peak amplitude information or peak energy information of the current frequency region. Among them, the energy information or amplitude information includes: the power spectrum ratio, for example, the power spectrum ratio of the peak is the ratio of the power spectrum value of the frequency point corresponding to the peak position to the average value of the power spectrum of the current frequency region. Of course, in the embodiment of the present application, other methods can also be used to perform peak search to obtain the peak quantity information, peak position information, and peak amplitude information or energy information of the current area, and the embodiment of the present application is not limited thereto.

[0131] In one embodiment of the present application, the audio encoding device may store the peak position information and peak energy information of the current frequency region in the peak_idx and peak_val arrays respectively, and store the peak quantity information of the current frequency region in peak_cnt.

[0132] The high-frequency band signal for peak search may be a frequency domain signal or a time domain signal.

[0133] Specifically, in one implementation, the peak search may be performed based on at least one of a power spectrum, an energy spectrum, or an amplitude spectrum in the current frequency region.

[0134] 4042. Perform peak screening on the peak information of the current frequency region according to the spectrum retention flag of each frequency point in the current frequency region to obtain information on candidate tone components of the current frequency region.

[0135] Among them, the audio encoding device can obtain the filtered peak number information, peak position information, peak amplitude information or energy information of the current frequency region based on the spectrum retention flag information of each frequency point in the current frequency region and the peak number information, peak position information and peak amplitude information or energy information of the current frequency region. The filtered peak number information, peak position information and peak amplitude information or energy information is the information of the candidate tonal components of the current frequency region.

[0136] For example, the peak amplitude information or energy information may include the energy ratio of the peak, or the power spectrum ratio of the peak. The audio encoding device may also obtain other information characterizing the peak energy or amplitude in the peak search, such as the value of the power spectrum of the frequency point corresponding to the peak position. The power spectrum ratio of the peak is the ratio of the value of the power spectrum of the peak to the average value of the power spectrum of the current frequency region, that is, the ratio of the value of the power spectrum of the frequency point corresponding to the peak position to the average value of the power spectrum of the current frequency region. Similarly, the power spectrum ratio of the candidate tone component is the ratio of the value of the power spectrum of the candidate tone component to the average value of the power spectrum of the current frequency region, that is, the ratio of the value of the power spectrum of the frequency point corresponding to the position of the candidate tone component to the average value of the power spectrum of the current frequency region.

[0137] It should be noted that, in the embodiment of the present application, peak screening can be performed directly according to the spectrum retention flag of each frequency point in the current frequency region to obtain the candidate tone components of the current frequency region. It is also possible to determine the spectrum retention flag of each sub-band in the current frequency region according to the spectrum retention flag of each frequency point in the current frequency region, and then perform peak screening based on the spectrum retention flag of each sub-band in the current frequency region, as described in the examples in the subsequent embodiments.

[0138] 4043. Obtain information about target tone components in the current frequency region based on information about candidate tone components in the current frequency region.

[0139] After acquiring the information of the candidate tone components of the current frequency region, the audio encoding device may process based on the information of the candidate tone components of the current frequency region to obtain the information of the target tone components of the current frequency region. The target tone component may be a tone component obtained by merging the candidate tone components, the target tone component may be a tone component obtained by quantitative screening of the candidate tone components, the target tone component may be a tone component obtained by inter-frame continuity processing of the candidate tone components, and the implementation method of obtaining the target tone component is not limited here.

[0140] 4044. Obtain a second encoding parameter of the current frequency region according to information of the target pitch component of the current frequency region.

[0141] In an embodiment of the present application, the audio encoding device can obtain a second encoding parameter of the current frequency region based on information of the target tone component of the current frequency region, and the second encoding parameter includes a position quantity parameter of the target tone component, and an amplitude parameter or an energy parameter. The position quantity parameter is used to indicate the position information and quantity information of the target tone component of the high-frequency band signal, the amplitude parameter is used to indicate the amplitude information of the target tone component of the high-frequency band signal, and the energy parameter is used to indicate the energy information of the target tone component of the high-frequency band signal.

[0142] It can be seen from the description of the aforementioned steps 4041 to 4044 that in the embodiment of the present application, according to the spectrum retention flag of each frequency point in the current frequency region, peak information of the current frequency region is subjected to peak screening to obtain information on candidate tone components in the current frequency region. The spectrum retention flag of each frequency point of the high-frequency band signal can be used to avoid repeated encoding of tone components that have been reserved in the band extension coding, thereby improving the coding efficiency of the tone components.

[0143] Next, please refer to some other embodiments provided by the present application, wherein the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and a frequency region includes at least one sub-band. Figure 6 As shown, the aforementioned step 4042 performs peak screening on the peak information of the current frequency region according to the spectrum reservation flag of each frequency point in the current frequency region to obtain information on candidate tone components in the current frequency region, including:

[0144] 601. Obtain a spectrum reservation flag of each subband in the current frequency region according to a spectrum reservation flag of each frequency point in the current frequency region.

[0145] Among them, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and a frequency region includes at least one sub-band. The audio encoding device can determine the value of the spectrum reservation flag of each frequency point through the spectrum reservation flag of each frequency point in the current frequency region. A frequency point in the current frequency region can belong to a certain sub-band, so the value of the spectrum reservation flag of the sub-band can be determined by the value of the spectrum reservation flag of the frequency point in the sub-band. Based on the above method, the audio encoding device can obtain the spectrum reservation flag of each sub-band in the current frequency region.

[0146] Further, in some embodiments of the present application, the aforementioned step 601 obtains the spectrum reservation flag of each sub-band in the current frequency region according to the spectrum reservation flag of each frequency point in the current frequency region, including:

[0147] If the number of frequency points in which the value of the spectrum reservation flag in the current sub-band is equal to the second preset value is greater than the preset threshold, determining that the value of the spectrum reservation flag of the current sub-band is the first flag value, wherein if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the frequency point meet the preset condition, the value of the spectrum reservation flag of the frequency point is the second preset value; or,

[0148] If the number of frequency points whose spectrum reservation flag value in the current sub-band is equal to the second preset value is less than or equal to the preset threshold, the spectrum reservation flag value of the current sub-band is determined to be the second flag value.

[0149] The first flag value is used to indicate that the number of frequency points in the current sub-band whose value of the spectrum reservation flag is equal to the second preset value is greater than a preset threshold value, and if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to a frequency point meet a preset condition, the value of the spectrum reservation flag of the frequency point is the second preset value, and the frequency point is a frequency point in the current sub-band. The second flag value is used to indicate that the number of frequency points in the current sub-band whose value of the spectrum reservation flag is equal to the second preset value is less than or equal to the preset threshold value.

[0150] There may be multiple values ​​of the spectrum reservation flag of the current sub-band, for example, the spectrum reservation flag of the current sub-band is a first flag value, or the spectrum reservation flag of the current sub-band is a second flag value. It may be specifically determined based on the number of frequency points in the current sub-band where the spectrum reservation flag is equal to the second preset value. In the embodiment of the present application, there is no limitation on the specific values ​​of the first flag value and the second flag value.

[0151] In some embodiments of the present application, the preset condition includes: a spectrum value before the frequency band extension coding corresponding to the frequency point is equal to a spectrum value after the frequency band extension coding.

[0152] Specifically, the preset condition can be that the spectrum value before the frequency band extension coding corresponding to the frequency point is equal to the spectrum value after the frequency band extension coding. Wherein, the preset condition can be that the spectrum value before and after the frequency band extension coding does not change, that is, the spectrum value before the frequency band extension coding corresponding to the frequency point is equal to the spectrum value after the frequency band extension coding. For example, the preset condition can also be that the absolute value of the difference between the spectrum value before the frequency band extension coding corresponding to the frequency point and the spectrum value after the frequency band extension coding is less than or equal to a preset threshold value. Wherein, the preset condition is based on the spectrum value before and after the frequency band extension coding and there may be certain differences, but the spectrum information has been retained, that is, the difference between the spectrum value before the frequency band extension coding corresponding to the frequency point and the spectrum value after the frequency band extension coding is less than the preset threshold value. In the present application embodiment, the judgment by the preset condition determines the spectrum reservation mark of each frequency point of the high frequency band signal, and according to the spectrum reservation mark of each frequency point of the high frequency band signal, it is possible to avoid repeating the encoding of the tone component retained in the frequency band extension coding, thereby the coding efficiency of the tone component can be improved.

[0153] An example is given below: for a frequency point that is not within the frequency range of the frequency band extension coding, the value of the spectrum reservation flag corresponding to the frequency point is set to the first preset value. For a frequency point that is within the frequency range of the frequency band extension coding, if the spectrum value before the frequency band extension coding corresponding to the frequency point is equal to the spectrum value after the frequency band extension coding, the value of the spectrum reservation flag of the frequency point is set to the second preset value; if the spectrum value before the frequency band extension coding corresponding to the frequency point is not equal to the spectrum value after the frequency band extension coding, the value of the spectrum reservation flag of the frequency point is set to the third preset value.

[0154] To illustrate, a method for obtaining a spectrum reservation flag for each subband in the current frequency region can specifically determine the spectrum reservation flag of the current subband based on the spectrum reservation flags of all frequency points in the current subband. For example, if the value of the spectrum reservation flag in the current subband is equal to the number of frequency points of a second preset value and is greater than a preset threshold, then the spectrum reservation flag of the current subband is 1; otherwise, the spectrum reservation flag of the current subband is 0.

[0155] In a specific embodiment, the spectrum reservation flag information of the frequency band extension coding is recorded as igfActivityMask, and the spectrum reservation flag of each subband in the current frequency region (tile) is recorded as subband_enc_flag[num_subband], where num_subband is the number of subbands in the current frequency region (tile). The acquisition method of subband_enc_flag includes:

[0156] Step 1: Determine the number of sub-bands.

[0157] For the pth tile, calculate the number of subbands num_subband contained in the tile:

[0158] num_subband=tile_width[p] / tone_res[p].

[0159] Among them, tone_res[p] is the frequency domain resolution of the subband in the pth frequency region (i.e., the subband width), and tile_width is the width of the pth tile (the number of frequency points contained in the pth frequency region). The calculation process is as follows:

[0160] tile_width=tile[p+1]-tile[p].

[0161] Among them, tile[p] and tile[p+1] are the starting frequency point numbers of the pth and p+1th tiles respectively.

[0162] Step 2: Obtain the spectrum reservation flag of each sub-band.

[0163] Assume that the flag indicating whether there is spectrum reservation in each subband is subband_enc_flag[num_subband], and the pseudo code for obtaining this parameter is as follows:

[0164]

[0165]

[0166] Among them, cntEnc is a spectrum reservation counter, which is used to count the frequency points whose value of the spectrum reservation flag igfActivityMask is equal to the second preset value within the i-th sub-band range in the p-th frequency region, startIdx is the starting frequency point number of the i-th sub-band, and stopIdx is the starting frequency point number of the i+1-th sub-band.

[0167] The pseudo code for obtaining the subband_enc_flag parameter can also be in the following form:

[0168]

[0169] Wherein, IGF_Activity is a second preset value, and in this embodiment, IGF_Activity is set to 1. Th1 is a preset threshold, and in this embodiment, it is set to 0.

[0170] 602. Perform peak screening on peak information of the current frequency region according to the spectrum reservation flag of each sub-band in the current frequency region to obtain information on candidate tonal components of the current frequency region.

[0171] In an embodiment of the present application, the peak filtering in the aforementioned step 4042 can also be performed on sub-bands, so the audio encoding device can perform peak filtering on the peak information of the current frequency region according to the spectrum retention flag of each sub-band in the current frequency region.

[0172] An example is as follows: According to the spectrum retention flag information of each frequency point in the current frequency region and the peak quantity information, peak position information and peak amplitude information or energy information of the current frequency region, the peak quantity information, peak position information and peak amplitude information or energy information after screening of the current frequency region is obtained. For example, according to the spectrum retention flag information of each frequency point in the current frequency region, the spectrum retention flag of each sub-band in the current frequency region is obtained. According to the spectrum retention flag of each sub-band in the current frequency region and the peak quantity information, peak position information and peak amplitude information or energy information of the current frequency region, the peak quantity information, peak position information and peak amplitude information or energy information after screening of the current frequency region is obtained.

[0173] Further, in some embodiments of the present application, the aforementioned step 602 performs peak screening on the peak information of the current frequency region according to the spectrum reservation flag of each sub-band in the current frequency region to obtain information of candidate tone components in the current frequency region, including:

[0174] A1. According to the peak position information of the current frequency region, obtain the subband sequence number corresponding to the peak position of the current frequency region;

[0175] A2. According to the subband sequence number corresponding to the peak position of the current frequency region and the spectrum retention flag of each subband in the current frequency region, peak information of the current frequency region is filtered to obtain information of candidate tonal components of the current frequency region.

[0176] Among them, according to the subband sequence number corresponding to the peak position of the current frequency region and the spectrum retention flag of each subband in the current frequency region, the peak information of the current frequency region is subjected to peak filtering to obtain the peak quantity information, peak position information and peak amplitude information or energy information after filtering of the current frequency region as the information of the candidate tonal components of the current frequency region.

[0177] Further, in some embodiments of the application, if the value of the spectrum reservation flag of the current sub-band is a second flag value, the peak value in the current sub-band is a candidate tone component. The second flag value is used to indicate that the number of frequency points in the current sub-band where the value of the spectrum reservation flag is equal to the second preset value is less than or equal to a preset threshold value, and if the value of the spectrum reservation flag of the current sub-band is the second flag value, it means that the spectrum of the current sub-band is not reserved in the frequency band extension coding, and therefore the candidate tone component can be determined by the value of the spectrum reservation flag of the current sub-band being the second flag value.

[0178] Specifically, if the spectrum retention flag corresponding to the first subband number corresponding to the peak position of the current frequency region is the first flag value, it can be determined that the information of the candidate tone components of the current frequency region does not include: the peak position information and the peak amplitude information or energy information corresponding to the first subband number; or, if the spectrum retention flag corresponding to the second subband number corresponding to the peak position of the current frequency region is the second flag value, it can be determined that the position information of the candidate tone components of the current frequency region includes: the peak position information corresponding to the second subband number, the amplitude information or energy information of the candidate tone components of the current frequency region includes: the peak amplitude information or energy information corresponding to the second subband number, and the number information of the candidate tone components of the current frequency region is equal to the total number of peaks in all subbands in the current frequency region whose spectrum retention flag value is the second flag value.

[0179] An example is given as follows: based on the subband sequence number corresponding to the peak position of the current frequency region and the spectrum retention flag of each subband in the current frequency region, the peak quantity information, peak position information and peak amplitude information or energy information after filtering of the current frequency region are obtained. Specifically, it can be: if the subband spectrum retention flag corresponding to the subband sequence number corresponding to the peak position of the current frequency region is 1, then the peak position information and the corresponding peak amplitude or energy information are removed from the peak search result; otherwise, the peak position information and the corresponding peak amplitude information or peak energy information are retained; the retained peak position information and amplitude or energy information constitute the filtered peak position information and peak amplitude or peak energy information; the filtered peak quantity information is equal to the number of peaks in the current frequency region minus the number of removed peaks.

[0180] In a specific embodiment, in the current frequency region, for the peak_cnt power spectrum peaks obtained by the peak search, the subband number subband_idx where each peak position information peak_idx is located is determined in turn; if there is a reserved spectrum in this subband (i.e., subband_enc_flag[subband_idx]==1), this peak is removed. The number of peaks removed in the current frequency region is recorded as peak_cnt_remove, and the number of peaks after this step is updated as: peak_cnt=peak_cnt-peak_cnt_remove.

[0181] In the embodiment of the present application, the spectrum reservation flag of each sub-band in the current frequency region can be used to avoid repeated encoding of the tone components that have been reserved in the frequency band extension coding, thereby improving the coding efficiency of the tone components.

[0182] The above embodiment introduces the audio encoding method performed by the audio encoding device. Next, the audio decoding method performed by the audio decoding device provided in the embodiment of the present application is introduced. Figure 7 As shown, it mainly includes the following steps:

[0183] 701. Obtain the encoded bitstream.

[0184] The encoded code stream is sent from the audio encoding device to the audio decoding device.

[0185] 702. Demultiplex the encoded code stream to obtain a first encoding parameter of a current frame of the audio signal and a second encoding parameter of the current frame.

[0186] The first encoding parameter and the second encoding parameter may refer to the aforementioned audio encoding method, which will not be described in detail here.

[0187] 703. Obtain a first high-frequency band signal of the current frame and a first low-frequency band signal of the current frame according to the first encoding parameter.

[0188] The first high-band signal may include at least one of a decoded high-band signal obtained by directly decoding according to the first coding parameter and an extended high-band signal obtained by performing frequency band extension on the first low-band signal.

[0189] 704. Obtain a second high-frequency band signal of the current frame according to the second encoding parameter, where the second high-frequency band signal includes a reconstructed tone signal.

[0190] The second coding parameter may include the tone component information of the high frequency band signal. For example, the second coding parameter of the current frame includes the position and quantity parameters of the tone component, and the amplitude parameter or energy parameter of the tone component. For another example, the second coding parameter of the current frame includes the position parameter, the quantity parameter, and the amplitude parameter or energy parameter of the tone component. The second coding parameter of the current frame can refer to the coding method, which will not be repeated here.

[0191] Similar to the encoding end processing flow method, the process of obtaining the reconstructed high-frequency band signal of the current frame according to the second coding parameter in the decoding end processing flow will also be carried out according to the frequency region division and / or sub-band division of the high-frequency band. The high-frequency band corresponding to the high-frequency band signal includes at least one frequency region, and one of the frequency regions includes at least one sub-band. The number of frequency regions of the second coding parameter to be determined can be predetermined or obtained from the bit stream. Here, a further description is given by taking the example of obtaining the reconstructed high-frequency band signal of the current frame according to the position number parameter of the tone component and the amplitude parameter of the tone component in a frequency region. Specifically, it can be:

[0192] Determining the position of the tone component in the current frequency region according to the position quantity parameter of the tone component in the current frequency region;

[0193] Determining the amplitude or energy corresponding to the position of the tone component according to the amplitude parameter or energy parameter of the tone component in the current frequency region;

[0194] Obtaining the reconstructed tone signal according to the position of the tone component in the current frequency region and the amplitude or energy corresponding to the position of the tone component;

[0195] The reconstructed high-frequency band signal is obtained according to the reconstructed tone signal.

[0196] 705 . Obtain a decoded signal of the current frame according to the first low-frequency band signal, the first high-frequency band signal, and the second high-frequency band signal of the current frame.

[0197] Among them, in the embodiment of the present application, by determining the spectrum reservation flag information of each frequency point of the high-frequency band signal, in the process of obtaining the second coding parameter, the peak quantity information, peak position information and peak amplitude information or energy information of the high-frequency band signal are screened according to the spectrum reservation flag information of each frequency point of the high-frequency band signal, so as to avoid repeated encoding of the tone components that have been reserved in the frequency band extension coding, thereby improving the coding efficiency of the tone components. At the corresponding decoding end, the high-frequency band signal that is reserved in the frequency band extension coding process is not repeatedly decoded, so the decoding efficiency is correspondingly improved.

[0198] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0199] In order to better implement the above-mentioned solution of the embodiment of the present application, relevant devices for implementing the above-mentioned solution are also provided below.

[0200] See also Figure 8 As shown, an audio encoding device 800 provided in an embodiment of the present application may include: an acquisition module 801, a first encoding module 802, a flag determination module 803, a second encoding module 804 and a code stream multiplexing module 805, wherein:

[0201] An acquisition module, used for acquiring a current frame of an audio signal, wherein the current frame includes a high-frequency band signal and a low-frequency band signal;

[0202] A first encoding module, configured to perform first encoding on the high-frequency band signal and the low-frequency band signal to obtain a first encoding parameter of the current frame, wherein the first encoding includes frequency band extension encoding;

[0203] a flag determination module, used to determine a spectrum reservation flag for each frequency point of the high-frequency band signal, wherein the spectrum reservation flag is used to indicate whether a first spectrum corresponding to the frequency point is reserved in a second spectrum corresponding to the frequency point, wherein the first spectrum includes a spectrum before the frequency band extension coding corresponding to the frequency point, and the second spectrum includes a spectrum after the frequency band extension coding corresponding to the frequency point;

[0204] A second encoding module, configured to perform a second encoding on the high-frequency band signal according to a spectrum reservation flag of each frequency point of the high-frequency band signal to obtain a second encoding parameter of the current frame, wherein the second encoding parameter is used to represent information of a target tone component of the high-frequency band signal, wherein the information of the target tone component includes position information, quantity information, and amplitude information or energy information of the target tone component;

[0205] The code stream multiplexing module is used to perform code stream multiplexing on the first coding parameter and the second coding parameter to obtain a coded code stream.

[0206] In some embodiments of the present application, the flag determination module is specifically used to determine a spectrum reservation flag for each frequency point of the high-band signal according to the first spectrum, the second spectrum, and a frequency range of the frequency band extension coding.

[0207] In some embodiments of the present application, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region;

[0208] The second encoding module is specifically used for:

[0209] Performing a peak search according to the high frequency band signal of the current frequency region to obtain peak information of the current frequency region, wherein the peak information of the current frequency region includes: peak quantity information, peak position information, and peak amplitude information or peak energy information of the current frequency region;

[0210] According to the spectrum reservation flag of each frequency point in the current frequency region, peak information of the current frequency region is subjected to peak screening to obtain information of candidate tone components of the current frequency region;

[0211] Obtaining information of a target tone component in the current frequency region according to information of candidate tone components in the current frequency region;

[0212] According to the information of the target pitch component of the current frequency region, a second encoding parameter of the current frequency region is obtained.

[0213] In some embodiments of the present application, the second encoding parameter includes a position quantity parameter of the target tone component, and an amplitude parameter or an energy parameter of the target tone component, the position quantity parameter is used to indicate the position information and quantity information of the target tone component of the high-frequency band signal, the amplitude parameter is used to indicate the amplitude information of the target tone component of the high-frequency band signal, and the energy parameter is used to indicate the energy information of the target tone component of the high-frequency band signal.

[0214] In some embodiments of the present application, the high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region;

[0215] When the first frequency point in the current frequency region does not belong to the frequency range of the frequency band extension coding, the value of the spectrum reservation flag of the first frequency point is a first preset value; or,

[0216] When the second frequency point in the current frequency area belongs to the frequency range of the frequency band extension coding, if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the second preset value; or, if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point do not meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the third preset value.

[0217] In some embodiments of the present application, the current frequency region includes at least one sub-band, and the second encoding module is specifically configured to:

[0218] Obtaining a spectrum reservation flag of each subband in the current frequency region according to a spectrum reservation flag of each frequency point in the current frequency region;

[0219] According to the spectrum reservation flag of each sub-band in the current frequency region, peak information of the current frequency region is subjected to peak screening to obtain information of candidate tone components of the current frequency region.

[0220] In some embodiments of the present application, the at least one subband includes a current subband; and the second encoding module is specifically configured to:

[0221] If the number of frequency points whose value of the spectrum reservation flag in the current sub-band is equal to the second preset value is greater than a preset threshold, determining the value of the spectrum reservation flag of the current sub-band to be the first flag value, wherein if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to one frequency point meet a preset condition, the value of the spectrum reservation flag of the one frequency point is the second preset value; or

[0222] If the number of frequency points in the current sub-band whose spectrum reservation flag value is equal to the second preset value is less than or equal to the preset threshold, the spectrum reservation flag value of the current sub-band is determined to be the second flag value.

[0223] In some embodiments of the present application, the second encoding module is specifically used to:

[0224] Obtaining, according to the peak position information of the current frequency region, a subband sequence number corresponding to the peak position of the current frequency region;

[0225] According to the subband sequence number corresponding to the peak position of the current frequency region and the spectrum reservation flag of each subband in the current frequency region, peak information of the current frequency region is filtered to obtain information of candidate tonal components of the current frequency region.

[0226] In some embodiments of the present application, if the value of the spectrum reservation flag of the current sub-band is the second flag value, the peak in the current sub-band is a candidate tone component.

[0227] In some embodiments of the present application, the preset condition includes: a spectrum value before frequency band extension coding corresponding to a frequency point is equal to a spectrum value after frequency band extension coding.

[0228] It can be seen from the examples of the aforementioned embodiments that a current frame of an audio signal is obtained, the current frame includes a high-frequency band signal and a low-frequency band signal, and a first encoding is performed on the high-frequency band signal and the low-frequency band signal to obtain a first encoding parameter of the current frame, the first encoding includes a frequency band extension encoding, a spectrum reservation flag for each frequency point of the high-frequency band signal is determined, and the spectrum reservation flag is used to indicate whether a first spectrum corresponding to the frequency point is retained in a second spectrum corresponding to the frequency point, wherein the first spectrum is the spectrum of the high-frequency band signal before the frequency band extension encoding corresponding to the frequency point, and the second spectrum is the spectrum of the high-frequency band signal after the frequency band extension encoding corresponding to the frequency point, and the high-frequency band signal is second-encoded according to the spectrum reservation flag of each frequency point of the high-frequency band signal to obtain a second encoding parameter of the current frame, the second encoding parameter is used to represent information of a target tone component of the high-frequency band signal, and the information of the target tone component includes position information, quantity information, and amplitude information or energy information of the target tone component, and the first encoding parameter and the second encoding parameter are multiplexed to obtain an encoded code stream. In the embodiment of the present application, the first encoding process includes frequency band extension coding. Each frequency point of the high-frequency band signal corresponds to a spectrum retention flag, which indicates whether the spectrum of the frequency point in the high-frequency band signal from before the frequency band extension coding to after the frequency band extension coding is retained. The high-frequency band signal is secondly encoded according to the spectrum retention flag of each frequency point of the high-frequency band signal. The spectrum retention flag of each frequency point of the high-frequency band signal can be used to avoid repeated encoding of the tone components that have been retained in the frequency band extension coding, thereby improving the coding efficiency of the tone components.

[0229] It should be noted that the information interaction, execution process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and will not be repeated here.

[0230] Based on the same inventive concept as the above method, an embodiment of the present application provides an audio signal encoder, which is used to encode an audio signal, including: an encoder as described in one or more of the above embodiments, wherein the audio encoding device is used to encode and generate a corresponding bit stream.

[0231] Based on the same inventive concept as the above method, the present application embodiment provides a device for encoding an audio signal, for example, an audio encoding device, see Fig. 9 As shown, the audio encoding device 900 includes:

[0232] processor 901, memory 902, and communication interface 903 (wherein the number of processors 901 in the audio encoding device 900 may be one or more, Fig. 9 In some embodiments of the present application, the processor 901, the memory 902 and the communication interface 903 may be connected via a bus or other means, wherein: Fig. 9 The example of connecting through bus is taken in the following.

[0233] The memory 902 may include a read-only memory and a random access memory, and provides instructions and data to the processor 901. A portion of the memory 902 may also include a non-volatile random access memory (NVRAM). The memory 902 stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks.

[0234] The processor 901 controls the operation of the audio encoding device, and the processor 901 may also be referred to as a central processing unit (CPU). In a specific application, the various components of the audio encoding device are coupled together through a bus system, wherein the bus system may include a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clarity, various buses are referred to as bus systems in the figure.

[0235] The method disclosed in the above embodiment of the present application can be applied to the processor 901, or implemented by the processor 901. The processor 901 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 901. The above processor 901 can be a general processor, a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 902, and the processor 901 reads the information in the memory 902 and completes the steps of the above method in combination with its hardware.

[0236] The communication interface 903 may be used to receive or send digital or character information, and may be, for example, an input / output interface, a pin or a circuit, etc. For example, the above-mentioned encoding code stream is sent via the communication interface 903 .

[0237] Based on the same inventive concept as the above method, an embodiment of the present application provides an audio encoding device, comprising: a non-volatile memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute part or all of the steps of the audio signal encoding method described in one or more of the above embodiments.

[0238] Based on the same inventive concept as the above method, an embodiment of the present application provides a computer-readable storage medium, which stores program code, wherein the program code includes instructions for executing part or all of the steps of the audio signal encoding method described in one or more of the above embodiments.

[0239] Based on the same inventive concept as the above method, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer executes part or all of the steps of the audio signal encoding method described in one or more embodiments above.

[0240] The processor mentioned in the above embodiments can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The processor can be a general-purpose processor, a digital signal processor (digital signal processor, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware coding processor to be executed, or the hardware and software modules in the coding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0241] The memory mentioned in the above embodiments may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0242] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0243] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0244] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0245] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0246] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0247] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0248] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An audio encoding method, characterized in that: The method comprises: Acquire a current frame of an audio signal, wherein the current frame includes a high-frequency band signal and a low-frequency band signal; Performing first encoding on the high-frequency band signal and the low-frequency band signal to obtain first encoding parameters of the current frame, wherein the first encoding includes frequency band extension encoding; Determine a spectrum reservation flag for each frequency point of the high-frequency band signal, wherein the spectrum reservation flag is used to indicate whether a first spectrum corresponding to the frequency point is reserved in a second spectrum corresponding to the frequency point, wherein the first spectrum includes a spectrum before frequency band extension coding corresponding to the frequency point, and the second spectrum includes a spectrum after frequency band extension coding corresponding to the frequency point; Performing a second encoding on the high-frequency band signal according to a spectrum reservation flag of each frequency point of the high-frequency band signal to obtain a second encoding parameter of the current frame, wherein the second encoding parameter is used to represent information of a target tone component of the high-frequency band signal, wherein the information of the target tone component includes position information, quantity information, and amplitude information of the target tone component, or the information of the target tone component includes position information, quantity information, and energy information of the target tone component; The first encoding parameter and the second encoding parameter are multiplexed to obtain an encoded code stream.

2. The method according to claim 1, characterized in that The step of determining a spectrum reservation flag for each frequency point of the high frequency band signal comprises: A spectrum reservation flag for each frequency point of the high-band signal is determined according to the first spectrum, the second spectrum, and the frequency range of the frequency band extension coding.

3. The method according to claim 1 or 2, characterized in that: The high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; The performing second encoding on the high-frequency band signal according to the spectrum reservation flag of each frequency point of the high-frequency band signal to obtain the second encoding parameter of the current frame includes: Performing a peak search according to the high frequency band signal of the current frequency region to obtain peak information of the current frequency region, wherein the peak information of the current frequency region includes: peak quantity information, peak position information, and peak amplitude information of the current frequency region, or peak quantity information, peak position information, and peak energy information of the current frequency region; According to the spectrum reservation flag of each frequency point in the current frequency region, peak information of the current frequency region is subjected to peak screening to obtain information of candidate tone components of the current frequency region; Obtaining information of a target tone component in the current frequency region according to information of candidate tone components in the current frequency region; According to the information of the target pitch component of the current frequency region, a second encoding parameter of the current frequency region is obtained.

4. The method according to claim 2, characterized in that: The high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; When the first frequency point in the current frequency region does not belong to the frequency range of the frequency band extension coding, the value of the spectrum reservation flag of the first frequency point is a first preset value; or, When the second frequency point in the current frequency area belongs to the frequency range of the frequency band extension coding, if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the second preset value; or, if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point do not meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the third preset value.

5. The method according to claim 3, characterized in that: The current frequency region includes at least one sub-band, and the peak information of the current frequency region is subjected to peak screening according to a spectrum reservation flag of each frequency point of the current frequency region to obtain information of candidate tone components of the current frequency region, including: Obtaining a spectrum reservation flag of each subband in the current frequency region according to a spectrum reservation flag of each frequency point in the current frequency region; According to the spectrum reservation flag of each sub-band in the current frequency region, peak information of the current frequency region is subjected to peak screening to obtain information of candidate tone components of the current frequency region.

6. The method according to claim 5, characterized in that The at least one subband includes a current subband; The obtaining, according to the spectrum reservation flag of each frequency point in the current frequency region, a spectrum reservation flag of each sub-band in the current frequency region comprises: If the number of frequency points whose value of the spectrum reservation flag in the current sub-band is equal to the second preset value is greater than a preset threshold, determining the value of the spectrum reservation flag of the current sub-band to be the first flag value, wherein if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to one frequency point meet a preset condition, the value of the spectrum reservation flag of the one frequency point is the second preset value; or If the number of frequency points in the current sub-band whose spectrum reservation flag value is equal to the second preset value is less than or equal to the preset threshold, the spectrum reservation flag value of the current sub-band is determined to be the second flag value.

7. The method according to claim 5, characterized in that The performing peak screening on the peak information of the current frequency region according to the spectrum reservation flag of each sub-band in the current frequency region to obtain information of candidate tone components of the current frequency region includes: Obtaining, according to the peak position information of the current frequency region, a subband sequence number corresponding to the peak position of the current frequency region; According to the subband sequence number corresponding to the peak position of the current frequency region and the spectrum reservation flag of each subband in the current frequency region, peak information of the current frequency region is filtered to obtain information of candidate tonal components of the current frequency region.

8. The method according to claim 7, characterized in that If the value of the spectrum reservation flag of the current sub-band is the second flag value, the peak value in the current sub-band is a candidate tone component.

9. The method according to claim 4 or 6, characterized in that: The preset condition includes: the spectrum value before the frequency band extension coding corresponding to the frequency point is equal to the spectrum value after the frequency band extension coding.

10. An audio encoding device, characterized in that: The device comprises: An acquisition module, used for acquiring a current frame of an audio signal, wherein the current frame includes a high-frequency band signal and a low-frequency band signal; A first encoding module, configured to perform first encoding on the high-frequency band signal and the low-frequency band signal to obtain a first encoding parameter of the current frame, wherein the first encoding includes frequency band extension encoding; a flag determination module, used to determine a spectrum reservation flag for each frequency point of the high-frequency band signal, wherein the spectrum reservation flag is used to indicate whether a first spectrum corresponding to the frequency point is reserved in a second spectrum corresponding to the frequency point, wherein the first spectrum includes a spectrum before the frequency band extension coding corresponding to the frequency point, and the second spectrum includes a spectrum after the frequency band extension coding corresponding to the frequency point; a second encoding module, configured to perform a second encoding on the high-frequency band signal according to a spectrum reservation flag of each frequency point of the high-frequency band signal to obtain a second encoding parameter of the current frame, wherein the second encoding parameter is used to represent information of a target tone component of the high-frequency band signal, wherein the information of the target tone component includes position information, quantity information, and amplitude information of the target tone component, or the information of the target tone component includes position information, quantity information, and energy information of the target tone component; The code stream multiplexing module is used to perform code stream multiplexing on the first coding parameter and the second coding parameter to obtain a coded code stream.

11. The device according to claim 10, characterized in that The flag determination module is specifically used for: A spectrum reservation flag for each frequency point of the high-band signal is determined according to the first spectrum, the second spectrum, and the frequency range of the frequency band extension coding.

12. The device according to claim 10 or 11, characterized in that The high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; The second encoding module is specifically used for: Performing a peak search according to the high frequency band signal of the current frequency region to obtain peak information of the current frequency region, wherein the peak information of the current frequency region includes: peak quantity information, peak position information, and peak amplitude information of the current frequency region, or peak quantity information, peak position information, and peak energy information of the current frequency region; According to the spectrum reservation flag of each frequency point in the current frequency region, peak information of the current frequency region is subjected to peak screening to obtain information of candidate tone components of the current frequency region; Obtaining information of a target tone component in the current frequency region according to information of candidate tone components in the current frequency region; According to the information of the target pitch component of the current frequency region, a second encoding parameter of the current frequency region is obtained.

13. The device according to claim 11, characterized in that The high frequency band corresponding to the high frequency band signal includes at least one frequency region, and the at least one frequency region includes the current frequency region; When the first frequency point in the current frequency region does not belong to the frequency range of the frequency band extension coding, the value of the spectrum reservation flag of the first frequency point is a first preset value; or, When the second frequency point in the current frequency area belongs to the frequency range of the frequency band extension coding, if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the second preset value; or, if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to the second frequency point do not meet the preset conditions, the value of the spectrum retention flag of the second frequency point is the third preset value.

14. The device according to claim 12, characterized in that The current frequency region includes at least one sub-band, and the second encoding module is specifically configured to: Obtaining a spectrum reservation flag of each subband in the current frequency region according to a spectrum reservation flag of each frequency point in the current frequency region; According to the spectrum reservation flag of each sub-band in the current frequency region, peak information of the current frequency region is subjected to peak screening to obtain information of candidate tone components of the current frequency region.

15. The device according to claim 14, characterized in that The at least one subband includes a current subband; The second encoding module is specifically used for: If the number of frequency points in which the value of the spectrum reservation flag in the current sub-band is equal to the second preset value is greater than a preset threshold, the value of the spectrum reservation flag of the current sub-band is determined to be the first flag value, wherein if the spectrum value before the frequency band extension coding and the spectrum value after the frequency band extension coding corresponding to one frequency point meet a preset condition, the value of the spectrum reservation flag of the one frequency point is determined to be the second preset value; or If the number of frequency points in the current sub-band whose spectrum reservation flag value is equal to the second preset value is less than or equal to the preset threshold, the spectrum reservation flag value of the current sub-band is the second flag value.

16. The device according to claim 14, characterized in that The second encoding module is specifically used for: Obtaining, according to the peak position information of the current frequency region, a subband sequence number corresponding to the peak position of the current frequency region; According to the subband sequence number corresponding to the peak position of the current frequency region and the spectrum reservation flag of each subband in the current frequency region, peak information of the current frequency region is filtered to obtain information of candidate tonal components of the current frequency region.

17. The device according to claim 16, characterized in that If the value of the spectrum reservation flag of the current sub-band is the second flag value, the peak value in the current sub-band is a candidate tone component.

18. The device according to claim 13 or 15, characterized in that The preset condition includes: the spectrum value before the frequency band extension coding corresponding to the frequency point is equal to the spectrum value after the frequency band extension coding.

19. An audio encoding device, characterized in that: include: A non-volatile memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute the method according to any one of claims 1 to 9.

20. An audio encoding device, characterized in that: The method comprises: an encoder configured to execute the method according to any one of claims 1 to 9.

21. A computer-readable storage medium, characterized in that: The invention comprises a computer program which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 9.

22. A computer-readable storage medium, characterized in that: The method comprises an encoded code stream obtained according to any one of the methods of claims 1 to 9.