Audio signal encoding method and device
By using the power spectrum ratio of audio signals to obtain tonal component information in three-dimensional audio coding and decoding technology, the problem of accurately determining the tonal components of high-frequency signals in the existing technology is solved, and the coding quality and efficiency are improved.
Patent Information
- Application Number
- CN202010318590.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-21
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-04-21
AI Technical Summary
In existing three-dimensional audio coding and decoding technology, how to accurately determine the tonal component information of high-frequency signals to improve the quality of encoded audio signals is an urgent technical problem that needs to be solved.
By obtaining the power spectrum ratio of the current frequency point in the current frequency region of at least part of the current frame of the audio signal, the encoding parameters are obtained to represent the tonal component information, and the code stream is multiplexed to generate the encoded code stream, thereby accurately obtaining the tonality Ingredient information.
This method can more accurately reflect signal characteristics and improve the accuracy of tonal component information, thereby improving encoding quality and reducing encoding bit rate.
Smart Images

Figure CN113539281B
Abstract
Description
Technical Field
[0001] The present application relates to audio coding and decoding technology, and in particular to an audio signal coding method and device. Background Art
[0002] With the continuous development of multimedia technology, audio has been widely used in multimedia communications, consumer electronics, virtual reality, human-computer interaction and other fields. Users have higher and higher demands for audio quality. Three-dimensional audio (3D audio) has a close to real sense of space and can provide users with a better immersive experience, becoming a new trend in multimedia technology.
[0003] The audio signal that the three-dimensional audio codec needs to compress and encode contains multiple signals. Generally, the three-dimensional audio codec uses the correlation between channels to downmix the multiple signals to obtain a downmix signal and multi-channel encoding parameters. Generally, the number of channels of the downmix signal is much smaller than the number of channels of the input audio signal. Then, the downmix signal and the multi-channel encoding parameters are encoded. The number of bits used to encode the downmix signal and the multi-channel encoding parameters is much smaller than the number of bits used to independently encode the multiple channels. In the process of encoding the downmix signal and the multi-channel encoding parameters, in order to reduce the encoding bit rate, the correlation between signals in different frequency bands can be further used for encoding.
[0004] The basic principle of encoding by using the correlation between signals in different frequency bands is to use the correlation between low-frequency band signals and signals in different frequency bands, and adopt the band extension technology or spectrum replication technology to encode the high-frequency band signals, so as to encode the high-frequency band signals with fewer bits, thereby reducing the encoding bit rate of the entire multi-dimensional encoder. However, in real audio signals, there are often some tone components in the spectrum of the high-frequency band that are not similar to the spectrum of the low-frequency band. In order to encode the tone component information in the high-frequency band signal, a tone detection algorithm can be used to determine the tone component information that needs to be encoded, and then the tone component information is encoded so that the decoding end can accurately decode and obtain the high-frequency signal.
[0005] Among them, how to accurately determine the pitch component information of the high-frequency signal to improve the quality of the encoded audio signal has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present application provides an audio signal encoding method and device, which are beneficial to improving the quality of encoded audio signals.
[0007] In a first aspect, the present application provides an audio signal encoding method, which may include: obtaining a current frame of an audio signal. Obtaining encoding parameters based on the power spectrum ratio of a current frequency point in a current frequency region of at least a portion of the signal of the current frame, the encoding parameters are used to represent the tone component information of at least a portion of the signal, the tone component information includes at least one of the position information of the tone component, the quantity information of the tone component, the amplitude information of the tone component, or the energy information of the tone component, 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. Performing code stream multiplexing on the encoding parameters to obtain an encoded code stream.
[0008] In this implementation, the tone component information of at least part of the signal is obtained by the power spectrum ratio of the current frequency point of at least part of the signal of the current frame of the audio signal, and the encoded bit stream is obtained based on the tone component information. Since the power spectrum ratio is the ratio of the power spectrum to the average value of the power spectrum, it can better reflect the signal characteristics, thereby accurately obtaining the tone component information, so that the decoding end can more accurately reconstruct the audio signal according to the tone component information, thereby improving the encoding quality.
[0009] In one possible design, obtaining a coding parameter based on a power spectrum ratio of a current frequency point in a current frequency region of at least a portion of the signal may include: performing a peak search in the current frequency region based on the power spectrum ratio of the current frequency point to obtain at least one of the number information of peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks, where the peaks are power spectrum peaks or power spectrum ratio peaks. The coding parameter is obtained based on at least one of the number information of peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks.
[0010] In this implementation, a peak search is performed in the current frequency region through the power spectrum ratio of the current frequency point to obtain relevant information of the peak in the current frequency region (for example, at least one of quantity information, position information, amplitude information or energy information, etc.), and the above encoding parameters are obtained according to the relevant information of the peak in the current frequency region, so that the decoding end can more accurately reconstruct the audio signal according to the encoding parameters to improve the encoding quality. Since the power spectrum ratio is used in the peak search process, the accuracy of the peak obtained by the search can be improved, which is beneficial to improve the accuracy of the tone component information.
[0011] Furthermore, since the dynamic range of the power spectrum is large, using the power spectrum ratio can improve the peak search efficiency.
[0012] In one possible design, performing a peak search in the current frequency region based on the power spectrum ratio of the current frequency point may include: performing a peak search in the current frequency region based on the power spectrum ratio of the current frequency point, the power spectrum ratio of the left adjacent frequency point of the current frequency point, the power spectrum ratio of the right adjacent frequency point of the current frequency point, the average value of the power spectrum ratio of the current frequency region, the average value of the power spectrum ratio of the region adjacent to the left of the current frequency point, and the average value of the power spectrum ratio of the region adjacent to the right of the current frequency point.
[0013] Among them, the left neighboring area of the current frequency point includes N_neighbor_l frequency points whose frequency point numbers are smaller than the frequency point number of the current frequency point, N_neighbor_l is an arbitrary natural number, and the right neighboring area of the current frequency point includes N_neighbor_r frequency points whose frequency point numbers are larger than the frequency point number of the current frequency point, N_neighbor_r is an arbitrary natural number.
[0014] The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
[0015] This implementation method performs a peak search in the current frequency area based on the power spectrum ratio of the current frequency point, the average power spectrum ratio of the current frequency area, the power spectrum ratio of the left adjacent frequency point of the current frequency point, the power spectrum ratio of the right adjacent frequency point of the current frequency point, the average power spectrum ratio of the left adjacent area of the current frequency point, and the average power spectrum ratio of the right adjacent area of the current frequency point, thereby improving the accuracy of the peak value obtained by the search.
[0016] In a possible design, according to the power spectrum ratio of the current frequency point, the power spectrum ratio of the left adjacent frequency point of the current frequency point, the power spectrum ratio of the right adjacent frequency point of the current frequency point, the average value of the power spectrum ratio of the current frequency region, the average value of the power spectrum ratio of the left adjacent region of the current frequency point, and the average value of the power spectrum ratio of the right adjacent region of the current frequency point, a peak search is performed in the current frequency region, which may include: judging whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to a first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the left adjacent region of the current frequency point is greater than a second preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the right adjacent region of the current frequency point is greater than a third preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the current frequency region is greater than a fourth preset threshold. When the power spectrum ratio of the current frequency point meets the condition, the current frequency point is determined to be the frequency point corresponding to the peak.
[0017] In a possible design, performing a peak search in the current frequency region according to the power spectrum ratio of the current frequency point may include: determining whether the power spectrum ratio of the current frequency point satisfies at least one of the following conditions: greater than or equal to a first preset threshold; or, greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; or, greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; or, greater than the average value of the power spectrum ratio of the left adjacent region of the current frequency point; or, greater than the average value of the power spectrum ratio of the right adjacent region of the current frequency point; or, greater than the average value of the power spectrum ratio of the current frequency region. When at least one of the conditions is met, the current frequency point is determined to be the frequency point corresponding to the peak value.
[0018] In a possible design, performing a peak search in the current frequency region according to the power spectrum ratio of the current frequency point may include: determining whether the power spectrum ratio of the current frequency point satisfies the following conditions: greater than or equal to a first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point. When the conditions are met, determining that the current frequency point is the frequency point corresponding to the peak value.
[0019] In one possible design, obtaining the coding parameter according to at least one of the number information of peaks, the position information of peaks, the amplitude information of peaks, or the energy information of peaks in the current frequency region may include: determining at least one of the number information of tone components, the position information of tone components, the amplitude information of tone components, or the energy information of tone components according to at least one of the number information of peaks, the position information of peaks, the amplitude information of peaks, or the energy information of peaks in the current frequency region. Obtaining the coding parameter according to at least one of the number information of the tone components, the position information of the tone components, the amplitude information of the tone components, or the energy information of the tone components.
[0020] In one possible design, the at least partial signal includes a high-frequency band signal of the current frame.
[0021] This implementation method can accurately obtain the tone component information in the high-frequency band signal of the current frame through the power spectrum ratio, thereby improving the encoding quality.
[0022] In a second aspect, an embodiment of the present application provides an audio signal encoding device, which may be an encoder or a core encoder, or a functional module in an encoder or a core encoder for implementing the method of the first aspect or any possible design of the first aspect. The audio signal encoding device may implement the functions performed in the first aspect or each possible design of the first aspect, and the functions may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, in a possible implementation, the audio signal encoding device may include: an acquisition module, a coding parameter determination module, and a code stream multiplexing module.
[0023] The acquisition module is used to acquire the current frame of the audio signal. The coding parameter determination module is used to acquire the coding parameter according to the power spectrum ratio of the current frequency point of the current frequency region of at least part of the signal of the current frame, the coding parameter is used to represent the tone component information of at least part of the signal, the tone component information includes at least one of the position information of the tone component, the quantity information of the tone component, the amplitude information of the tone component or the energy information of the tone component, 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 code stream multiplexing module is used to perform code stream multiplexing on the coding parameter to acquire the coded code stream.
[0024] In one possible design, the coding parameter determination module is used to: perform a peak search in the current frequency region according to the power spectrum ratio of the current frequency point to obtain at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks. The coding parameter is obtained according to at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks.
[0025] In one possible design, the coding parameter determination module is used to perform a peak search in the current frequency area based on the power spectrum ratio of the current frequency point, the power spectrum ratio of the left adjacent frequency point of the current frequency point, the power spectrum ratio of the right adjacent frequency point of the current frequency point, the average value of the power spectrum ratio of the current frequency area, the average value of the power spectrum ratio of the left adjacent area of the current frequency point, and the average value of the power spectrum ratio of the right adjacent area of the current frequency point.
[0026] Among them, the left neighboring area of the current frequency point includes N_neighbor_l frequency points whose frequency point numbers are smaller than the frequency point number of the current frequency point, N_neighbor_l is an arbitrary natural number, and the right neighboring area of the current frequency point includes N_neighbor_r frequency points whose frequency point numbers are larger than the frequency point number of the current frequency point, N_neighbor_r is an arbitrary natural number.
[0027] The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
[0028] In a possible design, the coding parameter determination module is used to determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to the first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the left adjacent area of the current frequency point is greater than the second preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the right adjacent area of the current frequency point is greater than the third preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the current frequency area is greater than the fourth preset threshold. When the power spectrum ratio of the current frequency point meets the conditions, the current frequency point is determined to be the frequency point corresponding to the peak value.
[0029] In a possible design, the coding parameter determination module is used to determine whether the power spectrum ratio of the current frequency point satisfies at least one of the following conditions: greater than or equal to a first preset threshold; or greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; or greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; or greater than the average value of the power spectrum ratio of the left adjacent area of the current frequency point; or greater than the average value of the power spectrum ratio of the right adjacent area of the current frequency point; or greater than the average value of the power spectrum ratio of the current frequency area. When at least one of the conditions is met, the current frequency point is determined to be the frequency point corresponding to the peak.
[0030] In a possible design, the coding parameter determination module is used to determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to a first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point. When the conditions are met, the current frequency point is determined to be the frequency point corresponding to the peak.
[0031] In one possible design, the coding parameter determination module is used to: determine at least one of the quantity information of the tone component, the position information of the tone component, the amplitude information of the tone component, or the energy information of the tone component according to at least one of the quantity information of the peak, the position information of the peak, the amplitude information of the peak, or the energy information of the peak in the current frequency region. The coding parameter is obtained according to at least one of the quantity information of the tone component, the position information of the tone component, the amplitude information of the tone component, or the energy information of the tone component.
[0032] In one possible design, the at least partial signal includes a high-frequency band signal of the current frame.
[0033] In a third aspect, an embodiment of the present application provides an audio signal 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.
[0034] In a fourth aspect, an embodiment of the present application provides an audio signal encoding and decoding device, including: an encoder, wherein the encoder is used to execute the method as described in any one of the above-mentioned first aspects.
[0035] 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.
[0036] 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.
[0037] 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.
[0038] 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.
[0039] The audio signal encoding method and device of the embodiments of the present application obtain the tone component information of the audio signal through the power spectrum ratio of the audio signal, and obtain the encoded bit stream based on the tone component information. Since the power spectrum ratio is the ratio of the power spectrum to the average power spectrum, it can better reflect the signal characteristics, thereby accurately obtaining the tone component information, so that the decoding end can more accurately obtain the audio signal according to the tone component information, thereby improving the encoding quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of an example of an audio encoding and decoding system in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of an audio coding application in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of an audio coding application in an embodiment of the present application;
[0043] Figure 4 This is a flowchart of an audio signal encoding method according to an embodiment of the present application;
[0044] Figure 5 A flowchart of another audio signal encoding method according to an embodiment of the present application;
[0045] Figure 6 A flowchart of another audio signal encoding method according to an embodiment of the present application;
[0046] Figure 7 A flowchart of another audio signal encoding method according to an embodiment of the present application;
[0047] Figure 8 A schematic diagram of an audio signal encoding device according to an embodiment of the present application;
[0048] Fig. 9 A schematic diagram of an audio signal encoding device according to an embodiment of the present application. DETAILED DESCRIPTION
[0049] The terms "first", "second", etc., which are involved in the embodiments of the present application, are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, including a series of steps or units. The method, system, product or device is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0050] 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.
[0051] 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 the 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, RAM, ROM, EEPROM, flash memory, or any other media that can be used to store the desired program code in the form of instructions or data structures that can be accessed by a computer, as described herein. The source device 12 and the destination device 14 may include various devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, so-called "smart" phones and other telephone handsets, televisions, speakers, digital media players, video game consoles, in-vehicle computers, wireless communication devices, or the like.
[0052] 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.
[0053] 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.
[0054] 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:
[0055] 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.
[0056] 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 .
[0057] 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.
[0058] 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 signal encoding method described in this application on the encoding side.
[0059] 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.
[0060] 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:
[0061] 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.
[0062] 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.
[0063] The decoder 30 (or 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 signal encoding method described in this application on the decoding side.
[0064] 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.
[0065] 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.
[0066] Although, Figure 1The 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.
[0067] 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.
[0068] 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.
[0069] In some cases, Figure 1The 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.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] The mobile terminal 230 sends the transmission signal to the mobile terminal 240 via a wireless or wired network.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] The above-mentioned encoder can execute the audio signal encoding method of the embodiment of the present application to determine the tone component information of the audio signal according to the power spectrum ratio of the audio signal, and obtain the encoded bit stream based on the tone component information. Since the power spectrum ratio is the ratio of the power spectrum to the average power spectrum, it can better reflect the signal characteristics, thereby accurately obtaining the tone component information, so that the decoding end can more accurately reconstruct the audio signal according to the tone component information, thereby improving the encoding quality.
[0085] For example, the above encoder or the core encoder inside the encoder obtains the current frame of the audio signal, and obtains the encoding parameters according to the power spectrum ratio of at least one frequency point of at least one frequency region of at least part of the signal of the current frame, and the encoding parameters are used to represent the tone component information of at least part of the signal, and the tone component information includes at least one of the position information of the tone component, the quantity information of the tone component, the amplitude information of the tone component, or the energy information of the tone component. The encoding parameters are multiplexed to obtain the encoded bitstream. The specific implementation method can be found in the following Figure 4 Detailed explanation of the illustrated embodiment.
[0086] Figure 4 is a flowchart of an audio signal 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:
[0087] Step 101: Get the current frame of the audio signal.
[0088] The current frame may be any frame in the audio signal. In other words, any frame or each frame in the audio signal may be processed as in step 101 to step 103 of the embodiment of the present application.
[0089] Step 102: Obtain coding parameters according to a power spectrum ratio of a current frequency point in a current frequency region of at least a portion of a signal of a current frame.
[0090] The coding parameter is used to represent the tone component information of the at least part of the signal, and the tone component information may include at least one of the position information of the tone component, the quantity information of the tone component, the amplitude information of the tone component, or the energy information of the tone component. The power spectrum ratio of the current frequency point is the ratio of the value of the power spectrum of the current frequency point to the average value of the power spectrum of the current frequency region. The average value of the power spectrum may also be called the average power spectrum.
[0091] Explain at least part of the signal of the current frame. At least part of the signal of the current frame may be a high-frequency band signal of the current frame, or a low-frequency band signal of the current frame, or a full-frequency band signal of the current frame, or a signal of one or more frequency regions of the current frame, or may be a part of the signal in the high-frequency band signal, for example, a signal of one or more frequency regions of the high-frequency band signal, or may be a part of the signal in the low-frequency band signal, for example, a signal of one or more frequency regions of the low-frequency band signal. The specific explanation of the high-frequency signal and the low-frequency band signal may refer to the following Figure 5 Explanation of step 201 of the illustrated embodiment.
[0092] The current frequency region of the at least part of the signal may be any frequency region in the at least part of the signal, and the current frequency point may be any frequency point in the current frequency region.
[0093] In one implementable manner, a peak search can be performed in the current frequency region according to the power spectrum ratio of the current frequency point to obtain at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks. The encoding parameters are obtained according to at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks. The peak can be a power spectrum ratio peak or a power spectrum peak. The power spectrum ratio peak and the power spectrum peak correspond to the same frequency point, and the power spectrum ratio peak can indicate the power spectrum peak.
[0094] In some embodiments, the peak involved in the embodiments of the present application may also be an energy spectrum peak or an energy spectrum ratio peak. The energy spectrum ratio peak and the energy spectrum peak correspond to the same frequency point, so the energy spectrum ratio peak can indicate the energy spectrum peak.
[0095] Since the dynamic range of the energy spectrum / power spectrum is large, using the power spectrum ratio / energy spectrum ratio can improve the search efficiency.
[0096] In other words, the power spectrum ratio in the embodiment of the present application can be replaced by an energy spectrum ratio, which is the ratio of the energy of a frequency point in the current frequency region to the average energy of the current frequency region. For example, the encoding parameter is obtained according to the energy spectrum ratio of at least one frequency point in at least one frequency region of at least part of the signal of the current frame.
[0097] Step 103: multiplex the encoding parameters to obtain an encoded bitstream.
[0098] The coded code stream may be a payload code stream, which may carry specific information of each frame of the audio signal, for example, may carry tone component information of each frame.
[0099] In some embodiments, 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.
[0100] The encoder sends the encoded code stream to the decoder, and the decoder demultiplexes the encoded code stream to obtain the encoding parameters, thereby accurately obtaining the current frame of the audio signal.
[0101] In this embodiment, the tone component information of at least a portion of the signal of the current frame of the audio signal is obtained by the power spectrum ratio of the at least a portion of the signal, and the encoded bit stream is obtained based on the tone component information. Since the power spectrum ratio is the ratio of the power spectrum value to the average value of the power spectrum, it can better reflect the signal characteristics, thereby accurately obtaining the tone component information, so that the decoding end can more accurately reconstruct at least a portion of the signal of the current frame according to the tone component information, thereby accurately obtaining the current frame of the audio signal and improving the encoding quality.
[0102] The following example uses the power spectrum ratio of a high-frequency band signal to obtain tone component information to illustrate the audio signal encoding method of the embodiment of the present application.
[0103] Figure 5 is a flowchart of an audio signal 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 5 As shown, the method of this embodiment may include:
[0104] Step 201: Acquire a current frame of an audio signal, where the current frame includes a first partial signal and a second partial signal, and a frequency of the first partial signal is higher than a frequency of the second partial signal.
[0105] Wherein, the current frame can be any frame in the audio signal, the first part of the signal can also be called a high-frequency band signal, and the second part of the signal can also be called a low-frequency band signal. Wherein, the division of the high-frequency band signal and the low-frequency band signal in the current frame can be determined by a frequency band threshold. The part of the current frame that is higher than the frequency band threshold is the high-frequency band signal, and the part that is lower than the frequency band threshold is the 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 encoder and the decoder, and is not specifically limited here.
[0106] For example, when the current frame is a wideband signal of 0-8 khz, the frequency band threshold may be 4 khz. When the current frame is an ultra-wideband signal of 0-16 khz, the frequency band threshold may be 8 khz.
[0107] Step 202: Obtain a first encoding parameter according to the first partial signal and the second partial signal.
[0108] The first coding parameter is used by the decoding end to reconstruct the current frame of the audio signal. Exemplarily, the first coding parameter may include: any one of a time domain noise shaping parameter, a frequency domain noise shaping parameter, a spectrum quantization parameter, or a frequency band extension information, or a combination thereof.
[0109] Taking the frequency band extension information as an example, the determination of the frequency band extension information may be performed in units of frequency regions (tiles) or in units of frequency bands (SFBs). In other words, the frequency band extension information included in the first coding parameter may be frequency band extension information corresponding to one or more frequency regions (tiles), or one or more frequency bands (SFBs) may correspond to one frequency band extension information, or may include both frequency band extension information corresponding to a frequency region (tile) and frequency band (SFB) corresponding to one frequency band extension information.
[0110] The upper limit of the frequency band extension corresponding to the frequency band extension information may be determined in the process of acquiring the frequency band extension information, or may be obtained by presetting or looking up a table.
[0111] Likewise, the number of frequency regions of the frequency band extension corresponding to the frequency band extension information may also be determined in the process of acquiring the frequency band extension information, or may be obtained by presetting or looking up a table.
[0112] The frequency band extension upper limit corresponding to the frequency band extension information may be one or more of the highest frequency of the frequency band extension, the highest frequency point number, the highest frequency band number, or the highest frequency area number.
[0113] For example, during the encoding process, the high frequency band may be divided into K frequency regions (tiles), each of which is divided into N frequency bands (SFBs), and the frequency band extension information may be obtained with the frequency region (tile) or frequency band (SFB) as the granularity. Alternatively, the high frequency band may be divided into K frequency regions (tiles), each of which is divided into one or more frequency bands (SFBs), and each band may be further divided into one or more sub-bands, and parameters, such as spectrum quantization parameters, may be obtained with the frequency region (tile) or frequency band (SFB) or sub-band as the granularity.
[0114] Step 203: Obtain a second coding parameter according to the power spectrum ratio of the first partial signal, where the second coding parameter is used to represent the tone component information of the first partial signal, where the tone component information includes at least one of the position information, quantity, amplitude or energy of the tone component.
[0115] The second coding parameter is used for the decoding end to reconstruct the first part of the signal, that is, to reconstruct the high-frequency band signal of the current frame. The second coding parameter may include the high-frequency band parameter of the current frame, and the high-frequency band parameter may include the tone component information of the high-frequency band signal. 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 high-frequency band parameter of the current frame may include the high-frequency band parameter of one or more frequency domain regions, that is, the tone component information of one or more frequency regions. The number of frequency regions for which the high-frequency band parameter needs to be obtained may be predetermined, may be calculated according to a specific algorithm, or may be obtained from a bit stream, which is not limited in the embodiments of the present application.
[0116] The process of acquiring the second encoding parameter of the current frame according to the high-frequency band signal may be performed according to the frequency region division and / or sub-band division of the high-frequency band corresponding to the high-frequency band signal.
[0117] The embodiment of the present application can determine the peak value of the high-frequency band signal according to the power spectrum ratio of the first part of the signal (high-frequency band signal), determine the tone component based on the peak value, and obtain the second encoding parameter according to at least one of the position information, quantity information, amplitude information or energy information of the tone component.
[0118] The power spectrum ratio of this high-frequency band signal is the ratio of the mean value of the power spectrum of the high-frequency band signal and the power spectrum of the frequency region where the high-frequency band signal is located. For example, the power spectrum ratio of this high-frequency band signal comprises the ratio of the power spectrum of at least one frequency region of this high-frequency band signal and the average power spectrum, and this average power spectrum is the average power spectrum of at least one frequency region of this high-frequency band signal.
[0119] Step 204: multiplex the first encoding parameter and the second encoding parameter to obtain an encoded bitstream.
[0120] The encoder sends the encoded code stream to the decoder, and the decoder demultiplexes the encoded code stream to obtain the first encoding parameter and the second encoding parameter, thereby accurately obtaining the current frame of the audio signal. The specific explanation of the encoded code stream can refer to the explanation of the encoded code stream in step 103 above, which will not be repeated here.
[0121] In this embodiment, the tone component information of the high-frequency band signal is obtained by the power spectrum ratio of the high-frequency band signal of the audio signal, and the encoded bit stream is obtained based on the tone component information. Since the power spectrum ratio is the ratio of the power spectrum to the average power spectrum, it can better reflect the signal characteristics, thereby accurately obtaining the tone component information, so that the decoding end can more accurately reconstruct the high-frequency band signal according to the tone component information, thereby accurately obtaining the audio signal and improving the encoding quality.
[0122] Figure 6 is a flowchart of another audio signal 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 the core encoder inside the encoder. Figure 5 A specific implementation of the embodiment shown is as follows: Figure 6 As shown, the method of this embodiment may include:
[0123] Step 301: Acquire a current frame of an audio signal, where the current frame includes a high-frequency band signal and a low-frequency band signal.
[0124] Step 302: Obtain a first encoding parameter according to the high-frequency band signal and the low-frequency band signal.
[0125] The high frequency band signal includes a high frequency band signal of at least one frequency region. Figure 5 Step 201 and step 202 of the illustrated embodiment will not be described in detail here.
[0126] Step 303: Acquire a power spectrum ratio of the high-band signal in at least one frequency region according to the high-band signal in the frequency region.
[0127] Exemplary, a frequency region (for example, current frequency region, this current frequency region can be any frequency region in this high frequency band signal) is used as an example to explain, and the same operation can be performed to each frequency domain region.According to the high frequency band signal of this frequency region, the power spectrum of the high frequency band signal of this frequency region is obtained.The power spectrum of this high frequency band signal can include the power spectrum of each frequency point of this frequency region.According to the power spectrum of the high frequency band signal of this frequency region, the average power spectrum of frequency region is determined.According to the power spectrum of the high frequency band signal of this frequency region and the average power spectrum of this frequency region, the power spectrum ratio of the high frequency signal of this frequency region is determined.This power spectrum ratio is the power spectrum of the high frequency band signal of this frequency region divided by the average power spectrum of this frequency region.
[0128] For example, the average power spectrum of a frequency region (tile) can be calculated by the following formula (1).
[0129]
[0130] Where powerSpectrum is the power spectrum of the frequency region, tile_width is the width (number of frequency points) of the frequency region (tile), and mean_powerspec is the average power spectrum, also called the power spectrum mean.
[0131] The ratio of the power spectrum of each frequency point in a frequency region (tile) to the average power spectrum can be calculated by the following formula (2). The power spectrum ratio can be expressed as a logarithm with a base of 10:
[0132]
[0133] Where: tile[p] is the starting frequency of the pth tile, sb is the frequency number, peak_ratio represents the power spectrum ratio, powerSpectrum[sb] is the power spectrum of frequency sb, mean_powerspec is the average power spectrum of the frequency region where frequency sb is located. A is the minimum value to ensure the validity of logarithmic operation, for example, A = 1.0e -18 .
[0134] Regarding the frequency point number, the embodiment of the present application takes the frequency point numbers of the frequency points in the frequency domain area increasing from low frequency (left) to high frequency (right) as an example for illustration.
[0135] Step 304: perform peak search in the frequency region according to the power spectrum ratio of the high-frequency band signal in the frequency region to obtain at least one of the number information of peaks, the position information of peaks, the amplitude information of peaks or the energy information of peaks in the frequency region.
[0136] The embodiment of the present application performs peak search based on the power spectrum ratio. Since the power spectrum ratio can better reflect the signal characteristics, the peak value obtained by the search is more accurate, and then the tone component is determined based on the peak value, which can make the tone component more accurate, thereby accurately obtaining the tone component information, so that the decoding end can more accurately reconstruct the high-frequency band signal based on the tone component information.
[0137] The range for peak search can be the range of the frequency region excluding the two end frequency points, or a partial region within the frequency region, or all the frequency points within the frequency region, which can be flexibly set according to needs. For the range for peak search being all the frequency points in the frequency region, in some embodiments, when it is necessary to compare the power spectrum ratio of a frequency point with that of the left adjacent frequency point, the leftmost frequency point in the frequency region can be ignored, that is, no peak search is performed on the leftmost frequency point. In some embodiments, when it is necessary to compare the power spectrum ratio of a frequency point with that of the right adjacent frequency point, the rightmost frequency point in the frequency region can be ignored, that is, no peak search is performed on the rightmost frequency point.
[0138] Exemplarily, the peak value satisfies at least one of the following conditions, which are used to search for the peak value in the high-frequency band signal.
[0139] The conditions may include the following items (1) to (6).
[0140] (1) The power spectrum ratio of the frequency point where the peak value is located is greater than or equal to a first preset threshold.
[0141] In other words, the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located is greater than or equal to the first preset threshold, and the first preset threshold can be flexibly set according to demand. Taking a frequency region as an example, a frequency point whose power spectrum ratio is greater than or equal to the first preset threshold is searched among the frequency points in the frequency region, and the frequency point is the frequency point where the peak of the frequency region is located.
[0142] (2) The power spectrum ratio of the frequency point where the peak is located is greater than the power spectrum ratio of the left adjacent frequency point of the peak frequency point.
[0143] In other words, the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located is greater than the power spectrum ratio of the left adjacent frequency point where the peak is located. The left adjacent frequency point is adjacent to the frequency point where the peak is located, and the frequency point sequence number is less than the frequency point where the peak is located. Taking the frequency point sequence number of the frequency point where the peak is located as sb as an example, the frequency point sequence number of the left adjacent frequency point where the peak is located is sb-1. Of course, it can be understood that the frequency point sequence number of the left adjacent frequency point where the peak is located can also be sb-2, or sb-3, etc., which can be reasonably set according to demand. The left adjacent frequency point of the frequency point where the peak is located can also be multiple frequency points. For example, the frequency point sequence number of the left adjacent frequency point where the peak is located includes sb-1, sb-2 and sb-3.
[0144] (3) The power spectrum ratio of the frequency point where the peak is located is greater than the power spectrum ratio of the frequency point to the right of the peak.
[0145] In other words, the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located is greater than the power spectrum ratio of the right adjacent frequency point where the peak is located. The right adjacent frequency point is adjacent to the frequency point where the peak is located, and the frequency point sequence number is greater than the frequency point where the peak is located. Taking the frequency point sequence number of the frequency point where the peak is located as sb as an example, the frequency point sequence number of the right adjacent frequency point where the peak is located is sb+1. Of course, it can be understood that the frequency point sequence number of the right adjacent frequency point where the peak is located can also be sb+2, or sb+3, etc., which can be reasonably set according to needs. The right adjacent frequency point of the frequency point where the peak is located can also be multiple frequency points. For example, the frequency point sequence number of the right adjacent frequency point of the frequency point where the peak is located includes sb+1, sb+2 and sb+3.
[0146] (4) The power spectrum ratio of the frequency point where the peak is located is greater than the average value of the power spectrum ratio of the left neighboring area of the frequency point where the peak is located. The left neighboring area includes N_neighbor_l frequency points whose frequency point numbers are smaller than the frequency point number of the frequency point where the peak is located, and N_neighbor_l is an arbitrary natural number.
[0147] In other words, the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located is greater than the average value of the power spectrum ratio of the left adjacent area of the frequency point where the peak is located. Or the difference between the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located and the average value of the power spectrum ratio of the left adjacent area of the frequency point where the peak is located is greater than the second preset threshold value, and the second preset threshold value can be flexibly set according to demand. The left adjacent area includes N_neighbor_1 frequency points whose frequency point sequence number is less than the frequency point sequence number of the frequency point where the peak is located. Taking the frequency point sequence number of the frequency point where the peak is located as sb as an example, the frequency point sequence number included in the left adjacent area of the frequency point where the peak is located is sb-N_neighbor_1 to sb-1.
[0148] (5) The power spectrum ratio of the frequency point where the peak is located is greater than the average value of the power spectrum ratio of the right neighboring area of the frequency point where the peak is located. The right neighboring area includes N_neighbor_r frequency points whose frequency point numbers are greater than the frequency point number of the frequency point where the peak is located, where N_neighbor_r is an arbitrary natural number.
[0149] In other words, the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located is greater than the average value of the power spectrum ratio of the right neighboring area where the peak is located. Or the difference between the average value of the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located and the power spectrum ratio of the right neighboring area where the peak is located is greater than the third preset threshold, and the third preset threshold can be flexibly set according to demand. The right neighboring area includes N_neighbor_r frequency points whose frequency point sequence number is greater than the frequency point sequence number of the frequency point where the peak is located. Taking the frequency point sequence number of the frequency point where the peak is located as sb as an example, the frequency point sequence numbers included in the right neighboring area of the frequency point where the peak is located are sb+1 to sb+N_neighbor_r.
[0150] (6) The power spectrum ratio of the frequency point where the peak is located is greater than the average value of the power spectrum ratio of the frequency region where the peak is located.
[0151] In other words, the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located is greater than the average value of the power spectrum ratio of the frequency region where the peak is located. That is, the frequency point where the peak is located is a frequency point where the power spectrum ratio is higher than the average value of the power spectrum ratio of the frequency region where the peak is located. Or the difference between the power spectrum ratio of the frequency point where the peak of the high-frequency band signal is located and the average value of the power spectrum ratio of the frequency region where the peak is located is greater than the fourth preset threshold value, and the fourth preset threshold value can be flexibly set according to demand.
[0152] Of course, it can be understood that the above conditions may also include other items. The embodiments of the present application are illustrated by the above items (1) to (6), and the embodiments of the present application are not limited to them.
[0153] A feasible method is to determine at least one of the average value of the power spectrum ratio of the high-frequency band signal in the frequency region, the average value of the power spectrum ratio of the left adjacent region of each frequency point of the high-frequency band signal in the frequency region, or the average value of the power spectrum ratio of the right adjacent region of each frequency point of the high-frequency band signal in the frequency region according to the power spectrum ratio of the high-frequency band signal in the frequency region. According to at least one of the power spectrum ratio of each frequency point of the high-frequency band signal in the frequency region, the power spectrum ratio of the left adjacent frequency point of each frequency point, the power spectrum ratio of the right adjacent frequency point of each frequency point, the average value of the power spectrum ratio of the high-frequency band signal in the frequency region, the average value of the power spectrum ratio of the left adjacent region of each frequency point of the high-frequency band signal in the frequency region, or the average value of the power spectrum ratio of the right adjacent region of each frequency point of the high-frequency band signal in the frequency region, a peak search is performed in the frequency region to obtain at least one of the number of peaks in the frequency region, the position information of the peaks, the amplitude of the peaks, or the energy of the peaks.
[0154] For example, it is determined whether the power spectrum ratio of each frequency point of the high frequency band signal in the frequency region satisfies at least one of the following: greater than or equal to a first preset threshold; or, greater than the power spectrum ratio of the left adjacent frequency point of the frequency point; or, greater than the power spectrum ratio of the right adjacent frequency point of the frequency point; or, greater than the average value of the power spectrum ratio of the left adjacent region of the frequency point, the left adjacent region includes N_neighbor_l frequency points whose frequency point sequence number is less than the frequency point sequence number of the frequency point, N_neighbor_l is an arbitrary natural number; or, greater than the average value of the power spectrum ratio of the right adjacent region of the frequency point, the right adjacent region Including N_neighbor_r frequency points whose frequency point sequence number is greater than the frequency point sequence number of the frequency point, N_neighbor_r is an arbitrary natural number; or, greater than the average value of the power spectrum ratio of the frequency region; or, the difference between the power spectrum ratio of the frequency point and the average value of the power spectrum ratio of the left neighboring region of the frequency point is greater than the second preset threshold; or, the difference between the power spectrum ratio of the frequency point and the average value of the power spectrum ratio of the right neighboring region of the frequency point is greater than the third preset threshold; or, the difference between the power spectrum ratio of the frequency point and the average value of the power spectrum ratio of the frequency region where the frequency point is located is greater than the fourth preset threshold. When satisfied, determine that the frequency point is the frequency point corresponding to the peak, and obtain at least one of the number of peaks in the frequency region, the location information of the peaks, the amplitude of the peaks, or the energy of the peaks.
[0155] For another example, determine whether the power spectrum ratio of each frequency point of the high-frequency band signal in the frequency region satisfies all of the following items: greater than or equal to the first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the frequency point; the difference between the power spectrum ratio of the frequency point and the average value of the power spectrum ratio of the left adjacent region of the frequency point is greater than the second preset threshold, the left adjacent region includes N_neighbor_l frequency points whose frequency point numbers are less than the frequency point number of the frequency point, and N_neighbor_l is an arbitrary natural number; the difference between the power spectrum ratio of the frequency point and the average value of the power spectrum ratio of the right adjacent region of the frequency point is greater than the third preset threshold, the right adjacent region includes N_neighbor_r frequency points whose frequency point numbers are greater than the frequency point number of the frequency point, and N_neighbor_r is an arbitrary natural number; the difference between the power spectrum ratio of the frequency point and the average value of the power spectrum ratio of the frequency region where the frequency point is located is greater than the fourth preset threshold. When the condition is satisfied, the frequency point is determined to be the frequency point corresponding to the peak, and at least one of the number of peaks, the position information of the peaks, the amplitude of the peaks or the energy of the peaks in the frequency region is obtained.
[0156] Take the peak search for the frequency points in the range of [1, tile_width-2], the first preset threshold is 2.0f, the second preset threshold is 12, the third preset threshold is 12, and the fourth preset threshold is 15 as an example, tile_width is the width of the frequency region. The judgment includes the following conditions:
[0157] Condition 1 (Cond1): peak_ratio[sb]≥2.0f;
[0158] Condition 2 (Cond2): peak_ratio[sb]>peak_ratio[sb-1] and peak_ratio[sb]>peak_ratio[sb+1];
[0159] Condition 3 (Cond3): peak_ratio[sb]>neighbor_l+12;
[0160] Condition 4 (Cond4): peak_ratio[sb]>neighbor_r+12;
[0161] Condition 5 (Cond5): peak_ratio[sb]>mean_ratio+25;
[0162] The frequency point that meets all the above conditions is the frequency point corresponding to the peak value. For the specific explanation of mean_ratio, neighbor_l, and neighbor_r, refer to the following formulas (3) to (5).
[0163] For another example, it is determined whether the power spectrum ratio of each frequency point of the high frequency band signal in the frequency region satisfies all of the following items: greater than or equal to the first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the frequency point. If all of the above items are met, the frequency point is determined to be the frequency point corresponding to the peak value, and at least one of the number of peak values, the position information of the peak values, the amplitude of the peak values, or the energy of the peak values in the frequency region is obtained.
[0164] The judgment conditions for the peak search may also be other conditions, or a combination of the above conditions. The embodiments of the present application use the above judgment methods as examples for illustration, but are not intended to be limiting.
[0165] The peak search may be performed on each frequency point in the entire frequency region, or only within the range of the frequency region excluding the start frequency point and the cutoff frequency point, or within a predefined peak search range within the frequency region. The peak search ranges for different frequency regions may be the same or different.
[0166] The peak amplitude information or peak energy information may include the peak power spectrum ratio, the peak power spectrum, the peak energy, and the peak energy ratio. The energy ratio is the ratio of the energy of the signal spectrum in the frequency region to the average energy. The average energy is the average value of the signal spectrum energy in the frequency region.
[0167] Step 305: Obtain the second encoding parameter according to at least one of the number of peaks in the frequency region, the location information of the peaks, the amplitude of the peaks, or the energy of the peaks.
[0168] Optionally, in some embodiments, some frequency points that meet the above conditions can be selected as the frequency points where the filtered peaks are located, and based on at least one of the quantity information, position information, amplitude information or energy information of the filtered peaks, the quantity information, position information, amplitude information or energy information of the peaks can be determined, and based on at least one of the quantity information, position information, amplitude information or energy information of the tone components, the second encoding parameter can be obtained.
[0169] For example, a method of filtering peaks, the peaks of the high-frequency band signal include N peaks, and the embodiment of the present application can also select M peaks as filtered peaks based on the power spectrum ratio or energy or amplitude of the N peaks. N and M are any positive integers, and N≥M. For example, based on the energy or amplitude of the N peaks, M peaks with larger energy or amplitude of the N peaks can be selected, that is, the energy or amplitude of the M peaks is greater than the energy or amplitude of the peaks other than the M peaks among the N peaks.
[0170] The amplitude information of the tone component or the energy information of the tone component may include the power spectrum ratio of the tone component, the power spectrum of the tone component, the energy of the tone component, and the energy ratio of the tone component. The energy ratio is the ratio of the energy of the signal spectrum in the frequency region to the average energy. The average energy is the average value of the signal spectrum energy in the frequency region.
[0171] Step 306: multiplex the first encoding parameter and the second encoding parameter to obtain an encoded bitstream.
[0172] The encoder sends the encoded code stream to the decoder, and the decoder demultiplexes the encoded code stream to obtain the first encoding parameter and the second encoding parameter, thereby accurately obtaining the current frame of the audio signal.
[0173] In this embodiment, a peak search is performed through the power spectrum ratio of the high-frequency band signal of the audio signal. Since the power spectrum ratio can better reflect the signal characteristics, the peak value obtained by the search is more accurate, and then the tone component is determined based on the peak value, which can make the tone component more accurate, thereby accurately obtaining the tone component information, so that the decoding end can more accurately reconstruct the high-frequency band signal according to the tone component information, thereby accurately obtaining the audio signal and improving the encoding quality.
[0174] Figure 7is a flowchart of another audio signal 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. Figure 6 Step 304 of the embodiment shown is specifically explained. This embodiment takes a frequency region as an example. Figure 7 As shown, the method of this embodiment may include:
[0175] Step 401: Obtain an average value parameter of the power spectrum ratio according to the power spectrum ratio of the high-frequency band signal in the frequency region.
[0176] The average value parameter of the power spectrum ratio includes at least one of a first average value parameter of the power spectrum ratio, a second average value parameter of the power spectrum ratio, or a third average value parameter of the power spectrum ratio.
[0177] The first average parameter is the average value of the power spectrum ratios of all frequency points in the frequency region. In other words, the first average parameter corresponds to the frequency region, for example, corresponds to one frequency region.
[0178] Taking the above formula (1) and formula (2) as an example, the first average value parameter of this embodiment is explained, and the first average value parameter mean_ratio can be calculated by the following formula (3).
[0179]
[0180] Where tile_width is the tile width, tile[p] is the starting frequency of the pth tile, and sb belongs to [tile[p], tile[p]+tile_width-1].
[0181] The second average parameter is the average value of the power spectrum ratio in the left neighbor region of the frequency point. The left neighbor region refers to N_neighbor_1 frequency points whose frequency point numbers are smaller than the frequency point number of the frequency point. In other words, the second average parameter corresponds to each frequency point in the frequency region, for example, one second average parameter corresponds to one frequency point.
[0182] Taking the above formula (1) and formula (2) as an example, the second average value parameter of this embodiment is explained, and the second average value parameter neighbor_1 can be calculated by the following formula (4).
[0183]
[0184] Wherein, N_neighbor_1 is the number of points in the left neighboring area, for example, 3. sb is the frequency point number, and the left neighboring area of sb includes the frequency points in [sb-N_neighbor_1, sb-1].
[0185] The third average parameter is the average value of the power spectrum ratio in the right neighbor region of the frequency point. The right neighbor region refers to N_neighbor_r frequency points whose frequency point numbers are greater than the frequency point number of the frequency point. In other words, the third average parameter corresponds to each frequency point in the frequency region, for example, one third average parameter corresponds to one frequency point.
[0186] Taking the above formula (1) and formula (2) as an example, the third average value parameter of this embodiment is explained. The third average value parameter neighbor_r can be calculated by the following formula (5).
[0187]
[0188] Wherein, N_neighbor_r is the number of points in the right neighboring area, for example, 3. sb is the frequency point number, and the right neighboring area of sb includes the frequency points in [sb+1, sb+N_neighbor_r].
[0189] Step 402: Obtain at least one of a first judgment flag, a second judgment flag, a third judgment flag, a fourth judgment flag, or a fifth judgment flag according to the power spectrum ratio and the average value parameter of the power spectrum ratio.
[0190] For each frequency point in the frequency region, at least one of a first judgment flag, a second judgment flag, a third judgment flag, a fourth judgment flag, or a fifth judgment flag is obtained.
[0191] Taking a frequency point as an example, the first judgment flag can be determined based on the power spectrum ratio of the frequency point and the first preset threshold. If the power spectrum ratio of the frequency point is greater than the first preset threshold, the first judgment flag is 1, otherwise the first judgment flag is 0. The first preset threshold can be a real number greater than zero, which can be flexibly set according to needs. For example, the first preset threshold is 2.0, that is, it is judged whether the power spectrum ratio of the frequency point meets condition 1 (Cond1). Cond1: peak_ratio[sb]≥2.0f. When condition 1 (Cond1) is met, the first judgment flag is 1, otherwise, the first judgment flag is 0.
[0192] The second judgment flag is determined according to the power spectrum ratio of the frequency point and the power spectrum ratio of the left and right frequency points adjacent to the frequency point. If the power spectrum ratio of the frequency point is greater than the power spectrum ratio of the left and right frequency points adjacent to the frequency point, the second judgment flag is 1, otherwise the second judgment flag is 0. For example, determine whether the power spectrum ratio of the frequency point meets condition 2 (Cond2). Cond2: peak_ratio[sb]>peak_ratio[sb-1] and peak_ratio[sb]>peak_ratio[sb+1]. When condition 2 (Cond2) is met, the second judgment flag is 1, otherwise, the second judgment flag is 0.
[0193] According to the power spectrum ratio of the frequency point and the second average value parameter, determine the third judgment flag. If the power spectrum ratio of the frequency point is greater than the second average value parameter, or the difference between the power spectrum ratio of the frequency point and the second average value parameter is greater than the second preset threshold, the third judgment flag is 1, otherwise the third judgment flag is 0. For example, the second preset threshold is 12, and it is judged whether the power spectrum ratio of the frequency point meets condition 3 (Cond3). Cond3: peak_ratio[sb]>neighbor_l+12, when condition 3 (Cond3) is met, the third judgment flag is 1, otherwise, the third judgment flag is 0.
[0194] The fourth judgment flag is determined according to the power spectrum ratio of the frequency point and the third average value parameter. If the power spectrum ratio of the frequency point is greater than the third average value parameter, or the difference between the power spectrum ratio of the frequency point and the third average value parameter is greater than the third preset threshold, the fourth judgment flag is 1, otherwise the fourth judgment flag is 0. For example, the third preset threshold is 12, and it is determined whether the power spectrum ratio of the frequency point meets condition 4 (Cond4). Cond4: peak_ratio[sb]>neighbor_r+12, when condition 4 (Cond4) is met, the fourth judgment flag is 1, otherwise, the fourth judgment flag is 0.
[0195] The fifth judgment flag is determined according to the power spectrum ratio of the frequency point and the first average parameter. If the power spectrum ratio of the frequency point is greater than the first average parameter, or the difference between the power spectrum ratio of the frequency point and the first average parameter is greater than the fourth preset threshold, the fifth judgment flag is 1, otherwise the fifth judgment flag is 0. For example, the third preset threshold is 25, and it is judged whether the power spectrum ratio of the frequency point meets condition 5 (Cond5). Cond5: peak_ratio[sb]>mean_ratio+25, when condition 4 (Cond4) is met, the fifth judgment flag is 1, otherwise, the fifth judgment flag is 0.
[0196] Step 403: Perform a peak search based on at least one of the first judgment flag, the second judgment flag, the third judgment flag, the fourth judgment flag, and the fifth judgment flag to obtain at least one of the number of peaks in the frequency region, the position information of the peaks, the amplitude of the peaks, or the energy of the peaks.
[0197] For example, a peak search is performed on each frequency point in the frequency region. If at least one of the first judgment flag, the second judgment flag, the third judgment flag, the fourth judgment flag or the fifth judgment flag corresponding to the frequency point is 1, then the frequency point is the frequency point corresponding to the peak, the frequency point sequence number of the frequency point is the position information of the peak, the power spectrum ratio of the frequency point is the amplitude or energy information of the peak, and the number of all frequency points that meet the conditions in the frequency region is the number of peaks in the frequency region.
[0198] For another example, a peak search is performed on each frequency point in a frequency region. If the first judgment flag, the second judgment flag, the third judgment flag, the fourth judgment flag, and the fifth judgment flag corresponding to the frequency point are all 1, then the frequency point is the frequency point corresponding to the peak value, the frequency point sequence number of the frequency point is the location information of the peak value, the power spectrum ratio of the frequency point is the amplitude or energy information of the peak value, and the number of all frequency points that meet the conditions in the frequency region is the number of peak values in the frequency region. That is, the energy of the frequency point where the peak value is located is greater than the first preset threshold, greater than the energy of the left adjacent frequency point, greater than the energy of the right adjacent frequency point, greater than the energy of the left adjacent region, greater than the energy of the right adjacent region, and greater than the average energy.
[0199] For another example, a peak search is performed on each frequency point in the frequency region. If the first judgment flag and the second judgment flag corresponding to the frequency point are both 1, then the frequency point is the frequency point corresponding to the peak, the frequency point sequence number of the frequency point is the position information of the peak, the power spectrum ratio of the frequency point is the amplitude or energy information of the peak, and the number of all frequency points that meet the conditions in the frequency region is the number of peaks in the frequency region.
[0200] The peaks that meet the above conditions are regarded as candidates for the tonal components, and their peak positions and peak power spectrum ratios are stored in the peak identifier (peak_idx) and peak value (peak_val) arrays respectively. The number of peaks is peak_cnt.
[0201] In this embodiment, according to the power spectrum ratio of the high-frequency band signal in the frequency region, an average parameter of the power spectrum ratio is obtained. Through the average parameter of the power spectrum ratio, a peak search can be performed on each frequency point in the frequency region to determine the peak in the frequency region, and then determine the tone component information based on the peak. Since the power spectrum ratio is the ratio of the power spectrum to the average power spectrum, it can better reflect the signal characteristics, so that the tone component information can be accurately obtained, so that the decoding end can more accurately reconstruct the high-frequency band signal according to the tone component information, and then accurately obtain the audio signal, thereby improving the encoding quality.
[0202] Based on the same inventive concept as the above method, an embodiment of the present application further provides an audio signal encoding device, which can be applied to an audio encoder.
[0203] Figure 8 FIG. 1 is a schematic diagram of the structure of an audio signal encoding device according to an embodiment of the present application. Figure 8 As shown, the audio signal encoding device 800 includes: an acquisition unit 801, a coding parameter determination module 802, and a code stream multiplexing module 803.
[0204] The acquisition module 801 is used to acquire the current frame of the audio signal.
[0205] The coding parameter determination module 802 is used to obtain coding parameters based on the power spectrum ratio of the current frequency point in the current frequency region of at least part of the signal of the current frame, and the coding parameters are used to represent the tone component information of the at least part of the signal, and the tone component information includes at least one of the position information of the tone component, the quantity information of the tone component, the amplitude information of the tone component or the energy information of the tone component. 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.
[0206] The code stream multiplexing module 803 is used to perform code stream multiplexing on the encoding parameters to obtain the encoded code stream.
[0207] In some embodiments, the coding parameter determination module 802 is used to: perform a peak search in the current frequency region according to the power spectrum ratio of the current frequency point to obtain at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks, where the peaks are power spectrum peaks or power spectrum ratio peaks. The coding parameter is obtained according to at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks.
[0208] In some embodiments, the coding parameter determination module 802 is used to perform a peak search in the current frequency area based on the power spectrum ratio of the current frequency point, the power spectrum ratio of the left adjacent frequency point of the current frequency point, the power spectrum ratio of the right adjacent frequency point of the current frequency point, the average value of the power spectrum ratio of the current frequency area, the average value of the power spectrum ratio of the left adjacent area of the current frequency point, and the average value of the power spectrum ratio of the right adjacent area of the current frequency point.
[0209] Among them, the left neighboring area of the current frequency point includes N_neighbor_1 frequency points whose frequency point sequence number is less than the frequency point sequence number of the current frequency point, N_neighbor_1 is an arbitrary natural number, and the right neighboring area of the current frequency point includes N_neighbor_r frequency points whose frequency point sequence number is greater than the frequency point sequence number of the current frequency point, N_neighbor_r is an arbitrary natural number. The left neighboring frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than the current frequency point, and the right neighboring frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than the current frequency point.
[0210] In some embodiments, the coding parameter determination module 802 is used to determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to the first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the left adjacent area of the current frequency point is greater than the second preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the right adjacent area of the current frequency point is greater than the third preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the current frequency area is greater than the fourth preset threshold. When the power spectrum ratio of the current frequency point meets the conditions, the current frequency point is determined to be the frequency point corresponding to the peak.
[0211] In some embodiments, the coding parameter determination module 802 is used to determine whether the power spectrum ratio of the current frequency point satisfies at least one of the following conditions: greater than or equal to a first preset threshold; or greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; or greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; or greater than the average value of the power spectrum ratio of the left adjacent area of the current frequency point; or greater than the average value of the power spectrum ratio of the right adjacent area of the current frequency point; or greater than the average value of the power spectrum ratio of the current frequency area. When at least one of the conditions is met, the current frequency point is determined to be the frequency point corresponding to the peak.
[0212] In some embodiments, the coding parameter determination module 802 is used to determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to a first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point. When the conditions are met, the current frequency point is determined to be the frequency point corresponding to the peak.
[0213] In some embodiments, the coding parameter determination module 802 is used to: determine at least one of the quantity information of the tone component, the position information of the tone component, the amplitude information of the tone component, or the energy information of the tone component according to at least one of the quantity information of the peak, the position information of the peak, the amplitude information of the peak, or the energy information of the peak in the current frequency region. According to at least one of the quantity information of the tone component, the position information of the tone component, the amplitude information of the tone component, or the energy information of the tone component, the coding parameter is obtained.
[0214] In some embodiments, the at least partial signal comprises a high-frequency band signal of the current frame.
[0215] It should be noted that the acquisition module 801, the encoding parameter determination module 802, and the code stream multiplexing module 803 can be applied to the audio signal encoding process at the encoding end.
[0216] It should also be noted that the specific implementation process of the acquisition module 801, the coding parameter determination module 802, and the code stream multiplexing module 803 can refer to the detailed description of the above method embodiment, and for the sake of brevity of the specification, it will not be repeated here.
[0217] 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 signal encoding device is used to encode and generate a corresponding bit stream.
[0218] 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 signal encoding device, see Fig. 9 As shown, the audio signal encoding device 900 includes:
[0219] processor 901, memory 902 and communication interface 903 (wherein the number of processors 901 in the audio signal encoding device 900 can 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.
[0220] 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.
[0221] 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.
[0222] 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.
[0223] 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 .
[0224] 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.
[0225] 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.
[0226] 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.
[0227] 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.
[0228] 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 bus 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.
[0229] 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.
[0230] 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.
[0231] 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.
[0232] 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.
[0233] 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.
[0234] 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.
[0235] 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. A method for encoding an audio signal, characterized in that: include: Get the current frame of the audio signal; Obtaining a coding parameter according to a power spectrum ratio of a current frequency point in a current frequency region of at least a portion of the signal of the current frame, the coding parameter being used to represent tone component information of the at least a portion of the signal, the tone component information including at least one of position information of the tone component, quantity information of the tone component, amplitude information of the tone component, or energy information of the tone component, the power spectrum ratio of the current frequency point being a ratio of a value of the power spectrum of the current frequency point to an average value of a power spectrum of the current frequency region; Performing code stream multiplexing on the encoding parameters to obtain an encoded code stream; The acquiring of the coding parameter according to the power spectrum ratio of the current frequency point of the current frequency region of the at least part of the signal includes: Performing a peak search in the current frequency region according to the power spectrum ratio of the current frequency point to obtain at least one of the number information of peaks in the current frequency region, the position information of peaks, the amplitude information of peaks, or the energy information of peaks; the peak is a power spectrum peak or a power spectrum ratio peak; The encoding parameter is obtained according to at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks.
2. The method according to claim 1, characterized in that The performing peak search in the current frequency region according to the power spectrum ratio of the current frequency point includes: Perform peak search in the current frequency region according to the power spectrum ratio of the current frequency point, the power spectrum ratio of the frequency point adjacent to the left of the current frequency point, the power spectrum ratio of the frequency point adjacent to the right of the current frequency point, the average value of the power spectrum ratio of the current frequency region, the average value of the power spectrum ratio of the region adjacent to the left of the current frequency point, and the average value of the power spectrum ratio of the region adjacent to the right of the current frequency point; The left neighboring area of the current frequency point includes N_neighbor_1 frequency points whose frequency point numbers are smaller than the frequency point number of the current frequency point, where N_neighbor_1 is a natural number, and the right neighboring area of the current frequency point includes N_neighbor_r frequency points whose frequency point numbers are larger than the frequency point number of the current frequency point, where N_neighbor_r is a natural number; The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
3. The method according to claim 2, characterized in that The performing a peak search in the current frequency region according to the power spectrum ratio of the current frequency point, the power spectrum ratio of the left adjacent frequency point of the current frequency point, the power spectrum ratio of the right adjacent frequency point of the current frequency point, the average value of the power spectrum ratio of the current frequency region, the average value of the power spectrum ratio of the left adjacent region of the current frequency point, and the average value of the power spectrum ratio of the right adjacent region of the current frequency point, comprises: Determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to the first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; the difference between the average value of the power spectrum ratio of the current frequency point and the power spectrum ratio of the left adjacent area of the current frequency point is greater than the second preset threshold; the difference between the average value of the power spectrum ratio of the current frequency point and the power spectrum ratio of the right adjacent area of the current frequency point is greater than the third preset threshold; the difference between the average value of the power spectrum ratio of the current frequency point and the power spectrum ratio of the current frequency area is greater than the fourth preset threshold; When the condition is met, the current frequency point is determined to be a frequency point corresponding to a peak value of the current frequency region.
4. The method according to claim 1, characterized in that: The performing peak search in the current frequency region according to the power spectrum ratio of the current frequency point includes: Determine whether the power spectrum ratio of the current frequency point satisfies at least one of the following conditions: greater than or equal to a first preset threshold; or, greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; or, greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; or, greater than the average value of the power spectrum ratio of the left adjacent area of the current frequency point; or, greater than the average value of the power spectrum ratio of the right adjacent area of the current frequency point; or, greater than the average value of the power spectrum ratio of the current frequency area; When the power spectrum ratio of the current frequency point satisfies at least one of the conditions, determining that the current frequency point is the frequency point corresponding to the peak value of the current frequency region; The left neighboring area of the current frequency point includes N_neighbor_1 frequency points whose frequency point numbers are smaller than the frequency point number of the current frequency point, where N_neighbor_1 is a natural number, and the right neighboring area of the current frequency point includes N_neighbor_r frequency points whose frequency point numbers are larger than the frequency point number of the current frequency point, where N_neighbor_r is a natural number; The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
5. The method according to claim 1, characterized in that The performing peak search in the current frequency region according to the power spectrum ratio of the current frequency point includes: Determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to a first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; When the condition is met, determining that the current frequency point is the frequency point corresponding to the peak value of the current frequency region; The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
6. The method according to any one of claims 1 to 5, characterized in that: The acquiring the encoding parameter according to at least one of the number information of the peaks, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks in the current frequency region includes: Determine at least one of the quantity information of the tone components, the location information of the tone components, the amplitude information of the tone components, or the energy information of the tone components according to at least one of the quantity information of the peaks, the location information of the peaks, the amplitude information of the peaks, or the energy information of the peaks in the current frequency region; The encoding parameter is obtained according to at least one of the quantity information of the tone components, the position information of the tone components, the amplitude information of the tone components, or the energy information of the tone components.
7. The method according to any one of claims 1 to 5, characterized in that: The at least partial signal includes a high frequency band signal of the current frame.
8. An audio signal encoding device, characterized in that: include: An acquisition module, used to acquire a current frame of an audio signal; A coding parameter determination module, configured to obtain coding parameters according to a power spectrum ratio of a current frequency point in a current frequency region of at least a portion of the signal of the current frame, wherein the coding parameters are used to represent tone component information of at least a portion of the signal, wherein the tone component information includes at least one of position information of the tone component, quantity information of the tone component, amplitude information of the tone component, or energy information of the tone component, and the power spectrum ratio of the current frequency point is a ratio of a power spectrum value of the current frequency point to an average value of a power spectrum of the current frequency region; A code stream multiplexing module, used for performing code stream multiplexing on the encoding parameters to obtain an encoded code stream; The encoding parameter determination module is used for: Performing a peak search in the current frequency region according to the power spectrum ratio of the current frequency point to obtain at least one of the number information of peaks in the current frequency region, the position information of peaks, the amplitude information of peaks, or the energy information of peaks; the peak is a power spectrum peak or a power spectrum ratio peak; The encoding parameter is obtained according to at least one of the number information of the peaks in the current frequency region, the position information of the peaks, the amplitude information of the peaks, or the energy information of the peaks.
9. The device according to claim 8, characterized in that The encoding parameter determination module is used for: Perform peak search in the current frequency region according to the power spectrum ratio of the current frequency point, the power spectrum ratio of the frequency point adjacent to the left of the current frequency point, the power spectrum ratio of the frequency point adjacent to the right of the current frequency point, the average value of the power spectrum ratio of the current frequency region, the average value of the power spectrum ratio of the region adjacent to the left of the current frequency point, and the average value of the power spectrum ratio of the region adjacent to the right of the current frequency point; The left neighboring area of the current frequency point includes N_neighbor_1 frequency points whose frequency point numbers are smaller than the frequency point number of the current frequency point, where N_neighbor_1 is an arbitrary natural number, and the right neighboring area of the current frequency point includes N_neighbor_r frequency points whose frequency point numbers are larger than the frequency point number of the current frequency point, where N_neighbor_r is an arbitrary natural number; The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
10. The device according to claim 9, characterized in that The encoding parameter determination module is used for: Determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to a first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; is greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; The difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the left adjacent area of the current frequency point is greater than the second preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the right adjacent area of the current frequency point is greater than the third preset threshold; the difference between the power spectrum ratio of the current frequency point and the average value of the power spectrum ratio of the current frequency area is greater than the fourth preset threshold; When the condition is met, the current frequency point is determined to be a frequency point corresponding to a peak value of the current frequency region.
11. The device according to claim 8, characterized in that The encoding parameter determination module is used for: Determine whether the power spectrum ratio of the current frequency point satisfies at least one of the following conditions: greater than or equal to a first preset threshold; or, greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; or, greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; or, greater than the average value of the power spectrum ratio of the left adjacent area of the current frequency point; or, greater than the average value of the power spectrum ratio of the right adjacent area of the current frequency point; or, greater than the average value of the power spectrum ratio of the current frequency area; When the power spectrum ratio of the current frequency point satisfies at least one of the conditions, determining that the current frequency point is the frequency point corresponding to the peak value of the current frequency region; The left neighboring area of the current frequency point includes N_neighbor_1 frequency points whose frequency point numbers are smaller than the frequency point number of the current frequency point, where N_neighbor_1 is a natural number, and the right neighboring area of the current frequency point includes N_neighbor_r frequency points whose frequency point numbers are larger than the frequency point number of the current frequency point, where N_neighbor_r is a natural number; The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
12. The device according to claim 9, characterized in that The encoding parameter determination module is used for: Determine whether the power spectrum ratio of the current frequency point meets the following conditions: greater than or equal to a first preset threshold; greater than the power spectrum ratio of the left adjacent frequency point of the current frequency point; is greater than the power spectrum ratio of the right adjacent frequency point of the current frequency point; When the condition is met, determining that the current frequency point is the frequency point corresponding to the peak value of the frequency region; The left adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 less than that of the current frequency point, and the right adjacent frequency point of the current frequency point is a frequency point whose frequency point sequence number is 1 greater than that of the current frequency point.
13. The device according to any one of claims 8 to 12, characterized in that The encoding parameter determination module is used for: Determine at least one of the quantity information of the tone components, the location information of the tone components, the amplitude information of the tone components, or the energy information of the tone components according to at least one of the quantity information of the peaks, the location information of the peaks, the amplitude information of the peaks, or the energy information of the peaks in the current frequency region; The encoding parameter is obtained according to at least one of the quantity information of the tone components, the position information of the tone components, the amplitude information of the tone components, or the energy information of the tone components.
14. The device according to claim 13, characterized in that The at least partial signal includes a high frequency band signal of the current frame.
15. An audio signal 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 7.
16. An audio signal encoding and decoding device, characterized in that: The method comprises: an encoder, wherein the encoder is used to execute the method according to any one of claims 1 to 7.
17. 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 7.
18. A computer-readable storage medium, characterized in that: The method comprises an encoded bit stream obtained according to the method according to any one of claims 1 to 7.
