Pulse video coding and decoding method
By time sorting and substring division of pixel data of pulsed video, and using specific encoding and decoding methods, the problem of low compression rate of pulsed video in the prior art is solved, and more efficient data compression and accurate video restoration are achieved.
Patent Information
- Application Number
- CN202411809620.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-29
AI Technical Summary
The existing pulse video compression tools use general data compression algorithms, which leads to low compression rate of pulse videos, making it difficult to meet their high sampling frequency and high data rate requirements.
By sorting the data of each pixel at each sampling time by time and dividing the substrings, using the time series information and the continuity of pixel values in the pulse video, a more compact information representation method is generated using specific encoding and decoding methods.
The compression rate of pulsed video is significantly improved, redundant data is reduced, and important information of the original video is retained, so that the original video can be accurately restored during decoding.
Smart Images

Figure CN119906824A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video processing, and in particular to a pulse video encoding and decoding method. Background Art
[0002] Pulse video is different from traditional shooting methods. It uses an integral comparison mechanism. The integrator can accumulate the charge output by the photoelectric converter. The comparator compares the charge on the integrator with the preset threshold at a fixed time interval. If the accumulated charge on the integrator reaches the preset threshold, it outputs 1 and clears the charge on the integrator. If the charge on the integrator does not reach the preset threshold, it outputs 0 and maintains the charge on the integrator. It can be seen that this method is very different from the traditional shooting method. The traditional shooting method extracts the charge on the integrator at a fixed time interval. No matter how much charge there is, the charge on the integrator will be cleared.
[0003] Traditional shooting methods use the number of charges extracted as the brightness of the pixel corresponding to the integrator. In the era of digital photography, the brightness will be quantized into an integer, represented by 8 bits or more. This brings two problems: first, the processor needs to have a very high sensitivity. Because in high-speed photography, the signal will be distributed over all time intervals, and the signal collected at each time interval will become very weak; second, the processor needs to have a very high data processing speed. Because in high-speed photography, the amount of data is proportional to the frame rate.
[0004] Pulse video overcomes two problems of traditional high-speed photography. First, pulse video does not need to extract the specific strength of the signal at each time interval, but only needs to compare the signal strength (charge number) with the preset threshold. Second, each pixel only generates 1 bit of data at each time interval, reducing the amount of data.
[0005] Since the sampling frequency of pulse video is very high, although each pixel only outputs 1 bit at each moment, the data rate is still very high, and the pulse video data needs to be compressed and encoded. However, some existing compression tools mainly use some general data compression algorithms, such as Huffman coding, LZ77 coding, LZ78 coding and LZW coding. These encoding methods usually analyze the entire data, and then encode the data with high frequency in a shorter way to achieve the compression effect. This is not a high compression rate for pulse video. Summary of the invention
[0006] In order to solve the above problems, the present invention provides a pulse video encoding and decoding method.
[0007] The first aspect of the present invention discloses a pulse video coding method, comprising:
[0008] Acquire target pulse videos collected at multiple consecutive sampling moments;
[0009] Sorting the data of each pixel position in the target pulse video at each sampling time according to time to obtain a pixel bit string of each pixel position;
[0010] Dividing the pixel bit string into a plurality of substrings according to the value of the pixel bit string;
[0011] For each pixel position, encoding is performed according to the length of each substring and the number of all substrings to obtain its corresponding pixel code;
[0012] Arrange the pixel codes corresponding to all the pixel positions in the order of pixel position sorting to obtain a pixel code set;
[0013] Encode the width of the target pulse video, the height of the target pulse video, and the number of sampling moments into a basic data code having a length of a first length;
[0014] The pixel coding set is connected to the basic data coding to obtain the coding data of the target pulse video.
[0015] Furthermore, the step of dividing the pixel bit string into a plurality of substrings according to its value includes:
[0016] Traversing the pixel bit string and finding all the first bits therein;
[0017] According to the position of each of the first bits, the pixel bit string is divided into a plurality of substrings in a preset division manner.
[0018] Furthermore, the step of dividing the pixel bit string into a plurality of substrings according to a preset division method according to the position of each first bit includes:
[0019] Detect whether the bit value at the end position of the pixel bit string is the first bit:
[0020] If it is the first bit, the pixel bit string is divided into a plurality of substrings according to the division method of dividing the position after each first bit;
[0021] If it is not the first bit, the first bit is added after the end position of the pixel bit string, and then the pixel bit string is divided into a plurality of substrings in a partitioning manner according to the position after each first bit.
[0022] Furthermore, for each pixel position, encoding is performed according to the length of each substring and the number of all substrings to obtain the corresponding pixel code, including:
[0023] For each of these pixel locations:
[0024] Encode the number of substrings corresponding to the substrings to obtain a number code, wherein the length of the number code is a preset second length;
[0025] According to the length change of each substring and its adjacent substring, encoding is performed to obtain a substring encoding set;
[0026] The quantity code is concatenated with the substring code set to obtain a pixel code corresponding to the pixel position.
[0027] Furthermore, the step of encoding to obtain a substring encoding set according to the length change of each substring and its adjacent substring includes:
[0028] For the first substring, encode its length to obtain its corresponding substring code;
[0029] For other substrings, encode the change of their lengths relative to the length of the previous substring to obtain their corresponding substring codes;
[0030] Concatenate all the substring codes to obtain a substring code set;
[0031] The length of each substring code is a preset third length.
[0032] A second aspect of the present invention discloses a pulse video decoding method, comprising:
[0033] Get the encoded data;
[0034] Acquire data of a first length from the starting position of the coded data as basic data encoding, and use the remaining data of the coded data as a pixel coding set;
[0035] Decoding the basic data code to obtain the width of the target pulse video, the height of the target pulse video, and the number of sampling moments of the target pulse video;
[0036] Decoding and splitting the pixel code set into a number code and a substring code of a plurality of pixel codes, each pixel code corresponding to a pixel position;
[0037] Decoding each of the pixel codes to obtain a plurality of substrings corresponding to each of the pixel positions;
[0038] Concatenate all the substrings corresponding to each pixel position to obtain a pixel bit string for each pixel position;
[0039] According to the width of the target pulse video, the height of the target pulse video, and the number of sampling moments of the target pulse video, the pixel bit strings at all pixel positions are decoded to generate the target pulse video.
[0040] Furthermore, the step of decoding and splitting the pixel code set into a number code and a substring code of a plurality of pixel codes includes:
[0041] The following steps are performed on the pixel code set in a loop:
[0042] Starting from the starting position, read data having a length of the second length as a quantity code;
[0043] Decode the quantity code to obtain the substring quantity M;
[0044] M data of a third length are read as M substring codes, and the position after the M substring codes is updated as the starting position.
[0045] Furthermore, the step of decoding each pixel code to obtain a plurality of substrings corresponding to each pixel position includes:
[0046] Decoding a plurality of substring codes in each pixel code to obtain length change information of each substring relative to its adjacent substring;
[0047] Based on the length change information of each substring relative to its adjacent substring, the length of each substring is calculated;
[0048] According to the preset division method and the length of each substring, the first bit is filled into the corresponding substring to obtain a plurality of substrings corresponding to each pixel position.
[0049] Furthermore, the step of filling the first bit into the corresponding substring according to the preset division method and the length of each substring to obtain a plurality of substrings corresponding to each pixel position includes:
[0050] According to the preset division method and the length of each substring, fill the first bit into the corresponding substring;
[0051] Determine whether the sum of the lengths of all the substrings corresponding to each of the pixel positions exceeds the number of sampling moments;
[0052] When it exceeds, the data of the corresponding last substring is corrected according to the division method.
[0053] Furthermore, according to the preset division method and the length of each substring, the characteristics of filling the first bit into the corresponding substring include:
[0054] According to the length of each substring, fill the first bit into the last bit of the corresponding substring;
[0055] And, according to the division method, the step of correcting the data of the corresponding last substring includes:
[0056] Delete the last bit of the corresponding last substring.
[0057] The present invention effectively captures and utilizes the time series information and the continuity of pixel values in the pulse video by sorting the data of each pixel at each sampling moment according to time and dividing it into substrings. This division and encoding strategy is actually creating a more compact information representation method, which can greatly reduce redundant data, and thus significantly improve the compression rate of the pulse video. At the same time, this method also retains the important information of the original video, so that the original video can be accurately restored during decoding. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0059] Figure 1 It is a flow chart of a pulse video encoding method disclosed in an embodiment of the present invention;
[0060] Figure 2 is a certain pixel bit string in the target pulse video disclosed in the embodiment of the present invention;
[0061] Figure 3 It is a flow chart of a pulse video decoding method disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, or product end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0064] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0065] See also Figure 1 As shown, Figure 1 FIG. 1 is a flow chart of a pulse video encoding method disclosed in an embodiment of the present invention. Figure 1 As shown, the pulse video encoding method may include the following operations:
[0066] S101, obtaining target pulse videos collected at multiple consecutive sampling moments;
[0067] In this optional embodiment, the plurality of consecutive sampling moments refers to video sampling operations performed at consecutive time points.
[0068] S102, sorting the data of each pixel position in the target pulse video at each sampling time according to time to obtain a pixel bit string of each pixel position;
[0069] In this embodiment, the pixel position refers to the coordinate position corresponding to each pixel point in the two-dimensional image coordinate system. For example, in a video frame with a width of W and a height of H, the coordinate position of the pixel point in the upper left corner is (0,0), and the coordinate position of the pixel point in the lower right corner is (W-1,H-1).
[0070] For example, the number of sampling moments is 4. For a certain pixel position, the data at the 0th sampling moment is 0, the data at the 1st sampling moment is 0, the data at the 2nd sampling moment is 0, and the data at the 3rd sampling moment is 1. The corresponding pixel bit string is 0001.
[0071] Figure 2A pixel bit string in a target pulse video is shown, wherein the width of the target pulse video is W, the height of the target pulse video is H, and the number of sampling moments is N.
[0072] S103, dividing the pixel bit string into a plurality of substrings according to the value of the pixel bit string;
[0073] In an optional embodiment, the step of dividing the pixel bit string into a plurality of substrings according to its value comprises:
[0074] Traversing the pixel bit string and finding all the first bits therein;
[0075] According to the position of each of the first bits, the pixel bit string is divided into a plurality of substrings in a preset division manner.
[0076] In this optional embodiment, the first bit refers to a bit value in the target pulse video, and the bit value represents that the charge accumulated on the integrator in the pulse video capture device has reached a preset threshold. In this embodiment, the first bit is bit 1.
[0077] In a further optional embodiment, the step of dividing the pixel bit string into a plurality of substrings according to a preset division method according to the position of each first bit includes:
[0078] Detect whether the bit value at the end position of the pixel bit string is the first bit:
[0079] If it is the first bit, the pixel bit string is divided into a plurality of substrings according to the division method of dividing the position after each first bit;
[0080] If it is not the first bit, the first bit is added after the end position of the pixel bit string, and then the pixel bit string is divided into a plurality of substrings in a partitioning manner according to the position after each first bit.
[0081] For example, for the pixel bit string 10100010001, since its end position is the first bit, it is divided into substrings: 1, 01, 0001, 0001. For the pixel bit string 1010001000100, since its end position is not the first bit, the first bit is added after its end position to obtain 10100010001001, which is divided into substrings: 1, 01, 0001, 0001, 001.
[0082] S104, for each pixel position, encode according to the length of each substring and the number of all substrings to obtain its corresponding pixel code;
[0083] In an optional embodiment, the step of encoding each pixel position according to the length of each substring and the number of all substrings to obtain the corresponding pixel code includes:
[0084] For each of these pixel locations:
[0085] Encode the number of substrings corresponding to the substrings to obtain a number code, wherein the length of the number code is a preset second length;
[0086] According to the length change of each substring and its adjacent substring, encoding is performed to obtain a substring encoding set;
[0087] The quantity code is concatenated with the substring code set to obtain a pixel code corresponding to the pixel position.
[0088] In this embodiment, a variety of encoding methods can be used to encode the number of substrings, such as 0-order exponential Golomb coding, Golomb coding, Huffman coding, Arligman coding, etc.
[0089] In a further optional embodiment, the step of encoding to obtain a substring encoding set according to the length change of each substring and its adjacent substring includes:
[0090] For the first substring, encode its length to obtain its corresponding substring code;
[0091] For other substrings, encode the change of their lengths relative to the length of the previous substring to obtain their corresponding substring codes;
[0092] Concatenate all the substring codes to obtain a substring code set;
[0093] The length of each substring code is a preset third length.
[0094] The coding referred to in this embodiment can be selected from a variety of coding methods, such as 0-order exponential Golomb coding, Golomb coding, Huffman coding, Arrigoman coding, etc. However, for all substrings, it is preferred to use the same coding method for encoding, while the coding method of the substring and the coding method of the number of substrings can be different.
[0095] For example, the substrings of a pixel bit string are 1, 01, 0001, 0001, 001, then its substring encoding set is: Encode(1), Encode(1), Encode(2), Encode(0), Encode(-1), which means that the length of the first substring is 1, the length of the second substring is 2 (the length of the first substring plus 1), the length of the third substring is 4 (the length of the second substring plus 2), the length of the fourth substring is 4 (the length of the third substring plus 0), and the length of the fifth substring is 3 (the length of the fourth substring plus -1). Encode() represents the encoding function.
[0096] S105, arranging the pixel codes corresponding to all the pixel positions in a pixel position sorting order to obtain a pixel code set;
[0097] In this optional embodiment, the pixel position ordering may be a row-first arrangement or a column-first arrangement.
[0098] S106, encoding the width of the target pulse video, the height of the target pulse video, and the number of sampling moments into a basic data code having a first length;
[0099] In this optional embodiment, the width of the target pulse video, the height of the target pulse video, and the number of sampling moments are encoded into fixed-length data in a preset order and a preset encoding method.
[0100] S107 , connecting the pixel coding set to the basic data coding to obtain the coding data of the target pulse video.
[0101] See also Figure 3 As shown, Figure 3 FIG. 1 is a flow chart of a pulse video decoding method disclosed in an embodiment of the present invention. Figure 3 As shown, the pulse video decoding method may include the following operations:
[0102] S301, obtaining coded data;
[0103] The encoded data in this embodiment refers to data obtained after encoding the target video.
[0104] S302, obtaining data of a first length from the starting position of the coded data as basic data encoding, and using the remaining data of the coded data as a pixel coding set;
[0105] S303, decoding the basic data code to obtain the width of the target pulse video, the height of the target pulse video, and the number of sampling moments of the target pulse video;
[0106] For example, when encoding the target video, if the number of sampling moments of the target pulse video is first encoded as 32 bits using encoding method one, the height of the target pulse video is encoded as 16 bits using encoding method two, and the width of the target pulse video is encoded as 64 bits using encoding method three. Then when the basic data encoding is decoded, the 32-bit content should be read first, and decoded using the decoding method corresponding to encoding method one to obtain the number of sampling moments of the target pulse video, then the 16-bit content should be read, and decoded using the decoding method corresponding to encoding method two to obtain the height of the target pulse video, and then the 64-bit content should be read, and decoded using the decoding method corresponding to encoding method three to obtain the width of the target pulse video. That is, the length read during decoding should correspond to the length obtained during encoding, the decoding method used during decoding should correspond to the encoding method used during encoding, and the order of interpretation of the decoding results should correspond to the encoding order during encoding.
[0107] S304, decoding and splitting the pixel code set into a number code and a substring code of a plurality of pixel codes, each pixel code corresponding to a pixel position;
[0108] In an optional embodiment, the step of decoding and splitting the pixel code set into a number code and a substring code of a plurality of pixel codes comprises:
[0109] The following steps are performed on the pixel code set in a loop:
[0110] Starting from the starting position, read data having a length of the second length as a quantity code;
[0111] Decode the quantity code to obtain the substring quantity M;
[0112] M data of a third length are read as M substring codes, and the position after the M substring codes is updated as the starting position.
[0113] In this optional embodiment, the decoding method for decoding the quantity code needs to correspond to the encoding method for the substring quantity during encoding. Each quantity code and the M substring codes following it are a pixel code.
[0114] For example: the second length is one byte, the third length is two bytes, and the data in the pixel code set is E_1(3), E_2(3), E_2(4), E_2(5), E_1(2), E_2(0), E_2(2), E_1() represents one-byte data encoded by the data in the brackets, and E_2() represents two-byte data encoded by the data in the brackets (for ease of reading, commas are added to the pixel code set as separators, but there are no commas in the actual data). During decoding, the first loop reads one byte of data E_1(3) from the starting position, decodes to get 3, then reads three two-byte data E_2(3), E_2(4), E_2(5), and the first pixel code is E_1(3), E_2(3), E_2(4), E_2(5); the second loop continues to read one byte of data E_1(2), decodes to get 2, then reads two two-byte data E_2(0), E_2(2), and the first pixel code is E_1(2), E_2(0), E_2(2).
[0115] S305, decoding each of the pixel codes to obtain a plurality of substrings corresponding to each of the pixel positions;
[0116] In an optional embodiment, the step of decoding each pixel code to obtain a plurality of substrings corresponding to each pixel position includes:
[0117] Decoding a plurality of substring codes in each pixel code to obtain length change information of each substring relative to its adjacent substring;
[0118] Based on the length change information of each substring relative to its adjacent substring, the length of each substring is calculated;
[0119] According to the preset division method and the length of each substring, the first bit is filled into the corresponding substring to obtain a plurality of substrings corresponding to each pixel position.
[0120] In this optional embodiment, according to the preset division method and the length of each substring, the first bit is filled into the corresponding substring, which means that the substring is initialized to a non-first bit. When the division method is to split according to the position after each first bit, the last bit of the substring is changed to the first bit. For example, the length of the substring is 5, the substring is initialized to 00000, and then the last bit is changed to 1 to obtain the final substring 00001.
[0121] In a further optional embodiment, the step of filling the first bit into the corresponding substring according to the preset division method and the length of each substring to obtain a plurality of substrings corresponding to each pixel position includes:
[0122] According to the preset division method and the length of each substring, fill the first bit into the corresponding substring;
[0123] Determine whether the sum of the lengths of all the substrings corresponding to each of the pixel positions exceeds the number of sampling moments;
[0124] When it exceeds, the data of the corresponding last substring is corrected according to the division method.
[0125] In a further optional embodiment, according to the preset division method and the length of each substring, the feature of filling the first bit into the corresponding substring includes:
[0126] According to the length of each substring, fill the first bit into the last bit of the corresponding substring;
[0127] And, according to the division method, the step of correcting the data of the corresponding last substring includes:
[0128] Delete the last digit of the corresponding last substring
[0129] In this optional embodiment, since the length of all substrings corresponding to each pixel position should be equal to the length of the pixel bit string, and the length of the pixel bit string is equal to the number of sampling moments, in the case of exceeding the number of sampling moments, it is necessary to delete one bit according to the division method. When the division method is to divide according to the position after each first bit, the last bit of the last substring is deleted.
[0130] S306, concatenating all the substrings corresponding to each pixel position to obtain a pixel bit string for each pixel position;
[0131] S307. Decode the pixel bit strings at all pixel positions according to the width of the target pulse video, the height of the target pulse video, and the number of sampling moments of the target pulse video to generate the target pulse video.
[0132] In this optional embodiment, a possible implementation of S307 is to initialize an empty video frame set according to the width and height of the target video. This set will be used to store the video frames at each sampling moment. Each video frame can be regarded as a two-dimensional array, the size of which is equal to the width and height of the target video. For each pixel position, the corresponding pixel data in the corresponding pixel bit string is filled into the corresponding position of each video frame. Each video frame is arranged in order according to the sampling moment to obtain the target pulse video.
[0133] In summary, the pulse video encoding and decoding method disclosed in the present invention effectively captures and utilizes the time series information and the continuity of pixel values in the pulse video by sorting the data of each pixel at each sampling moment according to time and dividing it into substrings. This division and encoding strategy is actually creating a more compact information representation method, which can greatly reduce redundant data, and thus can significantly improve the compression rate of the pulse video. Therefore, the present invention effectively overcomes the various shortcomings of the prior art and has a high industrial utilization value.
[0134] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A pulse video coding method, characterized in that: The method comprises: Acquire target pulse videos collected at multiple consecutive sampling moments; Sorting the data of each pixel position in the target pulse video at each sampling time according to time to obtain a pixel bit string of each pixel position; Dividing the pixel bit string into a plurality of substrings according to the value of the pixel bit string; For each pixel position, encoding is performed according to the length of each substring and the number of all substrings to obtain its corresponding pixel code; Arrange the pixel codes corresponding to all the pixel positions in the order of pixel position sorting to obtain a pixel code set; Encode the width of the target pulse video, the height of the target pulse video, and the number of sampling moments into a basic data code having a length of a first length; The pixel coding set is connected to the basic data coding to obtain the coding data of the target pulse video.
2. The pulse video encoding method according to claim 1, characterized in that: The step of dividing the pixel bit string into a plurality of substrings according to its value comprises: Traversing the pixel bit string and finding all the first bits therein; According to the position of each of the first bits, the pixel bit string is divided into a plurality of substrings in a preset division manner.
3. The pulse video encoding method according to claim 2, characterized in that: The step of dividing the pixel bit string into a plurality of substrings according to a preset division method according to the position of each of the first bits comprises: Detect whether the bit value at the end position of the pixel bit string is the first bit: If it is the first bit, the pixel bit string is divided into a plurality of substrings according to the division method of dividing the position after each first bit; If it is not the first bit, the first bit is added after the end position of the pixel bit string, and then the pixel bit string is divided into a plurality of substrings in a partitioning manner according to the position after each first bit.
4. The pulse video encoding method according to claim 1, characterized in that: The step of encoding each pixel position according to the length of each substring and the number of all substrings to obtain the corresponding pixel code comprises: For each of these pixel locations: Encode the number of substrings corresponding to the substrings to obtain a number code, wherein the length of the number code is a preset second length; According to the length change of each substring and its adjacent substring, encoding is performed to obtain a substring encoding set; The quantity code is concatenated with the substring code set to obtain a pixel code corresponding to the pixel position.
5. The pulse video encoding method according to claim 4, characterized in that: The step of encoding to obtain a substring encoding set according to the length change of each substring and its adjacent substring comprises: For the first substring, encode its length to obtain its corresponding substring code; For other substrings, encode the change of their lengths relative to the length of the previous substring to obtain their corresponding substring codes; Concatenate all the substring codes to obtain a substring code set; The length of each substring code is a preset third length.
6. A pulse video decoding method, characterized in that: The method comprises: Get the encoded data; Acquire data of a first length from the starting position of the coded data as basic data encoding, and use the remaining data of the coded data as a pixel coding set; Decoding the basic data code to obtain the width of the target pulse video, the height of the target pulse video, and the number of sampling moments of the target pulse video; Decoding and splitting the pixel code set into a number code and a substring code of a plurality of pixel codes, each pixel code corresponding to a pixel position; Decoding each of the pixel codes to obtain a plurality of substrings corresponding to each of the pixel positions; Concatenate all the substrings corresponding to each pixel position to obtain a pixel bit string for each pixel position; According to the width of the target pulse video, the height of the target pulse video, and the number of sampling moments of the target pulse video, the pixel bit strings at all pixel positions are decoded to generate the target pulse video.
7. The pulse video decoding method according to claim 6, characterized in that: The step of decoding and splitting the pixel code set into a number code and a substring code of a plurality of pixel codes comprises: The following steps are performed on the pixel code set in a loop: Starting from the starting position, read data having a length of the second length as a quantity code; Decode the quantity code to obtain the substring quantity M; M data of a third length are read as M substring codes, and the position after the M substring codes is updated as the starting position.
8. The pulse video decoding method according to claim 7, characterized in that: The step of decoding each pixel code to obtain a plurality of substrings corresponding to each pixel position comprises: Decoding a plurality of substring codes in each pixel code to obtain length change information of each substring relative to its adjacent substring; Based on the length change information of each substring relative to its adjacent substring, the length of each substring is calculated; According to the preset division method and the length of each substring, the first bit is filled into the corresponding substring to obtain a plurality of substrings corresponding to each pixel position.
9. The pulse video decoding method according to claim 8, characterized in that: The step of filling the first bit into the corresponding substring according to the preset division method and the length of each substring to obtain a plurality of substrings corresponding to each pixel position includes: According to the preset division method and the length of each substring, fill the first bit into the corresponding substring; Determine whether the sum of the lengths of all the substrings corresponding to each of the pixel positions exceeds the number of sampling moments; When it exceeds, the data of the corresponding last substring is corrected according to the division method.
10. The pulse video decoding method according to claim 9, characterized in that: According to the preset division method and the length of each substring, the characteristics of filling the first bit into the corresponding substring include: According to the length of each substring, fill the first bit into the last bit of the corresponding substring; And, according to the division method, the step of correcting the data of the corresponding last substring includes: Delete the last bit of the corresponding last substring.
Citation Information
Cited By
Lossless compression coding and decoding method of pulse video data and readable storage medium
CN121442094A