Multi-channel audio decoding synchronization method and device and computer readable storage medium
By receiving and converting IP stream data and using clock recovery technology to achieve dynamic clock synchronization, it solves the problem of difficulty in clock synchronization in diversified audio streams with traditional audio decoding methods, and improves the synchronization accuracy and consistency of audio and video decoding.
Patent Information
- Application Number
- CN202410727315.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-03
AI Technical Summary
Traditional audio decoding methods are difficult to achieve precise clock synchronization when processing audio streams with diverse sampling rates and bit rates, which limits their application in complex scenarios.
By receiving IP stream data, converting it into PCM data, and using clock recovery technology to obtain the clock sampling rate, the delay and synchronization output of PCM data are controlled according to the delay conditions and clock sampling rate to achieve dynamic clock synchronization.
It improves the synchronization accuracy in the audio and video decoding process, ensures accurate synchronization of audio streams and video data, prevents sound distortion and desynchronization, adapts to audio streams with different sampling rates and bit rates, and transcends the limitations of fixed clock sources.
Smart Images

Figure CN118590694A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of audio and video data processing, and in particular to a multi-channel audio decoding synchronization method, device and computer-readable storage medium. Background Art
[0002] In the field of audio and video, audio and video synchronization is an important factor affecting decoding quality and user experience, and has always been a research focus in this field. Especially in multi-channel audio decoding scenarios, accurate synchronization between different audio streams and videos is particularly critical to avoid poor experience such as sound distortion, jitter, and asynchrony. Traditional decoding methods mainly rely on a fixed clock source, but this method is difficult to achieve accurate clock synchronization when processing audio streams with diverse sampling rates and bit rates and single firmware multi-channel output, which limits its application effect in complex scenarios. Summary of the invention
[0003] In view of the above problems, the example of the present invention provides a multi-channel audio decoding synchronization method, device and computer-readable storage medium, which are used to solve the problem that the traditional decoding method in the prior art mainly relies on a fixed clock source. This method that relies on a fixed clock source is difficult to achieve accurate clock synchronization when processing audio streams with diverse sampling rates and bit rates and single firmware multi-channel outputs, which limits its application effect in complex scenarios.
[0004] According to one aspect of an example of the present invention, a multi-channel audio decoding synchronization method is provided, the method comprising: Receiving IP stream data, converting the IP stream data into PCM data and writing the PCM data into a storage module; Obtain the clock sampling rate through clock recovery technology; According to the stored PCM data, the PCM data delay is controlled according to the delay condition and the clock sampling rate and the PCM data is output synchronously.
[0005] In some optional methods, the receiving IP data specifically includes: obtaining IP flow data according to the MAC address in the TCP protocol.
[0006] In some optional methods, the IP stream data is converted into PCM data, specifically including: removing the packet header of the IP stream data through a counter to obtain the PCM data.
[0007] In some optional manners, the acquiring clock data by using a clock recovery technology specifically includes: The clock sampling rate of the audio output of the IP stream data is calculated by FPGA clock division. The clock sampling rate calculation formula is: audio sampling rate = frequency division numerator / frequency division denominator * local clock; The gap compensation value is obtained by inputting the IP stream data interval, and the gap compensation value is superimposed on the frequency division denominator.
[0008] In some optional manners, the gap compensation value obtained by inputting the IP stream data interval and superimposing the gap compensation value on the frequency division denominator specifically includes: At the software decoding end, the audio and video synchronization information is obtained through the source end, and when sending IP stream data, the audio and video data of the IP stream data are initially synchronized, and the initial interval for sending adjacent IP stream data is obtained by the packet capture method; The gap compensation value is obtained by comparing the interval gap value between the sending interval and the receiving interval of each IP flow data and calculating the average of the interval gap values of all IP flow data.
[0009] In some optional manners, after the gap compensation value is obtained, if the gap compensation value continuously increases or continuously decreases outside a preset range, a negative compensation operation needs to be performed on the gap supplement value.
[0010] In some optional embodiments, the reading of the PCM data, and controlling the delay and synchronous output of the PCM data according to the number of cache packets and the clock sampling rate include: By calculating the PCM data of the IP stream data, the PCM data is written into the storage module according to the effective audio data length, and by setting the output condition of the read delay, the PCM data is output according to the delay output condition; Creates a clock-rate-based output enable that controls the synchronous readout of PCM data by the clock-rate.
[0011] In some optional embodiments, the storage module is a DDR storage module.
[0012] According to another aspect of an embodiment of the present invention, a multi-channel audio decoding synchronization device is provided, the device comprising: An IP decapsulation module, used for receiving IP data and converting the IP data into PCM data; An audio writing processing module, used for writing the PCM data into a storage module; A storage module for storing PCM data; A clock recovery module, used for obtaining a clock sampling rate through a clock recovery technique; And an audio reading processing module is used to read the PCM data according to the number of cached PCM data, and control the delay of the PCM data and output it synchronously according to the delay condition and clock sampling rate.
[0013] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, characterized in that at least one execution instruction is stored in the storage medium, and when the executable instruction is executed on a multi-channel audio decoding synchronization device as described above, the multi-channel audio decoding synchronization device performs the operation of the multi-channel audio decoding synchronization method as described above.
[0014] The present invention provides a multi-channel audio decoding synchronization method, device and computer-readable storage medium, and its beneficial effects are: the present invention example decodes IP stream data into PCM data, stores the PCM data in a storage module, and obtains the clock sampling rate through clock recovery technology; according to the provided delay parameters and clock sampling rate, the PCM data delay is controlled and output synchronously. It can improve the synchronization accuracy in the audio and video decoding process, especially for multi-channel audio decoding applications, ensure the accurate synchronization between all audio streams and video data, and prevent the occurrence of sound distortion, jitter and asynchronism; in addition, a mechanism is designed to adapt to audio streams with different sampling rates and bit rates, realize dynamic and accurate clock synchronization, and surpass the limitations of fixed clock sources. It solves the problem of audio and video asynchronism caused by the lack of direct clock relationship in the audio software decoding process, and ensures the high consistency and synchronization of audio decoding output and video data through innovative clock self-recovery technology and control of audio and video delay.
[0015] The above description is only an overview of the technical solution of the example of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the example of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings: Figure 1 A schematic diagram showing a flow chart of a first embodiment of a multi-channel audio decoding synchronization method provided by the present invention; Figure 2 A schematic structural diagram of a first embodiment of a multi-channel audio decoding synchronization device provided by the present invention is shown; Figure 3 A structural schematic diagram of the FPGA structure provided by the present invention is shown. DETAILED DESCRIPTION
[0017] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0018] Figure 1 FIG. 1 is a flowchart of a first embodiment of a multi-channel audio decoding synchronization method of the present invention, wherein the method is executed by a multi-channel audio decoding synchronization device. Figure 1 As shown, the method comprises the following steps: 110, receiving IP stream data, converting the IP stream data into PCM data and writing the PCM data into a storage module; in step 110, receiving IP data specifically includes: obtaining IP stream data according to the MAC address in the TCP protocol. Converting the IP stream data into PCM data specifically includes: removing the packet header of the IP stream data through a counter to obtain PCM data. Wherein, the storage module is a DDR storage module.
[0019] 120, obtaining the clock sampling rate through clock recovery technology; in step 120, obtaining clock data through clock recovery technology, specifically including: calculating the clock sampling rate of the audio output of the IP stream data through FPGA clock division, the clock sampling rate calculation formula is: audio sampling rate = division numerator / division denominator*local clock; wherein, calculating the gap compensation value obtained by the IP stream data input interval through FPGA, and superimposing the gap compensation value on the division denominator.
[0020] 130, read the PCM data according to the number of cached PCM data, and control the delay and synchronous output of the PCM data according to the clock sampling rate and the preset delay output condition. In step 130, read the PCM data, and control the delay and synchronous output of the PCM data according to the provided delay parameters and clock sampling rate, including: calculating the PCM data of the IP stream data, writing the PCM data into the storage module according to the length of the audio data, and setting the delay output condition in the storage module to delay the output of the PCM data; creating an output enable through the clock sampling rate to control the synchronous reading of the PCM data. The number of cached PCM data can be obtained by counting the counter of the storage module.
[0021] The embodiment of the present invention decodes IP stream data into PCM data, stores the PCM data in a storage module, and obtains the clock sampling rate through clock recovery technology; the PCM data delay is controlled and output synchronously according to the provided delay parameters and clock sampling rate. It can improve the synchronization accuracy in the audio and video decoding process, especially for multi-channel audio decoding applications, to ensure accurate synchronization between all audio streams and video data, and prevent the occurrence of sound distortion, jitter and asynchronism; in addition, a mechanism is designed to adapt to audio streams with different sampling rates and bit rates, to achieve dynamic and accurate clock synchronization, and to surpass the limitations of fixed clock sources. It solves the problem of audio and video asynchronism caused by the lack of direct clock relationship in the audio software decoding process, and ensures the high consistency and synchronization of audio decoding output and video data through innovative clock self-recovery technology and control of audio and video delay.
[0022] In some optional ways, the receiving IP data specifically includes: obtaining IP stream data according to the MAC address in the TCP protocol. Converting the IP stream data into PCM data specifically includes: removing the packet header of the IP stream data through the FPGA counter to obtain PCM data. In this embodiment, PCM is obtained through IP decapsulation technology. The IP decapsulation technology only needs to obtain the IP data under the corresponding MAC address of the received IP stream according to the TCP protocol, and remove the packet header through the counter to obtain pure audio PCM data. Among them, IP stream data refers to data streams transmitted in the network, which follow the Internet Protocol standard. In a more specific context, IP streams can refer to different types of data transmission situations, but the core is communication through IP networks. In this patent, this IP stream refers to IP streams in media communications. In the field of multimedia communications, IP streams specifically refer to network transmissions that carry audio, video or data content. It should be noted that IP streams that carry audio and video also have IP stream-specific properties. PCM data is a standardized process for converting analog audio signals into digital signals, and is widely used in the field of audio storage and transmission. PCM audio mainly includes sampling, quantization and encoding; its main feature is lossless, because it does not involve data compression and retains all the information of the original analog signal. Therefore, PCM audio files are usually relatively large and are suitable for application scenarios with extremely high requirements for sound quality, such as professional audio recording, editing and mastering. Common PCM audio file formats include .wav, .aiff, etc. These formats directly store PCM data without compression.
[0023] In some optional methods, the clock data is obtained through clock recovery technology, specifically including: calculating the clock sampling rate of the audio output of the IP stream data through FPGA clock division, and the clock sampling rate calculation formula is: audio sampling rate = division numerator / division denominator*local clock; wherein, the gap compensation value is obtained through the IP stream data input interval, and the gap compensation value is superimposed on the division denominator.
[0024] For clock recovery technology, because the audio data obtained from the IP stream data does not know the clock situation of its source, it is necessary to calculate the audio output 48K or 44.1K sampling rate through FPGA clock division. However, the sampling rate calculated by this local clock cannot be guaranteed to be synchronized with the source, so it will cause audio data overflow or read empty on the cache side, resulting in audio and video distortion, that is, asynchrony.
[0025] From the output sampling rate formula: audio sampling rate = frequency division numerator / frequency division denominator * local clock, it can be seen that if the frequency division numerator or frequency division denominator under the local clock can be controlled by the cache situation, so that the audio sampling rate is basically maintained at the required 48K or other sampling rates, the invention can be successful. However, changing the numerator will cause the audio sampling rate to fluctuate greatly. Therefore, by calculating the difference value obtained by the IP input interval and superimposing it on the denominator, a relatively stable audio sampling rate based on the source input situation can be obtained.
[0026] In some optional ways, the gap compensation value obtained by inputting the interval of IP stream data, and superimposing the gap compensation value on the frequency division denominator, specifically includes: at the software decoding end, obtaining audio and video synchronization information through the source end, and when sending IP stream data, performing initial synchronization on the audio and video data of the IP stream data, and obtaining the initial interval of the sending of adjacent IP stream data by the packet capture method; calculating the interval gap value between the sending interval and the receiving interval of each IP stream data by the FPGA counter, and performing mean calculation on the interval gap value of all IP stream data to obtain the gap compensation value. In this embodiment, on the soft solution side, the software will obtain audio and video synchronization information through the source audio and video, and when sending IP, the corresponding audio and video will be initially synchronized, and the sending interval of each group or each IP packet can be known by packet capture, and the interval is also sent at a fixed audio sampling rate, but the IP interval obtained at the FPGA end will be affected by the burst nature, thereby obtaining a fixed interval of the non-audio sampling rate. The soft solution side can be a decoding SOC system.
[0027] In addition, after obtaining the gap compensation value, if the gap compensation value continuously increases or decreases outside the preset range, the gap supplement value needs to be inverted for compensation. After obtaining the gap compensation value, advance prediction is required for control. The reason is still due to IP bursts. Each calculated frequency division value will result in a different output sampling rate, and each action will generate a new value, which makes the parameter delayed. Therefore, the audio sampling rate changes are checked regularly. If its value continues to increase or decrease, a "reset" operation is required. This reset is not a one-step reset, otherwise it will cause audio abnormalities. Instead, the next calculated gap value is inverted for compensation, so that the increasing or decreasing trend fluctuates within a range, thereby tracking the clock situation at the source end.
[0028] In this embodiment, the clock recovery technology includes data equalization module implementation, clock frequency difference detection, and output frequency difference control; data equalization module implementation is to count the discrete values of the input signal in a certain period of time through a counter and output it relatively evenly; clock frequency difference detection is to obtain the frequency difference by counting the counter difference between the source signal and the local clock; output frequency difference control determines whether the frequency difference adjustment is needed by setting the overflow condition to complete the tracking output. The clock recovery technology is used to obtain an accurate and stable clock sampling rate.
[0029] In some optional ways, the PCM data is read, and the delay and synchronous output of the PCM data are controlled according to the provided delay parameters and clock sampling rate, including: by calculating the PCM data of the IP stream data, the PCM data is written into the storage module according to the effective audio data length, and the delayed output condition is set in the storage module to delay the output of the PCM data; an output enable is created through the clock sampling rate to control the synchronous reading of the PCM data. In this embodiment, after clock recovery is realized, the last thing to be realized is the audio and video delay synchronization. This technology can be divided into two aspects for creation, one is delay and the other is synchronization; the delay is calculated by the PCM data encapsulated by the IP packet, and the data read and written to the DDR each time is stored according to the length of the audio data frame, so that the delay control can be realized by setting the delayed output condition; in the case where the self-recovery clock has been obtained in the early stage, it is only necessary to create an output enable through the clock obtained by clock recovery, and output the data from the internal cache, so that a controllable audio data output based on the source audio and video synchronization is obtained.
[0030] Embodiment 2: See also Figure 2According to another aspect of the embodiment of the present invention, a multi-channel audio decoding synchronization device is provided, the device comprising: an IP decapsulation module for receiving IP data and converting the IP data into PCM data; an audio write processing module for writing the PCM data into a storage module; a storage module for storing PCM data; the storage module is a DDR module; a clock recovery module for obtaining a clock sampling rate through a clock recovery technique; and an audio read processing module for reading the PCM data, and controlling the delay of the PCM data and outputting it synchronously according to the provided delay parameters and clock sampling rate. Figure 2 As shown, the multi-channel audio decoding synchronization device is a multi-channel audio processing module, and the multi-channel audio processing module is integrated in the FPGA structure. The FPGA structure is as follows Figure 3 As shown, the FPGA structure also includes ARM, IP audio filtering and encapsulation module, the first audio processing module, audio and video embedding, and SDI output. The FPGA is connected to the decoding SOC. The decoding SOC system is a soft decoding system, which needs to extract a synchronization information similar to PCR from the acquired audio and video data. Through this synchronization information, the audio and video are initially synchronized at the ZYNQ end and the audio data is encapsulated into an IP packet, and the IP packet is sent from the ZYNQ end through the audio sampling rate. After the IP stream is received, it is converted into PCM data format, and the data is stored in DDR through the AXI protocol. By reading the size of the internal cache data of DDR, the data is read out from DDR and stored in the internal cache, and the audio and video synchronization control is performed through the recovered audio clock, and the data is read out from the internal cache. From then on, the purpose of multi-channel audio synchronous output can be achieved under the condition of clock recovery. The implementation of this device can well obtain the audio source clock status sent from the IP end, and restore the audio output conditions based on the sampling rate of the source end, provide the receiving end with an adaptation solution for the audio and video asynchrony and distortion caused by multi-channel audio output, and then realize the data delay control reading on this basis, thereby achieving an audio and video delay control synchronous output effect under single-core cost conditions.
[0031] Embodiment 3: According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, characterized in that at least one executable instruction is stored in the storage medium, and when the executable instruction is executed on the multi-channel audio decoding synchronization device as described above, the multi-channel audio decoding synchronization device performs the operation of the multi-channel audio decoding synchronization method as described above. In the embodiment of the present invention, IP stream data is decoded into PCM data, and the PCM data is stored in a storage module, and the clock sampling rate is obtained by clock recovery technology; the PCM data delay is controlled according to the provided delay parameter and clock sampling rate, and the output is synchronized. It can improve the synchronization accuracy in the audio and video decoding process, especially for multi-channel audio decoding applications, ensure the accurate synchronization between all audio streams and video data, and prevent the occurrence of sound distortion, jitter and asynchronism; in addition, a mechanism is designed to adapt to audio streams with different sampling rates and bit rates, realize dynamic and accurate clock synchronization, and surpass the limitations of fixed clock sources. It solves the problem of audio and video asynchronism caused by the lack of direct clock relationship in the audio soft decoding process, and ensures the high consistency and synchronization of audio decoding output and video data through innovative clock self-recovery technology and control of audio and video delay.
[0032] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.
[0033] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.
[0034] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.
[0035] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A multi-channel audio decoding synchronization method, characterized in that: The method comprises: Receiving IP stream data, converting the IP stream data into PCM data and writing the PCM data into a storage module; Obtain the clock sampling rate through clock recovery technology; The PCM data is read according to the number of cached PCM data, and the PCM data delay is controlled and output synchronously according to the clock sampling rate and the preset delay output condition.
2. The multi-channel audio decoding synchronization method according to claim 1, characterized in that: The receiving of IP data specifically includes: obtaining IP flow data according to the MAC address in the TCP protocol.
3. The multi-channel audio decoding synchronization method according to claim 2, characterized in that: The IP stream data is converted into PCM data, specifically including: removing the packet header of the IP stream data through a counter to obtain the PCM data.
4. The multi-channel audio decoding synchronization method according to claim 1, characterized in that: The obtaining of clock data by clock recovery technology specifically includes: The clock sampling rate of the audio output of the IP stream data is calculated by FPGA clock division. The clock sampling rate calculation formula is: audio sampling rate = frequency division numerator / frequency division denominator * local clock; The gap compensation value is obtained by inputting the IP stream data interval, and the gap compensation value is superimposed on the frequency division denominator.
5. The multi-channel audio decoding synchronization method according to claim 4, characterized in that: The gap compensation value obtained by inputting the IP stream data interval and superimposing the gap compensation value on the frequency division denominator specifically includes: At the software decoding end, the audio and video synchronization information is obtained through the source end, and when sending IP stream data, the audio and video data of the IP stream data are initially synchronized, and the initial interval for sending adjacent IP stream data is obtained by the packet capture method; The receiving interval counted by the FPGA counter is used to compare the interval gap value between the initial interval for sending each IP flow data and the receiving interval, and the interval gap values of all IP flow data are averaged to obtain the gap compensation value.
6. The multi-channel audio decoding synchronization method according to claim 5, characterized in that: After the gap compensation value is obtained, if the gap compensation value continuously increases or continuously decreases outside a preset range, a negative compensation operation needs to be performed on the gap supplement value.
7. The multi-channel audio decoding synchronization method according to claim 1, characterized in that: The step of reading the PCM data and controlling the delay and synchronous output of the PCM data according to the clock sampling rate comprises: By calculating the PCM data of the IP stream data, the PCM data is written into the storage module according to the effective audio data length, and a delayed output condition is set in the storage module so that the PCM data is output according to the delayed output condition; Creates a clock-rate-based output enable that controls the synchronous readout of PCM data by the clock-rate.
8. The multi-channel audio decoding synchronization method according to claim 1, characterized in that: The storage module is a DDR storage module.
9. A multi-channel audio decoding synchronization device, characterized in that: The device comprises: An IP decapsulation module, used for receiving IP data and converting the IP data into PCM data; An audio writing processing module, used for writing the PCM data into a storage module; A storage module for storing PCM data; A clock recovery module, used for obtaining a clock sampling rate through a clock recovery technique; And an audio reading processing module, which is used to read the PCM data according to the number of cached PCM data, and control the delay and synchronous output of the PCM data according to the clock sampling rate and the preset delay output condition.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction, and when the executable instruction is executed on the multi-channel audio decoding synchronization device as claimed in claim 9, the multi-channel audio decoding synchronization device performs the operation of the multi-channel audio decoding synchronization method as claimed in any one of claims 1-8.
