Audio encoding method, audio decoding method, and related product

By upsampling or downsampling the encoding vectors in the audio frame sequence, and using the characteristic values ​​of historical audio frames to improve the encoding process of the current frame, the problem of audio data quality degradation is solved, and the audio encoding and decoding effect is significantly improved.

WO2023221674A9PCT designated stage expired Publication Date: 2024-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/085872
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-05-19
Filing Date
2023-04-03
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

During the audio encoding and decoding process, media data may cause data loss, thereby reducing media data quality.

Method used

When obtaining the coding vector in the audio frame sequence, the coding vector of the historical audio frame is upsampled or downsampled to obtain the feature value, and the coding vector of the current audio frame is sampled accordingly according to these feature values ​​to improve the audio quality. frame data receptive field, thereby improving audio data quality.

Benefits of technology

This method effectively improves the decoding quality of audio data, especially in weak network environments, and significantly improves the quality of voice calls and video calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023085872_12092024_PF_FP_ABST
    Figure CN2023085872_12092024_PF_FP_ABST
Patent Text Reader

Abstract

An audio encoding method, an audio decoding method, an audio encoding apparatus, an audio decoding apparatus, and a computer-readable medium, an electronic device and a computer program product. The present application belongs to the technical field of audio and video. The audio decoding method comprises: acquiring an encoding vector of each audio frame in an audio frame sequence (S410); when the current audio frame in the audio frame sequence is decoded, performing up-sampling on an encoding vector of a historical audio frame, so as to obtain an up-sampling feature value, wherein the historical audio frame is one or more audio frames, which are decoded before the current audio frame, in the audio frame sequence, and the up-sampling feature value is a feature vector which is obtained during the up-sampling process and is used for describing the historical audio frame (S420); and performing up-sampling on the encoding vector of the current audio frame according to the up-sampling feature value, so as to obtain decoded data of the current audio frame (S430). The encoding and decoding quality of audio data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Audio coding and decoding methods and related products

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 19, 2022, with application number 202210546928.4 and application name “Audio Coding and Decoding Methods and Related Products”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application belongs to the field of audio and video technology, and specifically relates to an audio coding and decoding method, an audio coding and decoding device, a computer-readable medium, an electronic device, and a computer program product. Background Art

[0003] Encoding and decoding media data such as audio and video can achieve compressed transmission of media data, thereby reducing the network transmission cost of media data and improving network transmission efficiency.

[0004] However, during the encoding process, media data may be lost, which may lead to poor quality of the media data.

[0005] Summary of the Invention

[0006] The present application provides an audio coding and decoding method, an audio coding and decoding device, a computer-readable medium, an electronic device, and a computer program product, the purpose of which is to improve the quality of media data.

[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0008] According to one aspect of an embodiment of the present application, there is provided an audio decoding method, the method being executed by a computer device, the method comprising:

[0009] Obtaining the encoding vector of each audio frame in the audio frame sequence;

[0010] When decoding to a current audio frame in the audio frame sequence, upsampling the encoding vector of a historical audio frame to obtain an upsampled feature value, where the historical audio frame is one or more audio frames decoded before the current audio frame in the audio frame sequence, and the upsampled feature value is a feature vector obtained during the upsampling process and used to describe the historical audio frame;

[0011] The encoding vector of the current audio frame is upsampled according to the upsampled eigenvalue to obtain decoded data of the current audio frame.

[0012] According to one aspect of an embodiment of the present application, there is provided an audio encoding method, the method being executed by a computer device, the method comprising:

[0013] Obtain audio data of each audio frame in the audio frame sequence;

[0014] When encoding a current audio frame in the audio frame sequence, downsampling audio data of a historical audio frame to obtain a downsampled feature value, where the historical audio frame is one or more audio frames encoded before the current audio frame in the audio frame sequence, and the downsampled feature value is a feature vector obtained during the downsampling process and used to describe the historical audio frame;

[0015] Down-sampling the audio data of the current audio frame according to the down-sampling eigenvalues ​​obtains an encoding vector of the current audio frame.

[0016] According to one aspect of an embodiment of the present application, an audio decoding apparatus is provided, wherein the apparatus is deployed on a computer device and includes:

[0017] An acquisition module is configured to acquire a coding vector of each audio frame in the audio frame sequence;

[0018] a first upsampling module configured to, when decoding to a current audio frame in the audio frame sequence, upsample an encoding vector of a historical audio frame to obtain an upsampled feature value, wherein the historical audio frame is one or more audio frames decoded before the current audio frame in the audio frame sequence, and the upsampled feature value is a feature vector obtained during the upsampling process and used to describe the historical audio frame;

[0019] The second upsampling module is configured to upsample the encoding vector of the current audio frame according to the upsampling feature value to obtain decoded data of the current audio frame.

[0020] According to one aspect of an embodiment of the present application, an audio encoding apparatus is provided, where the apparatus is deployed on a computer device and includes:

[0021] an acquisition module, configured to acquire audio data of each audio frame in the audio frame sequence;

[0022] a first downsampling module configured to, when encoding a current audio frame in the audio frame sequence, downsample audio data of a historical audio frame to obtain a downsampled feature value, wherein the historical audio frame is one or more audio frames encoded before the current audio frame in the audio frame sequence, and the downsampled feature value is a feature vector obtained during the downsampling process and used to describe the historical audio frame;

[0023] The second downsampling module is configured to downsample the audio data of the current audio frame according to the downsampling eigenvalue to obtain the encoding vector of the current audio frame.

[0024] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the audio encoding and decoding method in the above technical solution is implemented.

[0025] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing a computer program executable by the processor; wherein the processor is configured to enable the electronic device to perform an audio coding method as in the above technical solution by executing the executable computer program.

[0026] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, which implements the audio encoding and decoding method in the above technical solution when executed by a processor.

[0027] Based on the technical solution provided in the embodiments of the present application, the encoding vectors of each audio frame in the audio frame sequence are obtained. When decoding to the current audio frame in the audio frame sequence, the encoding vector of the current audio frame can be upsampled. In the process of upsampling the encoding vector of the current audio frame, the upsampling eigenvalue obtained by upsampling the encoding vector of the historical audio frame can be introduced, so that the encoding vector of the current audio frame is upsampled according to the upsampling eigenvalue to obtain the decoded data of the current audio frame, so that the upsampling process of a single audio frame can obtain a larger data receptive field, thereby improving the data quality of the audio.

[0028] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0030] FIG1 is a schematic diagram showing an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied;

[0031] FIG2 shows how a video encoding device and a video decoding device are placed in a streaming environment;

[0032] FIG3 shows a network structure diagram of a codec built on a convolutional neural network;

[0033] FIG4 shows a flowchart of an audio decoding method according to an embodiment of the present application;

[0034] FIG5 is a flowchart showing the steps of a method for performing audio decoding based on a convolutional neural network including multiple upsampling layers in one embodiment of the present application;

[0035] FIG6 shows a schematic diagram of a network module for implementing data encoding and decoding processing in one embodiment of the present application;

[0036] FIG7 is a schematic diagram showing the principle of normalizing channel characteristic values ​​output by multiple sampling channels in one embodiment of the present application;

[0037] FIG8 shows a flowchart of steps for performing audio frame decoding processing based on a query codebook in one embodiment of the present application;

[0038] FIG9 is a schematic diagram showing the principle of determining a coding vector based on data mapping in one embodiment of the present application;

[0039] FIG10 shows a flowchart of steps for training a quantizer in one embodiment of the present application;

[0040] FIG11 is a flowchart showing the steps of an audio encoding method in one embodiment of the present application;

[0041] FIG12 is a flowchart showing the steps of a method for audio encoding based on a convolutional neural network including multiple downsampling layers in one embodiment of the present application;

[0042] FIG13 shows a flowchart of steps for performing model training on an encoder and a decoder in one embodiment of the present application;

[0043] FIG14 is a schematic diagram showing the principle of performing codec model training based on a generative adversarial network in one embodiment of the present application;

[0044] FIG15 shows a structural block diagram of an audio decoding device in one embodiment of the present application;

[0045] FIG16 shows a structural block diagram of an audio encoding device in one embodiment of the present application;

[0046] FIG17 shows a block diagram of the computer system structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION

[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0048] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0049] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0050] It should be noted that the term "plurality" used in this document refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. The character " / " generally indicates an "or" relationship between the associated objects.

[0051] In the specific implementation of this application, user-related data such as audio frames are involved. When the various embodiments of this application are applied to specific products or technologies, the user's separate permission or consent must be obtained, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0052] The relevant terms or abbreviations involved in the embodiments of this application are explained as follows.

[0053] Convolutional neural network: In the field of multimedia data processing such as text, images, audio and video, convolutional neural network is the most successfully applied deep learning structure. Convolutional neural network consists of multiple convolutional layers, generally including convolutional layer (Convolutional Layer), downsampling layer (Pooling Layer), activation function layer (Activation Layer), normalization layer (Normalization Layer), fully connected layer (Full Connected Layer), etc.

[0054] Audio encoding and decoding: Audio encoding compresses audio into smaller data, while decoding converts smaller data into audio. The encoded smaller data is used for network transmission and occupies less bandwidth.

[0055] Audio sampling rate: The audio sampling rate describes the number of data points contained in a unit of time (1 second). For example, a 16k sampling rate contains 16,000 sampling points, each of which corresponds to a short integer.

[0056] Codebook: A collection of multiple vectors. The encoder and decoder both store the same codebook.

[0057] Quantization: Find the closest vector in the codebook for the input vector, return it as a replacement for the input vector, and return the corresponding codebook index position.

[0058] Quantizer: The quantizer is responsible for quantization and updating the vectors in the codebook.

[0059] Weak network environment: an environment with poor network transmission quality, such as a bandwidth below 3kpbs.

[0060] Audio frame: Indicates the minimum duration of a single voice transmission in the network.

[0061] Short-Time Fourier Transform (STFT): This method breaks a long signal into several shorter signals of equal length, then calculates the Fourier transform of each shorter segment. It is often used to depict changes in the frequency and time domains and is a key tool in time-frequency analysis.

[0062] FIG1 schematically shows a diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied.

[0063] 1 , a system architecture 100 includes a plurality of terminal devices, which can communicate with each other via, for example, a network 150. For example, the system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected via the network 150. In the embodiment of FIG1 , the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.

[0064] For example, the first terminal device 110 can encode audio and video data (such as an audio and video data stream collected by the terminal device 110) for transmission to the second terminal device 120 through the network 150. The encoded audio and video data is transmitted in the form of one or more encoded audio and video streams. The second terminal device 120 can receive the encoded audio and video data from the network 150, decode the encoded audio and video data to restore the audio and video data, and play or display content based on the restored audio and video data.

[0065] In one embodiment of the present application, the system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded audio and video data, such as during an audio and video conference. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode audio and video data (e.g., an audio and video data stream collected by the terminal device) for transmission to the other terminal device in the third terminal device 130 and the fourth terminal device 140 via the network 150. Each of the third terminal device 130 and the fourth terminal device 140 may also receive the encoded audio and video data transmitted by the other terminal device in the third terminal device 130 and the fourth terminal device 140, and may decode the encoded audio and video data to recover the audio and video data, and play or display content based on the recovered audio and video data.

[0066] In the embodiment of Figure 1, the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140 may be personal computers and smart phones, but the principles disclosed in this application are not limited to this. The embodiments disclosed in this application are applicable to laptop computers, tablet computers, media players, and / or dedicated audio and video conferencing equipment. Network 150 represents any number of networks that transmit encoded audio and video data between the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140, including, for example, wired and / or wireless communication networks. The communication network 150 can exchange data in circuit switching and / or packet switching channels. The network may include a telecommunications network, a local area network, a wide area network, and / or the Internet. For the purposes of this application, unless explained below, the architecture and topology of the network 150 may be irrelevant to the operations disclosed in this application.

[0067] In one embodiment of the present application, FIG2 schematically illustrates the placement of an audio / video encoding device and an audio / video decoding device in a streaming environment. The subject matter disclosed herein is equally applicable to other applications supporting audio and video, including, for example, audio / video conferencing, digital television, and storing compressed audio and video on digital media such as CDs, DVDs, and memory sticks.

[0068] The streaming system may include an acquisition subsystem 213, which may include an audio / video source 201, such as a microphone or a camera, that creates an uncompressed audio / video data stream 202. Compared to the encoded audio / video data 204 (or the encoded audio / video bitstream 204), the audio / video data stream 202 is depicted as a thick line to emphasize the high data volume of the audio / video data stream. The audio / video data stream 202 may be processed by an electronic device 220, which includes an audio / video encoding device 203 coupled to the audio / video source 201. The audio / video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or embody various aspects of the disclosed subject matter as described in more detail below. Compared to the audio / video data stream 202, the encoded audio / video data 204 (or encoded audio / video bitstream 204) is depicted as a thin line to emphasize the lower data volume of the encoded audio / video data 204 (or encoded audio / video bitstream 204), which can be stored on the streaming server 205 for future use. One or more streaming client subsystems, such as client subsystem 206 and client subsystem 208 in FIG. 2 , can access the streaming server 205 to retrieve copies 207 and 209 of the encoded audio / video data 204. Client subsystem 206 may include an audio / video decoding device 210, such as in electronic device 230. Audio / video decoding device 210 decodes the incoming copy 207 of the encoded audio / video data and generates an output audio / video data stream 211 that can be presented on an output 212 (e.g., a speaker, a display) or another presentation device. In some streaming systems, the encoded audio and video data 204 , audio and video data 207 , and audio and video data 209 (eg, audio and video bitstreams) may be encoded according to certain audio and video encoding / compression standards.

[0069] It should be noted that the electronic device 220 and the electronic device 230 may include other components not shown in the figure. For example, the electronic device 220 may include an audio and video decoding device, and the electronic device 230 may also include an audio and video encoding device.

[0070] FIG3 shows a network structure block diagram of a codec constructed based on a convolutional neural network in one embodiment of the present application.

[0071] As shown in FIG3 , the network structure of the codec includes an encoder 310 and a decoder 320 , wherein the encoder 310 can be implemented as software as the audio and video encoding device 203 shown in FIG2 , and the decoder 320 can be implemented as software as the audio and video decoding device 210 shown in FIG2 .

[0072] At the data transmitting end, the audio data may be encoded and compressed by an encoder 310. In one embodiment of the present application, the encoder 310 may include an input layer 311, one or more downsampling layers 312, and an output layer 313.

[0073] For example, the input layer 311 and the output layer 313 can be convolution layers constructed based on one-dimensional convolution kernels, and four downsampling layers 312 are sequentially connected between the input layer 311 and the output layer 313. The functions of each network layer are described below based on an application scenario.

[0074] At the input stage of the encoder, the raw audio data to be encoded is sampled to obtain a vector with 1 channel and 16,000 dimensions. This vector is input to the input layer 311, and after convolution processing, a feature vector with 32 channels and 16,000 dimensions is obtained. In some optional embodiments, to improve encoding efficiency, the encoder 310 can simultaneously encode a batch of audio vectors, B in number.

[0075] In the downsampling stage of the encoder, the first downsampling layer reduces the vector dimension to 1 / 2, obtaining a feature vector with 64 channels and a dimension of 8000; the second downsampling layer reduces the vector dimension to 1 / 4, obtaining a feature vector with 128 channels and a dimension of 2000; the third downsampling layer reduces the vector dimension to 1 / 5, obtaining a feature vector with 256 channels and a dimension of 400; the fourth downsampling layer reduces the vector dimension to 1 / 4, obtaining a feature vector with 512 channels and a dimension of 50.

[0076] At the output stage of the encoder, the output layer 313 performs convolution processing on the feature vector to obtain a coding vector with a channel number vq_dim and a dimension of 25. Here, vq_dim is a preset vector quantization dimension, which can be 32, for example.

[0077] The code vectors are input to the quantizer 330, which can then look up the vector index corresponding to each code vector in the codebook. The vector index can then be transmitted to the data receiving end, which decodes the vector index through the decoder 320 to obtain the restored audio data.

[0078] In one embodiment of the present application, the decoder 320 may include an input layer 321 , one or more upsampling layers 322 , and an output layer 323 .

[0079] After receiving the vector index transmitted by the network, the data receiving end may first query the codebook for the codebook vector corresponding to the vector index through the quantizer 320. The codebook vector may be, for example, a vector with a channel number vq_dim and a dimension of 25. vq_dim is a preset vector quantization dimension, for example, which may be 32. In some optional embodiments, to improve decoding efficiency, the data receiving end may simultaneously decode a batch of codebook vectors, B in number.

[0080] In the input stage of the decoder, the codebook vector to be decoded is input to the input layer 321, and after convolution processing, a feature vector with 512 channels and 50 dimensions can be obtained.

[0081] In the upsampling stage of the decoder, the first upsampling layer increases the vector dimension to 8 times (for example, 8×), obtaining a feature vector with 256 channels and 400 dimensions; the second upsampling layer increases the vector dimension to 5 times (for example, 5×), obtaining a feature vector with 128 channels and 2000 dimensions; the third upsampling layer increases the vector dimension to 4 times (for example, 4×), obtaining a feature vector with 64 channels and 8000 dimensions; the fourth upsampling layer increases the vector dimension to 2 times (for example, 2×), obtaining a feature vector with 32 channels and 16000 dimensions.

[0082] In the output stage of the decoder, the output layer 323 performs convolution processing on the feature vector to restore the decoded audio data with a channel number of 1 and a dimension of 16,000.

[0083] The codec as a whole can be thought of as a speech-to-speech model. To make the speech generated by the model more consistent with the human auditory curve, embodiments of the present application can extract Mel spectra from both the input and output audio, using them as inputs to a loss function to ensure that the two are close in Mel spectrum. Mel spectra can be set with different sampling window sizes. To make the generated speech quality closer to the input speech, embodiments of the present application can use multi-scale Mel spectrum constraints as the reconstruction loss function.

[0084] The mel spectrum is a spectrogram distributed on the mel scale, and can be represented as a mel spectrum. Sound signals are inherently one-dimensional time-domain signals, making it difficult to visually discern the frequency variation patterns. Using a Fourier transform to convert it to the frequency domain reveals the signal's frequency distribution, but loses the time-domain information, making it impossible to discern how the frequency distribution changes over time. The present application can address this issue using time-frequency domain analysis methods such as short-time Fourier transform, wavelet transform, and Wigner distribution.

[0085] The Short-Time Fourier Transform (STFT) performs a Fourier Transform (FFT) on the short-time signal obtained by framing. Specifically, a long signal is framed, windowed, and then Fourier Transformed on each frame. Finally, the results of each frame are stacked along another dimension to produce a two-dimensional signal similar to a graph. When the original signal is an audio signal, the two-dimensional signal obtained by STFT expansion is the spectrogram. To obtain sound features of appropriate size, the spectrogram is filtered using mel-scale filter banks to produce a mel-spectrum.

[0086] Below, in combination with specific implementation methods, the technical solutions such as the audio encoding method, audio decoding method, audio encoding device, audio decoding device, computer-readable medium, electronic device and computer program product provided in this application are described in detail from two aspects: the decoding side as the data receiving end and the encoding side as the data sending end.

[0087] Figure 4 shows a step flow chart of the audio decoding method in an embodiment of the present application. The method can be executed by a terminal device or a server that receives the encoded data, that is, the electronic device that executes the audio decoding method provided by the embodiment of the present application can be a terminal device or a server. The embodiment of the present application uses the audio decoding method executed by the terminal device as an example to illustrate. The terminal device can be, for example, the audio and video decoding device 210 shown in Figure 2 or the decoder 320 shown in Figure 3.

[0088] As shown in FIG. 4 , the audio decoding method in the embodiment of the present application may include the following S410 to S430 .

[0089] S410: Obtain a coding vector for each audio frame in the audio frame sequence.

[0090] An audio frame is a data segment of a specified time length obtained by framing and windowing the original audio data. A coding vector is a data compression vector obtained by multiple downsampling of the audio frame. In the embodiment of the present application, an encoder based on a convolutional neural network, such as that shown in FIG3 , can be used to encode the audio frame to obtain the coding vector.

[0091] From the overall perspective, the characteristics of the original audio data and the parameters that characterize its essential characteristics all change over time, so it is a non-stationary process and cannot be analyzed and processed using digital signal processing technology that processes stationary signals. However, since different voices are responses generated by the movement of the human oral muscles to form a certain shape of the vocal tract, and this oral muscle movement is very slow relative to the voice frequency, from another perspective, although the audio signal has time-varying characteristics, within a short time range (for example, within a short time of 10-30ms), its characteristics remain basically unchanged, that is, relatively stable, so it can be regarded as a quasi-steady-state process, that is, the audio signal has short-term stability. In order to achieve short-term analysis of the audio signal, the embodiment of the present application can divide the original audio data into sections to analyze its characteristic parameters, where each section is called an audio frame. The frame length of the audio frame can be, for example, taken within the range of 10-30ms. Framing can adopt a continuous segmentation method or an overlapping segmentation method. Overlapping segmentation can make the transition between frames smooth and maintain its continuity. The overlapping portion of the previous frame and the next frame is called frame shift, and the ratio of frame shift to frame length can be 0 to 1 / 2.

[0092] Windowing involves applying a window function to a framed audio signal, creating a smooth transition between adjacent audio frames. This reduces signal discontinuities at the beginning and end of the frames, improves overall continuity, and avoids the Gibbs effect. Windowing can also make an otherwise non-periodic audio signal exhibit some of the characteristics of a periodic function, facilitating signal analysis and processing.

[0093] When performing windowing, the slope at both ends of the time window should be minimized to ensure that the edges of the window do not change dramatically but transition smoothly to zero. This allows the intercepted signal waveform to slowly drop to zero, reducing the truncation effect of the audio data frame. The window length should be moderate. If the window length is too large, it is equivalent to a very narrow low-pass filter. When the audio signal passes through, the high-frequency part that reflects the waveform details is blocked, and the short-term energy changes little over time, which cannot truly reflect the amplitude changes of the audio signal. Conversely, if the window length is too short, the filter passband becomes wider, the short-term energy changes sharply over time, and a smooth energy function cannot be obtained.

[0094] In one embodiment of the present application, a Hamming window can be selected as the window function. The Hamming window has a smooth low-pass characteristic and can reflect the frequency characteristics of short-term signals to a high degree. In other embodiments, other types of window functions such as a rectangular window and a Henning window can also be selected.

[0095] S420: When decoding to the current audio frame in the audio frame sequence, the encoding vector of the historical audio frame is upsampled to obtain an upsampled eigenvalue, where the historical audio frame is one or more audio frames decoded before the current audio frame in the audio frame sequence, and the upsampled eigenvalue is a eigenvector obtained during the upsampling process and used to describe the historical audio frame.

[0096] In one embodiment of the present application, the historical audio frame is one or more audio frames that are temporally continuous with the current audio frame in the audio frame sequence. For example, the current audio frame being decoded is the Nth audio frame in the audio frame sequence, and the corresponding historical audio frame may be the N-1th audio frame in the audio frame sequence.

[0097] Upsampling is the operation of mapping the encoded vector from a low dimension to a high dimension. For example, upsampling methods such as linear interpolation, deconvolution, or depooling can be used. Among them, linear interpolation is a method of inserting new elements into a low-dimensional vector based on a linear interpolation function to obtain a high-dimensional vector. It can include the nearest neighbor interpolation algorithm, bilinear interpolation algorithm, bicubic interpolation algorithm, etc. Deconvolution, also known as transposed convolution, is a special convolution operation. For example, you can first add zeros to a low-dimensional vector to expand the vector dimension, and then perform forward convolution through the convolution kernel to obtain a high-dimensional vector. Depooling is the inverse operation of pooling.

[0098] In one embodiment of the present application, a buffer can be configured to retain upsampling process data. When upsampling an audio frame, a feature vector describing the audio frame obtained during the upsampling process can be cached, such as upsampled feature values ​​of historical audio frames.

[0099] S430: Up-sampling the encoding vector of the current audio frame according to the up-sampled eigenvalue to obtain decoded data of the current audio frame.

[0100] In one embodiment of the present application, the upsampled feature values ​​of the historical audio frame and the encoding vector of the current audio frame can be input into the decoder as input data, so that the decoder can use the feature vector of the historical video frame to upsample the current audio frame.

[0101] The original audio data will lose some information during the encoding process, and the decoding process based on upsampling is usually difficult to restore the original audio data. The embodiment of the present application can guide the upsampling process of the current audio frame by caching the upsampling features of the historical audio frames decoded previously, thereby improving the data restoration effect of audio decoding, and thus improving the audio encoding and decoding quality.

[0102] Figure 5 shows a flowchart of a method for audio decoding based on a convolutional neural network including multiple upsampling layers in one embodiment of the present application. As shown in Figure 5, the audio decoding method may include the following steps S510 to S540.

[0103] S510: Obtain a coding vector for each audio frame in the audio frame sequence.

[0104] An audio frame is a data segment of a specified time length obtained by framing and windowing the original audio data. A coding vector is a data compression vector obtained by multiple downsampling of the audio frame. In the embodiment of the present application, an encoder based on a convolutional neural network, such as that shown in FIG3 , can be used to encode the audio frame to obtain the coding vector.

[0105] S520: Obtain a decoder including multiple upsampling layers, and upsample the encoding vectors of historical audio frames through the multiple upsampling layers to obtain multiple feature vectors. The historical audio frames are one or more audio frames decoded before the current audio frame.

[0106] In the embodiment of the present application, a decoder based on a convolutional neural network as shown in FIG3 can be used to decode the encoded vector of the audio frame. The decoder includes multiple upsampling layers connected in sequence, and each upsampling layer can achieve upsampling by performing a convolution operation on the input vector.

[0107] In the embodiments of the present application, after the decoder performs upsampling processing on the encoding vectors of the historical audio frames, a plurality of feature vectors equal to the number of upsampling layers can be obtained. In this case, the plurality of feature vectors can be used as upsampled feature values. For example, the decoder shown in FIG3 includes four upsampling layers, each of which outputs a feature vector. Therefore, upsampling processing on a historical audio frame can produce four feature vectors.

[0108] In some optional embodiments, after the decoder performs upsampling processing on the encoding vector of the historical audio frame, a number of feature vectors less than the number of feature vectors in the upsampling layer can be obtained. For example, the decoder shown in FIG3 includes four upsampling layers, each of which outputs a feature vector, and then some feature vectors are extracted therefrom. In other words, upsampling processing on a historical audio frame can produce fewer than four feature vectors.

[0109] S530: Input the encoding vector of the current audio frame into the decoder, and input the multiple feature vectors into multiple upsampling layers accordingly.

[0110] The code vector of the current audio frame is upsampled multiple times through the encoder's multiple upsampling layers. During this process, the multiple feature vectors obtained by upsampling the previous audio frames are simultaneously input into the upsampling layers. In other words, the input data of the encoder's upsampling layers includes the feature vectors obtained by upsampling the previous audio frames in addition to the output data of the previous upsampling layer.

[0111] S540: Perform upsampling processing on the encoding vector and multiple feature vectors of the current audio frame through multiple upsampling layers to obtain decoded data of the current audio frame.

[0112] Figure 6 shows a schematic diagram of a network module for implementing data encoding and decoding processing in one embodiment of the present application. The network modules shown in Figure 6 are basic functional modules that constitute the encoder or decoder shown in Figure 3. For example, each downsampling layer in the encoder or each upsampling layer in the decoder can include one or more network modules shown in Figure 6.

[0113] As shown in Figure 6, the network module that implements data encoding and decoding processing includes multiple residual blocks Res Block. The input data of the network module includes two parts, namely the current input feature In feature and the first historical feature Last feature. Among them, the current input feature In feature can be the output feature obtained by the previous network module performing convolution processing on the current audio frame, and the historical feature Last feature can be the output feature obtained by the current network module performing convolution processing on the previous audio frame, for example, it can be the up-sampled feature value obtained by up-sampling the encoding vector of the historical audio frame through the up-sampling layer in the above embodiment of the present application.

[0114] The output data of the network module also consists of two parts: the current output feature Out feature and the second historical feature Last feature. The current output feature Out feature can be used as the output feature obtained by the subsequent network module through convolution processing on the current audio frame, and the second historical feature Last feature can be used as the input feature of the current network module through convolution processing on the subsequent audio frame.

[0115] By retaining the output features of the previous audio frame, the embodiment of the present application can jointly decode the upsampling feature values ​​obtained during the upsampling process of the historical audio frame and the encoding vector of the current audio frame, thereby improving the input receptive field of the current audio frame and improving the accuracy of audio encoding and decoding.

[0116] In one embodiment of the present application, the upsampling layer of the decoder includes at least two sampling channels. Based on this, the method of upsampling the code vector and multiple feature vectors of the current audio frame through multiple upsampling layers in S540 may include: performing feature extraction on the code vector and multiple feature vectors of the current audio frame through the at least two sampling channels in the upsampling layer to obtain at least two channel feature values; obtaining the mean and variance of the at least two channel feature values; and normalizing the at least two channel feature values ​​based on the mean and variance.

[0117] Different sampling channels can convolve the input data based on convolution kernels of different sizes or parameters to obtain multiple channel feature values ​​under different representation dimensions, thereby improving the comprehensiveness and reliability of feature extraction from audio frames. On this basis, in order to reduce the amount of model calculation, the embodiment of the present application can normalize the channel feature values ​​collected on different sampling channels of the same audio frame.

[0118] Figure 7 shows a schematic diagram of the principle of normalizing the channel feature values ​​output by multiple sampling channels in one embodiment of the present application. Each square in Figure 7 represents a data sampling point, a row of squares distributed horizontally represents an audio frame, multiple rows of squares distributed vertically represent multiple audio frames encoded and decoded synchronously in a batch, and multiple rows of squares distributed vertically represent multiple sampling channels sampling the same audio frame.

[0119] As shown in Figure 7, when normalizing the mapped data of the data sampling points, an audio frame is used as a normalization unit, and each audio frame is independent of each other. First, the mean and variance of the multiple channel feature values ​​obtained by sampling different sampling channels in the same audio frame can be calculated. Then, the mean of each channel feature value is subtracted and divided by the variance to obtain the normalized channel feature value. By normalizing the multiple channel feature values ​​obtained by sampling different sampling channels for each audio frame, each sampling channel can share the same mean and variance, ensuring the comprehensiveness of data sampling while reducing the amount of data calculation.

[0120] In one embodiment of the present application, before normalizing at least two channel eigenvalues ​​according to the mean and variance, weighted smoothing processing can be performed on the mean and variance between each audio frame. At this time, the normalization processing of at least two channel eigenvalues ​​can be performed on the at least two channel eigenvalues ​​according to the mean and variance after weighted smoothing processing, so as to further reduce the amount of data calculation.

[0121] When transmitting audio data, real-time segmented transmission may be used. This allows users to obtain media data in real time without having to download the entire media file, but it also places high demands on the user's device performance and network conditions. To ensure efficient transmission of audio frames in suboptimal network conditions, the audio frames can be compressed and quantized to obtain an index value. This quantized index value is then transmitted, reducing the amount of data transmitted and improving data transmission efficiency. In this case, decoding can be performed by finding the corresponding encoding vector in the codebook using the index value.

[0122] Figure 8 shows a flowchart of the steps for decoding an audio frame based on a query codebook in one embodiment of the present application. By configuring the same codebook in the encoder and decoder, the code vector of the audio frame can be located based on the query codebook, reducing the amount of data transmitted on the encoder and decoder sides. As shown in Figure 8, the method for decoding the code vector of an audio frame based on a query codebook may include the following steps S810 to S840.

[0123] S810: For each audio frame in the audio frame sequence, obtain a coding index value of the audio frame, where the coding index value is used to indicate a codebook vector in a codebook.

[0124] The codebook is used to store the mapping relationship between the coding index value and the codebook vector. The sender of audio data can transmit the coding index value of each audio frame to the receiver through network transmission, which can greatly reduce the data transmission volume and significantly improve the transmission efficiency of audio data.

[0125] S820: Searching a codebook vector associated with the coding index value in a codebook, and determining a coding vector of the audio frame according to the codebook vector.

[0126] After the receiver of the audio data obtains the coding index value, the quantizer can query the codebook for a codebook vector associated with the coding index value, and further determine the coding vector of the audio frame based on the codebook vector.

[0127] In some optional implementations, the decoder may directly use the codebook vector retrieved from the codebook as the encoding vector for the audio frame, or may perform data mapping on the retrieved codebook vector according to a preset mapping rule to determine the encoding vector for the audio frame. The preset mapping rule may be a rule pre-agreed upon between the sender and receiver of the audio data. Determining the encoding vector through data mapping can improve data transmission security while sharing the codebook.

[0128] In one embodiment of the present application, the dimension of the codebook vector is lower than the dimension of the encoding vector; and a method for determining the encoding vector of an audio frame based on the codebook vector may include: performing a dimension-up projection on the codebook vector to obtain the encoding vector of the audio frame. In this embodiment of the present application, data mapping using dimension-up projection can reduce the dimension of the vectors in the codebook, thereby compressing the codebook and reducing the amount of data maintained in the codebook.

[0129] Figure 9 shows a schematic diagram of the principle of determining the coding vector based on data mapping in one embodiment of the present application. As shown in Figure 9, on the encoding side, after the encoder encodes the audio frame, a coding vector can be obtained, and its vector dimension is, for example, N. Before querying the codebook, the coding vector is first subjected to dimensionality reduction projection, and a compressed vector with a dimension of N / Q can be obtained. Accordingly, the codebook includes M codebook vectors, where the vector dimension of each codebook vector is N / Q. By querying the codebook, the coding index value corresponding to the coding vector can be determined, and the value range of the coding index value is 1 to M.

[0130] On the decoding side, after receiving the encoding index value transmitted by the data sender, the corresponding codebook vector can be first searched in the codebook. The vector dimension of this codebook vector is N / Q. After performing a dimensionality-up projection on the codebook vector, the encoding vector with a vector dimension of N can be restored.

[0131] In one embodiment of the present application, the encoding vector can be projected down or up in dimension based on a linear transformation, or data mapping can be performed using some network layers of a neural network such as a convolutional layer or a fully connected layer.

[0132] S830: Upsample the encoding vector of the historical audio frame to obtain an upsampled eigenvalue, where the historical audio frame is one or more audio frames decoded before the current audio frame in the audio frame sequence, and the upsampled eigenvalue is a eigenvector obtained during the upsampling process and used to describe the historical audio frame.

[0133] A historical audio frame is one or more audio frames that are temporally continuous with the current audio frame in an audio frame sequence. For example, the current audio frame being decoded is the Nth audio frame in the audio frame sequence, and the corresponding historical audio frame may be the N-1th audio frame in the audio frame sequence.

[0134] Upsampling is the operation of mapping a code vector from a low dimension to a high dimension. For example, upsampling methods such as linear interpolation, deconvolution, or depooling can be used. In embodiments of the present application, a buffer can be configured to retain upsampling process data. When upsampling an audio frame, the feature vectors used to describe the audio frame obtained during the upsampling process can be cached.

[0135] S840: Up-sample the encoding vector of the current audio frame according to the up-sampled eigenvalue to obtain decoded data of the current audio frame.

[0136] In an embodiment of the present application, the upsampled feature values ​​of the historical audio frames and the encoding vector of the current audio frame can be input into the decoder as input data, so that the decoder can use the upsampled feature values ​​of the historical video frames to upsample the current audio frame. The original audio data will lose some information during the encoding process, and the decoding process based on upsampling is usually difficult to restore the original audio data. In an embodiment of the present application, by caching the upsampled features of the previously decoded historical audio frames, the upsampling process of the current audio frame can be guided, thereby improving the data restoration effect of the audio decoding, and thus improving the audio encoding and decoding quality.

[0137] To ensure the stability and reliability of data encoding and decoding, the codebook can be queried by a quantizer in the encoding and decoding model, and the codebook can be updated based on the sample data. The quantizer in the embodiment of the present application can be a model built based on a convolutional neural network, and the quantizer can be trained based on the sample data to improve its encoding and quantization effect on the audio frame.

[0138] In one embodiment of the present application, a method for training a quantizer may include: obtaining a codebook and a quantizer for maintaining the codebook, wherein the codebook is used to represent a mapping relationship between a coding index value and a codebook vector; obtaining a coding vector sample obtained by an encoder encoding an audio frame sample; predicting a codebook vector sample that matches the coding vector sample using a quantizer; and updating a network parameter of the quantizer based on a loss error between the coding vector sample and the codebook vector sample, thereby training the quantizer. After the quantizer is trained, the trained quantizer can be used to query the codebook for a codebook vector associated with the coding index value.

[0139] In one embodiment of the present application, a method for maintaining and updating a codebook based on a quantizer may include: obtaining statistical parameters of coding vector samples that match codebook vector samples; updating the codebook based on the statistical parameters, and using the updated codebook for the next prediction of codebook vector samples that match the coding vector samples. By continuously updating the codebook, the coding and quantization performance of the audio frame can be improved.

[0140] In one embodiment of the present application, the statistical parameters of the code vector samples include at least one of a vector sum and a hit count. The vector sum represents an average vector obtained by weighted averaging of the code vector samples, and the hit count represents the number of code vector samples that match the code book vector samples. Based on this, the method for updating the code book based on the statistical parameters may include: performing exponentially weighted smoothing on the code book based on the vector sum; and performing Laplace smoothing on the code book based on the hit count.

[0141] Figure 10 shows a flowchart of the steps for training a quantizer in one embodiment of the present application. As shown in Figure 10, the present embodiment can implement the construction and maintenance of a codebook based on training a quantizer. The training process includes the following steps S1001 to S1006.

[0142] S1001: Obtain input data for a quantizer, where the input data is a coding vector sample obtained by encoding audio data (eg, audio data of audio frame samples).

[0143] S1002: Determine whether the input data is the first input data to the quantizer. If the input data is the first input data to the quantizer, execute S1003; if the input data is not the first input data to the quantizer, execute S1004.

[0144] S1003: Cluster the input data to obtain M clusters, each of which corresponds to a codebook vector. The M codebook vectors can form a codebook for data quantization, and the codebook stores the encoding index value corresponding to each codebook vector.

[0145] In an optional embodiment, the present application can cluster the input data based on K-means clustering, where each cluster corresponds to a codebook vector and a coding index value. At the same time, the vector sum of each vector in each cluster and the number of hits in vector queries for each cluster can be counted.

[0146] S1004: Query the codebook for the category of the input data.

[0147] The method of querying the belonging category may include predicting the similarity between the input data and the cluster centers of each cluster, and taking the cluster with the highest similarity as the belonging category of the input data.

[0148] S1005: Determine a corresponding coding index value and a quantized codebook vector according to the category of the input data.

[0149] S1006: Obtain the loss error of the codebook vector and update the network parameters of the quantizer based on the loss error. The loss error of the codebook vector can be, for example, measured using mean squared error (MSE Loss). MSE refers to the expected value of the square of the difference between the parameter estimate and the parameter value. MSE Loss can be used to assess the degree of data variation. A smaller MSE Loss value indicates greater accuracy in the quantization processing of the input data by the quantizer.

[0150] S1007: Perform exponentially weighted smoothing on the codebook based on the vector sum. EMA smoothing, or exponential moving average, can be considered the average of the variable's values ​​over a period of time. Compared to directly assigning a value to the variable, the value obtained by the moving average is smoother and less volatile in data distribution, and will not cause large fluctuations in the moving average due to a single abnormal value.

[0151] S1008: Perform Laplace smoothing on the codebook according to the hit count. Laplace smoothing can solve the zero probability problem in the vector prediction of the codebook.

[0152] The embodiment of the present application performs weighted smoothing on the codebook to continuously update the codebook, so that the vector generated by the encoder is closer to the vector in the codebook, thereby improving the prediction accuracy of the quantizer for the vector in the codebook.

[0153] Figure 11 shows a step flow chart of the audio encoding method in an embodiment of the present application. The method can be executed by a terminal device or a server that sends audio data. The embodiment of the present application uses the audio encoding method executed by a terminal device as an example to illustrate. The terminal device can be, for example, the audio and video encoding device 203 shown in Figure 2 or the encoder 310 shown in Figure 3.

[0154] As shown in FIG. 11 , the audio decoding method in the embodiment of the present application may include the following S1110 to S1130 .

[0155] S1110: Acquire audio data of each audio frame in the audio frame sequence.

[0156] An audio frame is a data segment with a specified time length obtained by performing framing and windowing processing on the original audio data.

[0157] From a holistic perspective, the characteristics of raw audio data and the parameters that characterize its essential features all change over time, so it is a non-stationary process and cannot be analyzed and processed using digital signal processing techniques that process stationary signals. However, since different voices are responses generated by the movement of the human oral muscles to form a certain shape of the vocal tract, and this oral muscle movement is very slow relative to the frequency of the voice, from another perspective, although the audio signal has time-varying characteristics, within a short time range (for example, within a short time of 10-30ms), its characteristics remain basically unchanged, that is, relatively stable, so it can be regarded as a quasi-stationary process, that is, the audio signal has short-term stationarity. To achieve short-term analysis of the audio signal, the embodiment of the present application can divide the raw audio data into segments to analyze its characteristic parameters, where each segment is called an audio frame. The frame length of the audio frame can be, for example, taken within the range of 10-30ms. Framing can adopt a continuous segmentation method or an overlapping segmentation method. Overlapping segmentation can make the transition between frames smooth and maintain its continuity. The overlapping portion of the previous frame and the next frame is called frame shift, and the ratio of frame shift to frame length can be 0 to 1 / 2.

[0158] Windowing involves applying a window function to a framed audio signal, creating a smooth transition between adjacent audio frames. This reduces signal discontinuities at the beginning and end of the frames, improves overall continuity, and avoids the Gibbs effect. Windowing can also make an otherwise non-periodic audio signal exhibit some of the characteristics of a periodic function, facilitating signal analysis and processing.

[0159] S1120: When encoding the current audio frame in the audio frame sequence, the audio data of the historical audio frame is downsampled to obtain a downsampled eigenvalue. The historical audio frame is one or more audio frames encoded before the current audio frame in the audio frame sequence. The downsampled eigenvalue is a feature vector obtained during the downsampling process for describing the historical audio frame.

[0160] In one embodiment of the present application, the historical audio frame is one or more audio frames that are temporally continuous with the current audio frame in the audio frame sequence. For example, the current audio frame being decoded is the Nth audio frame in the audio frame sequence, and the corresponding historical audio frame may be the N-1th audio frame in the audio frame sequence.

[0161] Downsampling is an operation that maps the encoding vector from a high dimension to a low dimension. For example, convolution or pooling operations can be used for downsampling.

[0162] In one embodiment of the present application, the downsampling process data can be retained by configuring a buffer area. When downsampling an audio frame, the feature vector used to describe the audio frame obtained during the downsampling process can be cached.

[0163] S1130: Downsample the audio data of the current audio frame according to the downsampled eigenvalue to obtain a coding vector of the current audio frame.

[0164] In one embodiment of the present application, the downsampled feature values ​​of the historical audio frame and the audio data of the current audio frame can be input into the encoder as input data, so that the encoder can downsample the current audio frame using the features of the historical video frame.

[0165] The original audio data will lose some information during the encoding process. The embodiment of the present application can guide the downsampling process of the current audio frame by caching the downsampling features of the previously encoded historical audio frame, thereby improving the data correlation of the audio encoding and improving the audio encoding and decoding quality.

[0166] Figure 12 shows a flowchart of a method for audio encoding based on a convolutional neural network including multiple downsampling layers in one embodiment of the present application. As shown in Figure 12, the audio encoding method may include the following steps S1210 to S1240.

[0167] S1210: Acquire audio data of each audio frame in the audio frame sequence.

[0168] An audio frame is a data segment of a specified time length obtained by framing and windowing the original audio data. A coding vector is a data compression vector obtained by multiple downsampling of the audio frame. In the embodiment of the present application, an encoder based on a convolutional neural network, such as that shown in FIG3 , can be used to encode the audio frame to obtain the coding vector.

[0169] S1220: Obtain an encoder including multiple downsampling layers, and downsample audio data of historical audio frames through the multiple downsampling layers to obtain multiple feature vectors, where the historical audio frames are one or more audio frames encoded before the current audio frame.

[0170] In an embodiment of the present application, an encoder constructed based on a convolutional neural network as shown in FIG3 may be used to encode the audio data of an audio frame. The encoder includes a plurality of sequentially connected downsampling layers, each of which can implement downsampling processing by performing a convolution operation on an input vector.

[0171] In the embodiment of the present application, after the encoder downsamples the audio data of the historical audio frame, a plurality of feature vectors equal to the number of downsampling layers can be obtained. For example, the encoder shown in FIG3 includes four downsampling layers, each of which outputs a feature vector. Therefore, four feature vectors can be obtained by downsampling one historical audio frame.

[0172] In some optional embodiments, after the encoder downsamples the audio data of the historical audio frame, a number of feature vectors less than the number of feature vectors in the downsampling layer can be obtained. For example, the encoder shown in FIG3 includes four downsampling layers, each of which outputs a feature vector, and then some feature vectors are extracted therefrom. In other words, downsampling a historical audio frame can produce fewer than four feature vectors.

[0173] S1230: Input the audio data of the current audio frame into the encoder, and input the multiple feature vectors into the multiple downsampling layers accordingly.

[0174] The audio data of the current audio frame is downsampled multiple times through the encoder's multiple downsampling layers. During this process, the multiple feature vectors obtained by downsampling the previous audio frames are simultaneously input into the downsampling layers. In other words, the input data of the encoder's downsampling layers includes the feature vectors obtained by downsampling the previous audio frames in addition to the output data of the previous downsampling layer.

[0175] S1240: Downsampling the audio data and multiple feature vectors of the current audio frame through multiple downsampling layers to obtain a coding vector of the current audio frame.

[0176] By retaining the output features of the previous audio frame, the embodiment of the present application can jointly encode the feature vector obtained during the downsampling process of the historical audio frame and the audio data of the current audio frame, thereby improving the input receptive field of the current audio frame and improving the accuracy of audio encoding and decoding.

[0177] In one embodiment of the present application, a downsampling layer of the encoder includes at least two sampling channels. Based on this, the method of downsampling the audio data and multiple feature vectors of the current audio frame through multiple downsampling layers in S1240 may include: performing feature extraction on the audio data and multiple feature vectors of the current audio frame through the at least two sampling channels in the downsampling layer to obtain at least two channel feature values; obtaining a mean and a variance of the at least two channel feature values; and normalizing the at least two channel feature values ​​based on the mean and the variance.

[0178] Different sampling channels can convolve the input data based on convolution kernels of different sizes or different parameters to obtain multiple channel feature values ​​under different characterization dimensions, thereby improving the comprehensiveness and reliability of feature extraction of audio frames. On this basis, in order to reduce the amount of model calculation, the embodiment of the present application can normalize the channel feature values ​​collected on different sampling channels of the same audio frame. The solution for normalizing the channel feature values ​​collected on different sampling channels can refer to the embodiment shown in Figure 7 and will not be repeated here.

[0179] In one embodiment of the present application, audio frame encoding can be performed based on a codebook query. By configuring the same codebook at the encoder and decoder, the code vector of the audio frame can be located based on the codebook query, reducing the amount of data transmitted on the encoder and decoder sides. In this embodiment of the present application, after obtaining the code vector, the codebook vector can be queried in the codebook based on the code vector to obtain the codebook vector and obtain the code index value associated with the codebook vector.

[0180] Figure 13 shows a flowchart of the steps for model training of the encoder and decoder in one embodiment of the present application. As shown in Figure 13, the embodiment of the present application implements model training of the encoder and decoder by constructing a generative adversarial network. The training method may include the following steps S1310 to S1350.

[0181] S1310: Obtain an encoder including multiple downsampling layers and a decoder including multiple upsampling layers.

[0182] The encoder and decoder in the embodiment of the present application can be a coding and decoding model constructed based on a convolutional neural network as shown in Figure 3, wherein each upsampling layer or downsampling layer can use a convolution operation or a causal convolution operation to perform feature mapping.

[0183] S1320: Perform encoding and decoding processing on the audio input sample through the encoder and decoder to obtain an audio output sample.

[0184] The encoder encodes the audio input sample to obtain the corresponding code vector sample, and then the decoder decodes the code vector sample to obtain the audio output sample. The encoding and decoding methods of the encoder and decoder can refer to the above embodiment and will not be repeated here.

[0185] S1330: Determine a first loss error of the encoder and the decoder according to the audio input sample and the audio output sample.

[0186] In one embodiment of the present application, spectral feature extraction is performed on audio input samples and audio output samples respectively, that is, spectral feature extraction is performed on the audio input samples to obtain a first Mel spectrum, and spectral feature extraction is performed on the audio output samples to obtain a second Mel spectrum, and then a first loss error of the encoder and the decoder is determined according to the difference between the first Mel spectrum and the second Mel spectrum.

[0187] In one embodiment of the present application, a method for performing spectral feature extraction on an audio input sample to obtain a first Mel spectrum and a method for performing spectral feature extraction on an audio output sample to obtain a second Mel spectrum may be: obtaining a sampling window including at least two sample scales; performing spectral feature extraction on the audio input sample at different sample scales through the sampling window to obtain a multi-scale first Mel spectrum, and performing spectral feature extraction on the audio output sample to obtain a multi-scale second Mel spectrum.

[0188] S1340: Perform type discrimination on the audio input sample and the audio output sample by a sample discriminator, and determine a second loss error of the sample discriminator according to the discrimination result.

[0189] S1350: Perform generative adversarial training on the encoder, the decoder, and the sample discriminator according to the first loss error and the second loss error to update network parameters of the encoder, the decoder, and the sample discriminator.

[0190] In one embodiment of the present application, a sample discriminator may include an original sample discriminator and a sample feature discriminator. A method for performing type discrimination on an audio input sample and an audio output sample using the sample discriminator includes: inputting the audio input sample and the audio output sample into the original sample discriminator to obtain a first type discrimination result output by the original sample discriminator; performing spectral feature extraction on the audio input sample to obtain a first Mel spectrum, and performing spectral feature extraction on the audio output sample to obtain a second Mel spectrum; and inputting the first Mel spectrum and the second Mel spectrum into the sample feature discriminator to obtain a second type discrimination result output by the sample feature discriminator. In this case, the discrimination results include a first type discrimination result and a second type discrimination result.

[0191] Figure 14 shows a schematic diagram of the principle of codec model training based on a generative adversarial network in one embodiment of the present application. As shown in Figure 14, the codec as a whole can be regarded as a speech-to-speech model. In order to make the speech generated by the model more consistent with the human ear's auditory curve, the input audio input and the output audio output are respectively extracted from the Mel spectrum as the input of the loss function, so that the two are close in Mel spectrum. The Mel spectrum can be set with different sampling window sizes. In order to make the generated speech quality closer to the input speech, the embodiment of the present application adopts multi-scale Mel spectrum constraints as the reconstruction loss.

[0192] The embodiment of the present application uses a generative adversarial network (GAN) for model training, uses the codec as a generator, and designs two discriminators: a discriminator that uses the original speech as input (such as the first discriminator in Figure 14) and a discriminator that uses the Mel spectrum as input (such as the second discriminator in Figure 14). By using two discriminators to distinguish data from two perspectives, audio sampling and Mel spectrum sampling, the data discrimination strength can be improved, thereby improving the encoding and decoding quality of the codec model for audio data.

[0193] Using the codec model provided in the above embodiments of this application to encode or decode audio data can significantly improve the encoding and decoding quality of audio data, especially in weak network environments, such as elevators, under high-rise buildings, mountainous areas, etc., to improve the call quality of voice and video calls.

[0194] Table 1 shows the call quality comparison results of the codec model in the embodiment of the present application and the related art. Among them, PESQ and STOI indicators are both used to measure voice quality, and the larger the value, the better.

[0195] Table 1

[0196] From the comparison of the results in Table 1, it can be seen that the codec model provided in the embodiment of the present application can provide smooth voice calls at a bandwidth of 3 kbps, and the call quality is higher than the call quality of the open source codec Opus at a bandwidth of 6 kbps.

[0197] It should be noted that although the steps of the method of the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0198] The following describes an apparatus embodiment of the present application, which can be used to execute the audio encoding and decoding method in the above-mentioned embodiment of the present application.

[0199] FIG15 shows a block diagram of an audio decoding device in one embodiment of the present application. As shown in FIG15 , the audio decoding device 1500 includes:

[0200] An acquisition module 1510 is configured to acquire a coding vector of each audio frame in the audio frame sequence;

[0201] A first upsampling module 1520 is configured to, when decoding a current audio frame in the audio frame sequence, upsample a code vector of a historical audio frame to obtain an upsampled feature value, where the historical audio frame is one or more audio frames decoded before the current audio frame in the audio frame sequence, and the upsampled feature value is a feature vector obtained during the upsampling process and used to describe the historical audio frame;

[0202] The second upsampling module 1530 is configured to upsample the encoding vector of the current audio frame according to the upsampling feature value to obtain decoded data of the current audio frame.

[0203] In one embodiment of the present application, the second upsampling module 1530 may further include:

[0204] a decoder acquisition module configured to acquire a decoder comprising a plurality of upsampling layers, wherein the upsampling feature values ​​comprise a plurality of feature vectors obtained by upsampling the encoding vectors of the historical audio frames by the plurality of upsampling layers, respectively;

[0205] a data input module configured to input the encoding vector of the current audio frame into the decoder, and input the multiple feature vectors into the multiple upsampling layers accordingly;

[0206] The upsampling processing module is configured to perform upsampling processing on the encoding vector and the multiple feature vectors of the current audio frame through the multiple upsampling layers to obtain decoded data of the current audio frame.

[0207] In one embodiment of the present application, the second upsampling module 1530 may further include:

[0208] An encoder acquisition module, configured to acquire an encoder including a plurality of downsampling layers;

[0209] A codec processing module, configured to perform codec processing on the audio input sample through the encoder and the decoder to obtain an audio output sample;

[0210] a first error determination module configured to determine a first loss error between the encoder and the decoder based on the audio input sample and the audio output sample;

[0211] a second error determination module, configured to perform type discrimination on the audio input sample and the audio output sample through a sample discriminator, and determine a second loss error of the sample discriminator according to the discrimination result;

[0212] A generative adversarial training module is configured to perform generative adversarial training on the encoder, the decoder, and the sample discriminator according to the first loss error and the second loss error to update network parameters of the encoder, the decoder, and the sample discriminator.

[0213] In one embodiment of the present application, the sample discriminator includes an original sample discriminator and a sample feature discriminator; the second error determination module includes:

[0214] a discriminator input module, configured to input the audio input sample and the audio output sample into the original sample discriminator, and obtain a first type discrimination result output by the original sample discriminator;

[0215] a spectrum feature extraction module configured to extract spectrum features from the audio input sample to obtain a first Mel spectrum, and to extract spectrum features from the audio output sample to obtain a second Mel spectrum;

[0216] The spectrum feature input module is configured to input the first Mel spectrum and the second Mel spectrum into the sample feature discriminator to obtain a second type discrimination result output by the sample feature discriminator, wherein the discrimination result includes the first type discrimination result and the second type discrimination result.

[0217] In one embodiment of the present application, the first error determination module can be further configured to: perform spectral feature extraction on the audio input sample to obtain a first Mel spectrum, and perform spectral feature extraction on the audio output sample to obtain a second Mel spectrum; and determine a first loss error between the encoder and the decoder based on the difference between the first Mel spectrum and the second Mel spectrum.

[0218] In one embodiment of the present application, the first error determination module can be further configured to: obtain a sampling window including at least two sample scales; perform spectral feature extraction on the audio input sample at different sample scales through the sampling window to obtain a multi-scale first Mel spectrum, and perform spectral feature extraction on the audio output sample to obtain a multi-scale second Mel spectrum.

[0219] In one embodiment of the present application, the upsampling layer includes at least two sampling channels; the upsampling processing module includes:

[0220] a channel feature extraction module configured to perform feature extraction on the encoding vector of the current audio frame and the multiple feature vectors through at least two sampling channels in the upsampling layer to obtain at least two channel feature values;

[0221] a mean-variance acquisition module, configured to acquire the mean and variance of the at least two channel eigenvalues;

[0222] The normalization processing module is configured to perform normalization processing on the at least two channel feature values ​​according to the mean and variance.

[0223] In one embodiment of the present application, the upsampling processing module further includes:

[0224] A weighted smoothing module is configured to perform weighted smoothing processing on the mean and variance between each audio frame;

[0225] The normalization processing module is configured to perform normalization processing on the at least two channel feature values ​​according to the mean and variance after weighted smoothing processing.

[0226] In one embodiment of the present application, the acquisition module 1510 may further include:

[0227] a coding index value acquisition module, configured to acquire, for each audio frame in the audio frame sequence, a coding index value of the audio frame, wherein the coding index value is used to indicate a codebook vector in a codebook;

[0228] The coding vector determination module is configured to search the codebook for a codebook vector associated with the coding index value, and determine the coding vector of the audio frame according to the codebook vector.

[0229] In one embodiment of the present application, the dimension of the codebook vector is lower than the dimension of the encoding vector; the encoding vector determination module can be further configured to: perform dimensionality-up projection on the codebook vector to obtain the encoding vector of the audio frame.

[0230] In one embodiment of the present application, the acquisition module 1510 may further include:

[0231] a quantizer acquisition module configured to acquire the codebook and a quantizer for maintaining the codebook, wherein the codebook is used to represent a mapping relationship between a coding index value and a codebook vector;

[0232] A coding vector sample acquisition module is configured to obtain a coding vector sample obtained by encoding the audio frame sample by the encoder;

[0233] a quantizer prediction module configured to predict a codebook vector sample matching the encoding vector sample through the quantizer;

[0234] a quantizer updating module configured to update network parameters of the quantizer according to a loss error between the encoding vector sample and the codebook vector sample;

[0235] The coding vector determination module is configured to query the codebook for a codebook vector associated with the coding index value through a trained quantizer.

[0236] In one embodiment of the present application, the acquisition module 1510 may further include:

[0237] A statistical parameter acquisition module is configured to obtain statistical parameters of the coding vector sample matching the codebook vector sample;

[0238] The codebook updating module is configured to update the codebook according to the statistical parameter, and the updated codebook is used for next prediction of a codebook vector sample that matches the coding vector sample.

[0239] In one embodiment of the present application, the statistical parameters include at least one of a vector sum and a hit number, the vector sum represents an average value vector obtained after weighted averaging of each coding vector sample, and the hit number represents the number of coding vector samples that match the codebook vector sample; the codebook update module can be further configured to: perform exponential weighted smoothing on the codebook according to the vector sum; and perform Laplace smoothing on the codebook according to the hit number.

[0240] FIG16 shows a block diagram of an audio encoding apparatus in one embodiment of the present application. As shown in FIG16 , the audio encoding apparatus 1600 includes:

[0241] The acquisition module 1610 is configured to acquire audio data of each audio frame in the audio frame sequence;

[0242] A first downsampling module 1620 is configured to, when encoding a current audio frame in the audio frame sequence, downsample audio data of a historical audio frame to obtain a downsampled feature value, where the historical audio frame is one or more audio frames encoded before the current audio frame in the audio frame sequence, and the downsampled feature value is a feature vector obtained during the downsampling process and used to describe the historical audio frame;

[0243] The second down-sampling module 1630 is configured to down-sample the audio data of the current audio frame according to the down-sampling feature value to obtain the encoding vector of the current audio frame.

[0244] The specific details of the audio codec device provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.

[0245] FIG17 schematically shows a block diagram of a computer system structure of an electronic device for implementing an embodiment of the present application.

[0246] It should be noted that the computer system 1700 of the electronic device shown in FIG17 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.

[0247] As shown in Figure 17, the computer system 1700 includes a central processing unit (CPU) 1701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1702 or the program loaded from the storage part 1708 into the random access memory (RAM) 1703. Various programs and data required for system operation are also stored in the random access memory 1703. The CPU 1701, the read-only memory 1702, and the random access memory 1703 are connected to each other via a bus 1704. An input / output interface 1705 (i.e., an I / O interface) is also connected to the bus 1704.

[0248] The following components are connected to the input / output interface 1705: an input section 1706 including a keyboard, a mouse, and the like; an output section 1707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 1708 including a hard disk; and a communication section 17017 including a network interface card such as a local area network card or a modem. The communication section 17017 performs communication processing via a network such as the Internet. A drive 1710 is also connected to the input / output interface 1705 as needed. Removable media 1711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1710 as needed, so that computer programs read therefrom can be installed into the storage section 1708 as needed.

[0249] In particular, according to an embodiment of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 17017 and / or installed from a removable medium 1711. When the computer program is executed by the central processing unit 1701, the various functions defined in the system of the present application are performed.

[0250] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0251] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0252] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0253] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0254] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.

[0255] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. An audio decoding method, the method being executed by a computer device, comprising: Obtain the encoding vector of each audio frame in the audio frame sequence; When decoding to a current audio frame in the audio frame sequence, upsampling a coding vector of a historical audio frame to obtain an upsampled feature value, wherein the historical audio frame is one or more audio frames decoded before the current audio frame in the audio frame sequence, and the upsampled feature value is a feature vector obtained during the upsampling process and used to describe the historical audio frame; The encoding vector of the current audio frame is up-sampled according to the up-sampled feature value to obtain decoded data of the current audio frame.

2. The audio decoding method according to claim 1, upsampling the encoding vector of the current audio frame according to the upsampling feature value to obtain the decoded data of the current audio frame, comprising: Acquire a decoder including a plurality of upsampling layers, wherein the upsampling feature values ​​include a plurality of feature vectors obtained by upsampling the encoding vectors of the historical audio frames respectively by the plurality of upsampling layers; Inputting the encoding vector of the current audio frame into the decoder, and inputting the multiple feature vectors into the multiple upsampling layers accordingly; The encoding vector of the current audio frame and the multiple feature vectors are up-sampled through the multiple up-sampling layers to obtain decoded data of the current audio frame.

3. The audio decoding method according to claim 2, before inputting the encoding vector of the current audio frame into the decoder, the method further comprises: Obtain an encoder comprising a plurality of downsampling layers; The encoder and the decoder perform encoding and decoding processing on the audio input sample to obtain an audio output sample; determining a first loss error of the encoder and the decoder based on the audio input samples and the audio output samples; Performing type discrimination on the audio input sample and the audio output sample by a sample discriminator, and determining a second loss error of the sample discriminator according to the discrimination result; Generative adversarial training is performed on the encoder, the decoder, and the sample discriminator according to the first loss error and the second loss error to update network parameters of the encoder, the decoder, and the sample discriminator.

4. The audio decoding method according to claim 3, wherein the sample discriminator comprises an original sample discriminator and a sample feature discriminator; The method further comprises: performing type discrimination on the audio input sample and the audio output sample by a sample discriminator, comprising: Inputting the audio input sample and the audio output sample into the original sample discriminator to obtain a first type discrimination result output by the original sample discriminator; Extracting frequency spectrum features of the audio input sample to obtain a first Mel spectrum, and extracting frequency spectrum features of the audio output sample to obtain a second Mel spectrum; The first Mel spectrum and the second Mel spectrum are input into the sample feature discriminator to obtain a second type discrimination result output by the sample feature discriminator, wherein the discrimination result includes the first type discrimination result and the second type discrimination result.

5. The audio decoding method according to claim 3, determining the first loss error of the encoder and the decoder according to the audio input sample and the audio output sample, comprising: Extracting frequency spectrum features of the audio input sample to obtain a first Mel spectrum, and extracting frequency spectrum features of the audio output sample to obtain a second Mel spectrum; A first loss error between the encoder and the decoder is determined according to a difference between the first Mel spectrum and the second Mel spectrum.

6. The audio decoding method according to claim 5, extracting the frequency spectrum feature of the audio input sample to obtain a first Mel spectrum, and extracting the frequency spectrum feature of the audio output sample to obtain a second Mel spectrum, comprising: obtaining a sampling window including at least two sample scales; The frequency spectrum feature extraction is performed on the audio input sample at different sample scales through the sampling window to obtain a multi-scale first Mel spectrum, and the frequency spectrum feature extraction is performed on the audio output sample to obtain a multi-scale second Mel spectrum.

7. The audio decoding method according to claim 2, wherein the upsampling layer comprises at least two sampling channels; Performing upsampling processing on the encoding vector of the current audio frame and the multiple feature vectors through the multiple upsampling layers includes: Performing feature extraction on the encoding vector of the current audio frame and the multiple feature vectors through at least two sampling channels in the upsampling layer to obtain at least two channel feature values; Obtaining the mean and variance of the at least two channel feature values; The at least two channel feature values ​​are normalized according to the mean and the variance.

8. The audio decoding method according to claim 7, before normalizing the at least two channel feature values ​​according to the mean and the variance, the method further comprises: Perform weighted smoothing on the mean and variance between each audio frame; The normalizing the at least two channel feature values ​​according to the mean and the variance includes: The at least two channel feature values ​​are normalized according to the mean and variance after weighted smoothing.

9. The audio decoding method according to any one of claims 1 to 8, obtaining the encoding vector of each audio frame in the audio frame sequence, comprising: For each audio frame in the audio frame sequence, obtaining a coding index value of the audio frame, where the coding index value is used to indicate a codebook vector in a codebook; A codebook vector associated with the coding index value is searched in the codebook, and a coding vector of the audio frame is determined according to the codebook vector.

10. The audio decoding method according to claim 9, wherein the dimension of the codebook vector is lower than the dimension of the encoding vector; and determining the encoding vector of the audio frame according to the codebook vector comprises: Perform dimension-up projection on the codebook vector to obtain a coding vector of the audio frame.

11. The audio decoding method according to claim 9, before searching the codebook for a codebook vector associated with the encoding index value, the method further comprises: Acquire the codebook and a quantizer for maintaining the codebook, wherein the codebook is used to represent a mapping relationship between a coding index value and a codebook vector; Obtaining a coding vector sample obtained by encoding the audio frame sample by the encoder; Predicting, by the quantizer, a codebook vector sample matching the encoding vector sample; updating a network parameter of the quantizer according to a loss error between the encoding vector sample and the codebook vector sample; Querying the codebook for a codebook vector associated with the coding index value includes: The trained quantizer searches the codebook for a codebook vector associated with the encoding index value.

12. The audio decoding method according to claim 11, after predicting the codebook vector sample matching the encoding vector sample by the quantizer, the method further comprises: Obtaining statistical parameters of coding vector samples matching the codebook vector samples; The codebook is updated according to the statistical parameter, and the updated codebook is used for predicting a codebook vector sample that matches the encoding vector sample next time.

13. The audio decoding method according to claim 12, wherein the statistical parameter comprises at least one of a vector sum and a hit number, wherein the vector sum represents an average value vector obtained by weighted averaging of each coding vector sample, and the hit number represents the number of coding vector samples matching the codebook vector sample; and updating the codebook according to the statistical parameter comprises: Performing exponential weighted smoothing on the codebook according to the vector sum; The codebook is Laplace smoothed according to the hit number.

14. An audio encoding method, the method being executed by a computer device, comprising: Obtain audio data of each audio frame in the audio frame sequence; When encoding a current audio frame in the audio frame sequence, downsampling audio data of a historical audio frame to obtain a downsampled feature value, wherein the historical audio frame is one or more audio frames encoded before the current audio frame in the audio frame sequence, and the downsampled feature value is a feature vector obtained during the downsampling process and used to describe the historical audio frame; The audio data of the current audio frame is downsampled according to the downsampled feature value to obtain an encoding vector of the current audio frame.

15. An audio decoding device, the device being deployed on a computer device, comprising: An acquisition module is configured to acquire a coding vector of each audio frame in the audio frame sequence; A first upsampling module is configured to, when decoding to a current audio frame in the audio frame sequence, upsample the encoding vector of a historical audio frame to obtain an upsampled feature value, wherein the historical audio frame is one or more audio frames decoded before the current audio frame in the audio frame sequence, and the upsampled feature value is a feature vector obtained during the upsampling process and used to describe the historical audio frame; The second up-sampling module is configured to up-sample the encoding vector of the current audio frame according to the up-sampling feature value to obtain decoded data of the current audio frame.

16. An audio encoding device, the device being deployed on a computer device, comprising: An acquisition module, configured to acquire audio data of each audio frame in the audio frame sequence; The first downsampling module is configured to downsample the audio data of the historical audio frame to obtain a downsampled feature value when encoding the current audio frame in the audio frame sequence, wherein the historical audio frame is the audio frame in the audio frame sequence. One or more audio frames encoded before the current audio frame, the down-sampled feature value being a feature vector obtained during the down-sampling process and used to describe the historical audio frame; The second down-sampling module is configured to down-sample the audio data of the current audio frame according to the down-sampling feature value to obtain the encoding vector of the current audio frame.

17. A computer-readable medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 14 when executed by a processor.

18. An electronic device, comprising: processor; as well as A memory, for storing a computer program executable by the processor; The processor is configured to enable the electronic device to perform the method according to any one of claims 1 to 14 by executing the executable computer program.

19. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 14 is implemented.