Method and device for increasing volume of audio system, electronic equipment and storage medium
By blocking and interpolation amplifying the multi-channel pulse coded modulation data in the audio system, the problem of limited loudness output in the prior art is solved, and the adaptation and loudness improvement of the audio system and multi-channel hardware are achieved.
Patent Information
- Application Number
- CN202411007510.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-12
AI Technical Summary
When using Dolby decoding library, existing audio systems are unable to fully utilize the capabilities of multi-channel hardware devices, resulting in limited loudness output, unable to reach the maximum value, and abnormal loudness problems.
By obtaining the decoded multi-channel pulse code modulation data, dividing it into fixed blocks according to the preset sampling length, the characteristics of each block are obtained, and the target interpolation segment is determined according to the characteristics of the current and next blocks, and the sub-channel blocks are interpolated and amplified. Processing, eventually adding the enlarged data to the renderer.
Adapt the audio system's playback loudness and multi-channel hardware capabilities to avoid abnormal loudness, improve user experience, and exert the device's multi-channel playback capabilities.
Smart Images

Figure CN118945588A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a method, device, electronic device and storage medium for increasing the volume of an audio system. Background Art
[0002] With the continuous upgrading of playback hardware capabilities, some devices support multi-channel output features such as 5.1. If the decoding library solution provided by Dolby is used for iOS and Mac Dolby audio playback, such as the downmix solution, the multi-channel capabilities of some hardware devices cannot be fully utilized. If the system default playback solution is used, only a limited number of audio loudness outputs can be supported, and abnormal loudness may occur, and the maximum output loudness cannot be reached, and the multi-channel capabilities of the device cannot be fully utilized. Summary of the invention
[0003] The present application provides a method, device, electronic device and storage medium for increasing the volume of an audio system, so as to solve the problem of how to improve the multi-channel performance of the audio system.
[0004] In a first aspect, the present application provides a method for increasing the volume of an audio system, the method comprising:
[0005] Obtain decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M;
[0006] Dividing the multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length; wherein each of the fixed blocks includes M sub-channel blocks;
[0007] Obtaining a block feature corresponding to each of the fixed blocks, and performing the following processing on each of the fixed blocks in turn: determining a target interpolation line segment corresponding to each channel according to the block feature of the current fixed block and the block feature of the next fixed block of the current fixed block; performing interpolation and amplification processing on the sub-channel block corresponding to the channel according to the target interpolation line segment, so as to obtain amplified data of the current fixed block after completing the interpolation and amplification processing of all the sub-channel blocks;
[0008] Add the magnification data of all said fixed blocks to the renderer.
[0009] Optionally, obtaining a block feature corresponding to each of the fixed blocks includes:
[0010] Obtaining sub-features corresponding to the sub-channel block;
[0011] A block feature of the fixed block is determined based on the M sub-features.
[0012] Optionally, obtaining a sub-feature corresponding to the sub-channel block includes:
[0013] Get the preset gain threshold;
[0014] Obtaining a maximum value of target elements included in the sub-channel block;
[0015] The sub-feature corresponding to the sub-channel block is determined according to the maximum value of the target element and the gain threshold.
[0016] Optionally, determining the sub-feature corresponding to the sub-channel block according to the maximum value of the target element and the gain threshold includes:
[0017] If the absolute value of the maximum value of the target element is greater than the gain threshold, taking the absolute value of the maximum value of the target element as the sub-feature of the sub-channel block;
[0018] If the absolute value of the maximum value of the target element is less than or equal to the gain threshold, zero is used as the sub-feature of the sub-channel block.
[0019] Optionally, obtaining a preset gain threshold includes:
[0020] Get the preset amplification peak and gain parameters;
[0021] Determine the amplification factor according to the gain parameter;
[0022] The quotient of the amplification peak value and the amplification factor is used as the preset gain threshold.
[0023] Optionally, determining a target interpolation line segment corresponding to each channel according to a block feature of a current fixed block and a block feature of a next fixed block of the current fixed block includes:
[0024] Acquire the mixing feature of the current fixed block, and acquire the mixing feature of the next fixed block;
[0025] A target interpolation line segment corresponding to each channel of the current fixed block is determined according to the block feature of the current fixed block, the mixing feature of the current fixed block, the block feature of the next fixed block, and the mixing feature of the next fixed block.
[0026] Optionally, obtaining the mixing feature of the current fixed block includes:
[0027] Get the preset channel weight information and maximum mixing gain;
[0028] Determine a mixing upper limit value of a current sample according to the channel weight information and the amplification factor;
[0029] The mixing feature of the current fixed block is determined according to the mixing upper limit value, the amplification factor and the maximum mixing gain value.
[0030] Optionally, determining a target interpolation line segment corresponding to each channel of the current fixed block according to a block feature of the current fixed block, a mixing feature of the current fixed block, a block feature of the next fixed block, and a mixing feature of the next fixed block includes:
[0031] Obtaining a preset target channel interpolation coefficient corresponding to the target channel;
[0032] Determine a target sub-feature of a current fixed block corresponding to the target channel and a target sub-feature of a next fixed block corresponding to the target channel;
[0033] If the target sub-feature of the current fixed block is zero and the target sub-feature of the next fixed block is zero, determining that the first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to the target channel interpolation coefficient;
[0034] If the target sub-feature of the current fixed block is greater than the target sub-feature of the next fixed block, determining that the first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to the target channel interpolation coefficient;
[0035] If the target sub-feature of the current fixed block is less than or equal to the target sub-feature of the next fixed block, and the target sub-feature of the current fixed block is greater than zero, determining that a first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to a quotient of the amplified peak value and the target sub-feature of the next fixed block;
[0036] Calculating a minimum value among a first block interpolation coefficient of the sub-channel block, a mixing feature of the current fixed block, and a mixing feature of the next fixed block, and using the minimum value as a block interpolation coefficient of the sub-channel block;
[0037] The target interpolation line segment corresponding to the target channel is determined according to the block interpolation coefficient of the sub-channel block and a preset interpolation line segment.
[0038] Optionally, determining the target interpolation line segment corresponding to the target channel according to the block interpolation coefficient of the sub-channel block and a preset interpolation line segment includes:
[0039] Acquire the preset interpolation line segment; wherein the interpolation line segment includes a first point coordinate representing a starting point of the line segment and a second point coordinate representing an end point of the line segment;
[0040] Updating the first point coordinates according to the target interpolation coefficient of the target channel;
[0041] updating the coordinates of the second point according to the block interpolation coefficient of the sub-channel block;
[0042] The target interpolation line segment is determined according to the first point coordinates and the second point coordinates.
[0043] Optionally, obtaining decoded multi-channel pulse code modulation data includes:
[0044] Obtain decoded pulse code modulation data;
[0045] If the pulse code modulation data is dual-channel data, up-sampling the pulse code modulation data to obtain the multi-channel pulse code modulation data;
[0046] If the pulse code modulation data is multi-channel data, the pulse code modulation data is used as the multi-channel pulse code modulation data.
[0047] Optionally, performing upsampling processing on the pulse code modulation data to obtain the multi-channel pulse code modulation data includes:
[0048] Get the left and right channel scaling weights and the center channel scaling weights;
[0049] Acquire left channel data and right channel data included in the pulse code modulation data;
[0050] The multi-channel pulse code modulation data is generated according to the left channel data, the right channel data, the left and right channel scaling weights and the center channel scaling weight.
[0051] In a second aspect, the present application provides a device for increasing the volume of an audio system, the device comprising:
[0052] An acquisition module, used for acquiring decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M;
[0053] A division module, used for dividing the multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length; wherein each of the fixed blocks includes M sub-channel blocks;
[0054] a processing module, configured to obtain a block feature corresponding to each of the fixed blocks, and sequentially perform the following processing on each of the fixed blocks: determining a target interpolation line segment corresponding to each channel according to the block feature of the current fixed block and the block feature of the next fixed block of the current fixed block; and performing interpolation and amplification processing on the sub-channel blocks corresponding to the channel according to the target interpolation line segment, so as to obtain amplified data of the current fixed block after completing the interpolation and amplification processing of all the sub-channel blocks;
[0055] An adding module is used for adding the magnification data of all the fixed blocks to the renderer.
[0056] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0057] Memory, used to store computer programs;
[0058] The processor is used to implement the method for increasing the volume of the audio system described in any one of the embodiments of the first aspect when executing the program stored in the memory.
[0059] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for increasing the volume of an audio system as described in any one of the embodiments of the first aspect is implemented.
[0060] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application obtains decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M; the multi-channel pulse code modulation data is divided into X fixed blocks according to a preset sampling length; wherein each of the fixed blocks includes M sub-channel blocks; the block features corresponding to each of the fixed blocks are obtained, and the following processing is performed on each of the fixed blocks in turn: the target interpolation segment corresponding to each channel is determined according to the block features of the current fixed block and the block features of the next fixed block of the current fixed block; the sub-channel blocks corresponding to the channel are interpolated and amplified according to the target interpolation segment, so as to obtain the amplified data of the current fixed block after completing the interpolation and amplification processing of all the sub-channel blocks; the amplified data of all the fixed blocks are added to the renderer. The method divides the decoded multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length, obtains the block features corresponding to each fixed block, determines the target interpolation line segment corresponding to each channel according to the block features of the current fixed block and the block features of the next fixed block, and then performs interpolation and amplification processing on the sub-channel block corresponding to the channel according to the target interpolation line segment. After completing the interpolation and amplification processing of all fixed blocks, the amplified data of all fixed blocks are added to the renderer, so that the playback loudness of the audio system can be adapted to the hardware capability of multi-channel playback, thereby giving full play to the multi-channel capability of the device, avoiding loudness abnormality, and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0063] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0064] Figure 1 A flowchart of a method for increasing the volume of an audio system provided by an embodiment of the present application;
[0065] Figure 2 A flowchart of a method for increasing the volume of an audio system provided by another embodiment of the present application;
[0066] Figure 3 A flowchart of a method for increasing the volume of an audio system provided by another embodiment of the present application;
[0067] Figure 4 A schematic diagram of the structure of a device for increasing the volume of an audio system provided by an embodiment of the present application;
[0068] Figure 5 A schematic diagram of the structure of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0070] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0071] In order to solve the technical problem of how to improve the multi-channel performance of an audio system in the prior art, the present application provides a method, device, electronic device and storage medium for increasing the volume of an audio system, which can adapt the playback loudness of the audio system to the hardware capabilities of multi-channel playback, thereby giving full play to the multi-channel capabilities of the device, avoiding abnormal loudness, and improving the user experience.
[0072] The first embodiment of the present application provides a method for increasing the volume of an audio system, such as Figure 1 , the method for increasing the volume of the audio system includes:
[0073] Step 101, obtaining decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M.
[0074] The multi-channel referred to in this embodiment is a multi-channel greater than two channels, such as three channels, four channels, six channels, eight channels, etc. In the following embodiments, M is equal to 6, that is, six channels are used as an example for illustration, which does not represent a limitation on the number of channels of the multi-channel.
[0075] In one embodiment, obtaining decoded multi-channel pulse code modulation data includes: obtaining decoded pulse code modulation data; if the pulse code modulation data is dual-channel data, upsampling the pulse code modulation data to obtain multi-channel pulse code modulation data; if the pulse code modulation data is multi-channel data, using the pulse code modulation data as multi-channel pulse code modulation data.
[0076] In this embodiment, the compressed audio data is first decoded to obtain pulse code modulation (PCM) data. If the PCM data is dual-channel data, the PCM data is upsampled to obtain multi-channel PCM data. If the PCM data is multi-channel data, the PCM data is used as multi-channel PCM data.
[0077] With the continuous iteration of hardware capabilities, most devices have begun to support multi-channel rendering. For example, iOS, Mac and other devices support 5.1 surround sound playback. In traditional two-channel playback, if the decoded two channels are sent to built-in or Bluetooth audio output devices without processing, the capabilities of the current device hardware cannot be brought into play, and the sound encapsulation is too poor. The method of this embodiment proposes a method of upsampling two-channel data into multi-channel PCM data. At the same time, through the limitation of sound gain control and compressor, the output of its loudness can be selected according to different scenarios, so that users can experience the immersive feeling of encapsulation when listening to two-channel audio using iOS, Mac and other devices. Of course, if the compressed audio data is decoded as multi-channel PCM data, no upsampling processing is required.
[0078] In one embodiment, pulse code modulation data is upsampled to obtain multi-channel pulse code modulation data, including: obtaining left and right channel scaling weights and middle channel scaling weights; obtaining left channel data and right channel data included in the pulse code modulation data; and generating multi-channel pulse code modulation data according to the left channel data, the right channel data, the left and right channel scaling weights and the middle channel scaling weights.
[0079] In this embodiment, the preset left and right channel scaling weights w are obtained. LR and the middle channel scaling weight w c , get the left channel data and right channel data included in the PCM data, and set the i-th sample of the original data to: (src 0i , src 1i ), that is, src 0i Indicates the corresponding left channel data, src 1i Represents right channel data. The process of generating six-channel PCM data according to left channel data, right channel data, left and right channel scaling weights, and middle channel scaling weights can be as follows, that is, each sample undergoes the following operations:
[0080] x 0i =w LR *src 0i
[0081] x 2i =w LR *src 1i
[0082] x 1i =w c *(x 0i +x 2i )
[0083] x 5i =x 1i
[0084] x 3i =x 0i -x 2i
[0085] x 4i =-(x 0i -x 2i )
[0086] Get the generated multi-channel data (x 0i , x 1i , x 2i , x 3i , x 4i , x 5i), it should be noted again that the upsampling process here takes six channels as an example, which does not represent a limitation thereto, and in fact, the two-channel data can be upsampled into other multi-channel PCM data.
[0087] Step 102: divide the multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length; wherein each fixed block includes M sub-channel blocks.
[0088] The decoded multi-channel PCM data can be divided into X fixed blocks, each of which has a sampling length of N. Each sample contains 6 channels (including 6 channels but not limited to 6 channels). Taking the i-th sample as an example, (x 0i , x 1i , x 2i , x 3i , x 4i , x 5i ) correspond to the left channel, center channel, right channel, left surround, right surround, and subwoofer respectively (taking 6 channels as an example, it is not limited to 6 channels, the processing method for non-6 channels is the same).
[0089] Step 103, obtaining the block features corresponding to each fixed block, and performing the following processing on each fixed block in turn: determining the target interpolation segment corresponding to each channel according to the block features of the current fixed block and the block features of the next fixed block of the current fixed block; performing interpolation and amplification processing on the sub-channel blocks corresponding to the channel according to the target interpolation segment, so as to obtain the amplified data of the current fixed block after completing the interpolation and amplification processing of all sub-channel blocks.
[0090] In one embodiment, obtaining a block feature corresponding to each fixed block includes: obtaining a sub-feature corresponding to a sub-channel block; and determining a block feature of the fixed block based on the M sub-features.
[0091] In this embodiment, taking the i-th sample as an example, (x 0i , x 1i , x 2i , x 3i , x 4i , x 5i ) correspond to six sub-channel blocks, namely, left channel, middle channel, right channel, left surround, right surround, and subwoofer, and the sub-features of each sub-channel block are obtained, and the block features of the fixed block can be determined based on the M sub-features.
[0092] In one embodiment, obtaining a sub-feature corresponding to a sub-channel block includes: obtaining a preset gain threshold; obtaining a maximum value of a target element included in the sub-channel block; and determining the sub-feature corresponding to the sub-channel block according to the maximum value of the target element and the gain threshold.
[0093] In this embodiment, a preset gain threshold threshold may be first obtained. Since the length of the fixed block is N, each sub-channel block also includes N target elements. The maximum value of the N target elements included in the sub-channel block is obtained, and the sub-feature corresponding to the sub-channel block is determined based on the maximum value of the target element and the gain threshold.
[0094] In one embodiment, obtaining a preset gain threshold includes: obtaining a preset amplification peak value and a gain parameter; determining an amplification factor according to the gain parameter; and using a quotient of the amplification peak value and the amplification factor as the preset gain threshold.
[0095] In this embodiment, the amplification peak value peak (that is, the maximum value allowed for sound amplification) and the gain parameter gain dB can be set during initialization. The initial interpolation coefficient ch_scale[6] can be set to 1.0. Here, [6] in ch_scale[6] indicates that the number of channels is 6. For any channel, for example, ch_scale[0] for the left channel can be interpolation0. The amplification factor gain_scale is determined according to the gain parameter gain. Specifically, the amplification factor gain_scale=10 gain / 20 , then the gain threshold (maximum value of gain) is equal to the quotient of the amplification peak value and the amplification factor, that is, threshold = peak / gain_scale.
[0096] In one embodiment, a sub-feature corresponding to a sub-channel block is determined based on a maximum value of a target element and a gain threshold, including: if the absolute value of the maximum value of the target element is greater than the gain threshold, the absolute value of the maximum value of the target element is used as the sub-feature of the sub-channel block; if the absolute value of the maximum value of the target element is less than or equal to the gain threshold, zero is used as the sub-feature of the sub-channel block.
[0097] In this embodiment, the following operations are performed on each channel. Taking the left channel as an example, the sub-channel block x0(n) corresponding to the left channel {x 00 , x 01 , x 02 ...x 0i ,...x 0N-1}, for each element x 0i Take the absolute value y0(n){abs(x 00 ), abs(x 01 ), abs(x 02 )...abs(x 0i ), ... abs(x 0N-1 )}, get the maximum value y of y0(n) 0max If y 0max >threshold, store the current sub-feature feature0 as y0max , otherwise the sub-feature feature0 is 0. Use the same method to obtain the extreme features of other channel numbers, corresponding to feature1, feature2, feature3, feature4, feature5. In other words, the block features of this fixed block are (feature0, feature1, feature2, feature3, feature4, feature5). In order to distinguish the block features of the current fixed block from the block features of the next fixed block of the current fixed block, the block features of the current fixed block can be expressed as (feature 0cur , feature 1cur , feature 2cur , feature 3cur , feature 4cur , feature 5cur ), the block feature of the next fixed block is represented as (feature 0next , feature 1next , feature 2next , feature 3next , feature 4next , feature 5next ).
[0098] In one embodiment, a target interpolation segment corresponding to each channel is determined based on a block feature of a current fixed block and a block feature of a next fixed block of the current fixed block, including: obtaining a mixing feature of the current fixed block, and obtaining a mixing feature of the next fixed block; and determining a target interpolation segment corresponding to each channel of the current fixed block based on the block feature of the current fixed block, the mixing feature of the current fixed block, the block feature of the next fixed block, and the mixing feature of the next fixed block.
[0099] In this embodiment, the interpolation line segment can be used as the limit range of the volume amplification of each channel of the current fixed block to prevent the sound from being cut off and avoid the introduction of noise. The mixing feature of the current fixed block is obtained, and the mixing feature of the next fixed block is obtained; the target interpolation line segment corresponding to each channel of the current fixed block is determined according to the block feature of the current fixed block, the mixing feature of the current fixed block, the block feature of the next fixed block and the mixing feature of the next fixed block.
[0100] In one embodiment, obtaining the mixing characteristics of the current fixed block includes: obtaining preset channel weight information and a maximum mixing gain value; determining a current sampled mixing upper limit value based on the channel weight information and the amplification factor; and determining the mixing characteristics of the current fixed block based on the mixing upper limit value, the amplification factor, and the maximum mixing gain value.
[0101] In this embodiment, mixing features are extracted for each fixed block, the preset channel weight information weight may include sub-weights corresponding to each channel, the maximum mixing gain is downmix_peak_sample, and the mixing upper limit value of the current sample is determined according to the channel weight information and the amplification factor; the mixing features of the current fixed block are determined according to the mixing upper limit value, the amplification factor and the maximum mixing gain.
[0102] Specifically, the following operations are performed on each sample of each fixed block:
[0103] downmix_L i = abs(gain_scale*(x 0i +weight*x 1i +weight*x 3i ));
[0104] downmix_R i = abs(gain_scale*(x 2i +weight*x 1i +weight*x 4i ));
[0105] Here we still take six channels as an example, where downmix_L i indicates left mixing, indicates right mixing, x 0i x 2i x 1i x 3i x 4i The 0, 1, 2, 3, and 4 in the figure represent the left channel, the middle channel, the right channel, the left surround, and the right surround, respectively. Therefore, the left mix needs to be determined based on the data of the left channel, the middle channel, and the left surround, as well as the corresponding channel weight information. The weight multiplied by the middle channel represents the sub-weight corresponding to the middle channel, and the weight multiplied by the left surround represents the sub-weight corresponding to the left surround. The rest will not be repeated.
[0106] Get the mixing upper limit value downmix_LR of the current sample i =max(downmix_L i ,downmix_R i ), that is, the upper limit of the mix can be the maximum value of the left mix and the right mix.
[0107] Get the maximum value that each mixing block can amplify update_scale = gain_scale
[0108] The acquisition method can be as follows:
[0109] if(downmix_peak_sample <= downmix_LR i )
[0110] update_scale = updated_scale * downmix_peak_sample / downmix_LR i
[0111] if(update_scale < downmix_clip_sample[cur]) / / cur represents the current block
[0112] downmix_clip_sample[cur] = updated_scale
[0113] It is possible to preset the mixing feature downmix_clip_sample[2] = gain_scale. Here, 2 represents the two mixing features of left mixing and right mixing, and the preset maximum multiple does not exceed the amplification multiple. During the calculation process, if downmix_peak_sample <= downmix_LR i , then update the maximum value update_scale that each block of mixing can be amplified to updated_scale * downmix_peak_sample / downmix_LR i . If update_scale < downmix_clip_sample[cur], then set the mixing feature downmix_clip_sample[cur] of the current fixed block to be equal to updated_scale.
[0114] The mixing feature of the next fixed block can be obtained based on the same method.
[0115] In one embodiment, determining the target interpolation line segment corresponding to each channel of the current fixed block according to the block feature of the current fixed block, the mixing feature of the current fixed block, the block feature of the next fixed block, and the mixing feature of the next fixed block includes:
[0116] Obtain the preset target channel interpolation coefficient corresponding to the target channel;
[0117] Determine the target sub - feature of the current fixed block corresponding to the target channel and the target sub - feature of the next fixed block corresponding to the target channel;
[0118] If the target sub - feature of the current fixed block is zero and the target sub - feature of the next fixed block is zero, then determine that the first block interpolation coefficient of the sub - channel block corresponding to the target channel is equal to the target channel interpolation coefficient;
[0119] If the target sub-feature of the current fixed block is greater than the target sub-feature of the next fixed block, determining that the first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to the target channel interpolation coefficient;
[0120] If the target sub-feature of the current fixed block is less than or equal to the target sub-feature of the next fixed block, and the target sub-feature of the current fixed block is greater than zero, determining that the first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to the quotient of the amplified peak value and the target sub-feature of the next fixed block;
[0121] Calculate the minimum value among the first block interpolation coefficient of the sub-channel block, the mixing feature of the current fixed block, and the mixing feature of the next fixed block, and use the minimum value as the block interpolation coefficient of the sub-channel block;
[0122] A target interpolation line segment corresponding to the target channel is determined according to the block interpolation coefficient of the sub-channel block and a preset interpolation line segment.
[0123] In this embodiment, the block feature of the current fixed block is obtained. 0cur , feature 1cur , feature 2cur , feature 3cur , feature 4cur , feature 5cur ) and the mixing feature downmix_clip_sample[cur] of the current fixed block, the block feature (feature 0next , feature 1next , feature 2next , feature 3next , feature 4next , feature 5next ) and the mixing feature downmix_clip_sample[next] of the next fixed block, the target interpolation line segment corresponding to each channel of the current fixed block can be determined, and the left channel can be used as an example as follows:
[0124] Left channel current block interpolation decision: interpolation 00 =ch_scale[0]
[0125] if(feature 0cur ==0&&feature 0next = =0): interpolation 01 =ch_scale[0]
[0126] if(feature 0cur ==0&&feature0next >0): interpolation 01 =peak / feature 0next
[0127] if(feature 0cur >0&&feature 0next = =0): interpolation 01 =interpolation 00
[0128] if(feature 0cur >feature 0next ): interpolation 01 =interpolation 00
[0129] else:interpolation 01 =peak / feature 0next
[0130] interpolation 01 =min(interpolation 01 , min(downmix_clip_sample[cur], downmix_clip_sample[next]))
[0131] In an optional embodiment, a target interpolation line segment corresponding to a target channel is determined according to a block interpolation coefficient of a sub-channel block and a preset interpolation line segment, including: obtaining a preset interpolation line segment; wherein the interpolation line segment includes a first point coordinate representing a starting point of the line segment and a second point coordinate representing an end point of the line segment; updating the first point coordinate according to the target interpolation coefficient of the target channel; updating the second point coordinate according to the block interpolation coefficient of the sub-channel block; and determining the target interpolation line segment according to the first point coordinate and the second point coordinate.
[0132] In this embodiment, the preset interpolation line segment may be ch_gain_coe[6][4], where [6] represents six channels, and [4] represents four coordinates of the line segment corresponding to each channel, which may be as follows:
[0133] ch_gain_coe[0][0]=0; represents the x-axis coordinate of the first point;
[0134] ch_gain_coe[0][1]=ch_scale[i]; represents the y-axis coordinate of the first point;
[0135] ch_gain_coe[0][2]=N-1; represents the x-axis coordinate of the second point;
[0136] ch_gain_coe[0][3]=interpolation 01 ; Indicates the y-axis coordinate of the second point.
[0137] The left channel obtains the interpolation coefficient corresponding to each element 0i =(ch_gain_coe[0][3]-ch_gain_coe[0][1]) / (N-1)*i+ch_gain_coe[0][1], where i is the index value of the corresponding sample.
[0138] Next, the corresponding position of the current fixed block is enlarged, then: z 0i =x 0i *interpolation 0i , (z 0i , index 0 represents the left channel, 1, 2, 3, 4, 5 correspond to the center channel, right channel, left surround, right surround, and subwoofer, respectively; index i represents the i-th sample) then the current fixed block completes the amplification operation, z0(n){z 00 , z 01 , z 02 ,...z 0i ,...z 0N-1}, which is the amplified left channel data.
[0139] Similarly: the middle channel, right channel, left surround, right surround, and subwoofer perform the above steps in sequence to obtain the final amplified data corresponding to each channel, that is, the middle channel z1(n), the right channel z2(n), the left surround channel z3(n), the right surround channel z4(n), and the subwoofer channel z5(n), where n belongs to [0, N-1]). z0(n), z1(n), z2(n), z3(n), z4(n), and z5(n) are used as the amplified data of the current fixed block.
[0140] Step 104 , adding the magnified data of all fixed blocks to the renderer.
[0141] The method divides the decoded multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length, obtains the block features corresponding to each fixed block, determines the target interpolation line segment corresponding to each channel according to the block features of the current fixed block and the block features of the next fixed block, and then performs interpolation and amplification processing on the sub-channel block corresponding to the channel according to the target interpolation line segment. After completing the interpolation and amplification processing of all fixed blocks, the amplified data of all fixed blocks are added to the renderer, so that the playback loudness of the audio system can be adapted to the hardware capability of multi-channel playback, thereby giving full play to the multi-channel capability of the device, avoiding loudness abnormality, and improving user experience.
[0142] In typical multi-channel audio rendering, the compressed audio data is first decompressed into multi-channel PCM through a decoder, and then the PCM data is mixed into 2 channels and added to a 2-channel renderer. In a specific embodiment, multi-channel amplification processing is added to the decoded PCM, and then the multi-channel data is added to the multi-channel renderer to achieve the function of sound amplification, so that multi-channel playback can meet the loudness requirements, and at the same time, combined with the playback capabilities of the device, the multi-channel listening experience is improved. The method of increasing the volume of the audio system is a method of post-processing the audio data, such as Figure 2 ,include:
[0143] Step S21, set the amplified peak (amplified peak value), gain parameter gain dB, ch_scale[6]=1.0, ch_gain_coe[6][4], set the maximum mixing gain downmix_peak_sample, weight weight, and create a multi-channel renderer.
[0144] Step S22, calculate the magnification factor: magnification factor gain_scale=10 gain / 20 , then the maximum value of the gain is threshold = peak / gain_scale, and the mixing feature downmix_clip_sample[2] = gain_scale.
[0145] First, the decoded multi-channel PCM data is divided into X fixed blocks, each fixed block has a sampling length of N, and each sample contains 6 channels (including 6 channels but not limited to 6 channels of multi-channel). Taking the i-th sample as an example, (x 0i , x 1i , x 2i , x 3i , x 4i , x 5i ) respectively correspond to the left channel, center channel, right channel, left surround, right surround, and subwoofer (taking 6 channels as an example, it is not limited to 6 channels, and the processing method for non-6 channels is the same). Perform the following operations on each channel. Taking the left channel as an example, the sub-channel block x0(n) corresponding to the left channel is {x00 , x 01 , x 02 ...x 0i ,...x 0N-1}, for each element x 0i Take the absolute value y0(n){abs(x 00 ), abs(x 01 ), abs(x 02 )...abs(x 0i ), ... abs(x 0N-1 )}, get the maximum value y of y0(n) 0max If y 0max >threshold, store the current sub-feature feature0 as y 0max , otherwise the sub-feature feature0 is 0. Use the same method to obtain the extreme features of other channel numbers, corresponding to feature1, feature2, feature3, feature4, feature5. In other words, the block features of this fixed block are (feature0, feature1, feature2, feature3, feature4, feature5). In order to distinguish the block features of the current fixed block from the block features of the next fixed block of the current fixed block, the block features of the current fixed block can be expressed as (feature 0cur , feature 1cur , feature 2cur , feature 3cur , feature 4cur , feature 5cur ), the block feature of the next fixed block is represented as (feature 0next , feature 1next , feature 2next , feature 3next , feature 4next , feature 5next ).
[0146] Perform mixing feature extraction on each fixed block:
[0147] For each sample of each fixed block, the following operations are performed:
[0148] downmix_L i = abs(gain_scale*(x 0i +weight*x 1i +weight*x 3i ));
[0149] downmix_R i = abs(gain_scale * (x 2i + weight * x 1i + weight * x 4i ));
[0150] Here, still taking 6 channels as an example, where downmix_L i represents left mix, downmix_R represents right mix, and x 0i x 2i x 1i x 3i x 4i 0, 1, 2, 3, 4 in x respectively represent the left channel, the center channel, the right channel, the left surround, and the right surround. Therefore, the left mix needs to be determined based on the data of the left channel, the center channel, and the left surround, as well as the corresponding channel weight information. Among them, the weight multiplied by the center channel represents the sub-weight corresponding to the center channel, and the weight multiplied by the left surround represents the sub-weight corresponding to the left surround. The rest will not be elaborated here.
[0151] Take the upper limit value of the mix for the current sample, downmix_LR i = max(downmix_L i , downmix_R i ), that is, the upper limit value of the mix can be taken as the maximum value between the left mix and the right mix.
[0152] Obtain the maximum value that each block of mix can be amplified, update_scale = gain_scale
[0153] The obtaining method can be as follows:
[0154] if (downmix_peak_sample <= downmix_LR i )
[0155] update_scale = updated_scale * downmix_peak_sample / downmix_LR i
[0156] if (update_scale < downmix_clip_sample[cur]) / / cur represents the current block
[0157] downmix_clip_sample[cur] = updated_scale
[0158] Step S23, read the current block, and obtain the current block feature feature[cur] and downmix_clip_sample[cur].
[0159] Step S24, read the next block, and obtain the next block feature feature[next] and downmix_clip_sample[next].
[0160] Step S25, obtaining the interpolation line segments of each channel in sequence.
[0161] Left channel current block interpolation decision: interpolation 00 =ch_scale[0]
[0162] if(feature 0cur ==0&&feature 0next = =0): interpolation 01 =ch_scale[0]
[0163] if(feature 0cur ==0&&feature 0next >0): interpolation 01 =peak / feature 0next
[0164] if(feature 0cur >0&&feature 0next = =0): interpolation 01 =interpolation 00
[0165] if(feature 0cur >feature 0next ): interpolation 01 =interpolation 00
[0166] else:interpolation 01 =peak / feature 0next
[0167] interpolation 01 =min(interpolation 01 , min(downmix_clip_sample[cur], downmix_clip_sample[next]))
[0168] ch_gain_coe[0][0]=0; represents the x-axis coordinate of the first point;
[0169] ch_gain_coe[0][1]=ch_scale[i]; represents the y-axis coordinate of the first point;
[0170] ch_gain_coe[0][2]=N-1; represents the x-axis coordinate of the second point;
[0171] ch_gain_coe[0][3]=interpolation 01 ; Indicates the y-axis coordinate of the second point.
[0172] The left channel obtains the interpolation coefficient corresponding to each element 0i =(ch_gain_coe[0][3]-ch_gain_coe[0][1]) / (N-1)*i+ch_gain_coe[0][1], where i is the index value of the corresponding sample.
[0173] Next, the corresponding position of the current fixed block is enlarged, then: z 0i =x 0i *interpolation 0i , (z 0i , index 0 represents the left channel, 1, 2, 3, 4, 5 correspond to the center channel, right channel, left surround, right surround, and subwoofer, respectively; index i represents the i-th sample) then the current fixed block completes the amplification operation, z0(n){z 00 , z 01 , z 02 ,...z 0i ,...z 0N-1}, which is the amplified left channel data.
[0174] Step S26, after amplifying each channel, the amplified data is added to the multi-channel renderer.
[0175] Similarly: the middle channel, right channel, left surround, right surround, and subwoofer perform the above steps in sequence to obtain the final amplified data corresponding to each channel, that is, the middle channel z1(n), the right channel z2(n), the left surround channel z3(n), the right surround channel z4(n), and the subwoofer channel z5(n), where n belongs to [0, N-1]). z0(n), z1(n), z2(n), z3(n), z4(n), and z5(n) are used as the amplified data of the current fixed block.
[0176] Step S27, determine whether to end, if yes, go to step S28, if not, go to step S29.
[0177] Step S28, after amplifying each channel of the last block of data, the amplified data is added to the multi-channel renderer.
[0178] Step S29, updating the context.
[0179] feature jcur =feature jnext , j is the number of channels (there are M channels in total, j is one of them), downmix_clip_sample[cur]=downmix_clip_sample[next], jump to step S24.
[0180] In this embodiment, the limitation that Dolby cannot play the hardware capabilities of some devices is solved, and at the same time, the defect that the loudness of the system playing Dolby cannot reach the loudness required by Dolby is compensated. A method using iOS and Mac system decoders is proposed to add an audio amplification post-processing logic to the PCM data of the decoded audio. By dividing the decoded audio into blocks, extracting the features of the current and next blocks, and combining the Dolby mixing standard, the audio data is interpolated and gained, so that the Dolby audio playback can play the hardware decoding multi-channel playback capability while the sound loudness meets the Dolby standard and the sound is not overexposed.
[0181] In this embodiment, the system solution is expanded and gain control is used to make the playback loudness of the system solution consistent with the playback loudness of the Dolby decoding library, thereby solving the abnormal loudness problem of the native system playback solution; using the system solution, the dependence on third-party libraries is removed, and the size of the APP lib library is reduced; the gain process also refers to the mixing characteristics to prevent the gain from destroying the layering of the sound; the system solution can maximize the 5.1 multi-channel playback characteristics of the multi-channel playback hardware and improve the user experience; the noise can be controlled in real time, and there will be no noise caused by the delay control logic.
[0182] In traditional two-channel playback, if the decoded two-channel is sent to the built-in or Bluetooth audio output device without processing, the hardware capabilities cannot be brought into play and the sound envelopment is too poor. In a specific embodiment, a method is proposed to upsample the audio decoded PCM two-channel into multi-channel data, and hand the multi-channel data to the system, which renders the multi-channel data with the hardware capabilities to enhance the audio immersive experience. In this embodiment, a method for increasing the volume of an audio system is as follows: Figure 3 ,include:
[0183] Step S31, set the peak value of the amplification, gain parameter gain dB, ch_scale[6]=1.0, ch_gain_coe[6][4], set the maximum mixing gain downmix_peak_sample, weight weight, create a multi-channel renderer, set the weight w LR , weight w c .
[0184] Step S32, calculate the magnification factor: magnification factor gain_scale=10 gain / 20 , then the maximum value of the gain is threshold = peak / gain_scale, and the mixing feature downmix_clip_sample[2] = gain_scale.
[0185] Step S33, dual-channel sampling, generating multi-channel data (x 0i ,x 1i ,x 2i ,x 3i ,x 4i ,x 5i ).
[0186] Set the i-th sample of the original data to: (src 0i , src 1i ), that is, src 0i Indicates the corresponding left channel data, src 1i Represents the right channel data, each sample undergoes the following operations:
[0187] x 0i =w LR *src 0i
[0188] x 2i =w LR *src1i
[0189] x 1i =w c *(x 0i +x 2i )
[0190] x 5i =x 1i
[0191] x 3i =x 0i -x 2i
[0192] x 4i =-(x 0i -x 2i )
[0193] Get the generated multi-channel data (x 0i , x 1i , x 2i , x 3i , x 4i , x 5i ), it should be noted again that the upsampling process here takes six channels as an example, which does not mean that it is limited thereto. In fact, the two-channel data can be upsampled into other multi-channel PCM data.
[0194] First, the decoded multi-channel PCM data is divided into X fixed blocks, each fixed block has a sampling length of N, and each sample contains 6 channels (including 6 channels but not limited to 6 channels of multi-channel). Taking the i-th sample as an example, (x 0i , x 1i , x 2i , x 3i , x 4i , x 5i ) respectively correspond to the left channel, center channel, right channel, left surround, right surround, and subwoofer (taking 6 channels as an example, it is not limited to 6 channels, and the processing method for non-6 channels is the same). Perform the following operations on each channel. Taking the left channel as an example, the sub-channel block x0(n) corresponding to the left channel is {x 00 , x 01 , x 02 ...x 0i ,...x 0N-1}, for each element x 0i Take the absolute value y0(n){abs(x 00 ), abs(x 01 ), abs(x 02 )...abs(x 0i ), ... abs(x 0N-1 )}, get the maximum value y of y0(n) 0max If y 0max >threshold, store the current sub-feature feature0 as y 0max , otherwise the sub-feature feature0 is 0. Use the same method to obtain the extreme features of other channel numbers, corresponding to feature1, feature2, feature3, feature4, feature5. In other words, the block features of this fixed block are (feature0, feature1, feature2, feature3, feature4, feature5). In order to distinguish the block features of the current fixed block from the block features of the next fixed block of the current fixed block, the block features of the current fixed block can be expressed as (feature 0cur , feature 1cur, feature 2cur , feature 3cur , feature 4cur , feature 5cur ), the block feature of the next fixed block is represented as (feature 0next , feature 1next , feature 2next , feature 3next , feature 4next , feature 5next ).
[0195] Perform mixing feature extraction on each fixed block:
[0196] For each sample of each fixed block, the following operations are performed:
[0197] downmix_L i = abs(gain_scale*(x 0i +weight*x 1i +weight*x 3i ));
[0198] downmix_R i = abs(gain_scale*(x 2i +weight*x 1i +weight*x 4i ));
[0199] Here we still take six channels as an example, where downmix_L i indicates left mixing, indicates right mixing, x 0i x 2i x 1i x 3i x 4i The 0, 1, 2, 3, and 4 in the figure represent the left channel, the middle channel, the right channel, the left surround, and the right surround, respectively. Therefore, the left mix needs to be determined based on the data of the left channel, the middle channel, and the left surround, as well as the corresponding channel weight information. The weight multiplied by the middle channel represents the sub-weight corresponding to the middle channel, and the weight multiplied by the left surround represents the sub-weight corresponding to the left surround. The rest will not be repeated.
[0200] Get the mixing upper limit value downmix_LR of the current sample i =max(downmix_L i ,downmix_R i ), that is, the upper limit of the mix can be the maximum value of the left mix and the right mix.
[0201] Obtain the maximum value that each piece of mixed sound can be amplified. update_scale = gain_scale
[0202] The obtaining method can be as follows:
[0203] if(downmix_peak_sample <= downmix_LR i )
[0204] update_scale = updated_scale * downmix_peak_sample / downmix_LR i
[0205] if(update_scale < downmix_clip_sample[cur]) / / cur represents the current block
[0206] downmix_clip_sample[cur] = updated_scale
[0207] Step S34, read the current block, and obtain the current block feature feature[cur] and downmix_clip_sample[cur].
[0208] Step S35, read the next block, and obtain the next block feature feature[next] and downmix_clip_sample[next].
[0209] Step S36, sequentially obtain the interpolation line segments of each channel.
[0210] Left channel current block interpolation decision: interpolation 00 = ch_scale[0]
[0211] if(feature 0cur == 0 && feature 0next == 0): interpolation 01 = ch_scale[0]
[0212] if(feature 0cur == 0 && feature 0next > 0): interpolation 01 = peak / feature 0next
[0213] if(feature 0cur > 0 && feature 0next= =0): interpolation 01 =interpolation 00
[0214] if(feature 0cur >feature 0next ): interpolation 01 =interpolation 00
[0215] else:interpolation 01 =peak / feature 0next
[0216] interpolation 01 =min(interpolation 01 , min(downmix_clip_sample[cur], downmix_clip_sample[next]))
[0217] ch_gain_coe[0][0]=0; represents the x-axis coordinate of the first point;
[0218] ch_gain_coe[0][1]=ch_scale[i]; represents the y-axis coordinate of the first point;
[0219] ch_gain_coe[0][2]=N-1; represents the x-axis coordinate of the second point;
[0220] ch_gain_coe[0][3]=interpolation 01 ; Indicates the y-axis coordinate of the second point.
[0221] The left channel obtains the interpolation coefficient corresponding to each element 0i =(ch_gain_coe[0][3]-ch_gain_coe[0][1]) / (N-1)*i+ch_gain_coe[0][1], where i is the index value of the corresponding sample.
[0222] Next, the corresponding position of the current fixed block is enlarged, then: z 0i =x 0i *interpolation 0i , (z 0i, index 0 represents the left channel, 1, 2, 3, 4, 5 correspond to the center channel, right channel, left surround, right surround, and subwoofer, respectively; index i represents the i-th sample) then the current fixed block completes the amplification operation, z0(n){z 00 , z 01 , z 02 ,...z 0i ,...z 0N-1}, which is the amplified left channel data.
[0223] Step S37, after amplifying each channel, the amplified data is added to the multi-channel renderer.
[0224] Similarly: the middle channel, right channel, left surround, right surround, and subwoofer perform the above steps in sequence to obtain the final amplified data corresponding to each channel, that is, the middle channel z1(n), the right channel z2(n), the left surround channel z3(n), the right surround channel z4(n), and the subwoofer channel z5(n), where n belongs to [0, N-1]). z0(n), z1(n), z2(n), z3(n), z4(n), and z5(n) are used as the amplified data of the current fixed block.
[0225] Step S38, determine whether to end, if yes, execute step S28, if not, execute step S29.
[0226] Step S39, after amplifying each channel of the last block of data, the amplified data is added to the multi-channel renderer.
[0227] Step S310, updating the context.
[0228] feature jcur =feature jnext , j is the number of channels (there are M channels in total, j is one of them), downmix_clip_sample[cur]=downmix_clip_sample[next], jump to step S35.
[0229] In this embodiment, a method of upsampling a two-channel sound into a multi-channel sound is proposed. At the same time, through the limitation of sound gain control and compressor, the output of the loudness can be selected according to different scenarios, so that users can experience an immersive feeling when listening to the two-channel sound on iOS and Mac.
[0230] Upsampling the two-channel sound into multiple channels can give full play to the multi-channel characteristics of iOS and Mac audio playback devices. During the calculation process, the gain and compressor (interpolation line segment) are used for control, which makes the calculation simple and reduces the CPU load.
[0231] Based on the same technical concept, the second embodiment of the present application provides a device for increasing the volume of an audio system, such as Figure 4 , the device comprises:
[0232] The acquisition module 401 is used to acquire the decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M;
[0233] A division module 402 is used to divide the multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length; wherein each of the fixed blocks includes M sub-channel blocks;
[0234] The processing module 403 is used to obtain the block feature corresponding to each of the fixed blocks, and perform the following processing on each of the fixed blocks in sequence: determine the target interpolation line segment corresponding to each channel according to the block feature of the current fixed block and the block feature of the next fixed block of the current fixed block; perform interpolation and amplification processing on the sub-channel block corresponding to the channel according to the target interpolation line segment, so as to obtain the amplified data of the current fixed block after completing the interpolation and amplification processing of all the sub-channel blocks;
[0235] The adding module 404 is used to add the magnified data of all the fixed blocks to the renderer.
[0236] The device divides decoded multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length, obtains a block feature corresponding to each fixed block, determines a target interpolation line segment corresponding to each channel according to the block feature of the current fixed block and the block feature of the next fixed block, and performs interpolation and amplification processing on the sub-channel block corresponding to the channel according to the target interpolation line segment. After completing the interpolation and amplification processing of all fixed blocks, the amplified data of all fixed blocks are added to a renderer, so that the playback loudness of the audio system can be adapted to the hardware capability of multi-channel playback, thereby giving full play to the multi-channel capability of the device, avoiding abnormal loudness, and improving user experience.
[0237] like Figure 5 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0238] Memory 113, used for storing computer programs;
[0239] In one embodiment of the present application, the processor 111 is configured to execute a program stored in the memory 113 to implement a method for increasing the volume of an audio system provided by any one of the aforementioned method embodiments, including:
[0240] Obtain decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M;
[0241] Divide the multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length; wherein each fixed block includes M sub-channel blocks;
[0242] Obtaining a block feature corresponding to each of the fixed blocks, and performing the following processing on each of the fixed blocks in turn: determining a target interpolation line segment corresponding to each channel according to the block feature of the current fixed block and the block feature of the next fixed block of the current fixed block; performing interpolation and amplification processing on the sub-channel block corresponding to the channel according to the target interpolation line segment, so as to obtain amplified data of the current fixed block after completing the interpolation and amplification processing of all the sub-channel blocks;
[0243] Add the magnification data of all said fixed blocks to the renderer.
[0244] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0245] The communication interface is used for communication between the above terminal and other devices.
[0246] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0247] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0248] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for increasing the volume of an audio system provided in any of the aforementioned method embodiments is implemented.
[0249] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0250] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0251] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0252] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. In the description, the suffixes such as "module", "component" or "unit" used to represent the elements are only used to facilitate the description of the present application and have no specific meaning in themselves. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0253] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for increasing the volume of an audio system, characterized in that: The method comprises: Obtain decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M; Divide the multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length; wherein each fixed block includes M sub-channel blocks; Obtaining a block feature corresponding to each of the fixed blocks, and performing the following processing on each of the fixed blocks in turn: determining a target interpolation line segment corresponding to each channel according to the block feature of the current fixed block and the block feature of the next fixed block of the current fixed block; performing interpolation and amplification processing on the sub-channel block corresponding to the channel according to the target interpolation line segment, so as to obtain amplified data of the current fixed block after completing the interpolation and amplification processing of all the sub-channel blocks; Add the magnification data of all said fixed blocks to the renderer.
2. The method according to claim 1, characterized in that: Obtaining a block feature corresponding to each of the fixed blocks includes: Obtaining sub-features corresponding to the sub-channel block; A block feature of the fixed block is determined based on the M sub-features.
3. The method according to claim 2, characterized in that Obtaining the sub-features corresponding to the sub-channel block includes: Get the preset gain threshold; Obtaining a maximum value of target elements included in the sub-channel block; The sub-feature corresponding to the sub-channel block is determined according to the maximum value of the target element and the gain threshold.
4. The method according to claim 3, characterized in that Determining the sub-feature corresponding to the sub-channel block according to the maximum value of the target element and the gain threshold includes: If the absolute value of the maximum value of the target element is greater than the gain threshold, taking the absolute value of the maximum value of the target element as the sub-feature of the sub-channel block; If the absolute value of the maximum value of the target element is less than or equal to the gain threshold, zero is used as the sub-feature of the sub-channel block.
5. The method according to claim 4, characterized in that Get the preset gain threshold, including: Get the preset amplification peak and gain parameters; Determine the amplification factor according to the gain parameter; The quotient of the amplification peak value and the amplification factor is used as the preset gain threshold.
6. The method according to claim 5, characterized in that Determining a target interpolation line segment corresponding to each channel according to a block feature of a current fixed block and a block feature of a next fixed block of the current fixed block includes: Acquire the mixing feature of the current fixed block, and acquire the mixing feature of the next fixed block; A target interpolation line segment corresponding to each channel of the current fixed block is determined according to the block feature of the current fixed block, the mixing feature of the current fixed block, the block feature of the next fixed block, and the mixing feature of the next fixed block.
7. The method according to claim 6, characterized in that Obtaining the mixing feature of the current fixed block includes: Get the preset channel weight information and maximum mixing gain; Determine a mixing upper limit value of a current sample according to the channel weight information and the amplification factor; The mixing feature of the current fixed block is determined according to the mixing upper limit value, the amplification factor and the maximum mixing gain value.
8. The method according to claim 6, characterized in that Determining a target interpolation line segment corresponding to each channel of the current fixed block according to the block feature of the current fixed block, the mixing feature of the current fixed block, the block feature of the next fixed block, and the mixing feature of the next fixed block, including: Obtaining a preset target channel interpolation coefficient corresponding to the target channel; Determine a target sub-feature of a current fixed block corresponding to the target channel and a target sub-feature of a next fixed block corresponding to the target channel; If the target sub-feature of the current fixed block is zero and the target sub-feature of the next fixed block is zero, determining that the first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to the target channel interpolation coefficient; If the target sub-feature of the current fixed block is greater than the target sub-feature of the next fixed block, determining that the first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to the target channel interpolation coefficient; If the target sub-feature of the current fixed block is less than or equal to the target sub-feature of the next fixed block, and the target sub-feature of the current fixed block is greater than zero, determining that a first block interpolation coefficient of the sub-channel block corresponding to the target channel is equal to a quotient of the amplified peak value and the target sub-feature of the next fixed block; Calculating a minimum value among a first block interpolation coefficient of the sub-channel block, a mixing feature of the current fixed block, and a mixing feature of the next fixed block, and using the minimum value as a block interpolation coefficient of the sub-channel block; The target interpolation line segment corresponding to the target channel is determined according to the block interpolation coefficient of the sub-channel block and a preset interpolation line segment.
9. The method according to claim 8, characterized in that Determining the target interpolation line segment corresponding to the target channel according to the block interpolation coefficient of the sub-channel block and a preset interpolation line segment includes: Acquire the preset interpolation line segment; wherein the interpolation line segment includes a first point coordinate representing a starting point of the line segment and a second point coordinate representing an end point of the line segment; Updating the first point coordinates according to the target interpolation coefficient of the target channel; updating the coordinates of the second point according to the block interpolation coefficient of the sub-channel block; The target interpolation line segment is determined according to the first point coordinates and the second point coordinates.
10. The method according to claim 1, characterized in that Get decoded multi-channel pulse code modulation data, including: Obtain decoded pulse code modulation data; If the pulse code modulation data is dual-channel data, up-sampling the pulse code modulation data to obtain the multi-channel pulse code modulation data; If the pulse code modulation data is multi-channel data, the pulse code modulation data is used as the multi-channel pulse code modulation data.
11. The method according to claim 10, characterized in that Performing up-sampling processing on the pulse code modulation data to obtain the multi-channel pulse code modulation data includes: Get the left and right channel scaling weights and the center channel scaling weights; Acquire left channel data and right channel data included in the pulse code modulation data; The multi-channel pulse code modulation data is generated according to the left channel data, the right channel data, the left and right channel scaling weights and the center channel scaling weights.
12. A device for increasing the volume of an audio system, characterized in that: The device comprises: An acquisition module, used for acquiring decoded multi-channel pulse code modulation data; wherein the number of channels of the multi-channel pulse code modulation data is M; A division module, used for dividing the multi-channel pulse code modulation data into X fixed blocks according to a preset sampling length; wherein each of the fixed blocks includes M sub-channel blocks; a processing module, configured to obtain a block feature corresponding to each of the fixed blocks, and sequentially perform the following processing on each of the fixed blocks: determining a target interpolation line segment corresponding to each channel according to the block feature of the current fixed block and the block feature of the next fixed block of the current fixed block; and performing interpolation and amplification processing on the sub-channel blocks corresponding to the channel according to the target interpolation line segment, so as to obtain amplified data of the current fixed block after completing the interpolation and amplification processing of all the sub-channel blocks; An adding module is used for adding the magnification data of all the fixed blocks to the renderer.
13. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor is used to implement the method for increasing the volume of an audio system as described in any one of claims 1 to 11 when executing a program stored in a memory.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for increasing the volume of an audio system as described in any one of claims 1 to 11 is implemented.
