Multi-channel audio encoding, decoding method and electronic device
By setting extended header information bitstream and multi-channel spatial parameter bitstream in the encoding bitstream structure, the compatibility problem of multi-channel audio signals at low bitrates is solved, achieving compatibility on older devices and encoding quality at low bitrates, while reducing bandwidth and performance overhead.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2026-03-23
- Publication Date
- 2026-06-09
AI Technical Summary
Multi-channel audio signals are difficult to backward compatibility in low bitrate scenarios, which leads to additional bandwidth and performance overhead due to the additional encoding of stereo audio streams, affecting encoding and decoding quality.
By setting an extended header information stream, a stereo signal stream, and a multi-channel spatial parameter stream in the encoded stream structure, and defining a first extended data type flag in the extended header information stream, the stereo signal and spatial parameter stream are packaged together, and the newly defined extended data type flag is encapsulated, so that older decoding devices cannot recognize the spatial parameter stream and can only decode the stereo signal.
It achieves compatibility with older decoding devices, avoids additional bandwidth and performance overhead, ensures the encoding quality of multi-channel audio signals at low bit rates, and supports compatibility with different types of decoders.
Smart Images

Figure CN122177136A_ABST
Abstract
Description
Technical Field
[0001] It relates to the field of audio processing technology, specifically to multi-channel audio encoding and decoding methods and electronic devices. Background Technology
[0002] In parametric encoding of multi-channel, low-bitrate audio signals, the multi-channel audio signal is primarily described by encoding the transmission signal plus spatial parameter metadata, rather than directly encoding the multi-channel audio signal itself. However, this method is difficult to achieve backward compatibility, requiring the additional encoding of a stereo audio stream to ensure compatibility with devices that do not support spatial audio decoding. This increases bandwidth and performance overhead, thus increasing bandwidth usage in low-bitrate scenarios and affecting the encoding and decoding quality of the multi-channel audio signal. Summary of the Invention
[0003] A multi-channel audio encoding and decoding method and electronic device are disclosed to solve the problem of backward compatibility in the encoding of multi-channel audio signals.
[0004] In a first aspect, a multi-channel audio encoding method is provided, comprising: acquiring a multi-channel audio signal and an encoded bitstream structure, the encoded bitstream structure including an extended header information bitstream, a stereo signal bitstream, and a multi-channel spatial parameter bitstream, the extended header information bitstream including a first extended data type flag bit and a first extended data bit; extracting spatial parameters and a stereo signal, the spatial parameters corresponding to the multi-channel audio signal, and the stereo signal corresponding to the multi-channel audio signal; filling attribute information into the first extended data bit, the attribute information corresponding to the spatial parameters; filling stereo encoding into the stereo signal bitstream, and filling parameter encoding into the multi-channel spatial parameter bitstream, the stereo encoding corresponding to the stereo signal, and the parameter encoding corresponding to the spatial parameters; encapsulating the first extended data type flag bit, the first extended data bit, the stereo signal bitstream, and the multi-channel spatial parameter bitstream to obtain an audio encoded bitstream, the audio encoded bitstream corresponding to the multi-channel audio signal.
[0005] Secondly, a multi-channel audio decoding method is provided, comprising: acquiring a first audio encoded bitstream, wherein the first audio encoded bitstream is generated based on a multi-channel audio encoding method of the first aspect or any corresponding case; responding to the decoder being a first type of decoder, parsing a first extension header information bitstream to obtain a first extended data type and a first extension header data, wherein the first extension header information bitstream corresponds to the first audio encoded bitstream; parsing a first stereo signal bitstream and a first multi-channel spatial parameter bitstream to obtain a first stereo signal and a first spatial parameter, wherein both the first stereo signal bitstream and the first multi-channel spatial parameter bitstream correspond to the first audio encoded bitstream; and using the first extended data type, the first extension header data, the first stereo signal, and the first spatial parameter to perform signal reconstruction to obtain a first multi-channel audio signal, wherein the first multi-channel audio signal corresponds to the first audio encoded bitstream.
[0006] Thirdly, a multi-channel audio decoding method is provided, comprising: acquiring a second audio encoded bitstream, the second audio encoded bitstream being generated based on a multi-channel audio encoding method of the first aspect or any corresponding case; in response to the decoder being a second type of decoder, parsing a second extension header information bitstream to obtain a first extended data type, the second extension header information bitstream corresponding to the second audio encoded bitstream; parsing a second stereo signal bitstream and a second multi-channel spatial parameter bitstream to obtain a second stereo signal, both the second stereo signal bitstream and the second multi-channel spatial parameter bitstream corresponding to the second audio encoded bitstream; in response to the first extended data type not being recognized, using the second stereo signal to perform signal reconstruction to obtain a second multi-channel audio signal, the second multi-channel audio signal corresponding to the second audio encoded bitstream.
[0007] Fourthly, a multi-channel audio encoding device is provided, comprising: an audio information acquisition module for acquiring multi-channel audio signals and an encoded bitstream structure, the encoded bitstream structure including an extended header information bitstream, a stereo signal bitstream, and a multi-channel spatial parameter bitstream, the extended header information bitstream including a first extended data type flag bit and a first extended data bit; an information extraction module for extracting spatial parameters and stereo signals, the spatial parameters corresponding to the multi-channel audio signals, and the stereo signals corresponding to the multi-channel audio signals; an extended header filling module for filling attribute information into the first extended data bit, the attribute information corresponding to the spatial parameters; a bitstream filling module for filling stereo encoding into the stereo signal bitstream and filling parameter encoding into the multi-channel spatial parameter bitstream, the stereo encoding corresponding to the stereo signal and the parameter encoding corresponding to the spatial parameters; and a bitstream encapsulation module for encapsulating the first extended data type flag bit, the first extended data bit, the stereo signal bitstream, and the multi-channel spatial parameter bitstream to obtain an audio encoded bitstream, the audio encoded bitstream corresponding to the multi-channel audio signals.
[0008] Fifthly, a multi-channel audio decoding device is provided, comprising: a first audio encoding acquisition module, configured to acquire a first audio encoding bitstream, the first audio encoding bitstream being generated based on a multi-channel audio encoding method of the first aspect or any corresponding case; a first extension header parsing module, configured to parse the first extension header information bitstream in response to the decoder being a first type of decoder, to obtain a first extended data type and first extension header data, the first extension header information bitstream corresponding to the first audio encoding bitstream; a first load information parsing module, configured to parse a first stereo signal bitstream and a first multi-channel spatial parameter bitstream, to obtain a first stereo signal and a first spatial parameter, the first stereo signal bitstream and the first multi-channel spatial parameter bitstream both corresponding to the first audio encoding bitstream; and a first signal restoration module, configured to perform signal restoration using the first extended data type, the first extension header data, the first stereo signal, and the first spatial parameter, to obtain a first multi-channel audio signal, the first multi-channel audio signal corresponding to the first audio encoding bitstream.
[0009] A sixth aspect provides a multi-channel audio decoding device, comprising: a second audio encoding acquisition module for acquiring a second audio encoding bitstream, the second audio encoding bitstream being generated based on a multi-channel audio encoding method of the first aspect or any corresponding case; a second extension header parsing module for parsing the second extension header information bitstream to obtain a first extended data type in response to the decoder being a second type of decoder, the second extension header information bitstream corresponding to the second audio encoding bitstream; a second load information parsing module for parsing a second stereo signal bitstream and a second multi-channel spatial parameter bitstream to obtain a second stereo signal, both the second stereo signal bitstream and the second multi-channel spatial parameter bitstream corresponding to the second audio encoding bitstream; and a second signal restoration module for performing signal restoration using the second stereo signal in response to the first extended data type not being recognized, to obtain a second multi-channel audio signal, the second multi-channel audio signal corresponding to the second audio encoding bitstream.
[0010] In a seventh aspect, an electronic device is provided, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the multi-channel audio encoding method of the first aspect or any corresponding scenario described above, the multi-channel audio decoding method of the second aspect or any corresponding scenario described above, and the multi-channel audio decoding method of the third aspect or any corresponding scenario described above.
[0011] Eighthly, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a computer to perform the multi-channel audio encoding method of the first aspect or any corresponding scenario, the multi-channel audio decoding method of the second aspect or any corresponding scenario, and the multi-channel audio decoding method of the third aspect or any corresponding scenario.
[0012] Ninthly, a computer program product is provided, including computer instructions for causing a computer to execute the multi-channel audio encoding method of the first aspect or any corresponding scenario, the multi-channel audio decoding method of the second aspect or any corresponding scenario, and the multi-channel audio decoding method of the third aspect or any corresponding scenario.
[0013] The multi-channel audio encoding method described above supports defining spatial parameter bitstream data types within the encoding bitstream structure by setting an extended header information bitstream, a stereo signal bitstream, and a multi-channel spatial parameter bitstream in the encoding bitstream structure, and defining a first extended data type flag bit and a first extended data bit in the extended header information bitstream.
[0014] For the acquired multi-channel audio signal, the corresponding spatial parameters and stereo signal are extracted. Using the attribute information of the spatial parameters, the first extended data bits are filled, and the stereo code corresponding to the stereo signal is filled into the stereo signal bitstream. Similarly, the parameter code corresponding to the spatial parameters is filled into the multi-channel spatial parameter bitstream. The first extended data type flag, the first extended data bits, the stereo signal bitstream, and the multi-channel spatial parameter bitstream are encapsulated into an encoded bitstream to generate an audio encoded bitstream. Thus, by packaging the stereo signal bitstream and the multi-channel spatial parameter bitstream into the encoded bitstream, and encapsulating the spatial parameter bitstream with a newly defined extended data type flag, when older decoding devices cannot recognize the newly defined extended data type flag, they discard the corresponding length of the spatial parameter bitstream and only decode the stereo signal, thereby achieving compatibility on older decoding devices. Therefore, there is no need to additionally encode the stereo bitstream to support compatibility on different spatial audio decoding devices, avoiding additional bandwidth and performance overhead. This enables applications in low-bitrate scenarios and ensures the encoding quality of multi-channel audio signals at low bitrates.
[0015] The multi-channel audio decoding method described above supports different decoding methods for different types of decoders, so as to decode different content for different situations, ensure compatibility of different types of decoders, reduce transmission bandwidth, and save performance overhead.
[0016] For the first type of decoder that supports the new decoding method, by parsing the first stereo signal bitstream and the first multi-channel spatial parameter bitstream corresponding to the first audio encoded bitstream, the corresponding first stereo signal and the first spatial parameters are obtained to realize signal restoration and obtain the corresponding multi-channel audio signal. Thus, the complete decoding of the audio encoded bitstream under the first type of decoder is realized, ensuring the decoding quality of the audio encoded bitstream at low bitrates.
[0017] For the second type of decoder that does not support the new decoding method, it cannot recognize the extended data types defined in the new encoding method. Therefore, in the process of parsing the second stereo signal stream and the second multi-channel spatial parameter stream corresponding to the second audio encoded stream, only the second stereo signal stream can be parsed while discarding the spatial parameters corresponding to the second multi-channel spatial parameter stream, thus obtaining the corresponding stereo signal. This allows for the reconstruction of the multi-channel stereo audio signal from the stereo signal. This achieves backward compatibility of the audio encoded stream on the second type of decoder. Attached Figure Description
[0018] To more clearly illustrate the specific implementation methods or technical solutions in the prior art under certain circumstances, the accompanying drawings used in the description of the specific implementation methods or prior art will be briefly introduced below. Obviously, the accompanying drawings described below are some implementation methods under certain circumstances. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 These are schematic diagrams illustrating application scenarios in various situations; Figure 2 This is a flowchart illustrating the first type of multichannel audio coding method under certain circumstances; Figure 3 These are schematic diagrams of the encoded bitstream structure under certain conditions; Figure 4 This is a schematic diagram of the second process for multi-channel audio coding methods in some situations; Figure 5 These are schematic diagrams illustrating the structure of the first extended data bit in some scenarios; Figure 6 This is a flowchart illustrating the first type of multi-channel audio decoding method under certain circumstances; Figure 7 This is a second flowchart illustrating a multi-channel audio decoding method under certain circumstances; Figure 8 This is a flowchart illustrating the third method for multi-channel audio decoding in some situations; Figure 9 This is a flowchart illustrating the fourth method for multi-channel audio decoding in some situations; Figure 10 These are schematic diagrams illustrating multi-channel audio encoding in various scenarios; Figure 11 These are schematic diagrams illustrating multi-channel audio decoding in various scenarios. Figure 12 These are block diagrams of multi-channel audio encoding devices in some scenarios; Figure 13 This is a first structural block diagram of a multi-channel audio decoding device under certain conditions; Figure 14 This is a second structural block diagram of a multi-channel audio decoding device under certain conditions; Figure 15 These are schematic diagrams of the hardware structure of electronic devices in some scenarios. Detailed Implementation
[0020] To make the purpose, technical solution, and advantages of some scenarios clearer, the technical solutions in some scenarios will be clearly and completely described below with reference to the accompanying drawings. Obviously, the scenarios described are only a part of some scenarios, not all of them. Based on the scenarios in some scenarios, all other scenarios that a person skilled in the art can obtain without inventive effort fall within the scope of protection of these scenarios.
[0021] It is understandable that before using the technical solutions disclosed in various situations, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in those situations in an appropriate manner, in accordance with relevant laws and regulations, and their authorization should be obtained.
[0022] For example, upon receiving a user's proactive request, a prompt message can be sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media that perform certain technical solutions.
[0023] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0024] It is understood that the above notification and user authorization process are merely illustrative and do not limit the implementation methods in certain situations. Other methods that comply with relevant laws and regulations may also be applied to the implementation methods in certain situations.
[0025] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0026] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature marked "first" or "second" may explicitly or implicitly include one or more of that feature. In some descriptions, "multiple" means two or more, unless otherwise explicitly specified.
[0027] In the encoding of multi-channel audio signals, the most direct approach is to quantize and encode the waveforms of the multi-channel audio signals. However, this method requires significant bit overhead. Related technologies often combine the spatial layout of the multi-channel audio signals, jointly encoding the symmetrical channels in space to appropriately reduce the required bit rate. However, the bit rate overhead remains high, making it inconvenient for some bandwidth-limited scenarios.
[0028] To address the aforementioned shortcomings, multi-channel parameterized coding schemes have emerged that use encoded transmission signals plus spatial parameter metadata to describe multi-channel audio signals. This approach does not directly encode the multi-channel audio signal itself; instead, it describes the time-frequency information of the multi-channel signal through the transmission signal and the spatial sound field information through spatial parameter metadata. This allows for the transmission of multi-channel audio signals at almost the same bitrate as a single channel, in stereo. On the decoding side, the decoded transmission signal is combined with the spatial parameter information, and a multi-channel upmixing restoration algorithm is used to reconstruct the multi-channel audio signal from the stereo signal. Because the bitrate of the metadata is much lower than that of the audio signal itself, this method achieves good transmission quality even at lower bitrates.
[0029] However, current multi-channel parametric encoding cannot achieve backward compatibility. During use, an additional stereo audio stream needs to be encoded to ensure compatibility on devices that do not support spatial audio decoding, which will increase bandwidth and performance overhead. In low bitrate scenarios, this will actually increase bandwidth traffic, which is contrary to expectations.
[0030] Based on this, an encoding stream structure is proposed to achieve stereo-compatible multi-channel parametric encoding. This encoding stream structure includes an extended header information stream, a stereo signal stream, and a multi-channel spatial parameter stream. The extended header information stream defines a first extended data type flag and a first extended data bit, thus defining the spatial parameter stream data type within the encoding stream structure. By packaging the stereo signal stream and the multi-channel spatial parameter stream into the encoding stream, the spatial parameter stream is encapsulated in a way that older decoders cannot recognize. This eliminates the need for additional stereo encoding to support compatibility across different spatial audio decoding devices, thereby avoiding additional bandwidth and performance overhead. It supports applications in low-bitrate scenarios and ensures the encoding quality of multi-channel audio signals at low bitrates. Different decoding methods are supported for different types of decoders to decode different content in different situations, ensuring compatibility between different decoder types, reducing transmission bandwidth, and saving performance overhead.
[0031] As an optional application scenario in some situations, such as Figure 1 As shown, this application scenario may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the electronic devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 via a network 110.
[0032] Specifically, electronic devices can be smartphones, tablets, laptops, PDAs, desktop computers, game consoles, smart TVs, smart wearable devices, in-vehicle terminals, VR (Virtual Reality) devices, AR (Augmented Reality) devices, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranets, local area networks, wide area networks, mobile communication networks, and combinations thereof.
[0033] It should be noted that, Figure 1 This is merely an example of an application scenario and does not limit the scope of protection in certain situations.
[0034] In some cases, a multi-channel audio encoding method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases the steps shown or described can be executed in a different order than that shown here.
[0035] In some cases, a multi-channel audio encoding method is provided, which can be used in electronic devices such as encoders with encoding capabilities. Figure 2 These are flowcharts of multi-channel audio coding methods in some scenarios, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the multi-channel audio signal and the encoded bitstream structure.
[0036] The encoded bitstream structure includes an extended header information bitstream, a stereo signal bitstream, and a multi-channel spatial parameter bitstream. The extended header information bitstream includes a first extended data type flag bit and a first extended data bit.
[0037] A multi-channel audio signal is an audio signal with multiple audio channels, and each audio channel is independent of the others. For example, a multi-channel audio signal corresponding to 5.1 channels or a multi-channel audio signal corresponding to 7.1.4 channels.
[0038] Specifically, different audio systems have corresponding channel layouts, which are used to achieve a three-dimensional surround sound field. Examples include audio systems for home theaters, professional recording studios, or high-end car audio systems. Based on the channel layout of the audio system, the corresponding multi-channel audio signals can be obtained.
[0039] An encoded bitstream structure is a bitstream structure used to encode multi-channel audio signals. Figure 3 Taking the AAC bitstream structure shown as an example, this encoded bitstream structure can include encoder header information, extended header information bitstream, stereo signal bitstream, and multi-channel spatial parameter bitstream. The extended header information bitstream is placed after the encoder header information; the stereo signal bitstream is placed after the extended header information bitstream; and the multi-channel spatial parameter bitstream is placed after the stereo signal bitstream.
[0040] In some optional cases, a global extended bitstream can be set after the multi-channel spatial parameter bitstream, depending on the encoding requirements.
[0041] The extended header information bitstream includes a first extended data type flag and first extended data bits. The first extended data type flag is used to customize the extended data type, and the data type of the first extended data bits is defined by this flag. Figure 3 The 4-bit first extended data type flag bit EXT_TYPE1 shown is, for example, EXT_TYPE_HEADER_DATA, used to characterize the data type of the first extended data bit; this first extended data bit is used to characterize the extended header data in the extended header information bitstream, such as... Figure 3 The 8-bit EXT_HEADER_DATA shown.
[0042] Step S202: Extract spatial parameters and stereo signal.
[0043] Among them, the spatial parameters and the stereo signal correspond to the multi-channel audio signal.
[0044] Spatial parameters characterize the spatial properties of multi-channel audio signals. These parameters can include inter-channel coherence (ICC) and inter-channel level difference (ICLD). Spatial parameters can be calculated by combining the audio downmixed signal and the multi-channel audio signal determined according to downmixing parameters. For example, the inter-channel level difference can be quantized as the energy ratio of the target channel to the reference channel (or downmixed channel), determining the target channel and its corresponding reference channel in the multi-channel audio signal. Then, combining the first audio downmixed signal and the original multi-channel audio signal, the inter-channel level difference corresponding to the multi-channel audio signal can be calculated. Alternatively, inter-channel coherence can be quantized as the linear correlation between two channel signals, determining multiple channel pairs corresponding to the multi-channel audio signal. Then, combining the first audio downmixed signal and the original multi-channel audio signal, the inter-channel coherence between all channel pairs can be calculated.
[0045] Stereo signals are used to characterize the stereo channel signals corresponding to multi-channel audio signals. For example, the left stereo channel signal is formed by fusing the audio information of the left channel L, left surround Ls, center channel C, and low-frequency channel LFE; the right stereo channel signal is formed by fusing the audio information of the right channel R, right surround Rs, center channel C, and low-frequency channel LFE.
[0046] Step S203: Fill the attribute information into the first extended data bits.
[0047] Among them, the attribute information corresponds to the spatial parameters.
[0048] Attribute information is used to characterize the unique properties of spatial parameters, such as whether they carry multi-channel parameterized loads, whether they resolve spatial parameter loads, signal layout information, etc.
[0049] Specifically, the stereo signal and spatial parameters carried by the multi-channel audio signal are parsed out. For the stereo signal, the encoding header information, i.e., the ADTS header corresponding to the AAC code stream structure, is filled in according to the attribute information corresponding to the stereo signal. For the spatial parameters, the first extended data bits are filled in according to the attribute information corresponding to the spatial parameters to generate the extended header data corresponding to the spatial parameter signal frame.
[0050] Step S204: Fill stereo encoding into stereo signal stream and fill parameter encoding into multi-channel spatial parameter stream.
[0051] Among them, stereo coding corresponds to stereo signals, and parametric coding corresponds to spatial parameters.
[0052] Stereo coding is the digital bitstream obtained by converting stereo signals. After the stereo coding conversion is completed, the stereo code is filled into the field position of the stereo signal bitstream in the coding bitstream structure to obtain the stereo signal load information corresponding to the multi-channel audio signal.
[0053] The parametric bitstream is a digital bitstream obtained by converting spatial parameters. After the parametric bitstream conversion for spatial parameters is completed, the parametric bitstream is filled into the field position of the multi-channel spatial parameter bitstream in the encoded bitstream structure to obtain the multi-channel spatial parameter load information corresponding to the multi-channel audio signal.
[0054] Step S205: Encapsulate the first extended data type flag bit, the first extended data bit, the stereo signal bitstream, and the multi-channel spatial parameter bitstream to obtain the audio encoded bitstream, which corresponds to the multi-channel audio signal.
[0055] According to the encoding bitstream structure, the encoding header information, extension header type flag, extension header data, stereo signal bitstream, and multi-channel spatial parameter bitstream corresponding to the multi-channel audio signal are encapsulated to obtain an audio encoded bitstream with an encoding bitstream structure.
[0056] The multi-channel audio encoding method described above sets an extended header information stream, a stereo signal stream, and a multi-channel spatial parameter stream in the encoding stream structure, and defines a first extended data type flag bit and a first extended data bit in the extended header information stream. Thus, by defining the first extended data type flag bit in the encoding stream structure to represent the extended header information data type, it can support defining the spatial parameter stream data type in the encoding stream structure.
[0057] For the acquired multi-channel audio signal to be encoded, the corresponding spatial parameters and stereo signal are extracted. Using the attribute information of the spatial parameters and stereo signal, the first extended data bits are filled, and the stereo code corresponding to the stereo signal is filled into the stereo signal bitstream. Similarly, the parameter code corresponding to the spatial parameters is filled into the multi-channel spatial parameter bitstream. The first extended data type flag, the first extended data bits, the stereo signal bitstream, and the multi-channel spatial parameter bitstream are encapsulated into the encoded bitstream to generate the audio encoded bitstream. Thus, by packaging the stereo signal bitstream and the multi-channel spatial parameter bitstream into the encoded bitstream, and encapsulating the spatial parameter bitstream with a newly defined extended data type flag, when older decoding devices cannot recognize the newly defined extended data type flag, they discard the corresponding length of the spatial parameter bitstream and only decode the stereo signal, thereby achieving compatibility on older decoding devices. Therefore, there is no need to additionally encode the stereo bitstream to support compatibility on different spatial audio decoding devices, avoiding additional bandwidth and performance overhead, supporting applications in low-bitrate scenarios, and ensuring the encoding quality of multi-channel audio signals at low bitrates.
[0058] In some cases, a multi-channel audio encoding method is provided, which can be used in electronic devices such as encoders with encoding capabilities. Figure 4 These are flowcharts of multi-channel audio coding methods in some scenarios, such as... Figure 4 As shown, the process includes the following steps: Step S301: Obtain the multi-channel audio signal and the encoded bitstream structure. The encoded bitstream structure includes an extended header information bitstream, a stereo signal bitstream, and a multi-channel spatial parameter bitstream. The extended header information bitstream includes a first extended data type flag bit and a first extended data bit. For details, please refer to the relevant descriptions of the steps corresponding to the above-described scenarios, which will not be repeated here.
[0059] Step S302: Extract spatial parameters and stereo signals. Both spatial parameters and stereo signals correspond to multi-channel audio signals. For details, please refer to the relevant descriptions of the steps corresponding to the scenarios described above; they will not be repeated here.
[0060] Step S303: Fill attribute information into the first extended data bit, and the attribute information corresponds to the spatial parameters.
[0061] Specifically, such as Figure 5 As shown, the first extended data bits include a parameterized load flag bit, a parameterized encoding flag bit, and a signal layout flag bit. Specifically, the parameterized load flag bit P indicates whether a multi-channel parameterized load is carried; the parameterized encoding flag bit S indicates whether a multi-channel parameterized load is decoded; and the signal layout flag bit Config indicates the specific layout information of the multi-channel audio signal.
[0062] Accordingly, step S303 above includes: Step S3031: Fill the multi-channel parameterized load information into the parameterized load flag bit.
[0063] Among them, the multi-channel parameterized load carries information corresponding to the attribute information.
[0064] The multi-channel parameterized load carries information indicating whether it carries a multi-channel parameterized load, which is the spatial parameterized load. The identifiers corresponding to carrying and not carrying multi-channel parameterized loads are different. Therefore, the parameterized load flag bits can be filled with the identifier corresponding to the multi-channel parameterized load carrying information.
[0065] In a specific example, the parameterized payload flag P occupies 1 bit. P=1 indicates that the bitstream carries a multi-channel parameterized payload, and P=0 indicates that the bitstream does not carry a multi-channel parameterized payload. That is, when carrying a multi-channel parameterized payload, the parameterized payload flag P is filled with 1, and when not carrying a multi-channel parameterized payload, the parameterized payload flag P is filled with 0.
[0066] Step S3032: Fill the parameterized payload decoding information into the parameterized encoding flag bit.
[0067] Among them, the parameterized load decoding information corresponds to the attribute information.
[0068] After filling the parameterized load flag, continue filling the parameterized encoding flag. When the parameterized load flag indicates that no multi-channel parameterized load is being carried, simply fill the parameterized encoding flag with 0.
[0069] When the parameterized load flag indicates that a multi-channel parameterized load is being carried, the decision to parse the multi-channel parameterized load can be made based on the decoder type and the actual application scenario. The decoder supports parsing different parameterized encoding identifiers for multi-channel parameterized loads compared to parsing only stereo signals; therefore, the parameterized load flag can be filled with the required decoding content.
[0070] In a specific example, the parameterization encoding flag S occupies 1 bit. S=1 indicates that the decoder decodes the multi-channel parameterized load, while S=0 indicates that the decoder only decodes the stereo signal and discards the multi-channel parameterized load. That is, when the decoder supports parsing a multi-channel parameterized load, the parameterization encoding flag S is filled with 1; when the decoder only parses the stereo signal, the parameterization encoding flag S is filled with 0.
[0071] Step S3033: Fill the audio signal layout information into the signal layout identifier bit.
[0072] The audio signal layout information corresponds to the attribute information.
[0073] Audio signal layout information represents the location, number, type, and transmission format of audio channels / sources in three-dimensional space. Different dimensions of layout information have different identifiers.
[0074] In a specific example, the signal layout identifier Config occupies 6 bits. Layout information of different dimensions is filled into the signal layout identifier to obtain the specific layout information for transmitting multi-channel audio signals.
[0075] In some optional cases, such as Figure 3 As shown, the extended header information bitstream also includes a first extended data length bit EXT_LEN1 and a first bitstream element flag bit ID_TYPE1. The first extended data length bit is set before the first extended data type flag bit, and the first bitstream element flag bit is set before the first extended data length bit.
[0076] The first bitstream element flag is used to characterize the encapsulation format of the bitstream element. For example, if the space parameter payload information is packaged using the ID_FILL format, then the first bitstream element flag ID_TYPE1 can be ID_FIL, etc.; the first extended data length bit indicates the length of the extended header information bitstream.
[0077] Accordingly, the above methods also include: Step a1: Fill the first bitstream element type into the first bitstream element flag bit. The first bitstream element type corresponds to the extended header information bitstream.
[0078] Step a2: Fill the first payload length to the first extended data length bits, where the first payload length corresponds to the extended header information bitstream.
[0079] The first bitstream element type is the padding payload data type pre-defined for the extended header information bitstream. Specifically, the padding payload corresponding to the extended header information bitstream is parsed to obtain the first bitstream element type corresponding to the extended header information bitstream, and the data type identifier corresponding to the first bitstream element type is filled into the first bitstream element flag bit.
[0080] The first payload length is the total byte length of the extended header information bitstream. Specifically, when parsing the extended header information bitstream, the total byte length corresponding to the extended header information bitstream is determined, and this total byte length is filled into the first extended data length bits.
[0081] In a specific example, such as Figure 3As shown, a 3-bit first stream element flag, ID_TYPE1, is set in the extended header information bitstream. If the extended header data is packaged using the ID_FIL padding element format, then ID_FIL is filled into the first stream element flag. Simultaneously, a 4-bit first extended data length bit, EXT_LEN1, is set in the extended header information bitstream. By parsing the total byte length of the extended header information bitstream, this total byte length is filled into the first extended data length bit, EXT_LEN1.
[0082] In the above scenario, the first bitstream element flag and the first extended data length are filled in according to the bitstream element type and the first payload length corresponding to the extended header information bitstream, so that the content to be decoded and the length of the content to be decoded can be clearly identified during decoding.
[0083] Step S304: Fill the stereo code into the stereo signal stream and fill the parameter code into the multi-channel spatial parameter stream. The stereo code corresponds to the stereo signal, and the parameter code corresponds to the spatial parameters.
[0084] Specifically, the multi-channel spatial parameter bitstream includes a second extended data type flag and second extended data bits. The second extended data type flag is used to characterize the extended data type, which includes the multi-channel spatial parameter bitstream and other extended data information, such as... Figure 3 The 4-bit second extended data type flag bit EXT_MC_PARAM_DATA is shown; the second extended data bits are used to represent the data corresponding to the spatial parameters, such as... Figure 3 The multi-channel spatial parameter load bit is shown.
[0085] The parameter bitstream includes data type encoding and parameter content encoding. Data type encoding represents the digital bitstream generated by digital conversion of data type; parameter content encoding represents the digital bitstream generated by digital conversion of data content.
[0086] Accordingly, step S304 above includes: Step S3041: Fill the stereo code into the stereo signal stream. For details, please refer to the relevant descriptions of the steps corresponding to the scenarios described above; they will not be repeated here.
[0087] Step S3042: Fill the data type encoding into the second extended data type flag bit.
[0088] Among them, the data type encoding corresponds to the spatial parameters.
[0089] Different spatial parameters correspond to different parameter identifiers. Data type encoding is a digital code stream obtained by converting the data type of the spatial parameter. After the conversion of the data type encoding is completed, the data type encoding is filled into the field position of the second extended data type flag bit to obtain the extended data type corresponding to the spatial parameter.
[0090] Step S3043: Encode the parameter content into the second extended data bits.
[0091] Among them, the parameter content encoding corresponds to the spatial parameters.
[0092] Parameter content encoding is a digital bitstream obtained by converting the parameter data content of spatial parameters. After the conversion of parameter content encoding is completed, the parameter content encoding is filled into the field position of the second extended data bit to obtain the parameter load information corresponding to the spatial parameters.
[0093] In some optional cases, such as Figure 3 As shown, the multi-channel spatial parameter bitstream also includes a second extended data length bit and a second bitstream element flag bit. The second extended data length bit is set before the second extended data type flag bit, and the second bitstream element flag bit is set before the second extended data length bit. The second bitstream element flag bit is used to characterize the packing format of the bitstream elements, for example, packing the bitstream using the ID_FILL padded element format; the second extended data length bit indicates the length information of the padded bitstream elements, such as the length of the spatial parameter bitstream elements.
[0094] Accordingly, the above methods also include: Step b1: Fill the second bitstream element type into the second bitstream element flag bit. The second bitstream element type corresponds to the spatial parameters.
[0095] Step b2: Fill the second load length to the second extended data length bits, where the second load length corresponds to the space parameter.
[0096] The second bitstream element type is a data type that is pre-defined for the spatial parameters. Specifically, when parsing the spatial parameters, the second bitstream element type corresponding to the spatial parameters is determined, and the data type identifier corresponding to the second bitstream element data type is filled into the second bitstream element flag bit.
[0097] The second payload length is the total byte length of the padding elements corresponding to the space parameter. Specifically, when parsing the space parameter, the total byte length of the padding elements corresponding to the space parameter is determined, and this total byte length is filled into the second extended data length bits.
[0098] In a specific example, such as Figure 3As shown, a 3-bit second stream element flag, ID_TYPE2, is set in the multi-channel spatial parameter bitstream. If the spatial parameter payload information is packaged using the ID_FIL format, then ID_FIL is filled into the second stream element flag, ID_TYPE2. Simultaneously, a 4-bit or 12-bit second extended data length bit, EXT_LEN2, is set in the extended header information bitstream. The payload length of the spatial parameters is parsed and then filled into the second extended data length bit, EXT_LEN2.
[0099] In the above scenario, the second bitstream element flag bit and the second extended data length bit are filled in combination with the second bitstream element type and the second payload length corresponding to the spatial parameters, so that the spatial parameter information to be decoded can be clearly defined during decoding.
[0100] Step S305: Encapsulate the first extended data type flag bit, the first extended data bit, the stereo signal bitstream, and the multi-channel spatial parameter bitstream to obtain the audio encoded bitstream, which corresponds to the multi-channel audio signal. For details, please refer to the relevant descriptions of the steps corresponding to the scenarios described above; they will not be repeated here.
[0101] The multi-channel audio encoding method described above sets parameterized load flags, parameterized encoding flags, and signal layout flags in the first extended data bits. This allows the parameterized load flags to be filled with information carried by the multi-channel parameterized load, the parameterized encoding flags to be filled with information decoded by the parameterized load, and the signal layout flags to be filled with information about the audio signal layout. This enables the selection of decoding only stereo signals, only spatial parameter signals, or both stereo signals and spatial parameter signals, facilitating the decoding of different content according to different decoding conditions.
[0102] By filling the stereo signal bitstream with the stereo code corresponding to the stereo signal, and setting a second extended data type flag and a second extended data bit in the multi-channel spatial parameter bitstream, the second extended data type flag is filled with the data type code corresponding to the spatial parameters, and the second extended data bit is filled with the parameter content code corresponding to the spatial parameters. Thus, the stereo signal bitstream and the multi-channel spatial parameter bitstream are encapsulated in a single encoded bitstream structure. The spatial parameter bitstream is encapsulated with a newly defined extended data type flag. Older decoding devices cannot recognize the newly defined extended data type flag, so they will discard the spatial parameter bitstream of the corresponding length and only decode the stereo signal, thereby achieving compatibility with older decoding devices.
[0103] In some cases, a multi-channel audio decoding method is provided that can be used in electronic devices such as a first-type decoder with decoding capabilities, the first-type decoder being a new decoder corresponding to the encoder. Figure 6These are flowcharts of multi-channel audio decoding methods in some situations, such as... Figure 6 As shown, the process includes the following steps: Step S401: Obtain the first audio encoded bitstream. The first audio encoded bitstream is generated based on the multi-channel audio encoding method described above.
[0104] The decoding function of the first type of decoder corresponds to the encoding function of the encoder; that is, this first type of decoder is a new type of decoder that supports decoding spatial parameters and stereo signals. When the encoder encodes the multi-channel audio signal according to the encoding bitstream structure to obtain the first audio encoded bitstream, it can output the first audio encoded bitstream to the first type of decoder. Correspondingly, the first type of decoder can receive the first audio encoded bitstream sent by the encoder to perform the decoding process to restore the first audio encoded bitstream to the original multi-channel audio signal.
[0105] Step S402: In response to the decoder being a first type of decoder, the first extended header information bitstream is parsed to obtain the first extended data type and the first extended header data.
[0106] The first extended header information bitstream corresponds to the first audio encoded bitstream.
[0107] The first extended header information stream is the extended header information stream carried in the first audio encoded stream; the first extended data type is the audio signal extension type corresponding to the first audio encoded stream; the first extended header data is the audio signal extension header data corresponding to the first audio encoded stream.
[0108] Specifically, the first extended header information bitstream carries a first extended data type flag and a first extended data bit. By parsing the content of the first extended data type flag, the first extended data type represented by that content is determined. After parsing the first extended data type flag, the data content of the first extended data bit is parsed to determine the first extended header data represented by that data content.
[0109] Step S403: Analyze the first stereo signal bitstream and the first multi-channel spatial parameter bitstream to obtain the first stereo signal and the first spatial parameters.
[0110] Among them, the first stereo signal bitstream and the first multi-channel spatial parameter bitstream both correspond to the first audio encoded bitstream.
[0111] After parsing the first extended data type and the first extended header data, the first type decoder continues to parse the signal encoding content of the field where the first stereo signal bitstream is located, and decodes the encoded content to obtain the first stereo signal corresponding to the first stereo signal bitstream. After parsing the first stereo signal bitstream, the first type decoder continues to parse the parameter encoding content of the field where the first multi-channel spatial parameter bitstream is located, and decodes the parameter encoding content to obtain the first spatial parameters corresponding to the first multi-channel spatial parameter bitstream.
[0112] Step S404: The signal is restored using the first extended data type, the first extended header data, the first stereo signal and the first spatial parameters to obtain the first multi-channel audio signal, which corresponds to the first audio encoded bitstream.
[0113] Using the information represented by the first extended data type and the first extended header data, the first stereo signal and the first spatial parameters to be parsed by the first type of decoder are obtained. The upmixing algorithm corresponding to the multi-channel audio signal is invoked to upmix the first stereo signal and the first spatial parameters to obtain the first multi-channel audio signal corresponding to the first audio encoded bitstream.
[0114] The multi-channel audio decoding method provided above, for the first type of decoder that supports the new decoding method, obtains the corresponding first stereo signal and first spatial parameter by parsing the first stereo signal and the first multi-channel spatial parameter corresponding to the first audio encoded bitstream to achieve signal restoration and obtain the corresponding multi-channel audio signal. Thus, the complete decoding of the audio encoded bitstream under the first type of decoder is realized, ensuring the decoding quality of the audio encoded bitstream at low bitrates.
[0115] In some cases, a multi-channel audio decoding method is provided, which can be used in electronic devices such as decoders with decoding capabilities. Figure 7 These are flowcharts of multi-channel audio decoding methods in some situations, such as... Figure 7 As shown, the process includes the following steps: Step S501: Obtain the first audio encoded bitstream. The first audio encoded bitstream is generated based on the multi-channel audio encoding method described above. For details, please refer to the relevant descriptions of the steps corresponding to the scenarios shown above; they will not be repeated here.
[0116] In step S502, in response to the decoder being a first type of decoder, the first extended header information bitstream is parsed to obtain the first extended data type and the first extended header data, and the first extended header information bitstream corresponds to the first audio encoded bitstream.
[0117] Specifically, step S502 above includes: Step S5021: Parse the first bitstream element flag bit to obtain the first bitstream element flag.
[0118] The first bit stream element flag is located in the first extended header information bit stream.
[0119] As described in the multi-channel audio signal encoding method, the extended header information bitstream includes a first extended data length bit and a first bitstream element flag bit, that is, the first extended header information bitstream corresponding to the first audio encoding includes the first bitstream element flag bit.
[0120] After completing the decoding initialization, the first type of decoder performs parsing of the first extended header information bitstream. The first bitstream element flag bit is located in the starting byte of the first extended header information bitstream; therefore, the first type of decoder first parses the first bitstream element flag bit to obtain the bitstream element flag represented by the first bitstream element flag bit.
[0121] In some optional cases, before parsing the first extended header information bitstream, the method further includes: parsing the first encoding header information to obtain audio signal encoding header data, wherein the first encoding header information corresponds to the first audio encoding bitstream, and the audio signal encoding header information corresponds to the first audio encoding bitstream.
[0122] The first encoding header information is the encoding header of the first audio encoding; the audio signal encoding header data is the basic encoding information of the encoded frame signal, including sampling rate, encoding mode, whether it is a variable bit rate flag, channel layout, etc.
[0123] Specifically, when parsing the first audio encoded bitstream, the first type of decoder first parses the first encoding header information in the first audio encoded bitstream to obtain audio signal encoding header data such as the sampling rate, encoding mode, whether it is a variable bit rate flag, and number of channels of the current encoded frame signal, and initializes the first type of decoder according to the audio signal encoding header data to execute the subsequent encoding and parsing process.
[0124] In the above scenario, before parsing the first extended header information bitstream corresponding to the first audio encoded bitstream, the first encoding header information corresponding to the first audio encoded bitstream is parsed to obtain the basic header information of the audio frame corresponding to the audio encoded signal, thereby ensuring the integrity of the audio encoding decoding.
[0125] Step S5022: If the first bitstream element flag is the first flag, then parse the first extended data length bit and the first extended data type flag bit to obtain the first extended data length and the first extended data type.
[0126] The first extended data length bit and the first extended data type flag bit are located in the first extended header information bitstream, and the first flag indicates the parsing of the execution payload information.
[0127] Specifically, if the first target bit stream flag ID_TYPE1 is the first flag ID_FIL, then the load information parsing process begins.
[0128] After entering the load information parsing process, continue to parse the first extended data length bit EXT_LEN1 and the first extended data type flag bit EXT_TYPE1 in the first extended header information bit stream to obtain the first extended data length and the first extended data type that represents the data type information of the load.
[0129] Step S5023: Parse the first extended data bits to obtain the first extended header data.
[0130] The first extended data bit is located in the first extended header information bitstream, and the first extended header data has a first extended data length.
[0131] If the first extended data type flag EXT_TYPE1 is determined to be the data type EXT_TYPE_HEADER_DATA representing spatial parameters in the bitstream, it indicates that the first extended data type represents spatial parameters. At this point, the first type decoder continues to parse the first extended data bit HEADER_DATA following the first extended data type flag, according to the first extended data length, to determine the first extended header data of the first extended data length carried by the first extended data bit HEADER_DATA.
[0132] In some optional implementations, step S5023 above includes: Step c1: Parse the first parameterized load flag bit to obtain the first parameter value. The first parameterized load flag bit is located in the first extended data bits, and the first parameter value corresponds to the first parameterized load flag bit.
[0133] Step c2: If the first parameter value represents carrying multi-channel spatial parameters, then parse the first parameterized encoding flag bit and the first signal layout identifier bit to obtain the second parameter value and signal layout information. The first parameterized encoding flag bit and the first signal layout identifier bit are located in the first extended data bits. The second parameter value corresponds to the first parameterized encoding flag bit, and the signal layout information corresponds to the first signal layout identifier bit.
[0134] Step c3: If the value of the second parameter represents the parsed multi-channel spatial parameters, then the first extended head data is obtained using the signal layout information.
[0135] As described in the multi-channel audio signal encoding method, the first extended data bit consists of a parameterized load flag bit P, a parameterized encoding flag bit S, and a signal layout identifier bit Config. When parsing the first extended data bit, the first parameterized load flag bit is parsed first to determine whether its value is a first parameter value. This first parameter value is used to characterize the multi-channel parameterized load, such as a value of 1.
[0136] If the value of the first parameterized load flag is the first parameter value, then the first parameterized encoding flag in the first extended data bits is further parsed to determine whether the value of the first parameterized encoding flag is the second parameter value. The second parameter value is used to characterize whether to decode the multi-channel parameterized load; for example, if the second parameter value is 1.
[0137] If the value of the first parameterized encoding flag is the second parameter value, then the first signal layout identifier in the first extended data bit is further parsed to determine the audio layout code corresponding to the first signal layout identifier, obtain the signal layout information corresponding to the audio layout code, and reinitialize the first type decoder based on the signal layout information, and normally parse the subsequent stereo signal stream and multi-channel spatial parameter stream.
[0138] If the value of the first parameterized load flag is not the first parameter value, then exit the current parsing process and continue parsing the stereo signal stream.
[0139] In the above scenario, the first parameterized load flag bit, the first parameterized encoding flag bit, and the first signal layout identifier bit in the first extended data bits are parsed sequentially to determine the first extended header data, so as to supplement the basic header information using the first extended header data.
[0140] Step S503: Analyze the first stereo signal bitstream and the first multi-channel spatial parameter bitstream to obtain the first stereo signal and the first spatial parameters.
[0141] Specifically, step S503 includes: Step S5031: Parse the first stereo signal stream to obtain the first stereo signal. For details, please refer to the relevant descriptions of the steps corresponding to the scenarios described above; they will not be repeated here.
[0142] Step S5032: Parse the second bitstream element flag bit to obtain the second bitstream element flag.
[0143] The second bit stream element flag is located in the first multi-channel spatial parameter bit stream.
[0144] As described in the above multi-channel audio signal encoding method, the multi-channel spatial parameter bitstream includes a second bitstream element flag bit, a second extended data length bit, a second extended data type flag bit, and a second extended data bit.
[0145] After completing the parsing of the first stereo signal bitstream, the parsing of the first multi-channel spatial parameter bitstream continues. The second bitstream element flag is located in the starting byte of the first multi-channel spatial parameter bitstream. Therefore, when parsing the first multi-channel spatial parameter bitstream, the second bitstream element flag is parsed first to determine the second bitstream element flag represented by the second bitstream element flag.
[0146] Step S5033: If the second code stream element flag is the second flag, then parse the second extended data length bit and the second extended data type flag bit to obtain the second extended data length and the second extended data type.
[0147] The second extended data length bit and the second extended data type flag bit are both located in the first multi-channel spatial parameter bitstream, and the second bitstream flag indicates that the execution load information parsing is performed.
[0148] Different bitstream parsing methods are executed for different second flags. For example, if the second flag ID_TYPE2 is ID_FIL, then the parsing process for parameter payload information is entered.
[0149] If the second bitstream element flag is determined to be the second flag, then continue to parse the second extended data length bit EXT_LEN2 and the second extended data type flag bit EXT_TYPE2 in the first multi-channel spatial parameter bitstream to obtain the second extended data length and the second extended data type representing the spatial parameter load information.
[0150] Step S5034: If the second extended data type represents the spatial parameter code stream, then the first spatial parameter is obtained by using the spatial parameter decoding method.
[0151] The first spatial parameter has a second extended data length.
[0152] If the second extended data type EXT_TYPE2 is determined to represent the spatial parameter load information EXT_MC_PARAM_DATA, then the first type decoder parses the first spatial parameter of the second extended data length from the first multi-channel spatial parameter bitstream.
[0153] Then, combining the value of the first parameterized encoding flag with the value of the second parameter, the multi-channel signal upmixing generation algorithm is invoked to upmix the parsed first stereo signal and the first spatial parameter to restore the original multi-channel audio signal.
[0154] In some optional cases, the above method further includes: if the second extended data type represents a non-spatial parameter bitstream, then the first bitstream is parsed using the first decoding logic.
[0155] The first decoding logic and the first bitstream both correspond to the second extended data type.
[0156] If the second extended data type EXT_TYPE2 is determined to be a flag representing other data types of non-spatial parameter bitstreams, then the first decoding logic matching the bitstream data type EXT_TYPE is determined, and the corresponding bitstream parsing process is executed according to the first decoding logic. The specific bitstream parsing process is consistent with the existing Advanced Audio Coding (AAC) decoding process, and will not be elaborated here.
[0157] In some optional cases, the above method further includes: if the second bitstream element flag is a third flag, then using the second decoding logic to parse the first audio encoded bitstream.
[0158] The second decoding logic corresponds to the third flag.
[0159] The third flag indicates that load information parsing is not performed, and the normal parsing process is executed instead.
[0160] If the second bitstream element flag is determined to be the third flag, then the second decoding logic matching the third flag is determined, and the decoding process for the first audio codec is executed according to the second decoding logic. The specific decoding process is consistent with the existing Advanced Audio Coding (AAC) decoding process, and will not be described in detail here.
[0161] In a specific example, if the second bitstream element flag is the bitstream end flag, it means that the bitstream has been completely parsed and the decoding process ends.
[0162] Step S504: Signal reconstruction is performed using the first extended data type, first extended header data, first stereo signal, and first spatial parameters to obtain a first multi-channel audio signal. The first multi-channel audio signal corresponds to the first audio encoded bitstream. For details, please refer to the relevant descriptions of the steps corresponding to the scenarios described above; they will not be repeated here.
[0163] The multi-channel audio decoding method described above, by parsing the first bitstream element flag, the first extended data length bit, and the first extended data type flag in the first extended header information bitstream, and combining the first extended data type and the first extended data length to parse the first extended data bits, determines the corresponding first extended header data, thus achieving accurate parsing of the extended header data. After completing the parsing of the extended header data, by parsing the second bitstream element flag, the second extended data length bit, and the second extended data type flag in the first multi-channel spatial parameter bitstream, the first spatial parameter of the first bitstream length is decoded, thus achieving accurate parsing of the spatial parameter bitstream payload information. Therefore, complete decoding is achieved under the first type of decoder, ensuring that the decoded audio quality of the multi-channel audio signal is consistent with the encoded audio quality, and improving the decoding quality of the first type of decoder for multi-channel audio signals.
[0164] In some cases, a multi-channel audio decoding method is provided that can be used in electronic devices such as a second type of decoder with decoding capabilities, which is an older decoder corresponding to the encoder. Figure 8 These are flowcharts of multi-channel audio decoding methods in some situations, such as... Figure 8 As shown, the process includes the following steps: Step S601: Obtain the second audio encoded bitstream. The second audio encoded bitstream is generated based on the multi-channel audio encoding method described above.
[0165] The decoding function of the second type of decoder does not correspond to the encoding function of the encoder. This second type of decoder is an older type that only supports decoding stereo signals. When the encoder encodes the multi-channel audio signal according to the encoding bitstream structure to obtain the second audio encoded bitstream, it can output the second audio encoded bitstream to the second type of decoder. Correspondingly, the second type of decoder can receive the second audio encoded bitstream from the encoder and perform the decoding process to restore the stereo audio signal corresponding to the multi-channel audio signal from the second audio encoded bitstream, thus achieving backward compatibility of the audio encoded bitstream.
[0166] In step S602, in response to the decoder being a second type of decoder, the second extended header information bitstream is parsed to obtain the first extended data type.
[0167] The second extended header information stream corresponds to the second audio encoded stream.
[0168] The second extended header information stream is the extended header information stream carried in the second audio encoded stream; the first extended data type is the audio signal extension type corresponding to the second audio encoded stream. The second type decoder only supports stereo signal decoding.
[0169] Specifically, the second extended header information bitstream carries a first extended data type flag bit and a first extended data bit. The second type decoder determines the first extended data type represented by the content of the first extended data type flag bit by parsing the content of the first extended data type flag bit.
[0170] If the first extended data type is an extended data type (extended header data type) that is not defined by the second type decoder, then the parsing of the data content of the first extended data bit is skipped.
[0171] Step S603: Analyze the second stereo signal bitstream and the second multi-channel spatial parameter bitstream to obtain the second stereo signal.
[0172] Among them, the second stereo signal bitstream and the second multi-channel spatial parameter bitstream both correspond to the second audio encoded bitstream.
[0173] After completing the parsing of the first extended data type, the second type decoder continues to parse the signal encoding content of the field where the second stereo signal bitstream is located, and decodes the encoding content to obtain the second stereo signal corresponding to the second stereo signal bitstream.
[0174] Upon completing the parsing of the second stereo signal, the second type of decoder continues to parse the field containing the second multi-channel spatial parameter bitstream to determine the second extended data type flag corresponding to that bitstream. If the second extended data type flag indicates a spatial parameter bitstream not defined by the second type of decoder, the bitstream payload corresponding to that second multi-channel spatial parameter bitstream is discarded. If the second extended header type is another bitstream type defined by the second type of decoder, the bitstream payload corresponding to that other bitstream type is parsed.
[0175] In step S604, in response to the first extended data type not being recognized, the signal is restored using the second stereo signal to obtain the second multi-channel audio signal, which corresponds to the second audio encoded bitstream.
[0176] Since the second type decoder is an old-end decoder, it cannot recognize the newly defined first extended data type. At this time, it can be determined that the second type decoder can only restore the second stereo signal and call the restoration method corresponding to the stereo signal to restore the second stereo signal to the stereo audio signal corresponding to the second audio code stream. This stereo audio signal is the second multi-channel audio signal corresponding to the second audio code stream.
[0177] The multi-channel audio decoding method described above, for second-type decoders that do not support the new decoding method, cannot recognize the first and second extended data types defined in the new encoding method. Therefore, in parsing the second stereo signal stream and the second multi-channel spatial parameter stream corresponding to the second audio encoded stream, only the second stereo signal stream can be parsed, discarding the extended header information and the spatial parameters corresponding to the second multi-channel spatial parameter stream, to obtain the corresponding stereo signal. This allows for the reconstruction of the multi-channel stereo audio signal from the stereo signal. Thus, backward compatibility of the audio encoded stream on second-type decoders is achieved, ensuring the basic experience of the audio encoded stream under older decoders.
[0178] In some cases, a multi-channel audio decoding method is provided, which can be used in electronic devices such as decoders with decoding capabilities. Figure 9 These are flowcharts of multi-channel audio decoding methods in some situations, such as... Figure 9 As shown, the process includes the following steps: Step S701: Obtain the second audio encoded bitstream. The second audio encoded bitstream is generated based on the multi-channel audio encoding method described above. For details, please refer to the relevant descriptions of the steps corresponding to the scenarios described above; they will not be repeated here.
[0179] In step S702, in response to the decoder being a second type of decoder, the second extended header information bitstream is parsed to obtain the first extended data type, and the second extended header information bitstream corresponds to the second audio encoded bitstream.
[0180] Specifically, step S702 above includes: Step S7021: Parse the first bitstream element flag bit to obtain the first bitstream element flag.
[0181] The first bit stream element flag is located in the second extended header information bit stream.
[0182] As described in the multi-channel audio signal encoding method, the extended header information bitstream includes a first extended data length bit and a first bitstream element flag bit, that is, the second extended header information bitstream corresponding to the second audio encoded bitstream includes the first bitstream element flag bit.
[0183] After completing the decoding initialization, the second type of decoder performs parsing of the second extended header information bitstream. The first bitstream element flag bit is located at the beginning byte of the second extended header information bitstream; therefore, the second type of decoder first parses the first bitstream element flag bit to determine the extended element flag represented by the first bitstream element flag bit.
[0184] Step S7022: If the first bitstream element flag is the fourth flag, then parse the first extended data length bit and the first extended data type flag bit to obtain the first extended data length and the first extended data type.
[0185] Among them, the first extended data length bit and the first extended data type flag bit are in the second extended header information bitstream, and the fourth flag indicates that the execution payload information parsing is performed.
[0186] Specifically, if the fourth target stream flag ID_TYPE1 is the fourth flag ID_FIL, then the load information parsing process begins.
[0187] After entering the load information parsing process, continue to parse the first extended data length bit EXT_LEN1 and the first extended data type flag bit EXT_TYPE1 in the second extended header information bit stream to obtain the first extended data length and the first extended data type that represents the data type information of the load.
[0188] In step S7023, in response to the first extended data type indicating that the extended header is invalid, the first extended data bits are discarded.
[0189] The first extended data bit has a first extended data length.
[0190] If the first extended data type flag bit EXT_TYPE1 is determined to represent the spatial parameter bitstream data type EXT_TYPE_HEADER_DATA, since the second type decoder does not define this flag bit, the extended header corresponding to this first extended data type flag bit can be determined to be invalid. At this time, the second type decoder parses the first extended data bits corresponding to the second extended header information bitstream, that is, it discards the bitstream payload of the first extended data length.
[0191] Step S703: Analyze the second stereo signal stream and the second multi-channel spatial parameter stream to obtain the second stereo signal.
[0192] Specifically, step S703 includes: Step S7031: Obtain channel layout information.
[0193] Among them, the channel layout information is obtained by parsing the second encoding header information, and the second encoding header information corresponds to the second audio encoding bitstream.
[0194] Before parsing the second extended header information bitstream corresponding to the second audio encoded bitstream, the second type of decoder parses the second encoding header information corresponding to the second audio encoded bitstream in order to determine the signal layout information corresponding to the second audio encoded bitstream from the second encoding header information.
[0195] Since the second type of decoder only supports decoding stereo signals, and restoring the multi-channel audio signal corresponding to the stereo signal requires combining channel layout information, it is necessary to obtain the channel layout information determined by parsing the second encoder header information in order to perform the subsequent signal restoration process.
[0196] Step S7032: Analyze the second stereo signal stream using the channel layout information.
[0197] The second type of decoder parses the second stereo signal stream based on the channel layout information to determine the stereo signal load information corresponding to the second stereo signal stream.
[0198] Step S7033: In response to the completion of the second stereo signal stream parsing, the second stream element flag bits are decoded to determine the second stream flag.
[0199] The second bit stream element flag is located in the second multi-channel spatial parameter bit stream.
[0200] As described in the multi-channel audio signal encoding method above, the multi-channel spatial parameter bitstream includes a second bitstream element flag bit, a second extended data length bit, a second extended data type flag bit, and a second extended data bit. Accordingly, the second multi-channel spatial parameter bitstream includes a second bitstream element flag bit, and the second bitstream element flag bit is located in the starting byte of the second multi-channel spatial parameter bitstream.
[0201] After the second stereo signal bitstream is parsed, the second multi-channel spatial parameter bitstream is parsed. Since the second bitstream element flag is located in the starting byte of the second multi-channel spatial parameter bitstream, the second type of decoder will first parse the second bitstream element flag of the second multi-channel spatial parameter bitstream to determine the second bitstream flag represented by the second bitstream element flag.
[0202] Step S7034: If the second code stream flag is the fifth flag, then parse the second extended data length bit and the second extended data type flag bit to obtain the second extended data length and the second extended data type.
[0203] The second extended data length bit and the second extended data type flag bit are located in the second multi-channel spatial parameter bitstream.
[0204] The fifth flag indicates the start of the parameter load information parsing process. For example, if the fifth flag ID_TYPE2 can be ID_FIL, then the parameter load information parsing process will begin.
[0205] Different bitstream parsing methods are executed for different second bitstream flags. If the second bitstream flag is determined to be the fifth flag, then the second extended data length bit EXT_LEN2 and the second extended data type flag bit EXT_TYPE2 in the second multi-channel spatial parameter bitstream are parsed to obtain the second extended data length and the second extended data type representing the parameter load information.
[0206] Step S7035: If the second extended data type represents the spatial parameter bitstream, then discard the bitstream payload information to obtain the second stereo signal.
[0207] Among them, the discarded bitstream payload information is located in the second multi-channel spatial parameter bitstream, and the discarded bitstream payload information has a second extended data length.
[0208] If the second extended data type EXT_TYPE2 is determined to represent the spatial parameter bitstream EXT_MC_PARAM_DATA, but the second type decoder has not defined this spatial parameter bitstream, then the second type decoder can discard the bitstream payload of the second extended data length in the second multi-channel spatial parameter bitstream, and only parse the second stereo signal bitstream to obtain the corresponding second stereo signal.
[0209] In some optional cases, if the second extended data type EXT_TYPE2 is determined to be a flag representing other data types of non-spatial parameter bitstreams, then the decoding logic matching the second extended data type EXT_TYPE2 is determined, and the corresponding parsing process is executed according to the decoding logic. The specific bitstream parsing process is consistent with the existing Advanced Audio Coding (AAC) decoding process, and will not be elaborated here.
[0210] In some optional cases, if the second bitstream element flag is another target bitstream flag, then the decoding logic that matches the other target bitstream flag is determined, and the decoding process for the second audio codec is executed according to the decoding logic. The specific decoding process is consistent with the existing Advanced Audio Coding (AAC) decoding process, which will not be described in detail here.
[0211] In some optional cases, if the second bitstream element flag is a bitstream end flag, it means that the bitstream has been completely parsed and the decoding process ends.
[0212] In step S704, in response to the first extended data type not being recognized, the signal is restored using the second stereo signal to obtain a second multi-channel audio signal, which corresponds to the second audio encoded bitstream. For details, please refer to the relevant descriptions of the steps corresponding to the above-described scenarios; they will not be repeated here.
[0213] The multi-channel audio decoding method described above, by parsing the first bitstream element flag, the first extended data length bit, and the first extended data type flag bit in the second extended header information bitstream, refuses to parse the first extended data bit of the second extended information length when the second extended header type indicates that the extended header is invalid, ensuring that the second type decoder only recognizes the core stereo signal bitstream. After the second stereo signal bitstream is parsed, by parsing the second bitstream element flag, the second extended data length bit, and the second extended data type flag bit in the second multi-channel spatial parameter bitstream, the bitstream payload information of the second extended data length is discarded when the second extended data type indicates the spatial parameter bitstream, ensuring that the second type decoder only parses the stereo audio signal. This achieves decoding compatibility of the audio encoded bitstream with the second type encoder, ensuring that the decoded stereo audio quality is consistent with the encoded stereo quality, and improving the decoding quality of the second type encoder for stereo audio.
[0214] Taking AAC as a specific application scenario, AAC supports custom extended padding data types. Here, a new extended data type (EXT_MC_PARAM_DATA) is defined, indicating that the extended data is a spatial parameter bitstream data type.
[0215] like Figure 10 As shown, for the multi-channel audio signal to be encoded, spatial parameters and stereo signals are extracted from the multi-channel audio signal. The spatial parameters are quantized and encoded, and the stereo signals are AAC encoded. Then, the stereo signal payload corresponding to the stereo signal is packaged according to the stereo element format, and the spatial output parameter payload corresponding to the spatial parameters is packaged according to the extended element (ID_FILL) format. The spatial parameter payload information and the stereo signal payload information are then packaged together into the output bitstream to obtain the corresponding audio encoded bitstream.
[0216] For new types of decoders that receive audio encoding, such as Figure 11 As shown, the decoding process of the new type of decoder is as follows: (1) First, parse the ADTS Header information to obtain information such as the sampling rate of the encoded frame signal, AAC encoding mode, whether it is a variable bit rate flag, number of channels, etc., and initialize the decoder; (2) After the ADTS Header is parsed, the 3-bit extended element flag ID_TYPE1 is parsed. If ID_TYPE1 is ID_FIL, the AAC padding load parsing process is entered, as follows: (2-1) Parse the information length EXT_LEN1 and the extended header type flag EXT_TYPE1; (2-2) If EXT_TYPE1 is EXT_TYPE_HEADER_DATA, then parse the padding data of the first extended data bit to obtain the parameterized load flag P for whether it carries spatial parameter load. If the parameterized load flag P=1, then further parse the parameterized encoding flag S and the signal layout identifier Config; otherwise, exit the parsing process. (3) If the parameterized encoding flag S=1, then the corresponding spatial audio signal is re-initialized according to the signal layout flag Config, and the stereo signal stream is parsed normally.
[0217] (4) After the stereo signal stream is parsed, continue to parse the multi-channel spatial parameter stream and read the 3-bit second stream element flag ID_TYPE2: (4-1) If ID_TYPE2 is the end marker of the bitstream, it means that the bitstream has been completely parsed and the decoding process ends; otherwise, continue to the next step. (4-2) Different parsing processes are executed based on ID_TYPE2, as follows: (4-2-1) If ID_TYPE2 equals ID_FIL, then read the bitstream length EXT_LEN2 and the second extended data type flag EXT_TYPE2, and execute according to EXT_TYPE2: a) If EXT_TYPE2 equals EXT_MC_PARAM_DATA, it means that the second extended data bit is filled with multi-channel spatial parameter load, and S=1 in the previous extended header byte. At this time, the stereo signal and multi-channel spatial parameters can be combined to call the multi-channel signal upmixing algorithm to synthesize a multi-channel audio signal; otherwise, skip the bitstream load of the corresponding length. b) If EXT_TYPE2 is another extended data flag, then execute the corresponding decoding process according to EXT_TYPE2. The specific process is consistent with AAC and will not be described here.
[0218] (4-2-2) If ID_TYPE2 is another extended element flag, then the corresponding parsing process is executed according to ID_TYPE2. The specific process is consistent with AAC, and will not be described here.
[0219] (4-3) After the padding elements of the current frame bitstream are decoded, return to step (4) to continue parsing the remaining frame bitstream.
[0220] (5) After all frame bitstreams of ADTS have been parsed, the original multi-channel audio signal is output.
[0221] For older decoders that receive audio encoding, the decoding process is as follows: (1) First, parse the ADTS Header information to obtain information such as the sampling rate of the encoded frame signal, AAC encoding mode, whether it is a variable bit rate flag, number of channels, etc., and initialize the decoder; (2) After the ADTS Header is parsed, the 3-bit extended element flag ID_TYPE1 is parsed. If ID_TYPE1 is ID_FIL, the AAC padding load parsing process is entered, as follows: (2-1) Parse the information length EXT_LEN1 and the extended header type flag EXT_TYPE1; (2-2) If EXT_TYPE1 is EXT_TYPE_HEADER_DATA(0x07), the old type decoder does not define this flag bit, and considers it an invalid payload, discarding the bitstream payload with a length of EXT_LEN1; (3) Based on the channel layout obtained from the ADTS Header, parse the stereo load information corresponding to the stereo code until the stereo load information parsing is completed; (4) After the stereo encoding is parsed, continue to parse the multi-channel spatial parameter bitstream and read the 3-bit second bitstream element flag ID_TYPE2: (4-1) If ID_TYPE2 is the end marker of the bitstream, it means that the bitstream has been completely parsed and the decoding process ends; otherwise, continue to the next step. (4-2) Different parsing processes are executed based on ID_TYPE2, as follows: (4-2-1) If ID_TYPE2 is equal to ID_FIL, then read the bitstream length EXT_LEN2 and the second extended data type flag EXT_TYPE2, and execute according to EXT_TYPE2: a) If EXT_TYPE2 is equal to EXT_MC_PARAM_DATA(0x08), the old type decoder has not defined this flag, and it is considered an invalid payload, and the bitstream payload with information length EXT_LEN2 is discarded; b) If EXT_TYPE2 is another extended data flag, then execute the corresponding decoding process according to EXT_TYPE2. The specific process is consistent with AAC, and will not be described here.
[0222] (4-2-2) If ID_TYPE2 is another extended element flag, then the corresponding parsing process is executed according to ID_TYPE2. The specific process is consistent with AAC, and will not be described here.
[0223] (4-3) After the padding elements of the current frame bitstream are decoded, return to step (4) to continue parsing the remaining frame bitstream.
[0224] (5) After all frame bitstreams of ADTS have been parsed, the stereo signal restoration process is executed to obtain the stereo audio signal.
[0225] Therefore, the new type of decoder can recognize the newly defined extended data types to obtain the original multi-channel audio signal. The old type of decoder, however, does not recognize the newly defined extended data types and will directly discard the current extended payload, ensuring that the old type of decoder can only recognize the core stereo signal stream.
[0226] In summary, a compatible encoding stream structure is used here, and the generated audio encoding is fully compatible with the AAC encoder. The AAC decoder can directly decode stereo audio, and the audio quality is basically the same as that of AAC encoded stereo.
[0227] On terminals that support encoding and decoding methods, you can choose to decode only stereo signals, only spatial audio signals, or decode both stereo and spatial audio signals, decoding different content for different situations.
[0228] For example, in sharing proprietary new types of decoders, only spatial audio signals can be decoded, while only stereo signals can be recognized on other third-party devices. It can also ensure the compatibility of older types of decoders during the upgrade process, further reducing transmission bandwidth and saving performance overhead.
[0229] In some cases, a multi-channel audio encoding apparatus is also provided for implementing the multi-channel audio encoding method described above; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described below is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0230] In some cases, a multi-channel audio encoding device is provided, such as Figure 12 As shown, it includes: The audio information acquisition module 801 is used to acquire multi-channel audio signals and encoded bitstream structures. The encoded bitstream structure includes an extended header information bitstream, a stereo signal bitstream, and a multi-channel spatial parameter bitstream. The extended header information bitstream includes a first extended data type flag bit and a first extended data bit.
[0231] The information extraction module 802 is used to extract spatial parameters and stereo signals, both of which correspond to multi-channel audio signals.
[0232] The extended header filling module 803 is used to fill attribute information into the first extended data bit, and the attribute information corresponds to the spatial parameters.
[0233] The bitstream filling module 804 is used to fill the stereo code into the stereo signal bitstream and fill the parameter code into the multi-channel spatial parameter bitstream. The stereo code corresponds to the stereo signal, and the parameter code corresponds to the spatial parameters.
[0234] The stream encapsulation module 805 is used to encapsulate the first extended data type flag bit, the first extended data bit, the stereo signal stream, and the multi-channel spatial parameter stream to obtain the audio encoded stream, which corresponds to the multi-channel audio signal.
[0235] In some optional cases, the first extended data bits include a parameterized load flag bit, a parameterized encoding flag bit, and a signal layout identifier bit. Accordingly, the extended header filling module 803 includes: The load flag filling unit is used to fill the multi-channel parameterized load information into the parameterized load flag bits.
[0236] The encoding flag padding unit is used to fill the parameterized payload decoding information into the parameterized encoding flag bits.
[0237] The layout identifier filling unit is used to fill the audio signal layout information into the signal layout identifier bit.
[0238] Among them, the multi-channel parameterized load information, parameterized load decoding information, and audio signal layout information all correspond to the attribute information.
[0239] In some optional cases, the extended header information bitstream further includes a first extended data length bit and a first bitstream element flag bit; correspondingly, the above-mentioned apparatus further includes: The element flag filling module is used to fill the first bitstream element type to the first bitstream element flag bit. The first bitstream element type corresponds to the extended header information bitstream.
[0240] The extended information length filling module is used to fill the first payload length to the first extended data length bits, and the first payload length corresponds to the extended header information bitstream.
[0241] In some optional cases, the multi-channel spatial parameter bitstream includes a second extended data type flag bit and a second extended data bit, and the parameter encoding includes data type encoding and parameter content encoding. Accordingly, the bitstream filling module 804 includes: The bitstream data type padding unit is used to fill the data type encoding to the second extended data type flag bit. The data type encoding corresponds to the spatial parameters.
[0242] The parameter filling unit is used to fill the parameter content encoding to the second extended data bits, and the parameter content encoding corresponds to the spatial parameter.
[0243] In some optional cases, the multi-channel spatial parameter bitstream further includes a second extended data length bit and a second bitstream element flag bit. Accordingly, the above-described apparatus further includes: The stream flag filling module is used to fill the second stream element type to the second stream element flag bit. The second stream element type corresponds to the spatial parameters.
[0244] The bitstream length padding module is used to pad the second payload length to the second extended data length bits, and the second payload length corresponds to the space parameter.
[0245] Further functional descriptions of the various modules and units mentioned above are the same as those for the corresponding cases described above, and will not be repeated here.
[0246] The multi-channel audio encoding device provided herein can execute the above-described multi-channel audio encoding method, and has the corresponding functional modules and beneficial effects for executing the method.
[0247] By setting an extended header information stream, a stereo signal stream, and a multi-channel spatial parameter stream in the encoded stream structure, and defining a first extended data type flag bit and a first extended data bit in the extended header information stream, it is possible to support defining spatial parameter stream data types in the encoded stream structure.
[0248] For the acquired multi-channel audio signal to be encoded, the corresponding spatial parameters and stereo signal are extracted. Using the attribute information of the spatial parameters, the first extended data bits are filled, and the stereo encoding corresponding to the stereo signal is filled into the stereo signal bitstream. The parameter encoding corresponding to the spatial parameters is filled into the multi-channel spatial parameter bitstream. The first extended data type flag, the first extended data bits, the stereo signal bitstream, and the multi-channel spatial parameter bitstream are encapsulated into the encoded bitstream to generate the audio encoded bitstream. Thus, by packaging the stereo signal bitstream and the multi-channel spatial parameter bitstream into the encoded bitstream, and encapsulating the spatial parameter bitstream with a newly defined extended data type flag, when older decoding devices cannot recognize the newly defined extended data type flag, they discard the corresponding length of the spatial parameter bitstream and only decode the stereo signal, thereby achieving compatibility on older decoding devices. Therefore, there is no need to additionally encode the stereo bitstream to support compatibility on different spatial audio decoding devices, avoiding additional bandwidth and performance overhead, supporting applications in low-bitrate scenarios, and ensuring the encoding quality of multi-channel audio signals at low bitrates.
[0249] In some cases, a multi-channel audio decoding apparatus is also provided for implementing the multi-channel audio decoding method described above; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described below is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0250] In some cases, a multi-channel audio decoding device is provided, such as Figure 13 As shown, it includes: The first audio encoding acquisition module 901 is used to acquire the first audio encoding bitstream, which is generated based on a multi-channel audio encoding method.
[0251] The first extension header parsing module 902 is used to parse the first extension header information bitstream in response to the decoder being a first type of decoder, to obtain the first extended data type and the first extension header data, wherein the first extension header information bitstream corresponds to the first audio encoded bitstream.
[0252] The first load information parsing module 903 is used to parse the first stereo signal bitstream and the first multi-channel spatial parameter bitstream to obtain the first stereo signal and the first spatial parameters. The first stereo signal bitstream and the first multi-channel spatial parameter bitstream both correspond to the first audio encoding bitstream.
[0253] The first signal restoration module 904 is used to restore the signal using the first extended data type, the first extended header data, the first stereo signal and the first spatial parameters to obtain the first multi-channel audio signal, which corresponds to the first audio encoding stream.
[0254] In some optional cases, the first extended header parsing module 902 includes: The first parsing unit is used to parse the first bitstream element flag bit to obtain the first bitstream element flag bit, which is located in the first extended header information bitstream.
[0255] The second parsing unit is used to parse the first extended data length bit and the first extended data type flag bit if the first bit stream element flag is the first flag, to obtain the first extended data length and the first extended data type. The first extended data length bit and the first extended data type flag bit are in the first extended header information bit stream, and the first flag indicates that the execution load information parsing is performed.
[0256] The first extended header data parsing unit is used to parse the first extended data bits to obtain the first extended header data. The first extended data bits are in the first extended header information bitstream, and the first extended header data has a first extended data length.
[0257] In some optional cases, the first extended header data parsing unit includes: The load flag parsing subunit is used to parse the first parameterized load flag bit to obtain the first parameter value. The first parameterized load flag bit is located in the first extended data bits, and the first parameter value corresponds to the first parameterized load flag bit.
[0258] The encoding flag and layout flag parsing subunit is used to parse the first parameterized encoding flag bit and the first signal layout flag bit if the first parameter value represents carrying multi-channel spatial parameters, and obtain the second parameter value and signal layout information. The first parameterized encoding flag bit and the first signal layout flag bit are located in the first extended data bits, the second parameter value corresponds to the first parameterized encoding flag bit, and the signal layout information corresponds to the first signal layout flag bit.
[0259] The extended head data determination subunit is used to obtain the first extended head data by utilizing the signal layout information if the second parameter value represents the analytical multi-channel spatial parameters.
[0260] In some alternative cases, the above-mentioned device further includes: The header information parsing module is used to parse the first encoding header information to obtain the audio signal encoding header data. The first encoding header information corresponds to the first audio encoding bitstream, and the audio signal encoding header information corresponds to the first audio encoding bitstream.
[0261] In some optional cases, the first load information parsing module 903 includes: The bitstream flag parsing unit is used to parse the second bitstream element flag bit to obtain the second bitstream element flag bit, which is located in the first multi-channel spatial parameter bitstream.
[0262] The bitstream length and data type parsing unit is used to parse the second extended data length bit and the second extended data type flag bit if the second bitstream element flag is the second flag, to obtain the second extended data length and the second extended data type. The second extended data length bit and the second extended data type flag bit are both in the first multi-channel spatial parameter bitstream. The second bitstream flag indicates that the load information parsing is performed.
[0263] The spatial parameter load parsing unit is used to obtain the first spatial parameter by using the spatial parameter decoding method if the second extended data type represents the spatial parameter code stream. The first spatial parameter has the second extended data length.
[0264] In some alternative cases, the above-mentioned device further includes: The first decoding logic determination module is used to parse the first bitstream using the first decoding logic if the second extended data type represents a non-spatial parameter bitstream. Both the first decoding logic and the first bitstream correspond to the second extended data type.
[0265] The second decoding logic determination module is used to parse the first audio encoded bitstream using the second decoding logic if the second bitstream element flag is the third flag. The second decoding logic corresponds to the third flag.
[0266] Further functional descriptions of the various modules and units mentioned above are the same as those for the corresponding cases described above, and will not be repeated here.
[0267] The multi-channel audio decoding device provided herein can perform the above-described multi-channel audio decoding method, and has the corresponding functional modules and beneficial effects for performing the method.
[0268] For the first type of decoder that supports the new decoding method, by parsing the first stereo signal bitstream and the first multi-channel spatial parameter bitstream corresponding to the first audio encoded bitstream, the corresponding first stereo signal and the first spatial parameters are obtained to realize signal restoration and obtain the corresponding multi-channel audio signal. Thus, the complete decoding of the audio encoded bitstream on the first type of decoder is realized, ensuring the decoding quality of the audio encoded bitstream at low bitrates.
[0269] In some cases, a multi-channel audio decoding device is also provided, such as Figure 14 As shown, it includes: The second audio encoding acquisition module 1001 is used to acquire the second audio encoding bitstream, which is generated based on a multi-channel audio encoding method.
[0270] The second extension header parsing module 1002 is used to parse the second extension header information bitstream in response to the decoder being a second type of decoder, to obtain the first extended data type, and the second extension header information bitstream corresponds to the second audio encoded bitstream.
[0271] The second load information parsing module 1003 is used to parse the second stereo signal bitstream and the second multi-channel spatial parameter bitstream to obtain the second stereo signal. The second stereo signal bitstream and the second multi-channel spatial parameter bitstream both correspond to the second audio encoding bitstream.
[0272] The second signal restoration module 1004 is used to restore the signal using the second stereo signal in response to the first extended data type not being recognized, so as to obtain the second multi-channel audio signal, which corresponds to the second audio encoding stream.
[0273] In some optional cases, the second extended header parsing module 1002 includes: The third parsing unit parses the first bitstream element flag bit to obtain the first bitstream element flag, which is located in the second extended header information bitstream.
[0274] The fourth parsing unit is used to parse the first extended data length bit and the first extended data type bit if the first bit stream element flag bit is the fourth flag, to obtain the first extended data length and the first extended data type. The first extended data length bit and the first extended data type bit are in the second extended header information bit stream. The fourth flag indicates that the payload information parsing is performed.
[0275] The first discard unit is used to discard the first extended data bit in response to the first extended data type indicating that the extended header is invalid. The first extended data bit has a first extended data length.
[0276] In some optional cases, the second load information parsing module 1003 includes: The channel layout acquisition unit is used to acquire channel layout information, which is obtained by parsing the second encoding header information. The second encoding header information corresponds to the second audio encoding bitstream.
[0277] The fifth parsing unit is used to parse the second stereo signal stream using the channel layout information.
[0278] The sixth parsing unit is used to respond to the completion of parsing the second stereo signal stream, decode the second stream element flag, and determine the second stream flag, which is located in the second multi-channel spatial parameter stream.
[0279] The seventh parsing unit is used to parse the second extended data length bit and the second extended data type flag bit if the second bit stream flag is the fifth flag, to obtain the second extended data length and the second extended data type. The second extended data length bit and the second extended data type flag bit are in the second multi-channel spatial parameter bit stream.
[0280] The second discarding unit is used to discard the bitstream payload information if the second extended data type represents the spatial parameter bitstream, thereby obtaining the second stereo signal. The discarded bitstream payload information is in the second multi-channel spatial parameter bitstream, and the discarded bitstream payload information has the second extended data length.
[0281] Further functional descriptions of the various modules and units mentioned above are the same as those for the corresponding cases described above, and will not be repeated here.
[0282] The multi-channel audio decoding device provided herein can perform the above-described multi-channel audio decoding method, and has the corresponding functional modules and beneficial effects for performing the method.
[0283] For the second type of decoder that does not support the new decoding method, it cannot recognize the extended data types defined in the new encoding method. Therefore, in the process of parsing the second stereo signal stream and the second multi-channel spatial parameter stream corresponding to the second audio encoded stream, only the second stereo signal stream can be parsed while discarding the spatial parameters corresponding to the second multi-channel spatial parameter stream, thus obtaining the corresponding stereo signal. This allows for the reconstruction of the multi-channel stereo audio signal from the stereo signal. This achieves backward compatibility of the audio encoded stream on the second type of decoder.
[0284] Figure 15 This is a schematic diagram of the structure of an electronic device provided in certain situations.
[0285] The following is a detailed reference. Figure 15 The diagram illustrates a structural schematic of an electronic device suitable for implementing the above-described scenario. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1101, which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 1102 or a program loaded from memory 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the operation of the electronic device. The processor 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0286] Typically, the following devices can be connected to I / O interface 1105: input devices 1106 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1107 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1108 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1109. Communication device 1109 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 15 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0287] In particular, depending on the circumstances, the processes described in the flowchart above can be implemented as computer software programs. For example, some cases include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such cases, the computer program can be downloaded and installed from a network via communication device 1109, or installed from memory 1108, or installed from ROM 1102. When the computer program is executed by processor 1101, it performs the functions defined in the multi-channel audio encoding method and multi-channel audio decoding method described above.
[0288] Figure 15 The electronic device shown is merely an example and should not impose any limitations on the functionality and scope of use of the above-described situation.
[0289] In some cases, a computer-readable storage medium is also provided, wherein the methods described above can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network, so that the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium may be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that a computer, processor, microprocessor controller, or programmable hardware includes storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the multi-channel audio encoding method and multi-channel audio decoding method shown above.
[0290] In some cases, certain components can be applied as computer program products, such as computer program instructions. When executed by a computer, these instructions, through the operation of the computer, can invoke or provide methods and / or technical solutions according to the aforementioned situations. Those skilled in the art will understand that the forms in which computer program instructions exist in computer-readable media include, but are not limited to, source files, executable files, and installation package files. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0291] Although some scenarios have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the above scenarios, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A multi-channel audio encoding method, comprising: Acquire multi-channel audio signals and encoded bitstream structures, wherein the encoded bitstream structure includes extended header information bitstream, stereo signal bitstream, and multi-channel spatial parameter bitstream, and the extended header information bitstream includes a first extended data type flag bit and a first extended data bit; Extract spatial parameters and stereo signals, both of which correspond to the multi-channel audio signals; Fill attribute information into the first extended data bit, where the attribute information corresponds to the spatial parameter; Stereo coding is added to the stereo signal stream, and parameter coding is added to the multi-channel spatial parameter stream. The stereo coding corresponds to the stereo signal, and the parameter coding corresponds to the spatial parameters. The first extended data type flag bit, the first extended data bit, the stereo signal bitstream, and the multi-channel spatial parameter bitstream are encapsulated to obtain an audio encoded bitstream, which corresponds to the multi-channel audio signal.
2. The method according to claim 1, wherein the first extended data bit includes a parameterized load flag bit, a parameterized encoding flag bit, and a signal layout identifier bit; The filling of attribute information into the first extended data bits includes: Fill the multi-channel parameterized load with information carried by the parameterized load flag; Fill the parameterized payload decoding information into the parameterized encoding flag bits; Fill the signal layout information into the signal layout identifier bits; The multi-channel parameterized load carrying information, the parameterized load decoding information, and the audio signal layout information all correspond to the attribute information.
3. The method according to claim 2, wherein the extended header information bitstream further includes a first extended data length bit and a first bitstream element flag bit; the method further includes: Fill the first bitstream element type into the first bitstream element flag bit, where the first bitstream element type corresponds to the extended header information bitstream; Fill the first payload length to the first extended data length bits, where the first payload length corresponds to the extended header information bitstream.
4. The method according to claim 1, wherein the multi-channel spatial parameter bitstream includes a second extended data type flag bit and a second extended data bit; The encoding of the padding parameters into the multi-channel spatial parameter bitstream includes: The data type encoding is filled into the second extended data type flag bit, and the data type encoding corresponds to the spatial parameter; The parameter content is filled and encoded into the second extended data bits, and the parameter content encoding corresponds to the spatial parameter; The parameter encoding includes the data type encoding and the parameter content encoding.
5. The method according to claim 4, wherein the multi-channel spatial parameter bitstream further includes a second extended data length bit and a second bitstream element flag bit; the method further includes: Fill the second bitstream element type into the second bitstream element flag bit, where the second bitstream element type corresponds to the spatial parameter; Fill the second load length to the second extended data length bits, the second load length corresponding to the space parameter.
6. A multi-channel audio decoding method, comprising: A first audio encoded bitstream is obtained, wherein the first audio encoded bitstream is generated based on the multi-channel audio encoding method according to any one of claims 1-5; In response to the decoder being a first type of decoder, the first extended header information bitstream is parsed to obtain the first extended data type and the first extended header data, wherein the first extended header information bitstream corresponds to the first audio encoded bitstream; The first stereo signal bitstream and the first multi-channel spatial parameter bitstream are analyzed to obtain the first stereo signal and the first spatial parameters. The first stereo signal bitstream and the first multi-channel spatial parameter bitstream are both corresponding to the first audio encoded bitstream. The signal is restored using the first extended data type, the first extended header data, the first stereo signal, and the first spatial parameters to obtain a first multi-channel audio signal, which corresponds to the first audio encoded bitstream.
7. The method according to claim 6, wherein parsing the first extended header information bitstream to obtain the first extended data type and the first extended header data includes: Parse the first bitstream element flag bit to obtain the first bitstream element flag bit, which is located in the first extended header information bitstream. If the first bitstream element flag is the first flag, then the first extended data length bit and the first extended data type flag bit are parsed to obtain the first extended data length and the first extended data type; the first extended data length bit and the first extended data type flag bit are in the first extended header information bitstream, and the first flag indicates that the execution payload information is parsed; Parse the first extended data bit to obtain the first extended header data. The first extended data bit is in the first extended header information bitstream, and the first extended header data has the first extended data length.
8. The method according to claim 7, wherein parsing the first extended data bits to obtain the first extended header data comprises: Parse the first parameterized load flag bit to obtain the first parameter value. The first parameterized load flag bit is located in the first extended data bits, and the first parameter value corresponds to the first parameterized load flag bit. If the first parameter value represents carrying multi-channel spatial parameters, then the first parameterized encoding flag bit and the first signal layout identifier bit are parsed to obtain the second parameter value and signal layout information; the first parameterized encoding flag bit and the first signal layout identifier bit are located in the first extended data bits, the second parameter value corresponds to the first parameterized encoding flag bit, and the signal layout information corresponds to the first signal layout identifier bit; If the second parameter value represents the parsing of the multi-channel spatial parameters, then the first extended header data is obtained using the signal layout information.
9. The method according to claim 7, wherein before parsing the first extended header information bitstream, the method comprises: The first encoding header information is parsed to obtain the audio signal encoding header information, which corresponds to the first audio encoding bitstream.
10. The method according to any one of claims 6 to 9, parsing the first multi-channel spatial parameter bitstream to obtain the first spatial parameters, comprising: Parse the second bitstream element flag bit to obtain the second bitstream element flag bit, which is located in the first multi-channel spatial parameter bitstream. If the second bitstream element flag is the second flag, then the second extended data length bit and the second extended data type flag bit are parsed to obtain the second extended data length and the second extended data type. The second extended data length bit and the second extended data type flag bit are both in the first multi-channel spatial parameter bitstream. The second bitstream flag indicates that the load information parsing is performed. If the second extended data type represents a spatial parameter code stream, then the first spatial parameter is obtained by using the spatial parameter decoding method, and the first spatial parameter has the length of the second extended data.
11. The method of claim 10, further comprising: If the second extended data type represents a non-spatial parameter bitstream, then the first decoding logic is used to parse the first bitstream, and both the first decoding logic and the first bitstream correspond to the second extended data type. And / or, If the second bitstream element flag is the third flag, then the first audio encoded bitstream is parsed using the second decoding logic, and the second decoding logic corresponds to the third flag.
12. A multi-channel audio decoding method, comprising: A second audio encoded bitstream is obtained, wherein the second audio encoded bitstream is generated based on the multi-channel audio encoding method according to any one of claims 1-5; In response to the decoder being a second type of decoder, the second extended header information bitstream is parsed to obtain the first extended data type, and the second extended header information bitstream corresponds to the second audio encoded bitstream; The second stereo signal bitstream and the second multi-channel spatial parameter bitstream are analyzed to obtain the second stereo signal. The second stereo signal bitstream and the second multi-channel spatial parameter bitstream are both corresponding to the second audio encoded bitstream. In response to the first extended data type not being recognized, the second stereo signal is used to restore the signal and obtain a second multi-channel audio signal, which corresponds to the second audio encoded bitstream.
13. The method according to claim 12, wherein parsing the second extended header information bitstream to obtain the first extended data type includes: Parse the first bitstream element flag bit to obtain the first bitstream element flag bit, which is located in the second extended header information bitstream. If the first bitstream element flag is the fourth flag, then the first extended data length bit and the first extended data type flag bit are parsed to obtain the first extended data length and the first extended data type. The first extended data length bit and the first extended data type flag bit are in the second extended header information bitstream. The fourth flag indicates that the payload information parsing is performed. In response to the first extended data type indicating that the extended header bitstream is invalid, the first extended data bit is discarded, and the first extended data bit has the length of the first extended data.
14. The method according to claim 13, wherein parsing the second stereo signal bitstream and the second multi-channel spatial parameter bitstream to obtain the second stereo signal comprises: Obtain channel layout information, which is obtained by parsing the second encoding header information, and the second encoding header information corresponds to the second audio encoded bitstream; The second stereo signal stream is parsed using the channel layout information. In response to the completion of the parsing of the second stereo signal bitstream, the second bitstream element flag is parsed to obtain the second bitstream flag, which is located in the second multi-channel spatial parameter bitstream; If the second bitstream flag is the fifth flag, then the second extended data length bit and the second extended data type flag bit are parsed to obtain the second extended data length and the second extended data type. The second extended data length bit and the second extended data type flag bit are in the second multi-channel spatial parameter bitstream. If the second extended data type represents a spatial parameter bitstream, then the bitstream payload information is discarded to obtain the second stereo signal. The discarded bitstream payload information is located in the second multi-channel spatial parameter bitstream, and the discarded bitstream payload information has the second extended data length.
15. An electronic device comprising: The system includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the multi-channel audio encoding method of any one of claims 1 to 5, or the multi-channel audio decoding method of any one of claims 6 to 11, or the multi-channel audio decoding method of any one of claims 12 to 14.