Pulse video data prediction encoding method, system and readable storage medium
By using a context-predictive coding method for pulse video, an index is generated by initializing and quantizing differential feature values, querying a static prediction table, and performing entropy coding. This method solves the shortcomings of traditional video coding techniques in terms of compression efficiency and applicability, and achieves high-efficiency compression results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI GMT DIGITAL TECH
- Filing Date
- 2026-04-02
- Publication Date
- 2026-06-09
AI Technical Summary
Traditional video coding techniques cannot effectively compress pulse video data, resulting in huge amounts of data at high temporal resolution. Existing tools and standards are insufficient in terms of compression efficiency and applicability.
A context prediction coding method for pulse videos is adopted. This method initializes the context state array, calculates the quantized differential feature values, generates an index and queries the static prediction table, and then combines entropy coding for compression.
It achieves a high compression efficiency improvement, adapts to different content scenarios, is suitable for resource-constrained devices and high frame rate real-time processing, and has good robustness and adaptability.
Smart Images

Figure CN121967684B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video coding technology, and in particular to a pulse video data predictive coding method, system, and readable storage medium. Background Technology
[0002] With the continuous development of video technology, people's demand for shooting high-speed moving objects is becoming increasingly urgent. However, although traditional high-speed photography can reach thousands or even tens of thousands of frames per second, the cost is too high, and it can only be used in special fields such as scientific research, thus delaying its widespread application.
[0003] In recent years, a new high-speed photography technology called "pulse video" has emerged. This technology differs from traditional methods in its shooting principle. It employs an integral-comparison mechanism. An integrator accumulates the charge output by the photoelectric converter, and a comparator compares the charge on the integrator with a preset threshold at fixed time intervals. 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 retains the charge on the integrator. This data format, generated based on the integral-comparison mechanism, has the potential for high dynamic range and low-power processing, and is widely used in high-speed visual sensing, autonomous driving, and the Internet of Things (IoT).
[0004] However, the high temporal resolution of pulsed video (typically thousands to tens of thousands of frames per second) results in a huge raw data rate. Although each pixel generates only 1 bit of data per sample, the total data volume is still enormous at high frame rates, necessitating efficient compression. Traditional lossless compression tools (such as ZIP and RAR) are not designed for the unique spatiotemporal statistical characteristics of pulsed video, resulting in limited compression efficiency. Furthermore, the intra-frame prediction modules of traditional video coding standards (such as H.264 / HEVC) are designed for continuous multi-valued pixels. Their prediction models based on the brightness of spatially neighboring pixels are unsuitable for binary and event-driven pulsed data, making it difficult to capture its temporal correlation when applied directly, leading to poor performance. Summary of the Invention
[0005] The purpose of this invention is to provide a pulse video data predictive coding method, system, and readable storage medium to solve the problem of insufficient compression efficiency of pulse video in the prior art.
[0006] To achieve the above objectives, the present invention provides a pulse video data predictive coding method, comprising the following steps:
[0007] S1. Initialization steps: Initialize a context state array for each pixel in the pulse video sequence. The context state array is at least used to record the temporal history state value of the pixel itself.
[0008] S2. Prediction Steps: For each pixel in the current frame, perform the following steps:
[0009] S2.1. Calculate multiple quantization difference feature values based on the temporal history state value of the pixel itself and the temporal history state value of at least one spatially adjacent pixel.
[0010] S2.2, Combine and encode the multiple quantized differential feature values to generate a first index;
[0011] S2.3. Determine a second index based on the element value in the context state array of the pixel used to represent the count of consecutive no events;
[0012] S2.4. Based on the first index and the second index, query a static prediction table to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index.
[0013] S3. Error calculation steps: Compare whether the predicted value is equal to the original binary data of the corresponding pixel to obtain the prediction error; wherein, if they are equal, the prediction error is recorded as 0, and if they are not equal, the prediction error is recorded as 1.
[0014] S4. Update step: Based on whether the original binary data of the pixel is 0 or 1, update the context state array of the pixel itself using different rules; wherein, if the original binary data is 0, then update the consecutive no-event count; if it is 1, then shift and update the elements that record the time-series historical state values.
[0015] S5. Encoding steps: Entropy encoding is performed on the prediction error of all pixels in the current frame to output a compressed bitstream.
[0016] Optionally, the context state array includes four elements, one of which is used to record the consecutive no-event count, and the other three elements are used to record the historical temporal state value of the pixel itself.
[0017] Optionally, in S2.1, calculating multiple quantization difference feature values includes:
[0018] The temporal history state value of the pixel itself is quantized to obtain at least one first-type quantization value;
[0019] The difference in temporal historical state values of the pixel at different historical moments is quantized to obtain at least one second-type quantized value; and
[0020] The difference between the temporal historical state value of the pixel itself and the temporal historical state value of its spatially adjacent pixels is quantized to obtain at least one third-type quantization value.
[0021] Optionally, the second type of quantization values includes:
[0022] The pixel's own context state array records the first difference between the temporal history state value at the penultimate event occurrence time and the temporal history state value at the most recent event occurrence time; and
[0023] Record the second difference between the time-series historical state value at the time of the third-to-last event and the time-series historical state value at the time of the second-to-last event.
[0024] Optionally, the third type of quantization value includes:
[0025] The context state array of the left-adjacent pixel records the temporal history state value at the time of the most recent event, and the third difference between this value and the pixel's own temporal history state value at the time of the most recent event; and
[0026] The context state array of the adjacent pixels above records the temporal history state value of the most recent event occurrence time, and the fourth difference between the temporal history state value of the pixel itself that records the most recent event occurrence time.
[0027] Optionally, in S2.2, the multiple quantization difference feature values are combined and encoded to generate a first index by bit operations that concatenate each quantization difference feature value into an integer.
[0028] Optionally, in S4:
[0029] Updating the consecutive no-event count means incrementing the value of the consecutive no-event count by one;
[0030] Shifting and updating elements that record historical state values refers to performing the following operations sequentially:
[0031] Assign the value of the element that records the second newest time-series historical state value in the context state array to the element that records the earliest time-series historical state value.
[0032] Assign the value of the element that records the latest time-series historical state value in the context state array to the element that records the second newest time-series historical state value;
[0033] The consecutive no-event count value before the shift is assigned to the element in the context state array that records the latest time-series historical state value;
[0034] Reset the consecutive no-event count to zero.
[0035] Optionally, the entropy encoding is binary arithmetic encoding, and its probability model parameters are determined based on the statistical proportion of error values of 1 in the prediction error.
[0036] Based on the same inventive concept, the present invention also provides a pulse video data prediction coding system, comprising:
[0037] An initialization module is used to initialize a context state array for each pixel in the pulse video sequence, wherein the context state array is at least used to record the temporal history state value of the pixel itself.
[0038] The prediction module is configured to, for each pixel in the current frame, calculate multiple quantized differential feature values based on the pixel's own temporal historical state value and the temporal historical state values of at least one spatially adjacent pixel, combine and encode the multiple quantized differential feature values to generate a first index, and determine a second index based on the element value in the context state array of the pixel used to represent the count of consecutive no events, and query a static prediction table based on the first index and the second index to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index;
[0039] An error calculation module is used to compare whether the predicted value is equal to the original binary data of the corresponding pixel to obtain the prediction error; wherein, if they are equal, the prediction error is recorded as 0, and if they are not equal, the prediction error is recorded as 1.
[0040] The update module is used to update the context state array of the pixel itself according to different rules based on whether the original binary data of the pixel is 0 or 1; wherein, if the original binary data is 0, the continuous no-event count is updated; if it is 1, the elements recording the time-series historical state values are shifted and updated.
[0041] The encoding module is used to entropy encode the prediction error of all pixels in the current frame and output a compressed bitstream.
[0042] Based on the same inventive concept, the present invention also provides a readable storage medium having a computer program stored thereon, which, when executed, can implement the pulse video data prediction coding method as described above.
[0043] The pulse video data prediction coding method, system, and readable storage medium provided by this invention have at least one of the following beneficial effects:
[0044] (1) By designing a context prediction coding specifically for pulse video event timing, and adopting a prediction method based on quantization difference features and dual-index query static prediction table, it can provide statistically optimal prediction values under various complex context conditions, achieving extremely high prediction accuracy and significantly improving overall compression efficiency compared to general compression tools.
[0045] (2) The core prediction operation in the encoding process is simplified to a quick "table lookup" action. The complex statistical learning and decision-making process is completed in the offline training stage. Online encoding only requires simple arithmetic, comparison and memory access operations, with low computational complexity, making it very suitable for deployment in resource-constrained embedded devices or scenarios requiring high frame rate real-time processing;
[0046] (3) By dynamically maintaining and updating the context state array for each pixel, the algorithm has good robustness and adaptability to different scene content (such as static background and complex motion). Attached Figure Description
[0047] Those skilled in the art will understand that the accompanying drawings are provided to better understand the invention and do not constitute any limitation on the scope of the invention. Wherein:
[0048] Figure 1 A flowchart of a pulse video data prediction coding method provided in an embodiment of the present invention;
[0049] Figure 2 This is a schematic diagram of the spatiotemporal structure of pulse video data provided in an embodiment of the present invention;
[0050] Figure 3 This is a schematic diagram of the 16-bit composition of a first index provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0052] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0053] In the description of this invention, it should be understood that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product is in use, or the orientation or positional relationship commonly understood by those skilled in the art. They are only used to facilitate the description of this invention and to simplify the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0054] Furthermore, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or apparatus that includes said element. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0055] Please refer to Figure 1 This invention provides a pulse video data prediction coding method, comprising the following steps:
[0056] S1. Initialization steps: Initialize a context state array for each pixel in the pulse video sequence. The context state array is at least used to record the temporal history state value of the pixel itself.
[0057] S2. Prediction Steps: For each pixel in the current frame, perform the following steps:
[0058] S2.1. Calculate multiple quantization difference feature values based on the temporal history state value of the pixel itself and the temporal history state value of at least one spatially adjacent pixel.
[0059] S2.2, Combine and encode the multiple quantized differential feature values to generate a first index;
[0060] S2.3. Determine a second index based on the element value in the context state array of the pixel used to represent the count of consecutive no events;
[0061] S2.4. Based on the first index and the second index, query a static prediction table to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index.
[0062] S3. Error calculation steps: Compare whether the predicted value is equal to the original binary data of the corresponding pixel to obtain the prediction error; wherein, if they are equal, the prediction error is recorded as 0, and if they are not equal, the prediction error is recorded as 1.
[0063] S4. Update step: Based on whether the original binary data of the pixel is 0 or 1, update the context state array of the pixel itself using different rules; wherein, if the original binary data is 0, then update the consecutive no-event count; if it is 1, then shift and update the elements that record the time-series historical state values.
[0064] S5. Encoding steps: Entropy encoding is performed on the prediction error of all pixels in the current frame to output a compressed bitstream.
[0065] This invention achieves extremely high prediction accuracy by specially designing context prediction coding for pulse video event timing, and the overall compression efficiency is significantly improved compared to general compression tools.
[0066] Specifically, S1 is executed first, the initialization step: a context state array is initialized for each pixel in the pulse video sequence, the context state array is used at least to record the temporal history state value of the pixel itself.
[0067] In this embodiment, a global initialization operation is performed before encoding a pulse video sequence:
[0068] 1) Set the current frame number to be encoded, n=0;
[0069] 2) Obtain the basic parameters of the pulse video sequence: the height (number of rows H), width (number of columns W), and frame rate F of each frame. The pixel located in the y-th row and x-th column of the sequence is denoted as p(x, y).
[0070] 3) Initialize the context state array for all pixels: Allocate a context state array L[x][y][i] for each pixel, where x=0..W-1, y=0..H-1, and i=0..3. Initialize all elements to -1. This special value -1 indicates "invalid" or "no history".
[0071] Load the static prediction table: Load the pre-trained static prediction table prediction
[65536] into memory. This table contains 65536 32-bit unsigned integer entries. The 32 bits of each entry prediction[k] define the statistically optimal prediction value when the first index C1=k and the second index C0 takes different values (0-31).
[0072] Preferably, the context state array includes four elements, one of which is used to record the consecutive no-event count, and the other three elements are used to record the historical temporal state values of the pixel itself. In this embodiment, in this array containing four elements, L[x][y][0] will be used to record the consecutive no-event count, and L[x][y][1], L[x][y][2], and L[x][y][3] will be used to record the historical temporal state values of the pixel itself.
[0073] In this embodiment, as Figure 2 As shown, pulse video data can be understood in space and time as a three-dimensional data block: spatially, each frame consists of a two-dimensional array of W (width) columns and H (height) rows of pixels; temporally, it consists of a continuous sequence of frames. Figure 2 The rectangular area illustrates the spatial structure of a single frame of data. The binary sequence "0, 1, 1,..." at the top indicates the binary data (0 or 1) of a certain row of pixels in that frame. Each pixel p(x, y) is uniquely determined by its column coordinate x (ranging from 0 to W-1) and row coordinate y (ranging from 0 to H-1). Then, pixel-by-pixel prediction and encoding are performed, traversing each pixel p(x,y) of the current frame in scan order (e.g., row-first).
[0074] Before executing S2, the original data is obtained by reading the original binary data d(n,x,y) of the nth frame, yth row, and xth column pixel, with a value of 0 or 1.
[0075] Then execute S2, the prediction step: For each pixel in the current frame, perform the following steps:
[0076] S2.1. Calculate multiple quantization difference feature values based on the temporal history state value of the pixel itself and the temporal history state value of at least one spatially adjacent pixel.
[0077] S2.2, Combine and encode the multiple quantized differential feature values to generate a first index;
[0078] S2.3. Determine a second index based on the element value in the context state array of the pixel used to represent the count of consecutive no events;
[0079] S2.4. Based on the first index and the second index, query a static prediction table to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index.
[0080] In this embodiment, starting from frame 0, each frame in the pulse video sequence is processed sequentially. For frame n, the following sub-steps are performed:
[0081] Check if L[x][y][1] is less than 0. If so, it means that the pixel has no valid event history, so directly set the predicted value pred(x,y)=0 and jump to S3. Otherwise, continue execution.
[0082] Then, five key temporal history state values L1 to L5 are extracted from the context state array L to describe the spatiotemporal environment of the current pixel. The specific extraction rules are as follows:
[0083] Let L1 = L[x][y][1], which represents the historical state value of the current pixel's most recent event.
[0084] If L[x][y][2] is less than 0, then let L2 = L1; otherwise, let L2 = L[x][y][2]. L2 represents the historical state value of the previous event of the current pixel. If there is no valid record, L1 is used to fill it.
[0085] If L[x][y][3] is less than 0, then let L3 = L2; otherwise, let L3 = L[x][y][3]. L3 represents the historical state value of the previous event of the current pixel. If there is no valid record, L2 is used to fill it.
[0086] If x-1 < 0 or L[x-1][y][1] is less than 0, then let L4 = L1; otherwise, let L4 = L[x-1][y][1]. L4 represents the recent event history state value of the left neighboring pixel.
[0087] If y-1 < 0 or L[x][y-1][1] is less than 0, then let L5 = L1; otherwise, let L5 = L[x][y-1][1]. L5 represents the most recent event history state value of the upper adjacent pixel.
[0088] Then, step S2.1 is executed to calculate the quantization difference feature values. Preferably, in step S2.1, calculating multiple quantization difference feature values includes:
[0089] The temporal history state value of the pixel itself is quantized to obtain at least one first-type quantization value;
[0090] The difference in temporal historical state values of the pixel at different historical moments is quantized to obtain at least one second-type quantized value; and
[0091] The difference between the temporal historical state value of the pixel itself and the temporal historical state value of its spatially adjacent pixels is quantized to obtain at least one third-type quantization value.
[0092] The second type of quantization values includes:
[0093] The pixel's own context state array records the first difference between the temporal history state value at the penultimate event occurrence time and the temporal history state value at the most recent event occurrence time; and
[0094] Record the second difference between the time-series historical state value at the time of the third-to-last event and the time-series historical state value at the time of the second-to-last event.
[0095] The third type of quantization value includes:
[0096] The context state array of the left-adjacent pixel records the temporal history state value at the time of the most recent event, and the third difference between this value and the pixel's own temporal history state value at the time of the most recent event; and
[0097] The context state array of the adjacent pixels above records the temporal history state value of the most recent event occurrence time, and the fourth difference between the temporal history state value of the pixel itself that records the most recent event occurrence time.
[0098] In this embodiment, multiple quantization difference feature values D0-D4 are calculated based on L1-L5. The specific calculation and quantization rules are as follows:
[0099] Let D0 = L1; if D0 > 63, let D0 = 63. This operation is to perform amplitude limiting quantization on the temporal history state value L1 of the pixel itself to obtain the first type of quantization value D0, so as to normalize the possible large values to a fixed range [0, 63], laying the foundation for the subsequent generation of compact index.
[0100] Let D1 = L2 - L1; if |D1| > 3, let D1 = 4; D1 = D1 + 3; This operation performs amplitude limiting and offset quantization on the difference (i.e., L2 - L1) between the temporal history state values of the pixel at different historical moments, mapping the result to an integer in the range [0, 6], to obtain a second-type quantization value D1. This difference is calculated based on the temporal history state values recorded at the penultimate and most recent event times, reflecting the changing trend of the event interval.
[0101] Let D2 = L3 - L2; if |D2| > 3, let D2 = 4; D2 = D2 + 3; similarly, we get another second-type quantization value D2, which reflects changes in earlier event intervals.
[0102] D3 = L4 - L1; If |D3| > 1, let D3 = 2; D3 = D3 + 1; This operation calculates the difference between the temporal history state value of the pixel itself and the left neighboring pixel, and quantizes it to an integer in [0, 2] to obtain a third type quantization value D3.
[0103] D4 = L5 - L1; If |D4| > 1, let D4 = 2; D4 = D4 + 1; This operation calculates the difference between the temporal history state value of the pixel itself and the adjacent pixel above it, and quantizes it to an integer in [0, 2] to obtain another third-type quantization value D4.
[0104] Through the above quantization operation, continuous and large-scale context differences can be mapped to a few discrete symbols, which greatly reduces the total number of context states that need to be modeled, making it possible to use a static prediction table of fixed size and ensuring the stability of the prediction.
[0105] Then, step S2.2 is executed to combine and encode the multiple quantization difference feature values to generate a first index. In this embodiment, the five quantization difference feature values D0-D4 are combined and encoded to generate a first index C1.
[0106] Specifically, such as Figure 3 As shown, the 16-bit C1 index is formed by concatenating five parts, D0-D4, in a fixed order and with a fixed bit width. Preferably, each quantized differential feature value is concatenated into an integer using bit operations, specifically: C1 = (D0<<10)|(D1<<7)|(D2<<4)|(D3<<2)|(D4). Here, D0 (quantized range 0-63) occupies the high 6 bits, D1 and D2 (range 0-6) each occupy the next 3 bits, and D3 and D4 (range 0-2) each occupy the last 2 bits. This concatenation method ensures a unique and fast mapping from context features to the index value.
[0107] Next, step S2.3 is executed, determining a second index based on the element value in the context state array of the pixel used to represent the consecutive no-event count. In this embodiment, the element value used to represent the consecutive no-event count is obtained from the context state array, i.e., C0 = L[x][y][0]. If C0 > 30, then C0 = 31. Therefore, the value range of the second index C0 is 0 to 31. The value of C0 is essentially determined by comparing the consecutive no-event count with a preset threshold (30 in this case), serving as an auxiliary index for refining the context.
[0108] Then, S2.4 is executed, and a static prediction table is queried based on the first index and the second index to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index.
[0109] In this embodiment, the static prediction table `prediction` is queried using C1 and C0 as coordinates. The predicted value `pred(x,y)` is obtained through the following bit operation: `pred(x,y) = (prediction[C1] >> (31 - C0)) & 0x01`. That is, the (31-C0)th bit of the 32-bit integer `prediction[C1]` is retrieved. The value of this bit (0 or 1) is the optimal predicted value obtained through offline statistical learning under the specific spatiotemporal context defined at the current (C1, C0) coordinates. This step replaces complex online probability estimation with a very low cost of a single memory access and simple bit operations, thus improving efficiency.
[0110] Then, step S3 is executed, which involves calculating the error by comparing the predicted value with the original binary data of the corresponding pixel to obtain the prediction error. If they are equal, the prediction error is recorded as 0; otherwise, it is recorded as 1.
[0111] In this embodiment, the predicted value pred(x,y) is compared with the original binary data d(n,x,y) of the pixel. If they are equal, the prediction is correct, and the prediction error e(x,y) is recorded as 0; if they are not equal, the prediction is incorrect, and e(x,y) is recorded as 1. That is: e(x,y) = (pred(x,y) == d(n,x,y)) ? 0 : 1. Thus, the encoding of the original data is transformed into the encoding of a sparse error sequence mainly composed of 0s.
[0112] Next, execute S4, update step: based on whether the original binary data of the pixel is 0 or 1, update the context state array of the pixel itself using different rules; wherein, if the original binary data is 0, then update the consecutive no-event count; if it is 1, then shift and update the elements that record the time-series historical state values.
[0113] Preferably, in S4:
[0114] Updating the consecutive no-event count means incrementing the value of the consecutive no-event count by one;
[0115] Shifting and updating elements that record historical state values refers to performing the following operations sequentially:
[0116] Assign the value of the element that records the second newest time-series historical state value in the context state array to the element that records the earliest time-series historical state value.
[0117] Assign the value of the element that records the latest time-series historical state value in the context state array to the element that records the second newest time-series historical state value;
[0118] The consecutive no-event count value before the shift is assigned to the element in the context state array that records the latest time-series historical state value;
[0119] Reset the consecutive no-event count to zero.
[0120] In this embodiment, the context state array L[x][y] of the current pixel must be updated according to the original binary data d(n,x,y) of the current pixel so that it can track changes in the video content.
[0121] If d(n,x,y) is 0, then the count of consecutive events without occurrence is updated. Specifically, if L[x][y][0] < 0, then let L[x][y][0] = 1; otherwise, let L[x][y][0] = L[x][y][0] + 1. The values of L[1], L[2], and L[3] remain unchanged.
[0122] If d(n,x,y) is 1, then perform the following operations in sequence:
[0123] L[x][y][3] = L[x][y][2]; The value of the element that records the second newest time-series historical state value (i.e., L[2]) is assigned to the element that records the earliest time-series historical state value (i.e., L[3]).
[0124] L[x][y][2] = L[x][y][1]; The value of the element that records the latest time-series historical state value (i.e., L[1]) is assigned to the element that records the second newest time-series historical state value (i.e., L[2]).
[0125] L[x][y][1] = (L[x][y][0] < 0) ? 0 : L[x][y][0]; This assigns the consecutive no-event count value before this update (i.e., the old L[0]) to the element recording the latest time-series historical state value (i.e., L[1]). This is equivalent to recording the "moment" when the new event occurs.
[0126] L[x][y][0] = 0; This resets the count of consecutive events to zero.
[0127] This series of operations implements a first-in-first-out update of a history state window (L[1], L[2], L[3]) with a length of 3. New event intervals enter the window, and the oldest history is removed, thus dynamically maintaining the time information of the three most recent events.
[0128] Finally, S5 is executed, the encoding step is: entropy encoding is performed on the prediction error of all pixels in the current frame, and a compressed bitstream is output.
[0129] Preferably, the entropy encoding is binary arithmetic encoding, and its probability model parameters are determined based on the statistical proportion of error values of 1 in the prediction error.
[0130] In this embodiment, after traversing all W*H pixels of the current frame, a prediction error matrix E is obtained.
[0131] Count the number of errors with a value of 1 in E, nznum.
[0132] The statistical proportion of errors with a value of 1 is calculated as prob = nznum / (W * H). This prob will be used as a parameter for the probabilistic model of binary arithmetic encoding.
[0133] Using a binary arithmetic encoder, with prob as the initial probability parameter, entropy encoding is performed on the prediction error matrix E (expanded into a one-dimensional sequence according to the scanning order) to generate the compressed bitstream of the nth frame.
[0134] After encoding the nth frame, let n = n + 1, return to step S2 to process the next frame, until the sequence ends.
[0135] The following details the preferred generation method for the static prediction table prediction
[65536] generated through offline statistical training, to ensure that the table stores statistically optimal prediction values.
[0136] Preparation and Initialization: Prepare a large-scale, representative pulse video training dataset. Create a two-dimensional statistical array s
[65536]
[32] and initialize all its elements to 0. s[C1][C0] is used to accumulate the number of times the actual value of a pixel is 1 in the context (C1, C0).
[0137] Simulated Encoding and Statistics: For each video sequence in the training dataset, simulate the encoding process described above (but do not perform the final entropy-encoded output):
[0138] Initialize the context array L (same as S1);
[0139] For each frame in the sequence, for each pixel p(x,y):
[0140] Get its original value d;
[0141] Based on its current L array, C1 and C0 are calculated according to the method in S2.
[0142] If d == 1, then execute s[C1][C0]++.
[0143] Based on the value of d, strictly follow the rules of S4 to update the L array of the pixel itself.
[0144] Decision generation entries: Iterate through all 65536 possible C1 values. For each C1, based on the statistical array s[C1][0..31], generate 32 bits of prediction[C1].
[0145] For each C0 = i (i ranges from 0 to 30), compute m[i+1] = s[C1][i+1] + s[C1][i+2] + ... + s[C1]
[31] . m[i+1] represents the total number of times 1 appears under all conditions that are more dormant than the current context i (i.e., C0 value is larger).
[0146] Optimal decision rule: Compare s[C1][i] with m[i+1]. If s[C1][i] > m[i+1], it means that in the current specific context (C1, i), the statistical number of times the next pixel value is 1 has exceeded the sum of the occurrences of 1 in all possible future "more dormant" contexts. Therefore, predicting 1 at this moment is the optimal choice in the long-term statistical sense. Hence, let the decision bit b[i] = 1. Otherwise, let b[i] = 0. For i=31 (the most dormant state), usually let b
[31] = 0.
[0147] Combine into a table: Combine the 32 decision bits b[0] to b
[31] into a 32-bit unsigned integer, which gives the table entry of prediction[C1]: prediction[C1] = (b[0]<<31) | (b[1]<<30) | ... | (b
[31] <<0).
[0148] Output and Staticization: Save the generated prediction
[65536] array, which is the final static prediction table, which can be embedded in the encoder and decoder.
[0149] Based on the same inventive concept, this invention also proposes a pulse video data prediction coding system, comprising:
[0150] An initialization module is used to initialize a context state array for each pixel in the pulse video sequence, wherein the context state array is at least used to record the temporal history state value of the pixel itself.
[0151] The prediction module is configured to, for each pixel in the current frame, calculate multiple quantized differential feature values based on the pixel's own temporal historical state value and the temporal historical state values of at least one spatially adjacent pixel, combine and encode the multiple quantized differential feature values to generate a first index, and determine a second index based on the element value in the context state array of the pixel used to represent the count of consecutive no events, and query a static prediction table based on the first index and the second index to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index;
[0152] An error calculation module is used to compare whether the predicted value is equal to the original binary data of the corresponding pixel to obtain the prediction error; wherein, if they are equal, the prediction error is recorded as 0, and if they are not equal, the prediction error is recorded as 1.
[0153] The update module is used to update the context state array of the pixel itself according to different rules based on whether the original binary data of the pixel is 0 or 1; wherein, if the original binary data is 0, the continuous no-event count is updated; if it is 1, the elements recording the time-series historical state values are shifted and updated.
[0154] The encoding module is used to entropy encode the prediction error of all pixels in the current frame and output a compressed bitstream.
[0155] Since the pulse video data predictive coding system provided by this invention belongs to the same inventive concept as the pulse video data predictive coding method described above, the pulse video data predictive coding system provided by this invention has all the advantages of the pulse video data predictive coding method described above. Therefore, the beneficial effects of the pulse video data predictive coding system provided by this invention will not be described in detail here.
[0156] Based on the same inventive concept, embodiments of the present invention also propose a readable storage medium storing a computer program thereon, which, when executed, can implement the pulse video data prediction coding method as described above.
[0157] A readable storage medium can be a tangible device capable of holding and storing instructions for use by an instruction execution device, such as, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer programs described herein can be downloaded from the readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. Networks can include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. Each computing / processing device's network adapter card or network interface receives and forwards a computer program from the network for storage on a readable storage medium within the respective computing / processing device. The computer program used to perform the operations of this invention can be execution instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" or similar languages. The computer program can execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from a computer program. These electronic circuits can execute computer-readable program instructions, thereby realizing various aspects of the present invention.
[0158] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, systems, and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by a computer program. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. These computer programs can also be stored in a readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the readable storage medium storing the computer program comprises an article of manufacture including instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams.
[0159] A computer program may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the computer program executing on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0160] Since the readable storage medium provided by this invention belongs to the same inventive concept as the pulse video data prediction coding method described above, the readable storage medium provided by this invention has all the advantages of the pulse video data prediction coding method described above. Therefore, the beneficial effects of the readable storage medium provided by this invention will not be described in detail here.
[0161] In summary, this invention provides a predictive coding method, system, and readable storage medium for pulse video data. By specifically designing context-based predictive coding for pulse video event timing and employing a prediction method based on quantization differential features and a dual-index lookup static prediction table, it can provide statistically optimal prediction values under various complex context conditions, achieving extremely high prediction accuracy and significantly improving overall compression efficiency compared to general compression tools. Furthermore, the core prediction operation in the encoding process is simplified to a single, rapid "table lookup" action. Complex statistical learning and decision-making processes are pre-processed in the offline training phase. Online encoding requires only simple arithmetic, comparison, and memory access operations, resulting in low computational complexity, making it highly suitable for deployment in resource-constrained embedded devices or scenarios requiring high frame rate real-time processing.
[0162] The above description is merely a description of preferred embodiments of the present invention and is not intended to limit the scope of the invention in any way. Any changes or modifications made by those skilled in the art based on the above disclosure are within the protection scope of the present invention. Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the present invention and its equivalents, the present invention also intends to include these modifications and variations.
Claims
1. A predictive coding method for pulse video data, characterized in that, Includes the following steps: S1. Initialization steps: Initialize a context state array for each pixel in the pulse video sequence. The context state array is at least used to record the temporal history state value of the pixel itself. S2. Prediction Steps: For each pixel in the current frame, perform the following steps: S2.
1. Calculate multiple quantization difference feature values based on the temporal history state value of the pixel itself and the temporal history state value of at least one spatially adjacent pixel. S2.2, Combine and encode the multiple quantized differential feature values to generate a first index; S2.
3. Determine a second index based on the element value in the context state array of the pixel used to represent the count of consecutive no events; S2.
4. Based on the first index and the second index, query a static prediction table to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index. S3. Error calculation steps: Compare whether the predicted value is equal to the original binary data of the corresponding pixel to obtain the prediction error; wherein, if they are equal, the prediction error is recorded as 0, and if they are not equal, the prediction error is recorded as 1. S4. Update step: Based on whether the original binary data of the pixel is 0 or 1, update the context state array of the pixel itself using different rules; wherein, if the original binary data is 0, then update the consecutive no-event count; if it is 1, then shift and update the elements that record the time-series historical state values. S5. Encoding steps: Entropy encoding is performed on the prediction error of all pixels in the current frame to output a compressed bitstream; In step S2.1, calculating multiple quantized difference feature values includes: The temporal history state value of the pixel itself is quantized to obtain at least one first-type quantization value; The difference in temporal historical state values of the pixel at different historical moments is quantized to obtain at least one second-type quantized value; and The difference between the temporal historical state value of the pixel itself and the temporal historical state value of its spatially adjacent pixels is quantized to obtain at least one third-type quantization value.
2. The pulse video data prediction coding method according to claim 1, characterized in that, The context state array includes four elements, one of which is used to record the consecutive no-event count, and the other three elements are used to record the historical temporal state value of the pixel itself.
3. The pulse video data prediction coding method according to claim 1, characterized in that, The second type of quantization values includes: The pixel's own context state array records the first difference between the temporal history state value at the penultimate event occurrence time and the temporal history state value at the most recent event occurrence time; and Record the second difference between the time-series historical state value at the time of the third-to-last event and the time-series historical state value at the time of the second-to-last event.
4. The pulse video data prediction coding method according to claim 1, characterized in that, The third type of quantization value includes: The context state array of the left-adjacent pixel records the temporal history state value at the time of the most recent event, and the third difference between this value and the pixel's own temporal history state value at the time of the most recent event; and The context state array of the adjacent pixels above records the temporal history state value of the most recent event occurrence time, and the fourth difference between the temporal history state value of the pixel itself that records the most recent event occurrence time.
5. The pulse video data prediction coding method according to claim 1, characterized in that, In step S2.2, the multiple quantization difference feature values are combined and encoded to generate a first index by bit operations that concatenate the quantization difference feature values into an integer.
6. The pulse video data prediction coding method according to claim 1, characterized in that, In S4: Updating the consecutive no-event count means incrementing the value of the consecutive no-event count by one; Shifting and updating elements that record historical state values refers to performing the following operations sequentially: Assign the value of the element that records the second newest time-series historical state value in the context state array to the element that records the earliest time-series historical state value. Assign the value of the element that records the latest time-series historical state value in the context state array to the element that records the second newest time-series historical state value; The consecutive no-event count value before the shift is assigned to the element in the context state array that records the latest time-series historical state value; Reset the consecutive no-event count to zero.
7. The pulse video data prediction coding method according to claim 1, characterized in that, The entropy encoding is a binary arithmetic encoding, and its probability model parameters are determined based on the statistical proportion of error values of 1 in the prediction error.
8. A pulse video data predictive coding system, characterized in that, include: An initialization module is used to initialize a context state array for each pixel in the pulse video sequence, wherein the context state array is at least used to record the temporal history state value of the pixel itself. The prediction module is configured to, for each pixel in the current frame, calculate multiple quantized differential feature values based on the pixel's own temporal historical state value and the temporal historical state values of at least one spatially adjacent pixel, combine and encode the multiple quantized differential feature values to generate a first index, and determine a second index based on the element value in the context state array of the pixel used to represent the count of consecutive no events, and query a static prediction table based on the first index and the second index to obtain the predicted value of the pixel; wherein, the static prediction table is generated through offline statistical training, and each entry defines the statistically optimal predicted value under the context conditions jointly determined by the first index and the second index; An error calculation module is used to compare whether the predicted value is equal to the original binary data of the corresponding pixel to obtain the prediction error; wherein, if they are equal, the prediction error is recorded as 0, and if they are not equal, the prediction error is recorded as 1. The update module is used to update the context state array of the pixel itself according to different rules based on whether the original binary data of the pixel is 0 or 1; wherein, if the original binary data is 0, the continuous no-event count is updated; if it is 1, the elements recording the time-series historical state values are shifted and updated. The encoding module is used to entropy encode the prediction error of all pixels in the current frame and output a compressed bitstream. The prediction module calculates multiple quantized difference feature values, including: The temporal history state value of the pixel itself is quantized to obtain at least one first-type quantization value; The difference in temporal historical state values of the pixel at different historical moments is quantized to obtain at least one second-type quantized value; and The difference between the temporal historical state value of the pixel itself and the temporal historical state value of its spatially adjacent pixels is quantized to obtain at least one third-type quantization value.
9. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it can implement the pulse video data prediction coding method according to any one of claims 1-7.