Audio encoding method, apparatus, device, and storage medium

By obtaining the initial encoding bitrate and overuse penalty bitrate of the audio frame, the encoding ratio of the main frame is dynamically adjusted, which solves the problem of redundant frame encoding bitrate squeezing the main frame and improves the audio encoding quality.

CN117746872BActive Publication Date: 2025-12-26DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211124405.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-15
Publication Date
2025-12-26
Estimated Expiration
2042-09-15

AI Technical Summary

Technical Problem

In existing audio coding technologies, the bitrate of redundant frames is squeezed out of the main frame during forward error correction coding, resulting in insufficient bitrate of the main frame and noise problems.

Method used

By obtaining the initial encoding bitrate and overuse penalty bitrate of the current audio frame, the encoding ratio of the main frame is determined, and the encoding bitrate of the main frame is dynamically adjusted to reduce noise in the encoded audio.

Benefits of technology

Dynamically allocating the encoding bitrate reduces noise in the encoded audio and improves the audio encoding quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117746872B_ABST
    Figure CN117746872B_ABST
Patent Text Reader

Abstract

The embodiment of the present disclosure provides an audio encoding method, device, equipment and storage medium. The method comprises the following steps: obtaining an initial encoding code rate and an overuse penalty code rate corresponding to a current audio frame, and determining a main frame encoding proportion; determining a main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding proportion; and encoding the current audio frame according to the main frame encoding code rate to obtain main encoding audio data. The audio encoding method provided by the embodiment of the present disclosure determines the main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding proportion, and then encodes the current audio frame according to the main frame encoding code rate. The encoding code rate of each audio frame can be dynamically allocated, the encoding code rate fluctuation between audio frames is small, the noise in the encoded audio can be reduced, and the audio encoding quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the technical field of audio encoding, and in particular to an audio encoding method, device, equipment and storage medium. BACKGROUND

[0002] Audio data often has packet loss in the transmission process, and forward error correction (FEC) technology is usually used to overcome packet loss. When using FEC technology to encode, not only the information of the current frame (i.e. the main frame) is encoded, but also the information of the history frame (i.e. the redundant frame) is encoded. However, there is a significant code rate allocation defect when using FEC technology to encode. When encoding a complex audio signal, there is often a situation that the encoding code rate of the redundant frame squeezes the main frame, resulting in a serious lack of encoding code rate of the main frame, so that the encoded audio has noise. SUMMARY

[0003] Embodiments of the present disclosure provide an audio encoding method, device, equipment and storage medium, which can reduce noise in the encoded audio and improve the quality of audio encoding.

[0004] In a first aspect, the embodiments of the present disclosure provide an audio encoding method, comprising:

[0005] obtaining an initial encoding code rate and an overuse penalty code rate corresponding to a current audio frame; wherein the overuse penalty code rate is determined based on the encoding bits of the overuse of the encoded audio frame;

[0006] determining a main frame encoding ratio;

[0007] determining a main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding ratio;

[0008] encoding the current audio frame according to the main frame encoding code rate to obtain main encoded audio data.

[0009] In a second aspect, the embodiments of the present disclosure also provide an audio encoding device, characterized in comprising:

[0010] an obtaining module configured to obtain an initial encoding code rate and an overuse penalty code rate corresponding to a current audio frame; wherein the overuse penalty code rate is determined based on the encoding bits of the overuse of the encoded audio frame;

[0011] an encoding ratio determining module configured to determine a main frame encoding ratio;

[0012] a main frame encoding code rate determining module configured to determine a main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding ratio;

[0013] The encoding module is configured to encode the current audio frame according to the main frame encoding rate, to obtain main encoded audio data.

[0014] In a third aspect, the embodiments of the present disclosure further provide an electronic device, which comprises:

[0015] one or more processors;

[0016] a storage device configured to store one or more programs,

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the audio encoding method according to the embodiments of the present disclosure.

[0018] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium containing computer executable instructions, which, when executed by a computer processor, are configured to perform the audio encoding method according to the embodiments of the present disclosure.

[0019] The embodiments of the present disclosure disclose an audio encoding method, device, equipment and storage medium. An initial encoding rate and an overuse penalty rate corresponding to a current audio frame are obtained, and a main frame encoding ratio is determined. The main frame encoding rate of the current audio frame is determined according to the initial encoding rate, the overuse penalty rate and the main frame encoding ratio. The current audio frame is encoded according to the main frame encoding rate, to obtain main encoded audio data. The audio encoding method provided by the embodiments of the present disclosure determines the main frame encoding rate of the current audio frame according to the initial encoding rate, the overuse penalty rate and the main frame encoding ratio, and then encodes the current audio frame according to the main frame encoding rate. The encoding rate of each audio frame can be dynamically allocated, the encoding rate fluctuation between audio frames is small, the noise in the encoded audio can be reduced, and the audio encoding quality is improved. BRIEF DESCRIPTION OF DRAWINGS

[0020] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent upon reading the following detailed description in conjunction with the accompanying drawings, in which like reference numerals refer to like elements. It is to be understood that the drawings are designed solely for purposes of illustration and not as a definition of the limits of the disclosure, for which reference should be made only to the appended claims. Throughout the drawings, like reference numerals indicate like elements.

[0021] Figure 1 is a flowchart of an audio encoding method provided by the embodiments of the present disclosure;

[0022] Figure 2 is a structural diagram of an audio encoding device provided by the embodiments of the present disclosure;

[0023] Figure 3 is a structural diagram of an electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein; rather, these embodiments are provided so that the present disclosure can be more thoroughly and completely understood.

[0025] It should be understood that each step recited in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0026] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising but not limited to." The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." Related definitions are given below.

[0027] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.

[0028] It should be noted that the adjectives "one", "more" in the present disclosure are illustrative rather than limiting, and those skilled in the art should understand that "one" or "more" should be understood as "one or more" unless the context clearly indicates otherwise.

[0029] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are used only for illustrative purposes, and are not intended to limit the scope of the messages or information.

[0030] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained in accordance with relevant laws and regulations.

[0031] For example, in response to receiving an active request of a user, a prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require obtaining and using personal information of the user. Thus, the user can autonomously select whether to provide personal information to the software or hardware, such as an electronic device, an application program, a server or a storage medium, performing the operation of the technical solution of the present disclosure according to the prompt information.

[0032] As an optional but non-limiting implementation manner, in response to receiving an active request of a user, the manner of sending a prompt information to the user may, for example, be a pop-up window manner, in which the prompt information can be presented in a text manner. In addition, the pop-up window can also carry a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0033] It can be understood that the above notification and obtaining user authorization process is only illustrative and does not limit the implementation manner of the present disclosure, and other manners meeting relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0034] It can be understood that the data involved in the technical solution (including but not limited to the data itself, the obtaining or use of the data) should comply with the requirements of relevant laws and regulations and relevant provisions.

[0035] Figure 1 A flowchart of an audio encoding method provided by an embodiment of the present disclosure, the embodiment of the present disclosure is applicable to a case of determining an encoding code rate of each audio frame. The method can be executed by an audio encoding device, which can be implemented in the form of software and / or hardware, and can be implemented by an electronic device, which can be a mobile terminal, a PC terminal or a server, etc.

[0036] As shown in Figure 1 , the method comprises:

[0037] S110, obtaining an initial encoding code rate and an overuse penalty code rate corresponding to a current audio frame.

[0038] The initial encoding code rate can be determined by an initial encoding bit and a frame rate of audio data, and the initial encoding bit can be a pre-set bit value. In this embodiment, the initial encoding code rate can be calculated according to the following formula: initial encoding code rate = initial encoding bit * frame rate. The overuse penalty code rate is determined based on the encoding bits of the overused encoded audio frames, that is, the overuse penalty code rate can be a code rate determined according to the overused bits of the encoded audio frames.

[0039] Optionally, the manner of determining the overuse penalty code rate corresponding to the current audio frame can be: determining the total overuse bits of the encoded audio frames; determining the overuse penalty code rate according to the total overuse bits and a set overuse penalty coefficient.

[0040] The total overuse bits can be understood as the sum of the overuse bits of each encoded audio frame. The overuse penalty coefficient can be any value between 1 and 10. In the embodiment, the overuse penalty coefficient can be set to 2.

[0041] Specifically, the manner of determining the total overuse bits of the encoded audio frame can be: for each encoded audio frame, obtaining the main frame encoding bits, the initial encoding bits and the redundant frame encoding bits of the current encoded audio frame; determining the overuse bits of the current encoded audio frame according to the main frame encoding bits, the initial encoding bits and the redundant frame encoding bits; and accumulating the overuse bits of the encoded audio frame to obtain the total overuse bits.

[0042] The main frame encoding bits can be the data amount after encoding the main audio frame based on the main frame encoding parameters, the initial encoding bits can be the encoding data amount of each audio frame set in advance, and the redundant frame encoding bits can be the data amount after encoding the redundant audio frame based on the redundant encoding parameters. The redundant frame can be determined according to the FEC encoding algorithm, which is not limited here.

[0043] In the embodiment, the manner of determining the overuse bits of the current encoded audio frame according to the main frame encoding bits, the initial encoding bits and the redundant frame encoding bits can be: first summing the main frame encoding bits and the redundant frame encoding bits, then subtracting the initial encoding bits from the sum to obtain the overuse bits of the current encoded audio frame. The formula can be expressed as: overuse bits = main frame encoding bits + redundant frame encoding bits - initial encoding bits. After obtaining the overuse bits of each encoded audio frame, the overuse bits of each encoded audio frame are accumulated to obtain the total overuse bits corresponding to the current audio frame.

[0044] Specifically, the manner of determining the overuse penalty code rate according to the total overuse bits and the overuse penalty coefficient can be: multiplying the total overuse bits by the overuse penalty coefficient to obtain the overuse penalty code rate. The formula can be expressed as: overuse penalty code rate = total overuse bits * overuse penalty coefficient.

[0045] S120, determining the main frame encoding ratio.

[0046] The main frame encoding ratio can be understood as the ratio between the main frame encoding data amount and the total encoding data amount, i.e. the ratio between the main frame bits and the total encoding bits, wherein the total encoding bits are the sum of the main frame encoding bits and the redundant frame encoding bits.

[0047] Optionally, the manner of determining the main frame encoding ratio corresponding to the current audio frame can be: determining the preset main frame encoding ratio as the final main frame encoding ratio.

[0048] Exemplarily, the preset main frame encoding ratio can be set to any value between 50% and 80%. Determining the preset main frame encoding ratio as the final main frame encoding ratio can be understood as: each audio frame adopts the preset main frame encoding ratio, i.e., adopts a fixed main frame encoding ratio. Exemplarily, the preset main frame encoding ratio is set to 70%, and then each audio frame adopts the main frame encoding ratio of 70% to determine the main frame encoding code rate.

[0049] Optionally, the manner of determining the main frame encoding ratio corresponding to the current audio frame can be: determining a total overuse bit of the coded audio frames, determining a first adjustment amount according to the total overuse bit and a first setting value, and adjusting the preset main frame encoding ratio according to the first adjustment amount to obtain the final main frame encoding ratio.

[0050] The total overuse bit can be understood as the sum of the overuse bits of the coded audio frames, and the manner of determining the total overuse bit can refer to the above embodiment, which will not be described here. The first setting value can be set to any value between 1 and 1000, for example, can be set to 100. The manner of determining the first adjustment amount according to the total overuse bit and the first setting value can be: dividing the total overuse bit by the first setting value, and dividing the result of the division by 100 to obtain the first adjustment amount. The calculation formula of the first adjustment amount can be: first adjustment amount = (total overuse bit / first setting value)%. The manner of adjusting the preset main frame encoding ratio according to the first adjustment amount can be: subtracting the first adjustment amount from the preset main frame encoding ratio to obtain the final main frame encoding ratio. In this embodiment, if the total overuse bit is greater than 0, it indicates that the encoding data amount is overused, the calculated first adjustment amount is positive, and subtracting the first adjustment amount from the preset main frame encoding ratio can be understood as adjusting the main frame encoding ratio to be smaller. If the total overuse bit is less than 0, it indicates that the encoding data amount is underused, the calculated first adjustment amount is negative, and subtracting the first adjustment amount from the preset main frame encoding ratio can be understood as adjusting the main frame encoding ratio to be larger. If the total overuse bit is equal to 0, it indicates that the encoding data amount is neither overused nor underused, the calculated first adjustment amount is 0, and subtracting the first adjustment amount from the preset main frame encoding ratio can be understood as keeping the main frame encoding ratio unchanged. In this embodiment, adjusting the main frame encoding ratio based on the total overuse bit can dynamically adjust the main frame encoding ratio, thereby dynamically allocating the encoding code rate.

[0051] Optionally, the manner of determining the main frame encoding ratio corresponding to the current audio frame can be: obtaining an overuse bit of a previous audio frame, determining a second adjustment amount according to the overuse bit of the previous audio frame and a second setting value, and adjusting the preset main frame encoding ratio according to the second adjustment amount to obtain the final main frame encoding ratio.

[0052] The previous audio frame is an already encoded audio frame, and is a previous audio frame adjacent to the current audio frame. The manner of obtaining the overuse bits of the previous audio frame can be: first obtaining the main frame encoding bits, initial encoding bits and redundant frame encoding bits of the previous audio frame, then summing the main frame encoding bits and the redundant frame encoding bits of the previous audio frame, and then subtracting the sum from the initial encoding bits to obtain the overuse bits of the previous audio frame.

[0053] The second setting value can be less than the first setting value, and can be set to any value between 1 and 100, for example, 50. The manner of determining the second adjustment value according to the overuse bits of the previous audio frame and the second setting value can be: dividing the overuse bits of the previous audio frame by the second setting value, and then dividing the result of the division by 100 to obtain the second adjustment value. The calculation formula of the second adjustment value can be: second adjustment value = (overuse bits of the previous audio frame / second setting value)%. The manner of adjusting the preset main frame encoding ratio according to the second adjustment value can be: subtracting the second adjustment value from the preset main frame encoding ratio to obtain the final main frame encoding ratio. In this embodiment, if the overuse bits of the previous audio frame are greater than 0, it indicates that the encoding data amount of the previous audio frame is overused, the calculated second adjustment value is positive, and subtracting the second adjustment value from the preset main frame encoding ratio can be understood as reducing the main frame encoding ratio. If the overuse bits of the previous audio frame are less than 0, it indicates that the encoding data amount of the previous audio frame is underused, the calculated second adjustment value is negative, and subtracting the second adjustment value from the preset main frame encoding ratio can be understood as increasing the main frame encoding ratio. If the overuse bits of the previous audio frame are equal to 0, it indicates that the encoding data amount of the previous audio frame is neither overused nor underused, the calculated second adjustment value is 0, and subtracting the second adjustment value from the preset main frame encoding ratio can be understood as keeping the main frame encoding ratio unchanged. In this embodiment, the main frame encoding ratio is adjusted based on the overuse bits of the previous audio frame, the main frame encoding ratio can be dynamically adjusted, and thus the encoding code rate can be dynamically allocated.

[0054] S130, determining the main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding ratio.

[0055] Specifically, the process of determining the main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding ratio can be: multiplying the initial encoding code rate by the main frame encoding ratio to obtain a product result; and subtracting the product result from the overuse penalty code rate to obtain the main frame encoding code rate of the current audio frame.

[0056] In this embodiment, the formula of determining the main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding ratio can be: main frame encoding code rate = initial encoding code rate*main frame encoding ratio-overuse penalty code rate. The main frame encoding code rate of each audio frame can be dynamically determined.

[0057] Specifically, the process of determining the main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding proportion can be: subtracting the initial encoding code rate from the overuse penalty code rate to obtain a subtraction result; multiplying the subtraction result by the main frame encoding proportion to obtain the main frame encoding code rate of the current audio frame.

[0058] In this embodiment, the formula for determining the main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding proportion can be: main frame encoding code rate = (initial encoding code rate - overuse penalty code rate) * main frame encoding proportion. The main frame encoding code rate of each audio frame can be dynamically determined.

[0059] S140, encoding the current audio frame according to the main frame encoding code rate to obtain main encoded audio data.

[0060] In this embodiment, the process of encoding the current audio frame according to the main frame encoding code rate can be: determining the main frame encoding parameter according to the main frame encoding code rate, and encoding the current audio frame according to the main frame encoding parameter.

[0061] Wherein, the corresponding main frame encoding parameter is obtained by looking up the table according to the main frame encoding code rate. The process of encoding the current audio frame according to the main frame encoding parameter can be: dividing the excitation signal by the main frame encoding parameter to obtain the main frame signal-to-noise ratio, and encoding the current audio frame based on the main frame signal-to-noise ratio.

[0062] Optionally, after encoding the current audio frame according to the main frame encoding code rate, it further includes the following steps: determining the redundant frame encoding parameter according to the main frame encoding code rate and the set redundancy gain; encoding the redundant audio frame corresponding to the current audio frame according to the redundant frame encoding parameter to obtain redundant encoded audio data.

[0063] Wherein, the set redundancy gain can reflect the proportion between the main frame and the redundant frame, for example: 6:4 or 7:3, etc., which can be set by the user according to the encoding requirement.

[0064] Specifically, the process of determining the redundant frame encoding parameter according to the main frame encoding code rate and the set redundancy gain can be: first obtaining the main frame encoding parameter according to the main frame encoding code rate, and then accumulating the main frame encoding parameter and the set redundancy gain to obtain the redundant frame encoding parameter. The calculation formula can be: redundant frame encoding parameter = main frame encoding parameter + set redundancy gain. The process of encoding the redundant audio frame corresponding to the current audio frame according to the redundant frame encoding parameter can be: dividing the excitation signal by the redundant frame encoding parameter to obtain the redundant frame signal-to-noise ratio, and encoding the redundant frame corresponding to the current audio frame based on the redundant frame signal-to-noise ratio.

[0065] The technical scheme of the embodiment of the present disclosure determines an initial encoding code rate corresponding to a current audio frame, an overuse penalty code rate, and a main frame encoding proportion; determines a main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate, and the main frame encoding proportion; and encodes the current audio frame according to the main frame encoding code rate to obtain main encoded audio data. The audio encoding method provided by the embodiment of the present disclosure determines the main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate, and the main frame encoding proportion, so that the current audio frame is encoded according to the main frame encoding code rate, the encoding code rate of each audio frame can be dynamically allocated, the encoding code rate fluctuation between audio frames is small, the noise in the encoded audio can be reduced, and thus the audio encoding quality is improved.

[0066] Figure 2 An audio encoding device provided by the embodiment of the present disclosure is shown in a structural schematic diagram as shown in Figure 2 The device comprises:

[0067] The acquisition module 210 is configured to acquire an initial encoding code rate corresponding to a current audio frame and an overuse penalty code rate; wherein the overuse penalty code rate is determined based on the encoding bits of the overuse of the encoded audio frame.

[0068] The encoding proportion determination module 220 is configured to determine a main frame encoding proportion.

[0069] The main frame encoding code rate determination module 230 is configured to determine a main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate, and the main frame encoding proportion.

[0070] The encoding module 240 is configured to encode the current audio frame according to the main frame encoding code rate to obtain main encoded audio data.

[0071] Optionally, the encoding proportion determination module 220 is further configured to:

[0072] determine a preset main frame encoding proportion as a final main frame encoding proportion.

[0073] Optionally, the encoding proportion determination module 220 is further configured to:

[0074] determine a first adjustment amount according to the total overuse bits and a first setting value;

[0075] adjust the preset main frame encoding proportion according to the first adjustment amount to obtain a final main frame encoding proportion.

[0076] Optionally, the encoding proportion determination module 220 is further configured to:

[0077] acquire the overuse bits of a previous audio frame;

[0078] determining a second adjustment amount according to the overuse bit of the previous audio frame and a second set value;

[0079] adjusting the preset main frame encoding ratio according to the second adjustment amount to obtain a final main frame encoding ratio.

[0080] Optionally, the main frame encoding rate determining module 230 is further configured to:

[0081] multiply the initial encoding rate by the main frame encoding ratio to obtain a product result;

[0082] subtract the product result from the overuse penalty code rate to obtain the main frame encoding rate of the current audio frame.

[0083] Optionally, the main frame encoding rate determining module 230 is further configured to:

[0084] subtract the initial encoding rate from the overuse penalty code rate to obtain a subtraction result;

[0085] multiply the subtraction result by the main frame encoding ratio to obtain the main frame encoding rate of the current audio frame.

[0086] Optionally, the apparatus further comprises a redundant frame encoding module configured to:

[0087] determine a redundant frame encoding parameter according to the main frame encoding rate and a set redundant gain;

[0088] encode a redundant audio frame corresponding to the current audio frame according to the redundant frame encoding parameter to obtain redundant encoded audio data.

[0089] The audio encoding apparatus provided in the embodiments of the present disclosure can perform the audio encoding method provided in any of the embodiments of the present disclosure, and has the corresponding function modules and beneficial effects of the execution method.

[0090] It should be noted that each unit and module included in the apparatus is only divided according to the function logic, and is not limited to the above division, as long as the corresponding function can be implemented; in addition, the specific name of each functional unit is only for convenient mutual distinction, and is not used to limit the protection scope of the embodiments of the present disclosure.

[0091] Figure 3 A structural schematic diagram of an electronic device provided in the embodiments of the present disclosure is shown in FIG. 1. Hereinafter, the structural schematic diagram of the electronic device provided in the embodiments of the present disclosure will be described with reference to FIG. 1. Figure 3 FIG. 1 shows an electronic device (for example, a mobile phone) suitable for implementing the embodiments of the present disclosure. Figure 3FIG. 1 is a structural diagram of an electronic device 300 according to an embodiment of the present disclosure. The electronic device 300 can include a communication unit 310, a control unit 320, and a storage unit 330. The communication unit 310 can include a communication interface (e.g., an antenna) for communicating with an external device (e.g., a server or a terminal device). The control unit 320 can include a processor (e.g., a central processing unit (CPU), a microprocessor, a microcomputer, etc.) for controlling an overall operation of the electronic device 300. The storage unit 330 can include a memory (e.g., a random access memory (RAM), a read only memory (ROM), a flash memory, a hard disk drive, etc.) for storing various data and programs. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.

[0092] As shown in FIG. 1, the electronic device 300 can include a processing device (e.g., a central processing unit, a graphic processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An edit / output (I / O) interface 305 is also connected to the bus 304. Figure 3

[0093] Generally, the following devices can be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 can allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 300 having various devices is shown, but it is understood that all of the shown devices are not required to be implemented or provided. More or less devices can be alternatively implemented or provided.

[0094] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product including a computer program carried on a non-transitory computer readable medium, the computer program containing program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-described functions defined in the methods of the embodiments of the present disclosure are performed.

[0095] ​Names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of the messages or information.

[0096] The electronic device provided by the embodiments of the present disclosure and the audio encoding method provided by the above embodiments belong to the same inventive concept, and the technical details not described in detail in the present embodiment can be referred to the above embodiments, and the present embodiment has the same beneficial effects as the above embodiments.

[0097] The computer storage medium provided by the embodiments of the present disclosure has a computer program stored thereon, and the program is executed by a processor to implement the audio encoding method provided by the above embodiments.

[0098] It should be noted that the computer readable medium of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is 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 can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or 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 disclosure, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, an RF (radio frequency) or the like, or any suitable combination of the above.

[0099] In some embodiments, the client, server, or other computing machines can communicate using any known or later developed form of computer-readable media, including but not limited to wireless media, wire-based media, optical-based media, and the like. In some embodiments, the client, server, or other computing machines can communicate using any current or later developed network protocol, such as the HyperText Transfer Protocol (HTTP) and / or the like, and can be interconnected with any form or medium of digital data communication (for example, a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet, and peer-to-peer networks (for example, ad hoc peer-to-peer networks), as well as any current or later developed network.

[0100] The computer-readable medium described above can be included in the electronic device described above; alternatively, the computer-readable medium can exist as a standalone entity.

[0101] The computer-readable medium described above can carry one or more programs which, when executed by the electronic device described above, cause the electronic device to:

[0102] The computer-readable medium described above can carry one or more programs which, when executed by the electronic device described above, cause the electronic device to: obtain an initial encoding bit rate and an overuse penalty bit rate corresponding to a current audio frame; determine a main frame encoding ratio; determine a main frame encoding bit rate of the current audio frame according to the initial encoding bit rate, the overuse penalty bit rate, and the main frame encoding ratio; and encode the current audio frame according to the main frame encoding bit rate to obtain main encoded audio data.

[0103] Computer program code for carrying out operations of the present disclosure can be written in any one or more of a number of programming languages or combinations of languages including an object-oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network ("LAN") or a wide area network ("WAN"), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0104] The flow and block diagrams in the drawings represent possible architectural, functional, and operational architectures of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, a segment, or a portion of code that comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may

[0105] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself. For example, the first obtaining unit can also be described as a unit for obtaining at least two Internet protocol addresses.

[0106] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, non-limiting examples of exemplary types of hardware logic components that can be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SOCs), complex programmable logic devices (CPLDs), etc.

[0107] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0108] According to one or more embodiments of the present disclosure, an audio encoding method is provided, comprising:

[0109] obtaining an initial encoding bit rate corresponding to the current audio frame and an overuse penalty bit rate, wherein the overuse penalty bit rate is determined based on the encoding bits overused by the encoded audio frame;

[0110] determining a main frame encoding ratio;

[0111] determining a main frame encoding bit rate of the current audio frame according to the initial encoding bit rate, the overuse penalty bit rate and the main frame encoding ratio;

[0112] encoding the current audio frame according to the main frame encoding bit rate to obtain main encoded audio data.

[0113] Further, the determination of the main frame encoding ratio corresponding to the current audio frame comprises:

[0114] determining the preset main frame encoding ratio as the final main frame encoding ratio.

[0115] Further, the determination of the main frame encoding ratio corresponding to the current audio frame comprises:

[0116] determining a first adjustment amount according to the total overuse bits and a first setting value;

[0117] adjusting the preset main frame encoding ratio according to the first adjustment amount to obtain the final main frame encoding ratio.

[0118] Further, the determination of the main frame encoding ratio corresponding to the current audio frame comprises:

[0119] obtaining overuse bits of a previous audio frame;

[0120] determining a second adjustment amount according to the overuse bits of the previous audio frame and a second setting value;

[0121] adjusting the preset main frame encoding ratio according to the second adjustment amount to obtain the final main frame encoding ratio.

[0122] Further, the determination of the main frame encoding bit rate of the current audio frame according to the initial encoding bit rate, the overuse penalty bit rate and the main frame encoding ratio comprises:

[0123] multiplying the initial encoding bit rate by the main frame encoding ratio to obtain a product result;

[0124] subtracting the overuse penalty bit rate from the product result to obtain the main frame encoding bit rate of the current audio frame.

[0125] Further, the determination of the main frame encoding bit rate of the current audio frame according to the initial encoding bit rate, the overuse penalty bit rate and the main frame encoding ratio comprises:

[0126] obtaining a difference result by subtracting the initial coding rate from the overuse penalty coding rate;

[0127] multiplying the difference result by the main frame coding ratio to obtain a main frame coding rate of the current audio frame.

[0128] Further, after encoding the current audio frame according to the main frame coding rate, further comprising:

[0129] determining a redundant frame coding parameter according to the main frame coding rate and a set redundancy gain;

[0130] encoding a redundant audio frame corresponding to the current audio frame according to the redundant frame coding parameter to obtain redundant encoded audio data.

[0131] The above description is merely preferred embodiments of the present disclosure and a description of the principles of the technology employed. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and also covers other technical solutions formed by the combinations of the above technical features or equivalent features thereof without departing from the above disclosed concept. For example, the technical solutions formed by the mutual replacement of the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions.

[0132] Further, although each operation is depicted in a particular, sequential order, this should not be understood as requiring such order unless specifically specified that an order is "critical". One of ordinary skill in the art will recognize that many of the operations can be performed in a different order and still accomplish the desired results. Also, the above description is merely exemplary of the great number of applications of the present disclosure that require no more than the use of the principles hereof. Additionally, the features of the various implementations described above can be combined in different combinations from those described, to produce other implementations. The descriptions of the various implementations are not meant to limit the scope of the disclosure but merely to provide examples of the many possible implementations of the disclosure. The scope of the disclosure is limited only by the claims.

[0133] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims

1. An audio encoding method, characterized by, The method comprises: obtaining an initial encoding code rate corresponding to a current audio frame and an overuse penalty code rate, wherein the overuse penalty code rate is determined based on the encoding bits of the overuse of the encoded audio frame; determining a main frame encoding proportion; determining a main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding proportion; encoding the current audio frame according to the main frame encoding code rate to obtain main encoded audio data.

2. The method of claim 1, wherein, The method comprises: determining a preset main frame encoding proportion as a final main frame encoding proportion.

3. The method of claim 2, wherein, The method comprises: determining a total overuse bit of the encoded audio frame; determining a first adjustment amount according to the total overuse bit and a first setting value; adjusting the preset main frame encoding proportion according to the first adjustment amount to obtain a final main frame encoding proportion.

4. The method of claim 2, wherein, The method comprises: obtaining an overuse bit of a previous audio frame; determining a second adjustment amount according to the overuse bit of the previous audio frame and a second setting value; adjusting the preset main frame encoding proportion according to the second adjustment amount to obtain a final main frame encoding proportion.

5. The method of claim 1, wherein, The method comprises: multiplying the initial encoding code rate and the main frame encoding proportion to obtain a product result; subtracting the product result from the overuse penalty code rate to obtain the main frame encoding code rate of the current audio frame.

6. The method of claim 1, wherein, The method comprises: subtracting the initial encoding code rate from the overuse penalty code rate to obtain a subtraction result; multiplying the subtraction result and the main frame encoding proportion to obtain the main frame encoding code rate of the current audio frame.

7. The method of claim 1, wherein, After the current audio frame is encoded according to the main frame encoding code rate, the method further comprises: determining a redundancy frame encoding parameter according to the main frame encoding code rate and a set redundancy gain; encoding a redundancy audio frame corresponding to the current audio frame according to the redundancy frame encoding parameter to obtain redundancy encoded audio data.

8. An audio encoding apparatus characterized by comprising: The method comprises: obtaining a module for obtaining an initial encoding code rate corresponding to a current audio frame and an overuse penalty code rate, wherein the overuse penalty code rate is determined based on the encoding bits of the overuse of the encoded audio frame; an encoding proportion determination module for determining a main frame encoding proportion; a main frame encoding code rate determination module for determining a main frame encoding code rate of the current audio frame according to the initial encoding code rate, the overuse penalty code rate and the main frame encoding proportion; an encoding module for encoding the current audio frame according to the main frame encoding code rate to obtain main encoded audio data.

9. An electronic device, comprising: The electronic device comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the audio encoding method of any one of claims 1-7.

10. A storage medium containing computer-executable instructions for performing the audio encoding method of any one of claims 1-7 when executed by a computer processor.

Citation Information

Patent Citations

  • Coding method and device for realizing ultra-low coding rate, storage medium and equipment

    CN112735452A

  • Audio code rate determination method and device, storage medium and electronic equipment

    CN113450808A