Decoding method and device of SPDIF data stream, storage medium and decoding equipment
By using a sliding window and waveform scaling analysis method, SPDIF data streams are directly decoded, solving the problem of complex synchronization operations in existing technologies and achieving efficient and robust audio signal decoding.
Patent Information
- Application Number
- CN202411296138.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-07
AI Technical Summary
Existing SPDIF decoding technology requires complex synchronization operations when processing data streams with different symbol rates, resulting in low adaptability and efficiency in the decoding process, making it difficult to meet the ever-increasing demands of audio processing.
Using the sliding window technique, the sliding window starts from the beginning of the SPDIF data stream and slides with a step size of one sub-waveform. The waveform ratio is collected and calculated, and the frame header and frame body bit data are identified by combining the preset frame body detection rules to generate the decoded audio signal bit stream.
It enables rapid identification of frame headers and frames without the need for prior complex data stream synchronization operations, improving decoding efficiency and robustness while reducing system complexity and latency.
Smart Images

Figure CN119277137A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing, and in particular to a method, device, storage medium and decoding equipment for decoding an SPDIF data stream. Background Art
[0002] SPDIF interface, the full name of which is Sony / Philips Digital Interface Format, has been firmly established as a standard format in the field of civilian audio due to its wide application base. With the rapid advancement of audio technology, SPDIF interface not only shines in traditional audio equipment, but also deeply integrates into modern audio-visual equipment such as projectors, TVs and high-end amplifiers, showing strong compatibility and wide application potential.
[0003] In the field of SPDIF audio processing, this technology is known for supporting high-sampling-rate stereo and compressed multi-channel surround sound (such as Dolby and DTS standards), bringing users an unprecedented audio experience. In the audio processing process, the SPDIF data stream that complies with the IEC-60958 and IEC-61937 international standards is accurately transmitted to the processing circuit. Here, the SPDIF processing circuit plays a key role, responsible for detecting the symbols in the data stream and decoding them efficiently to ensure the accurate restoration of the audio signal.
[0004] However, it is worth noting that current SPDIF processing circuits face certain challenges when receiving and processing SPDIF data streams with different symbol rates. Specifically, the circuits are often optimized for a specific symbol rate. If a data stream with a non-preset symbol rate is encountered, the circuit parameters need to be adjusted to adapt. This not only increases the complexity and cost of circuit design, but may also affect the decoding effect due to untimely adjustments, and even cause loss or errors in audio information.
[0005] Further analysis shows that the SPDIF data stream is composed of synchronization frame headers such as B / M / W and data bit encodings such as 0 / 1. These elements follow a specific data format and are closely related to the symbol rate, which together construct the complete structure of the SPDIF data stream. Unfortunately, existing SPDIF decoding technologies mostly rely on preset symbol rates or require complex synchronization operations to obtain symbol rates, which to a certain extent limits the adaptability and efficiency of the decoding process and makes it difficult to meet the growing audio processing needs. Summary of the invention
[0006] The embodiments of the present application provide a method, apparatus, storage medium and decoding device for decoding an SPDIF data stream, which can solve the problem that SPDIF decoding in the prior art requires synchronous operation. The technical solution is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for decoding an SPDIF data stream, the method comprising:
[0008] Receive and buffer SPDIF data stream;
[0009] The sliding window is controlled to start from the starting point of the SPDIF data stream and slide with a step length of 1 sub-waveform, and 4 sub-waveform signals corresponding to the sliding window are collected at each position during the sliding process, and the waveform ratio is calculated according to the duration of the 4 sub-waveform signals; wherein the length of the sliding window is 4 sub-waveforms, and the sub-waveform represents the waveform between two adjacent transition edges, and the transition edge is a rising edge or a falling edge;
[0010] Matching the calculated at least one waveform ratio according to a preset frame body detection rule, and identifying a frame header and bit data of the frame header of the current subframe according to the matching result;
[0011] Determine the length of the frame body according to the length of the current subframe and the length of the frame header;
[0012] Acquiring a corresponding number of multiple waveform ratios according to the length of the frame body, matching the multiple waveform ratios according to a preset frame body detection rule, and identifying bit data of the frame body according to the matching result;
[0013] A decoded audio signal code stream is generated according to the bit data of the frame header and the bit data of the frame body.
[0014] In a second aspect, an embodiment of the present application provides a decoding device for an SPDIF data stream, the device comprising:
[0015] A receiving unit, used for receiving and buffering SPDIF data stream;
[0016] An acquisition unit, used for controlling the sliding window to start from the starting point of the SPDIF data stream and slide with a step length of 1 sub-waveform, acquiring 4 sub-waveform signals corresponding to the sliding window at each position during the sliding process, and calculating the waveform ratio according to the duration of the 4 sub-waveform signals; wherein the length of the sliding window is 4 sub-waveforms, and the sub-waveform represents the waveform between two adjacent transition edges, and the transition edge is a rising edge or a falling edge;
[0017] an identification unit, configured to match the calculated at least one waveform ratio according to a preset frame body detection rule, and identify a frame header and bit data of the frame header of a current subframe according to a matching result;
[0018] A determining unit, configured to determine the length of the frame body according to the length of the current subframe and the length of the frame header;
[0019] The identification unit is further configured to obtain a corresponding number of waveform ratios according to the length of the frame body, match the multiple waveform ratios according to a preset frame body detection rule, and identify the bit data of the frame body according to the matching result;
[0020] A generating unit is used to generate a decoded audio signal code stream according to the bit data of the frame header and the bit data of the frame body.
[0021] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0022] In a fourth aspect, an embodiment of the present application provides a decoding device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0023] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0024] It can directly decode the received SPDIF data stream without performing complex data stream synchronization operations in advance. When processing digital signals, traditional decoding methods usually need to first ensure that the various parts of the data stream (such as frame headers, frame bodies, etc.) are strictly aligned in time, that is, to achieve data stream synchronization. This process may involve complex algorithms and long processing time, which not only increases the complexity and delay of the system, but may also cause decoding failure due to synchronization failure.
[0025] By directly analyzing the waveform ratio characteristics of the data stream, the sliding window and waveform ratio matching method are used to achieve rapid recognition and decoding of the frame header and frame body. This method does not rely on the absolute time position of each part in the data stream, but decodes based on the physical characteristics of the waveform signal, so there is no need for explicit data stream synchronization. This feature makes the decoding process more concise and efficient, and also improves the robustness to interference factors such as signal noise and distortion. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] 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, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 It is a schematic diagram of the network architecture provided by the embodiment of the present application;
[0028] Figure 2 It is a flowchart of a method for decoding an SPDIF data stream provided in an embodiment of the present application;
[0029] Figure 3 It is a structural schematic diagram of a SPDIF data stream decoding device provided by the present application;
[0030] Figure 4 It is a structural schematic diagram of a decoding device provided by this application. DETAILED DESCRIPTION
[0031] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0032] It should be noted that the SPDIF data stream decoding method provided in the present application is generally executed by a decoding device, and correspondingly, the SPDIF data stream decoding device is generally arranged in the decoding device.
[0033] Figure 1 An exemplary system architecture that can be applied to the SPDIF data stream decoding method or SPDIF data stream decoding device of the present application is shown.
[0034] like Figure 1 As shown, the system architecture may include: a signal source device, a decoding device and an audio output device. The signal source device is used to generate an SPDIF data stream. The signal source device may be a device such as a television. The signal source device may be connected to the decoding device through a digital optical fiber or a coaxial cable. The audio output device is used to play the decoded data stream. The audio output device may be a speaker or a headset. The audio output device may be connected to the decoding device through a 3.5mm interface or a red and white interface.
[0035] It should be understood that Figure 1 The number of decoding devices, signal source devices and audio output devices in the embodiment is only for illustration and can be any number according to the implementation requirements.
[0036] The following will be combined with the attached Figure 2 , the SPDIF data stream decoding method provided in the embodiment of the present application is described in detail. Among them, the SPDIF data stream decoding device in the embodiment of the present application can be Figure 1 The decoding device shown.
[0037] See also Figure 2 , is a flowchart of a method for decoding an SPDIF data stream provided by an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0038] S201: Receive and buffer SPDIF data stream.
[0039] Among them, the decoding device (such as an audio decoder) receives the SPDIF (Sony / Philips Digital Interface Format) data stream from the audio source (such as a DVD player, Blu-ray player or audio server) through its built-in digital audio interface (such as IEC-958 or coaxial / optical interface). The SPDIF data stream is a digital audio signal transmitted in a serial manner, containing audio data and synchronization, clock, error detection and other information. The decoding device checks the error detection bits (such as CRC checksum) in the received data stream in real time to verify the integrity and correctness of the data. If an error is found, the device may record an error log, attempt error correction, or ignore the problematic data segment. The data stream that has been error-checked is sent to the buffer area (such as a FIFO buffer or RAM) inside the decoding device. The size of the buffer area is designed according to the performance and processing power of the device to ensure that a sufficient number of audio frame data can be stored to cope with data flow fluctuations and processing delays.
[0040] S202, control the sliding window to start from the starting point of the SPDIF data stream and slide with a step size of 1 sub-waveform, collect 4 sub-waveform signals corresponding to the sliding window at each position during the sliding process, and calculate the waveform ratio according to the duration of the 4 sub-waveform signals.
[0041] Among them, a sliding window of fixed length (such as 4 sub-waveform lengths) is defined inside the decoding device. The starting position of the window is set at the current processing point of the SPDIF data stream. The sliding window slides continuously on the data stream with a preset step size (such as 1 sub-waveform length). During each sliding process, the window covers the latest sub-waveform data. For each sub-waveform in the window, the decoding device collects the characteristic parameters of its waveform signal (such as duration, amplitude, etc.). These parameters reflect the physical characteristics and time characteristics of the sub-waveform. Based on the collected sub-waveform characteristic parameters (mainly duration), the decoding device calculates the waveform ratio. The waveform ratio may represent the ratio of the duration of the 4 sub-waveforms covered by the sliding window. For example: the duration of the 4 sub-waveforms is LEN1, LEN2, LEN3, LEN4, then the waveform ratio is LEN1:LEN2:LEN3:LEN4.
[0042] S203: Match the calculated at least one waveform ratio according to a preset frame body detection rule, and identify the frame header of the current subframe and the bit data of the frame header according to the matching result.
[0043] The decoding device matches the calculated waveform ratio with the preset frame header detection rules. These rules define the correspondence between a specific waveform ratio sequence and frame header features. When the waveform ratio sequence successfully matches a pattern in the preset rules, the decoding device identifies the frame header position of the current subframe. Subsequently, based on the structure definition of the frame header and the waveform ratio information, the decoding device parses the bit data of the frame header (such as synchronization word, frame type, sampling rate, etc.).
[0044] The frame header recognition process is described below.
[0045] The frame header may be a B frame header, an M frame header or a W frame header. The length of the frame header is 4 bits. The waveform ratios related to the first 3 bits of data of the frame header and the frame body are shown in the first waveform ratio list of Table 1.
[0046] Waveform ratio a 1 1 1 1 Waveform ratio b 2 1 2 2 Waveform ratio c 2 1 2 1 Waveform ratio d 1 3 2 2 Waveform ratio 2 3 1 1 Waveform ratio f 3 1 1 3 Waveform ratio g 1 1 3 1 Waveform ratio h 1 3 1 1 Waveform ratio i 2 3 3 1 Waveform ratioj 3 3 1 1 Waveform ratio k 1 1 3 3 Waveform ratio 1 3 3 1 Waveform ratio m 2 3 2 1 Waveform ratio n 3 2 1 2 Waveform ratio 1 1 3 2 Waveform ratio p 1 3 2 1 Waveform ratio q 3 2 1 1 Waveform ratio r 3 1 1 1 Waveform ratio 3 1 1 2 Waveform ratio t 3 2 2 1 Waveform ratio u 3 2 2 2 Waveform ratio v 1 2 1 1
[0047] Table 1
[0048] The frame head is identified based on the calculated waveform ratio according to the waveform ratio list in Table 1.
[0049] The method for identifying a B frame header includes: when waveform ratio e (2:3:1:1)→waveform ratio f (3:1:1:3) is continuously detected, determining that 4 sub-waveforms after waveform ratio f correspond to the B frame header.
[0050] When waveform ratio g (1:1:3:1) → waveform ratio h (1:3:1:1) → waveform ratio f (3:1:1:3) is detected continuously, it is determined that the 4 sub-waveforms after waveform ratio f correspond to the B frame header.
[0051] The detection methods of other types of frame headers can be determined according to the waveform of the frame header, which will not be described in detail here.
[0052] S204: Determine the length of the frame body according to the length of the current subframe and the length of the frame header.
[0053] Among them, after identifying the frame header and parsing its length information (if the frame header directly contains the length information or the length can be derived through a specific algorithm), the decoding device determines the length of the frame body based on this information and the frame structure defined in the SPDIF standard. The length of the frame body is usually expressed in bits or the number of sub-waveforms, and depends on the specific content and format of the frame header. For example: the length of the frame body is 28 bits, that is, the subframe includes a 28-bit frame body in addition to the frame header.
[0054] S205 , acquiring a corresponding number of multiple waveform ratios according to the length of the frame body, matching the multiple waveform ratios according to a preset frame body detection rule, and identifying the bit data of the frame body according to the matching result.
[0055] Among them, after determining the length of the frame body, the decoding device continues to slide the window and collects a corresponding number of waveform ratios according to the length of the frame body. These waveform ratios come from the data code stream of the frame body part, and the bit data of the frame body is identified by matching with the preset frame body detection rules. The matching process is similar to the process of identifying the frame header, but involves different rule sets and matching algorithms. The decoding device converts the waveform ratios into corresponding bit values according to the characteristics of the waveform ratios and the definitions in the rule set, and combines them into a complete frame body bit stream.
[0056] The frame body recognition process is described below.
[0057] When the B / M / W frame header is identified, the 3 bits of data after the frame header are identified. There are three methods for identifying that the first bit of data after the frame header is 0:
[0058] 1) When the waveform ratio f (3:1:1:3) → waveform ratio o (1:1:3:2) is continuously detected, it is determined that the first bit data after the frame header is 0, and the waveform ratio f corresponds to the frame header.
[0059] 2) When the waveform ratio j (3:3:1:1) → waveform ratio s (3:1:1:2) is continuously detected, it is determined that the first bit data after the frame header is 0, and the waveform ratio j (3:3:1:1) corresponds to the frame header.
[0060] 3) When the waveform ratio n (3:2:1:2) → waveform ratio b (2:1:2:2) is continuously detected, it is determined that the first bit data after the frame header is 0, and the waveform ratio n (3:2:1:2) corresponds to the frame header.
[0061] Among them, the methods of identifying that the first bit of data after the frame header is 1 include the following three methods:
[0062] 1) When the waveform ratio f(3:1:1:3) → waveform ratio g(1:1:3:1) → waveform ratio h(1:3:1:1) is continuously detected, it is determined that the first bit data after the frame header is 1, and f(3:1:1:3) corresponds to the frame header.
[0063] 2) When waveform ratio j (3:3:1:1) → waveform ratio r (3:1:1:1) → waveform ratio a (1:1:1:1) is detected continuously, it is confirmed that the first bit data after the frame header is 1.
[0064] 3) When waveform ratio n (3:2:1:2) → waveform ratio c (2:1:2:1) → waveform ratio v (1:2:1:1) is detected continuously, it is confirmed that the first bit data after the frame header is 1.
[0065] It should be noted that the identification method of 2 to 3 bits of data in the frame body is similar to that of the frame body, and will not be described in detail here.
[0066] Furthermore, the second waveform ratio list in Table 2 is used to identify other bit data in the frame body.
[0067]
[0068]
[0069] Table 2
[0070] Taking the identification of the last bit of data in the frame body as an example, there are 8 methods for identifying that the last bit of data is 0:
[0071] 1) Under the premise that the first three bits of the frame body are all 0, when the waveform ratio A (1:1:1:1) is detected, it is determined that the last bit of data after the waveform ratio A is 0.
[0072] 2) When waveform ratio C (2:2:1:1)→waveform ratio E (2:1:1:2) is continuously detected, it is determined that the last bit of data after waveform ratio E is 0.
[0073] 3) When waveform ratio D (2:1:1:1) → waveform ratio A (1:1:1:1) → waveform ratio F (1:1:1:2) is continuously detected, it is determined that the last bit of data after waveform ratio F is 0.
[0074] 4) When the waveform ratio E (2:1:1:2) → the waveform ratio I (1:1:2:2) is continuously detected, it is determined that the last bit of data after the waveform ratio I is 0.
[0075] 5) When waveform ratio A (1:1:1:1) → waveform ratio F (1:1:1:2) → waveform ratio I (1:1:2:2) is detected continuously, it is determined that the last bit of data after waveform ratio I is 0.
[0076] 6) When waveform ratio A (1:1:1:1) → waveform ratio A (1:1:1:1) → waveform ratio A (1:1:1:1) → waveform ratio F (1:1:1:2) is detected continuously, it is determined that the last bit of data after waveform ratio F is 0.
[0077] 7) When waveform ratio G (1:1:2:1) → waveform ratio H (1:2:1:1) → waveform ratio E (2:1:1:2) is continuously detected, it is determined that the last bit of data after waveform ratio E is 0.
[0078] 8) When the waveform ratio I (1:1:2:2) → the waveform ratio K (1:2:2:2) is continuously detected, it is determined that the last bit of data after the waveform ratio K is 0.
[0079] Among them, the methods for identifying that the last bit of data is 1 include the following 8 methods:
[0080] 1) When waveform ratio B (2:2:2:1) → waveform ratio C (2:2:1:1) is continuously detected, it is determined that the last bit of data after waveform ratio C is 1.
[0081] 2) When waveform ratio C (2:2:1:1) → waveform ratio D (2:1:1:1) → waveform ratio A (1:1:1:1) is detected continuously, it is recognized that the last bit of data after waveform ratio A is 1.
[0082] 3) When waveform ratio D (2:1:1:1) → waveform ratio A (1:1:1:1) → waveform ratio A (1:1:1:1) → waveform ratio A (1:1:1:1) is continuously detected, it is determined that the last bit data after waveform ratio A is 1.
[0083] 4) When waveform ratio E (2:1:1:2) → waveform ratio G (1:1:2:1) → waveform ratio H (1:2:1:1) is continuously detected, it is determined that the last bit of data after waveform ratio H is 1.
[0084] 5) When waveform ratio A (1:1:1:1) → waveform ratio F (1:1:1:2) → waveform ratio G (1:1:2:1) → waveform ratio H (1:2:1:1) is detected continuously, it is determined that the last bit data after waveform ratio H is 1.
[0085] 6) When waveform ratio A(1:1:1:1)→waveform ratio A(1:1:1:1)→waveform ratio A(1:1:1:1)→waveform ratio A(1:1:1:1)→waveform ratio A(1:1:1:1) is detected continuously, it is determined that the last bit data after waveform ratio A is 1.
[0086] 7) When waveform ratio G (1:1:2:1) → waveform ratio H (1:2:1:1) → waveform ratio D (2:1:1:1) → waveform ratio A (1:1:1:1) is detected continuously, it is determined that the last bit data after waveform ratio A is 1.
[0087] 8) When waveform ratio I (1:1:2:2) → waveform ratio J (1:2:2:1) → waveform ratio C (2:2:1:1) is detected continuously, it is determined that the last bit of data after waveform ratio C is 1.
[0088] S206: Generate a decoded audio signal code stream according to the bit data of the frame header and the bit data of the frame body.
[0089] After successfully identifying and parsing the bit data of the frame header and frame body, the decoding device combines these bit data into a complete audio signal code stream. If the audio data is compressed (such as Dolby Digital, DTS, etc.), the decoding device also needs to decompress the compressed data.
[0090] The decoded audio signal code stream may contain audio data in PCM (Pulse Code Modulation) format, which can be played directly by the audio output device. Before output, the decoding device may further process the audio signal, such as volume adjustment and equalization, to improve the sound quality and user experience. Finally, the decoded audio signal is sent to the audio output port of the decoding device for the user to listen to.
[0091] The embodiments of the present application have the following beneficial effects when decoding:
[0092] The received SPDIF data stream can be directly decoded without the need to perform complex data stream synchronization operations in advance. When processing digital signals, traditional decoding methods usually need to first ensure that the various parts of the data stream (such as frame headers, frame bodies, etc.) are strictly aligned in time, that is, to achieve data stream synchronization. This process may involve complex algorithms and long processing time, which not only increases the complexity and delay of the system, but may also cause decoding failure due to synchronization failure.
[0093] The method of sliding window combined with waveform ratio analysis can quickly and accurately locate the frame header of the data frame. Compared with the traditional synchronization method based on synchronization sequence or specific mode, this search method based on waveform features significantly reduces the time of searching for frame header and improves the real-time performance and efficiency of data decoding. In addition, since there is no need to perform complex data stream synchronization process in advance, it also further simplifies the decoding process and reduces the consumption of computing resources.
[0094] By analyzing the duration of the four sub-waveform signals collected in the sliding window and calculating the waveform ratio accordingly, this solution can more accurately capture subtle changes in the data stream, thereby improving the accuracy of identifying frame header and frame body bit data. This decoding method based on physical waveform characteristics reduces misjudgments caused by factors such as signal noise and distortion, and ensures the reliability of the decoding results.
[0095] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0096] See also Figure 3, which shows a schematic diagram of the structure of a decoding device for an SPDIF data stream provided by an exemplary embodiment of the present application, hereinafter referred to as device 3. The device 3 can be implemented as all or part of a decoding device through software, hardware, or a combination of both. The device 3 includes: a receiving unit 301, a collection unit 302, an identification unit 303, a determination unit 304, and a generation unit 305.
[0097] The receiving unit 301 is used to receive and buffer the SPDIF data stream;
[0098] The acquisition unit 302 is used to control the sliding window to start from the starting point of the SPDIF data stream and slide with a step length of 1 sub-waveform, collect 4 sub-waveform signals corresponding to the sliding window at each position during the sliding process, and calculate the waveform ratio according to the duration of the 4 sub-waveform signals; wherein the length of the sliding window is 4 sub-waveforms, and the sub-waveform represents the waveform between two adjacent transition edges, and the transition edge is a rising edge or a falling edge;
[0099] The identification unit 303 is used to match the calculated at least one waveform ratio according to a preset frame body detection rule, and identify the frame header and bit data of the frame header of the current subframe according to the matching result;
[0100] A determining unit 304, configured to determine a length of a frame body according to a length of the current subframe and a length of the frame header;
[0101] The identification unit 303 is further configured to obtain a corresponding number of waveform ratios according to the length of the frame body, match the multiple waveform ratios according to a preset frame body detection rule, and identify the bit data of the frame body according to the matching result;
[0102] The generating unit 305 is configured to generate a decoded audio signal code stream according to the bit data of the frame header and the bit data of the frame body.
[0103] In one or more possible embodiments, the receiving and buffering of the SPDIF data stream includes:
[0104] Receive SPDIF data stream;
[0105] An integrity check is performed on the SPDIF data stream, and the SPDIF data stream after successful check is written into a buffer area of a preset size.
[0106] In one or more possible embodiments, the length of the frame body is 28 bits.
[0107] In one or more possible embodiments, the first 3 bits of data in the frame header and frame body of the current subframe are identified according to the first waveform ratio list, and the 4th to 28th bits of data in the frame body are identified according to the second waveform ratio list.
[0108] It should be noted that, when the device 3 provided in the above embodiment performs the SPDIF data stream decoding method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the SPDIF data stream decoding device provided in the above embodiment and the SPDIF data stream decoding method embodiment belong to the same concept, and the embodiment and implementation process thereof are detailed in the method embodiment, which will not be repeated here.
[0109] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0110] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2 The specific description of the illustrated embodiment will not be repeated here.
[0111] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the SPDIF data stream decoding method described in the above embodiments.
[0112] See also Figure 4 , which is a schematic diagram of the structure of a decoding device provided in an embodiment of the present application. Figure 4 As shown, the decoding device 400 may include: at least one processor 401 , at least one network interface 404 , a user interface 403 , a memory 405 , and at least one communication bus 402 .
[0113] The communication bus 402 is used to realize the connection and communication between these components.
[0114] The user interface 403 may include a display screen (Display) and a camera (Camera), and the optional user interface 403 may also include a standard wired interface and a wireless interface.
[0115] The network interface 404 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0116] Among them, the processor 401 may include one or more processing cores. The processor 401 uses various interfaces and lines to connect the various parts of the entire decoding device 400, and executes various functions and processes data of the decoding device 400 by running or executing instructions, programs, code sets or instruction sets stored in the memory 405, and calling data stored in the memory 405. Optionally, the processor 401 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 401 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 401, and it can be implemented separately through a chip.
[0117] Among them, the memory 405 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 405 includes a non-transitory computer-readable storage medium. The memory 405 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 405 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 405 may optionally be at least one storage device located away from the aforementioned processor 401. As Figure 4 As shown, the memory 405 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program.
[0118] exist Figure 4In the decoding device 400 shown in FIG. 1 , the user interface 403 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 401 can be used to call the application stored in the memory 405 and specifically execute the following steps: Figure 2 The specific process can be referred to Figure 2 As shown, no further description is given here.
[0119] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0120] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for decoding an SPDIF data stream, characterized in that: include: Receive and buffer SPDIF data stream; The sliding window is controlled to start from the starting point of the SPDIF data stream and slide with a step length of 1 sub-waveform, and 4 sub-waveform signals corresponding to the sliding window are collected at each position during the sliding process, and the waveform ratio is calculated according to the duration of the 4 sub-waveform signals; wherein the length of the sliding window is 4 sub-waveforms, and the sub-waveform represents the waveform between two adjacent transition edges, and the transition edge is a rising edge or a falling edge; Matching the calculated at least one waveform ratio according to a preset frame body detection rule, and identifying a frame header and bit data of the frame header of the current subframe according to the matching result; Determine the length of the frame body according to the length of the current subframe and the length of the frame header; Acquiring a corresponding number of multiple waveform ratios according to the length of the frame body, matching the multiple waveform ratios according to a preset frame body detection rule, and identifying bit data of the frame body according to the matching result; A decoded audio signal code stream is generated according to the bit data of the frame header and the bit data of the frame body.
2. The method according to claim 1, characterized in that: The receiving and caching of the SPDIF data stream comprises: Receive SPDIF data stream; An integrity check is performed on the SPDIF data stream, and the SPDIF data stream after successful check is written into a buffer area of a preset size.
3. The method according to claim 1 or 2, characterized in that: The length of the frame body is 28 bits.
4. The method according to claim 3, characterized in that The first 3 bits of data in the frame header and the frame body of the current subframe are identified according to the first waveform ratio list, and the 4th to 28th bits of data in the frame body are identified according to the second waveform ratio list.
5. The method according to claim 1, 2 or 4, characterized in that: Also includes: The audio signal code stream is decompressed, and the decompressed audio signal code stream is sent to an audio output device.
6. A decoding device for SPDIF data stream, characterized in that: include: A receiving unit, used for receiving and buffering SPDIF data stream; An acquisition unit, used for controlling the sliding window to start from the starting point of the SPDIF data stream and slide with a step length of 1 sub-waveform, acquiring 4 sub-waveform signals corresponding to the sliding window at each position during the sliding process, and calculating the waveform ratio according to the duration of the 4 sub-waveform signals; wherein the length of the sliding window is 4 sub-waveforms, and the sub-waveform represents the waveform between two adjacent transition edges, and the transition edge is a rising edge or a falling edge; an identification unit, configured to match the calculated at least one waveform ratio according to a preset frame body detection rule, and identify a frame header and bit data of the frame header of a current subframe according to a matching result; A determining unit, configured to determine the length of the frame body according to the length of the current subframe and the length of the frame header; The identification unit is further configured to obtain a corresponding number of waveform ratios according to the length of the frame body, match the multiple waveform ratios according to a preset frame body detection rule, and identify the bit data of the frame body according to the matching result; A generating unit is used to generate a decoded audio signal code stream according to the bit data of the frame header and the bit data of the frame body.
7. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 5.
8. A decoding device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 5.
Citation Information
Cited By
Column bit feature efficient identification method based on byte alignment
CN121603162A