Encoding method, device, electronic device, and storage medium

By determining encoding bandwidth and perceptual entropy using MDCT and scale factor bands, the method addresses inaccurate bit allocation in audio encoding, enhancing encoding efficiency and stability.

JP7542153B2Active Publication Date: 2024-08-29VIVO MOBILE COMM CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2023534313
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-12-24
Filing Date
2021-12-17
Publication Date
2024-08-29
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

Current audio encoding methods suffer from inaccurate perceptual entropy calculations, leading to misallocation of encoded bits and fluctuations in encoding quality due to inconsistent bit usage across frames.

Method used

Determine the encoding bandwidth and perceptual entropy of audio frames based on actual encoding bit rates, using modified discrete cosine transform (MDCT) and scale factor bands to accurately calculate the bit requirement rate, thereby optimizing bit allocation.

Benefits of technology

This approach ensures accurate perceptual entropy calculation, avoids unreasonable bit allocation, saves encoding resources, and improves encoding efficiency by stabilizing quality fluctuations between frames.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007542153000018
    Figure 0007542153000018
  • Figure 0007542153000019
    Figure 0007542153000019
  • Figure 0007542153000020
    Figure 0007542153000020
Patent Text Reader

Abstract

This application relates to the technical field of audio coding and discloses a coding method, an apparatus, an electronic device, and a storage medium, which include the steps of: determining an encoding bandwidth of an audio signal of a target frame based on an encoding bit rate of the audio signal of the target frame; determining a perceptual entropy of the audio signal of the target frame based on the encoding bandwidth, determining a bit requirement rate of the audio signal of the target frame based on the perceptual entropy; determining a target number of bits based on the bit requirement rate, and encoding the audio signal of the target frame based on the target number of bits.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims priority to China Patent Application No. 202011553903.4, filed in China on December 24, 2020, the entire contents of which are incorporated herein by reference.

[0002] The present application relates to the technical field of audio encoding, and in particular to an encoding method, an apparatus, an electronic device and a storage medium. [Background technology]

[0003] Currently, network transmission bandwidth remains a bottleneck in many audio applications, such as Bluetooth audio, streaming media music transmission, and live Internet broadcasting. Because the content of audio signals is complex and subject to change, if the signal of each frame is encoded with the same number of encoding bits, quality fluctuations between frames are likely to occur, resulting in a deterioration in the encoding quality of the audio signal.

[0004] In order to obtain better coding quality and meet the transmission bandwidth limitation, the average bit rate (ABR) bit rate control method is usually chosen during coding. The basic principle of ABR bit rate control is to code frames that are easy to code with relatively few bits (less than the average coding bits) and store the remaining bits in a bit pool, while coding frames that are difficult to code with relatively more bits (more than the average coding bits) and extract the required additional bits from the bit pool.

[0005] Currently, the calculation of perceptual entropy is based on the bandwidth of the input signal, rather than the bandwidth of the signal actually encoded by the encoder, which leads to inaccurate calculation of perceptual entropy and misallocation of coding bits. Summary of the Invention [Problem to be solved by the invention]

[0006] The embodiments of the present application aim to provide an encoding method, an apparatus, an electronic device, and a storage medium that can solve the problem in the related art that the calculation of perceptual entropy can be inaccurate, causing misallocation of encoding bits. [Means for solving the problem]

[0007] In a first aspect, embodiments of the present application include determining an encoding bandwidth of the audio signal of the target frame based on an encoding bit rate of the audio signal of the target frame; determining a perceptual entropy of the audio signal of the target frame based on the coding bandwidth, and determining a bit requirement rate of the audio signal of the target frame based on the perceptual entropy; determining a target number of bits based on the bit request rate; and encoding the audio signal of the target frame based on the target number of bits.

[0008] In a second aspect, embodiments of the present application include an encoding bandwidth determination module for determining an encoding bandwidth of the audio signal of the target frame based on an encoding bit rate of the audio signal of the target frame; a perceptual entropy determination module for determining a perceptual entropy of the audio signal of the target frame based on the coding bandwidth; a bit requirement determination module for determining a bit requirement rate of an audio signal of a target frame based on a perceptual entropy; An encoding module for determining a target number of bits based on a bit request rate, and encoding the audio signal of the target frame based on the target number of bits is provided.

[0009] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or command stored in the memory and executable on the processor, the program or command, when executed by the processor, achieving steps of the method according to the first aspect.

[0010] In a fourth aspect, an embodiment of the present application provides a readable storage medium having stored thereon a program or instructions which, when executed by a processor, effectuates steps of the method according to the first aspect.

[0011] In a fifth aspect, an embodiment of the present application provides a chip including a processor and a communication interface coupled to the processor, the processor being adapted to execute programs or commands to implement a method according to the first aspect. Effect of the Invention

[0012] The encoding method, device, electronic device, and storage medium provided in the embodiments of the present application first determine the actual encoding bandwidth of the audio signal of the target frame based on the encoding bit rate of the audio signal of the target frame to calculate the perceptual entropy, so that the calculation result of the perceptual entropy is accurate.The encoding method, device, electronic device, and storage medium provided in the embodiments of the present application further determine the number of bits based on the accurate perceptual entropy to encode the audio signal of the target frame, so that unreasonable allocation of encoding bits can be avoided, encoding resources can be saved, and encoding efficiency can be improved. [Brief description of the drawings]

[0013] [Figure 1] 1 is a flowchart of an encoding method provided in an embodiment of the present application. [Diagram 2] 1 is a function image of a mapping function η() provided in an embodiment of the present application; [Diagram 3]1 is a function image of a mapping function φ() provided in an embodiment of the present application; [Figure 4] FIG. 2 is an overall flow block diagram of an encoding method provided in an embodiment of the present application. [Diagram 5] 1 is a waveform diagram of the number of encoded bits when encoding using the encoding method provided in the embodiment of the present application; [Figure 6] FIG. 2 is a waveform diagram of an average encoding bit rate when encoding using the encoding method provided in the embodiment of the present application. [Figure 7] FIG. 2 is a structural schematic diagram of an encoding device provided in an embodiment of the present application; [Figure 8] FIG. 2 is a structural schematic diagram of an electronic device provided in an embodiment of the present application. [Figure 9] FIG. 2 is a hardware structure schematic diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] Hereinafter, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it should be understood that the described embodiments are only a part of the embodiments of the present application, and are not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without any creative efforts belong to the protection scope of the present application.

[0015] The terms "first," "second," etc. in the specification and claims of this application are not intended to describe a particular order or chronology, but are intended to distinguish between similar objects. It should be understood that terms used in this manner may be substituted for one another where appropriate, such that the embodiments of this application may be practiced in orders other than those illustrated or described herein. Also, in the specification and claims, "and / or" indicates at least one of the connected objects, and the " / " symbol generally indicates that the related objects before and after are in an "or" relationship.

[0016] Hereinafter, the encoding method and apparatus provided in the embodiments of the present application will be described in detail in specific embodiments and their application scenarios with reference to the drawings.

[0017] FIG. 1 is a flow chart of the encoding method provided in the embodiment of the present application. Referring to FIG. 1, the encoding method provided in the embodiment of the present application includes: determining 110 an encoding bandwidth of the audio signal of the target frame based on an encoding bit rate of the audio signal of the target frame; determining a perceptual entropy of the audio signal of the target frame based on the coding bandwidth and determining a bit requirement rate of the audio signal of the target frame based on the perceptual entropy; and determining a target number of bits based on the bit request rate, and encoding the audio signal of the target frame based on the target number of bits 130.

[0018] The subject of the encoding method in the embodiment of the present application may be an electronic device, or a component, integrated circuit, or chip in the electronic device. The electronic device may be a portable electronic device or a non-portable electronic device. For example, the portable electronic device may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and the non-portable electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), an automated teller machine, or a kiosk, and the embodiments of the present application are not specifically limited.

[0019] In the following, the technical solutions of the present application are described in detail by taking the encoding method provided in the embodiments of the present application as an example to be implemented on a personal computer.

[0020] Specifically, in step 110, after the computer determines the encoding bit rate of the audio signal of the target frame, the computer can determine the encoding bandwidth of the audio signal of the target frame according to the corresponding relationship between the encoding bit rate and the encoding bandwidth, where the corresponding relationship between the encoding bit rate and the encoding bandwidth may be determined by a related protocol or standard, or may be preset.

[0021] In step 120, the perceptual entropy of the audio signal of the target frame can be determined by obtaining the perceptual entropy of each scale factor band of the audio signal of the target frame based on the relevant parameters of the modified discrete cosine transform (MDCT), etc., further according to the encoding bandwidth of the audio signal of the target frame.

[0022] Then, the bit requirement rate of the audio signal of the target frame can be further determined based on the perceptual entropy, whereby in step 130, a target number of bits is determined based on the bit requirement rate, and the audio signal of the target frame is encoded based on the target number of bits.

[0023] Here, the target frame may be the current frame input, or another frame to be encoded, such as another frame to be encoded that has been previously input into the cache, and the target bit count is the number of bits for encoding the audio signal of the target frame.

[0024] The encoding method provided in the embodiment of the present application first determines the actual encoding bandwidth of the audio signal of the target frame based on the encoding bit rate of the audio signal of the target frame to calculate the perceptual entropy, so that the calculation result of the perceptual entropy is accurate.The encoding method provided in the embodiment of the present application further determines the number of bits based on the accurate perceptual entropy to encode the audio signal of the target frame, so that unreasonable allocation of encoding bits can be avoided, encoding resources can be saved, and encoding efficiency can be improved.

[0025] Specifically, in one embodiment, determining the perceptual entropy of the audio signal of the target frame based on an encoding bandwidth includes: S1211 determining a number of scale factor bands of the audio signal of the target frame based on an encoding bandwidth; S1212 obtains the perceptual entropy of each scale factor band; and determining S1213 a perceptual entropy of the audio signal for the target frame based on the number of scale factor bands and the perceptual entropy of each scale factor band.

[0026] Specifically, first, the number of scale factor bands of the audio signal of the target frame can be determined based on the scale factor band offset table (Table 3.4) in the ISO / IEC 13818-7 standard document, and then the perceptual entropy of each scale factor band can be obtained.

[0027] In an embodiment of the present application, step S1212 includes: S1212a for determining MDCT spectral coefficients after a Modified Discrete Cosine Transform (MDCT) of the audio signal of the target frame; determining an energy of the MDCT spectral coefficients of each scale factor band based on the MDCT spectral coefficients and the scale factor band offset table; and S1212c determining a perceptual entropy for each scale factor band based on the energy of the MDCT spectral coefficients and a masking threshold for each scale factor band.

[0028] It should be noted that MDCT is a linear orthogonal lapped transform. It can effectively overcome the edge effect in the windowed discrete cosine transform (DCT) block processing operation without degrading the coding performance, and can effectively remove the periodic noise caused by the edge effect. For the same coding rate, the performance of MDCT is better than that of related technologies using DCT.

[0029] Furthermore, based on the scale factor band offset table, the energy of the MDCT spectral coefficients of each scale factor band can be determined by cumulative calculation of the MDCT spectral coefficients, etc.

[0030] The encoding method provided in the embodiments of the present application fully considers the MDCT spectral coefficients, the energy of the MDCT spectral coefficients and the masking threshold of each scale factor band when obtaining the perceptual entropy of each scale factor band, so that the obtained perceptual entropy of each scale factor band can accurately reflect the energy variation situation of each scale factor band.

[0031] After obtaining the perceptual entropy of each scale factor band, the perceptual entropy of the audio signal of the target frame can be determined based on the number of scale factor bands and the perceptual entropy of each scale factor band.

[0032] It can be understood that the encoding method provided in the embodiments of the present application obtains the perceptual entropy of each scale factor band of the audio signal of the target frame, and then determines the perceptual entropy of the audio signal of the target frame based on the perceptual entropy of each scale factor band, so that the accuracy of the obtained perceptual entropy of the audio signal of the target frame can be guaranteed.

[0033] Moreover, in one embodiment, determining a bit requirement rate of the audio signal for the target frame based on the perceptual entropy includes: S1221 obtaining an average perceptual entropy of an audio signal of a predetermined number of frames prior to the audio signal of a target frame; determining a difficulty factor for the audio signal of the target frame based on the perceptual entropy and the average perceptual entropy S1222; and S1223 determining a bit requirement rate of the audio signal of the target frame based on the difficulty coefficient.

[0034] In the embodiment of the present application, the size of the predetermined number may be, for example, 8, 9, 10, etc. The specific size can be adjusted according to the actual situation, and is not specifically limited in the embodiment of the present application.

[0035] After obtaining the average perceptual entropy, a difficulty coefficient of the target frame audio signal can be determined according to the perceptual entropy and the average perceptual entropy through a preset difficulty coefficient calculation manner, where the preset difficulty coefficient calculation manner may be: difficulty coefficient=(perceptual entropy-average perceptual entropy) / average perceptual entropy.

[0036] In an embodiment of the present application, the bit requirement rate of the audio signal of the target frame can be determined according to a pre-set mapping function from the difficulty coefficient to the bit requirement rate.

[0037] The encoding method provided in the embodiments of the present application determines the bit requirement rate based on the average perceptual entropy of the audio signal of a predetermined number of frames prior to the audio signal of the target frame, thereby avoiding the drawback present in the related art that the final estimated number of bits is inaccurate by directly using the perceptual entropy of the audio signal of the target frame to determine the bit requirement rate.

[0038] Moreover, in one embodiment, determining the target number of bits based on the bit request rate comprises: determining a current bitpool fullness based on the number of bits available in the current bitpool and the size of the bitpool; S1312: determining a bit pool control rate for encoding the audio signal of the target frame based on the fullness, and determining an encoding bit factor based on the bit request rate and the bit pool control rate; and determining a target number of bits based on the coding bit factor S1313.

[0039] It should be noted that the fullness of a bit pool may be the ratio of the number of available bits in the bit pool to the size of the bit pool.

[0040] In an embodiment of the present application, a bit pool adjustment rate during encoding of an audio signal of a target frame can be determined according to a preset mapping function from fullness to a bit pool adjustment rate.

[0041] After the bit request rate and the bit pool adjustment rate are determined, a coding bit factor can be obtained according to the bit request rate and the bit pool adjustment rate in a preset coding bit factor calculation manner.

[0042] In an embodiment of the present application, the target bit number may be a product of the coding bit factor and the average coding bit number of the signal of each frame, where the average coding bit number of the signal of each frame is determined according to the frame length of the audio signal of one frame, the sampling frequency of the audio signal, and the coding bit rate.

[0043] The encoding method provided in the embodiment of the present application determines a bit pool adjustment rate and a coding bit factor by analyzing the fullness of the current bit pool, and comprehensively takes into account factors such as the bit pool status, the difficulty of encoding the audio signal, and the allowable range of bit rate changes, thereby effectively preventing bit pool overflow and underflow.

[0044] In the following, the encoding method provided in the embodiment of the present application is described by taking encoding of a stereo audio signal sc03.wav as an example.

[0045] Here, the encoding bit rate of the stereo audio signal sc03.wav is 128 kbps. The size of the bitpool is maxbitRes = 12288 bits (6144 bits / channel). The sampling frequency Fs=48kHz. The frame length of one frame of an audio signal is N=1024. The average number of coding bits for each frame signal is meanBits = 1024 x 128 x 1000 / 48000 = 2731 bits.

[0046] The correspondence between the stereo encoding bit rate and the encoding bandwidth may be as shown in Table 1.

[0047] [Table 1]

[0048] As can be seen from Table 1, the actual coding bandwidth Bw=15.50 kHz corresponds to the coding bit rate bitRate=128 kbps of the stereo audio signal sc03.wav.

[0049] After determining the encoding bandwidth, the perceptual entropy of the audio signal of the target frame can be determined based on the encoding bandwidth.

[0050] Specifically, as can be seen from the scale factor band offset table (Table 3.4) in the ISO / IEC 13818-7 standard document, when the sampling rate of the input signal is Fs=48 kHz, the scale factor band value M corresponding to Bw=15.50 kHz is 41, that is, the number of scale factor bands of the audio signal of the target frame is 41.

[0051] The step of obtaining the perceptual entropy of each scale factor band may be specifically realized as follows.

[0052] Let X[k] be the MDCT spectral coefficient obtained after MDCT transforming the audio signal of the target frame, where k = 0, 1, 2, ..., M-1, and the energy of the MDCT spectral coefficient of each scale factor band is en[n], where n = 0, 1, 2, ..., M-1. Therefore, the calculation of en[n] is as follows: JPEG0007542153000002.jpg13158 where kOffset[n] represents the scale factor band offset table.

[0053] Let the perceptual entropy of each scale factor band be sfbPe[n], n=0, 1, 2, ..., M-1, and its calculation is as follows: JPEG0007542153000003.jpg27158 JPEG0007542153000004.jpg33158

[0054] nl is the number of non-zero MDCT spectral coefficients after quantization in each scale factor band, and its calculation is as follows: JPEG0007542153000005.jpg26158

[0055] After obtaining the perceptual entropy of each scale factor band, the perceptual entropy of the audio signal of the target frame can be determined based on the number of scale factor bands and the perceptual entropy of each scale factor band.

[0056] Assuming that the target frame is the l-th frame, the perceptual entropy Pe[l] of the audio signal of the target frame is calculated as follows: JPEG0007542153000006.jpg12158In equation (4), offset is an offset constant and is defined as follows. JPEG0007542153000007.jpg17158

[0057] The step of determining a bit requirement rate for encoding an audio signal of a target frame based on the perceptual entropy may be specifically realized as follows.

[0058] Average perceptual entropy is average is the average perceptual entropy of the audio signal over the past N1 frames, and PE average The calculation of is as follows: JPEG0007542153000008.jpg18158

[0059] In this embodiment, the value of N1 is 8. That is, the average perceptual entropy is the average value of the perceptual entropy of the audio signal of the past 8 frames. For example, if the current frame is the 10th frame, l=10, and PE average is the average of Pe[9], Pe[8], Pe[7], Pe[6], Pe[5], Pe[4], Pe[3], and Pe[2].

[0060] Of course, the specific value of N1 can be adjusted according to actual needs, for example, N1 can be 7, 10, 15, etc., and is not specifically limited in the embodiments of the present application.

[0061] After obtaining the average perceptual entropy of the audio signal of a predetermined number of frames, a difficulty coefficient of the audio signal of the target frame can be determined based on the average perceptual entropy and the perceptual entropy of the audio signal of the target frame.

[0062] For the lth frame, the calculation of its difficulty coefficient D[l] is as follows: JPEG0007542153000009.jpg14158

[0063] After determining the difficulty coefficient of the audio signal of the target frame, the bit requirement rate of the audio signal of the target frame can be determined.

[0064] Let the bit requirement rate of the audio signal of the target frame be R. demand [l] and its calculation is as follows: In the formula, η() is a mapping function from the difficulty coefficient to the bit request rate. The mapping function takes the relative difficulty coefficient D[l] as an argument and the bit request rate R demand It is a piecewise linear function with [l] as the function value.

[0065] In this embodiment, the mapping function η() is defined as follows: JPEG0007542153000011.jpg33158

[0066] The function image of the mapping function η() is shown in FIG.

[0067] Furthermore, the step of determining the target number of bits based on the bit request rate may be specifically realized as follows.

[0068] Let bitRes be the number of available bits in the current bit pool, and F be the current bit pool fullness, then: F=bitRes / maxbitRes (8)

[0069] After obtaining the bit pool fullness F, a bit pool adjustment rate for encoding the audio signal of the target frame can be determined based on the bit pool fullness F.

[0070] The bit pool adjustment rate when encoding the audio signal of the target frame is R adjust [l] and its calculation is as follows: In the formula, φ() is a mapping function from the bit pool fullness to the bit pool adjustment rate. The mapping function takes the bit pool fullness F as an argument and the bit pool adjustment rate R adjust It is a piecewise linear function with [l] as the function value.

[0071] In this embodiment, φ() is defined as follows: JPEG0007542153000013.jpg27158

[0072] The function image of the mapping function φ() is shown in FIG.

[0073] Furthermore, let the coding bit factor be bitFac[l], and its calculation is as follows: JPEG0007542153000014.jpg14158

[0074] If bitFac[l]>l, it indicates that the current l-th frame is a hard frame to code, the number of bits to code the current frame will be more than the average number of coded bits, and the additional bits required for coding (number of bits to code the current frame - average number of coded bits) will be extracted from the bit pool.

[0075] When bitFac[l] < l, it indicates that the current l-th frame is an easy-to-encode frame. The number of bits used to encode the current frame is less than the average encoding bits, and the remaining bits after encoding (average encoding bit number - number of bits used to encode the current frame) are stored in the bit pool.

[0076] After obtaining the encoding bit factor bitFac[l], the target bit number can be determined based on the encoding bit factor bitFac[l].

[0077] If the target bit number is availableBits, it is as follows. In Equation (11) of JPEG0007542153000015.jpg6158, when encoding according to the set bit rate, the calculation of the average encoding bit number meanBits of the signal of each frame is as follows. JPEG0007542153000016.jpg6158

[0078] When the frame length N of the audio signal of one frame is 1024 and the sampling frequency Fs is 48 kHz, the target bit number availableBits is as follows. JPEG0007542153000017.jpg7158

[0079] Figure 4 is an overall flowchart of the encoding method provided in the embodiment of the present application. To easily understand and implement the encoding method provided in the embodiment of the present application, as shown in Figure 4, the encoding method provided in the embodiment of the present application may be further subdivided into steps 410 to 490. In step 410, determine the encoding bandwidth of the audio signal of the target frame. In step 420, calculate the perceptual entropy of the audio signal of the target frame. In step 430, calculate the average perceptual entropy of the audio signals of a predetermined number of frames. In step 440, a difficulty factor of the audio signal of the target frame is calculated. In step 450, the bit requirement rate of the audio signal for the target frame is calculated. In step 460, the current bit pool fullness is calculated. In step 470, a bit pool adjustment rate for encoding the audio signal of the target frame is calculated. In step 480, the coding bit factor is calculated. In step 490, a target number of bits is determined.

[0080] For the specific implementation of steps 410 to 490, reference can be made to the relevant descriptions of the above embodiments, and detailed descriptions will be omitted here.

[0081] 5 and 6 show waveform diagrams of the number of coding bits and the average coding bit rate of the signal of each frame when the audio signal sc03.wav is coded by the coding method provided in the embodiment of the present application.

[0082] In Fig. 5, the solid line represents the actual number of coding bits of the signal of each frame, and the dotted line represents the average number of coding bits (2731) of the signal of each frame when encoding according to the set bit rate of 128 kbps. Fig. 5 shows that the actual number of coding bits fluctuates above and below the average number of coding bits during the encoding process, and shows that the number of coding bits of the signal of each frame can be reasonably determined by the encoding method provided in the embodiment of the present application.

[0083] In Fig. 6, the solid line represents the average encoding bit rate during the encoding process, and the dotted line represents the set target encoding bit rate (128000). As can be seen from Fig. 6, with the increase of time, the overall average encoding bit rate of the encoding method provided in the embodiment of the present application tends to match the set target encoding bit rate.

[0084] From the above, the encoding method provided in the embodiment of the present application can obtain the most moderate encoding quality under the premise that the average bit rate is close to the target bit rate. In addition, the encoding method provided in the embodiment of the present application can solve the problem of bit pool overflow and underflow in the conventional ABR bit rate control technology, can reasonably determine the number of encoding bits of the signal of each frame, and has good performance in suppressing quality fluctuation between frames.

[0085] It should be noted that the execution entity of the encoding method provided in the embodiments of the present application may be an encoding device or a control module in the encoding device for executing and loading the encoding method.

[0086] FIG. 7 is a structural schematic diagram of the encoding device provided in the embodiment of the present application. Referring to FIG. 7, the encoding device provided in the embodiment of the present application may include the following encoding bandwidth determination module 710, a perceptual entropy determination module 720, a bit requirement determination module 730, and an encoding module 740.

[0087] The encoding bandwidth determination module 710 is used for determining an encoding bandwidth of the audio signal of the target frame based on the encoding bit rate of the audio signal of the target frame.

[0088] The perceptual entropy determination module 720 is used for determining the perceptual entropy of the audio signal of the target frame based on the encoding bandwidth.

[0089] The bit requirement determination module 730 is used to determine a bit requirement rate of the audio signal of the target frame based on the perceptual entropy.

[0090] The encoding module 740 is used to determine a target number of bits based on the bit request rate, and encode the audio signal of the target frame based on the target number of bits.

[0091] The encoding device provided in the embodiment of the present application first determines the actual encoding bandwidth of the audio signal of the target frame based on the encoding bit rate of the audio signal of the target frame to calculate the perceptual entropy, so that the calculation result of the perceptual entropy is accurate.The encoding device provided in the embodiment of the present application further determines the number of bits based on the accurate perceptual entropy to encode the audio signal of the target frame, so that unreasonable allocation of encoding bits can be avoided, encoding resources can be saved, and encoding efficiency can be improved.

[0092] In one embodiment, the encoding module 730 is specifically used for determining the fullness of the current bit pool based on the number of available bits in the current bit pool and the size of the bit pool, determining a bit pool adjustment rate when encoding the audio signal of the target frame based on the fullness, determining a coding bit factor based on the bit request rate and the bit pool adjustment rate, and determining a target number of bits based on the coding bit factor.

[0093] In one embodiment, the perceptual entropy determination module 720 includes a first determination sub-module for determining the number of scale factor bands of the audio signal of the target frame based on the encoding bandwidth, an acquisition sub-module for acquiring the perceptual entropy of each scale factor band, and a second determination sub-module for determining the perceptual entropy of the audio signal of the target frame based on the number of scale factor bands and the perceptual entropy of each scale factor band.

[0094] In one embodiment, the bit requirement determination module 730 is specifically used for obtaining an average perceptual entropy of the audio signal of a predetermined number of frames prior to the audio signal of the target frame, determining a difficulty coefficient of the audio signal of the target frame based on the perceptual entropy and the average perceptual entropy, and determining a bit requirement rate for encoding the audio signal of the target frame based on the difficulty coefficient.

[0095] In one embodiment, the acquisition sub-module is specifically used for determining MDCT spectral coefficients after a modified discrete cosine transform (MDCT) of the audio signal of the target frame; determining the energy of the MDCT spectral coefficients of each scale factor band according to the MDCT spectral coefficients and a scale factor band offset table; and determining the perceptual entropy of each scale factor band according to the energy of the MDCT spectral coefficients and a masking threshold of each scale factor band.

[0096] From the above, the encoding device provided in the embodiment of the present application can obtain the most moderate encoding quality under the premise that the average bit rate is close to the target bit rate. In addition, the encoding device provided in the embodiment of the present application can solve the problem of bit pool overflow and underflow in the conventional ABR bit rate control technology, can reasonably determine the number of encoding bits for each frame signal, and has excellent performance in suppressing quality fluctuation between frames.

[0097] The encoding device in the embodiment of the present application may be a device, or may be a component, integrated circuit, or chip in a terminal. The device may be a portable electronic device or a non-portable electronic device. For example, the portable electronic device may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and the non-portable electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), an automated teller machine, or a kiosk, and the embodiments of the present application are not specifically limited.

[0098] The encoding device in the embodiment of the present application may be a device having an operating system, which may be an Android operating system, an ios operating system, or other possible operating systems, and is not specifically limited in the embodiment of the present application.

[0099] The apparatus provided in the embodiments of the present application can realize all the method steps of the above method embodiments and achieve the same technical effects, and detailed description is omitted here.

[0100] Optionally, the embodiment of the present application further provides an electronic device. As shown in Fig. 8, the electronic device 800 includes a processor 810, a memory 820, and a program or command stored in the memory 820 and executable on the processor 810, and when the program or command is executed by the processor 810, each process of the above-mentioned encoding method embodiment can be realized and the same technical effect can be achieved. In order to avoid repetition, detailed description is omitted here.

[0101] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned portable electronic devices and non-portable electronic devices.

[0102] 9 is a hardware structure schematic diagram of an electronic device provided in an embodiment of the present application. As shown in FIG. 9, the electronic device 900 may include, but is not limited to, components such as a high frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910, and a power supply 911.

[0103] Those skilled in the art can understand that the electronic device 900 may further include a power source (e.g., a battery) that supplies electricity to each component, and the power source is logically connected to the processor 910 by a power management system, so that the power management system can realize functions such as charge / discharge management and power consumption management. The structure of the electronic device shown in FIG. 9 does not limit the electronic device, and the electronic device may include more or fewer components than those shown, or a combination of some components, or a different component arrangement, and detailed description thereof will be omitted here.

[0104] In an embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, an in-vehicle terminal, a wearable device, a pedometer, and the like.

[0105] Here, the user input unit 907 is used for receiving a control command input by a user, such as whether to perform the encoding method provided in the embodiment of the present application.

[0106] The processor 910 is used for determining an encoding bandwidth of the audio signal of the target frame based on an encoding bit rate of the audio signal of the target frame, determining a perceptual entropy of the audio signal of the target frame based on the encoding bandwidth and determining a bit requirement rate of the audio signal of the target frame based on the perceptual entropy, determining a target number of bits based on the bit requirement rate, and encoding the audio signal of the target frame based on the target number of bits.

[0107] It should be noted that the above electronic device 900 in this embodiment can realize each process of the method embodiment in the embodiment of the present application, and can achieve the same technical effects. In order to avoid repetition, detailed description is omitted here.

[0108] It should be understood that in the embodiment of the present invention, the high frequency unit 901 can be used for receiving and transmitting information or receiving and transmitting signals in a call process, specifically, receiving downlink data from a base station, processing the data in the processor 910, and transmitting uplink data to the base station. Typically, the high frequency unit 901 includes, but is not limited to, an antenna, at least one amplifier, a receiver-transmitter, a coupler, a low-noise amplifier, a duplexer, etc. The high frequency unit 901 can also communicate with a network and other devices through a wireless communication system.

[0109] Through the network module 902, the electronic device provides wireless broadband Internet access to the user to facilitate, for example, sending and receiving e-mail, browsing web pages, and accessing streaming media. The audio output unit 903 can convert audio data received by the radio frequency unit 901 or the network module 902 or stored in the memory 909 into an audio signal and output it as a voice. The audio output unit 903 can also provide audio output (e.g., a call signal receiving sound, a message receiving sound, etc.) related to a specific function performed by the electronic device 900. The audio output unit 903 includes a speaker, a buzzer, a handset, etc.

[0110] The input unit 904 is used to receive audio or video signals. The input unit 904 may include a graphics processing unit (GPU) 9041 for processing image data of static or video captured by an image capture device (e.g., a camera) in a video capture mode or an image capture mode, and a microphone 9042. The processed image frames can be displayed on the display unit 906. The image frames processed by the graphics processing unit 9041 can be stored in a memory 909 (or other storage medium) or transmitted by the radio frequency unit 901 or the network module 902. The microphone 9042 can receive voice and process such voice as audio data. The processed audio data can be converted into a format transmittable to a mobile communication base station and output by the radio frequency unit 901 in a telephone call mode.

[0111] The terminal 900 further includes at least one sensor 905 such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 9061 according to the brightness of the ambient light, and a proximity sensor that can turn off the display panel 9061 and / or the backlight when the electronic device 900 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes) and can detect the magnitude and direction of gravity when stationary, and can be used for recognizing the posture of the electronic device (e.g., switching between horizontal and vertical screens, related games, magnetometer posture calibration), vibration recognition related functions (e.g., pedometer, tap), etc. The sensor 905 may further include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., and the description thereof will be omitted here.

[0112] The display unit 906 is used to display information input by a user or information provided to a user. The display unit 906 may include a display panel 9061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0113] The user input unit 907 can be used to receive input numbers or content information, and generate key signal inputs for user settings and function control in the electronic device. Specifically, the user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071 is also called a touch screen, and can detect a user's touch operation on or near the touch panel 9071 (e.g., a user's operation on or near the touch panel 9071 with any suitable object or accessory, such as a finger, a touch pen, etc.). The touch panel 9071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects a signal due to the touch operation, and transmits it to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into touch point coordinates and transmits them to the processor 910, and receives and executes commands transmitted from the processor 910. The touch panel 9071 can also be realized in multiple types, such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 9071, the user input unit 907 may further include other input devices 9072. Specifically, the other input devices 9072 may include, but are not limited to, a physical keyboard, function buttons (e.g., volume control buttons, switch buttons, etc.), a trackball, a mouse, and an operating lever, and detailed descriptions thereof will be omitted here.

[0114] Further, the touch panel 9071 may cover the display panel 9061, and when the touch panel 9071 detects a touch operation on or near it, it transmits it to the processor 910 to identify the type of the touch event, and then the processor 910 provides a corresponding visual output on the display panel 9061 according to the type of the touch event. In FIG. 9 , the touch panel 9071 and the display panel 9061 are two separate components to realize the input / output function of the electronic device, but in some embodiments, the touch panel 9071 and the display panel 9061 may be integrated to realize the input / output function of the electronic device, and the specifics are not limited herein.

[0115] The interface unit 908 is an interface that connects an external device to the electronic device 900. For example, the external device may include a wired or wireless headphone port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with a recognition module, an audio input / output (I / O) port, a video I / O port, an earphone port, etc. The interface unit 908 can be used to receive input (e.g., data information, power, etc.) from the external device and transmit the received input to one or more components within the electronic device 900 or transmit data between the electronic device 900 and the external device.

[0116] The memory 909 can be used to store software programs and various data. The memory 909 may mainly include a program storage area capable of storing an operating system, an application required for at least one function (e.g., an audio playback function, an image playback function, etc.), and a data storage area capable of storing data created in accordance with the use of the mobile phone (e.g., audio data, a phone book, etc.). The memory 909 may also include a high-speed random access memory, and may further include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage device.

[0117] The processor 910 is the control center of the electronic device, and connects each part of the entire electronic device through various interfaces and lines, and executes or operates software programs and / or modules stored in the memory 909 and calls up data stored in the memory 909 to perform various functions and data processing of the electronic device, thereby monitoring the electronic device as a whole. The processor 910 may include one or more processing units, and optionally, an application processor that mainly processes an operating system, a user interface, and applications, and a modem processor that mainly processes wireless communication can be integrated into the processor 910. It can be understood that the modem processor does not have to be integrated into the processor 910.

[0118] The electronic device 900 may further include a power source 911 (e.g., a battery) for powering each component, and optionally, the power source 911 may be logically connected to the processor 910 via a power management system, which may further realize functions such as charging / discharging management and power consumption management.

[0119] In addition, the electronic device 900 includes some functional modules that are not shown, and detailed descriptions thereof will be omitted here.

[0120] The embodiments of the present application further provide a readable storage medium, which stores a program or command, and when the program or command is executed by a processor, each process of the above-mentioned encoding method embodiment is realized, and the same technical effect can be achieved. In order to avoid repetition, detailed description is omitted here.

[0121] Here, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or other non-transitory computer readable storage medium.

[0122] The embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface and the processor are coupled, the processor executes a program or command, and is used to realize each process of the embodiment of the encoding method described above, and can achieve the same technical effect. In order to avoid repetition, detailed description is omitted here.

[0123] It should be understood that the chips referred to in the embodiments of this application may be referred to as system level chips, system chips, chip systems, or systems on chips, and the like.

[0124] It should be noted that in this specification, the terms "comprise", "consist of" or any other variations are intended to include a non-exclusive inclusion, whereby a process, method, article, or apparatus that includes a set of elements includes not only those elements, but also other elements not expressly stated or inherent to such process, method, article, or apparatus. Unless otherwise specified, an element limited by the phrase "comprises a" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element. It should also be noted that the scope of the method and apparatus in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may include performing functions substantially simultaneously or in the reverse order depending on such functions, for example, the described method may be performed in a different order than described, and various steps may be added, omitted, or combined. Also, features described with reference to any example may be combined in other examples.

[0125] The above describes each aspect of the present application with reference to flowcharts and / or block diagrams of methods, apparatuses (systems) and computer program products according to the embodiments of the present application. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of each block in the flowcharts and / or block diagrams, can be realized by computer program commands. These computer program commands may be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing apparatus to produce a machine, such that these commands executed by the processor of the computer or other programmable data processing apparatus can realize the functions / operations specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, a special purpose processor, or a field programmable logic circuit. It should also be understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be realized by dedicated hardware that performs the specified functions or operations, or by a combination of dedicated hardware and computer commands.

[0126] From the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be realized in the form of a combination of software and a necessary common hardware platform, and of course, they can be realized by hardware, but in many cases the former is a more preferred embodiment. Based on this view, the technical solution of the present application can be substantially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM / RAM, magnetic disk, optical disk) and includes a number of commands that cause a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the embodiments of the present application.

[0127] Although the examples of the present application have been described above with reference to the drawings, the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative and not limiting. Based on the suggestions of the present application, many forms that a person skilled in the art can make without departing from the spirit of the present application and the scope of protection of the claims are all within the scope of protection of the present application.

Claims

1. determining an encoding bandwidth of the audio signal of the target frame based on an encoding bit rate of the audio signal of the target frame; determining a perceptual entropy of the audio signal of the target frame based on the coding bandwidth; and determining a bit requirement rate of the audio signal of the target frame based on the perceptual entropy; determining a target number of bits based on the bit request rate; and encoding the audio signal of the target frame based on the target number of bits.

2. determining a target number of bits based on the bit request rate, determining a current fullness of the bit pool based on a current number of available bits in the bit pool and a size of the bit pool; determining a bit pool adjustment rate for encoding the audio signal of the target frame based on the fullness, and determining a coding bit factor based on the bit request rate and the bit pool adjustment rate; and determining the target number of bits based on the coding bit factor.

3. The step of determining a perceptual entropy of the audio signal of the target frame based on the encoding bandwidth comprises: determining a number of scale factor bands of an audio signal of the target frame based on the encoding bandwidth; obtaining a perceptual entropy for each said scale factor band; and determining a perceptual entropy of the audio signal of the target frame based on the number of scale factor bands and the perceptual entropy of each of the scale factor bands.

4. determining a bit requirement rate of the audio signal of the target frame based on the perceptual entropy, obtaining an average perceptual entropy of the audio signal of a predetermined number of frames prior to the audio signal of the target frame; determining a difficulty factor of the audio signal of the target frame based on the perceptual entropy and the average perceptual entropy; and determining a bit requirement rate of the audio signal of the target frame based on the difficulty factor.

5. The step of obtaining a perceptual entropy for each of the scale factor bands comprises: determining MDCT spectral coefficients after a modified discrete cosine transform (MDCT) of the audio signal of the target frame; determining an energy of an MDCT spectral coefficient of each of the scale factor bands based on the MDCT spectral coefficients and a scale factor band offset table; and determining a perceptual entropy for each of the scale factor bands based on the energy of the MDCT spectral coefficients and a masking threshold for each of the scale factor bands.

6. an encoding bandwidth determination module for determining an encoding bandwidth of the audio signal of the target frame based on an encoding bit rate of the audio signal of the target frame; a perceptual entropy determination module for determining a perceptual entropy of the audio signal of the target frame based on the encoding bandwidth; a bit requirement determination module for determining a bit requirement rate of an audio signal of the target frame based on the perceptual entropy; an encoding module for determining a target number of bits based on the bit request rate, and encoding the audio signal of the target frame based on the target number of bits.

7. Specifically, the encoding module includes: determining a current fullness of the bit pool based on a current number of bits available in the bit pool and a size of the bit pool; determining a bit pool adjustment rate for encoding the audio signal of the target frame based on the fullness, and determining a coding bit factor based on the bit request rate and the bit pool adjustment rate; The encoding device according to claim 6, further comprising: determining the target number of bits based on the coding bit factor.

8. The perceptual entropy determination module comprises: a first determination sub-module for determining a number of scale factor bands of the audio signal of the target frame based on the encoding bandwidth; an acquisition sub-module for acquiring a perceptual entropy for each said scale factor band; and a second determination sub-module for determining a perceptual entropy of the audio signal of the target frame based on the number of scale factor bands and a perceptual entropy of each of the scale factor bands.

9. The bit requirement determination module specifically includes: obtaining an average perceptual entropy of the audio signal of a predetermined number of frames preceding the audio signal of the target frame; determining a difficulty factor of the audio signal of the target frame based on the perceptual entropy and the average perceptual entropy; The encoding device according to claim 6, further comprising: determining a bit requirement rate of the audio signal of the target frame based on the difficulty coefficient.

10. The acquisition submodule specifically includes: determining MDCT spectral coefficients after a modified discrete cosine transform (MDCT) of the audio signal of the target frame; determining an energy of an MDCT spectral coefficient of each of the scale factor bands based on the MDCT spectral coefficients and a scale factor band offset table; 9. The encoding device according to claim 8, further comprising: determining a perceptual entropy of each of the scale factor bands based on the energy of the MDCT spectral coefficients and a masking threshold of each of the scale factor bands.

11. An electronic device comprising a processor, a memory, and a program or command stored in the memory and executable on the processor, the program or command implementing the steps of the encoding method according to any one of claims 1 to 5 when executed by the processor.

12. A readable storage medium having stored thereon a program or command, the program or command being executed by a processor to implement the steps of the encoding method according to any one of claims 1 to 5.

13. Electronic device arranged to carry out the steps of the encoding method according to any one of claims 1 to 5.

14. A computer program stored on a non-volatile storage medium and adapted to implement the steps of the encoding method according to any one of claims 1 to 5 when executed by at least one processor.

15. A chip including a processor and a communication interface coupled to the processor, the processor being adapted to execute programs or commands to implement the steps of the encoding method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Audio coding system, audio coding method, audio coder using the method, recording medium, and music distribution system

    JP2002196792A

  • Audio signal encoding device and bit rate converting device thereof

    JP2008268792A

  • Audio signal encoder, method for encoding audio signal and computer program

    JP2014002403A

  • Audio coding system, audio decoder, audio coding method, and audio decoding method

    JP2014016625A

  • Reducing the complexity of detecting and encoding clustered transient events.

    JP2020525853A