Video compression method, terminal and computer readable storage medium

By dividing pixels into blocks with similar RGB values ​​in video compression technology and analyzing the vector changes of moving pixel blocks, the compression area is optimized, solving the problems of high computational load and low efficiency in existing technologies, and achieving more efficient video compression.

CN116456098BActive Publication Date: 2026-01-27NANNING FUGUI PRECISION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210006451.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-05
Publication Date
2026-01-27
Estimated Expiration
2042-01-05

AI Technical Summary

Technical Problem

Existing video compression technologies suffer from high computational costs and low compression efficiency due to the large number of block divisions.

Method used

By decomposing the color of all pixels in the target video frame into R, G, and B and placing them in a three-dimensional coordinate system, the correspondence between each pixel and its coordinate position is established. Pixels with similar RGB values ​​are divided according to preset rules, the envelope of moving pixel blocks is extracted, vector changes are analyzed, moving blocks are optimized, and finally, the minimum compression change block is determined.

Benefits of technology

It improves video compression coding efficiency and reduces computational load and data redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116456098B_ABST
    Figure CN116456098B_ABST
Patent Text Reader

Abstract

A video compression method, comprising: placing all pixel points of a target video frame in a three-dimensional coordinate system, and establishing a corresponding relationship between each pixel point and a coordinate position; performing fuzzy reorganization and division on all pixel blocks of the target video frame; performing pixel block division on pixel points with similar RGB values to obtain a first target pixel block; extracting pixel blocks with the same RGB but not close coordinates in the first target pixel block, and performing division according to a second preset rule to obtain a second target pixel block; extracting an envelope area of the second target pixel block, traversing and analyzing vector changes of all motion pixel points on an envelope line of the envelope area; splitting and optimizing the motion block of the envelope area; and determining a minimum compression change block according to the optimized motion block and compressing the minimum compression change block. The application also provides a terminal and a computer readable storage medium. The application can solve the defects of large calculation amount and low compression efficiency caused by a large number of video compression blocks in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to video compression technology, and more particularly to a video compression method, a terminal, and a computer-readable storage medium. Background Technology

[0002] Current mainstream video compression block partitioning coding techniques divide the image into multiple rectangular blocks, decode the image block by block, and then recursively divide each sub-block into smaller units. Different patterns are then used for item prediction in each part, followed by transformation, quantization, and entropy coding to form compressed data. However, existing technologies suffer from high computational cost and low compression efficiency due to the large number of block divisions. Summary of the Invention

[0003] In view of the above, it is necessary to provide a video compression method, terminal and computer-readable storage medium that can solve the defects of the prior art, which is that the large number of video compression blocks leads to large computation and low compression efficiency.

[0004] This invention provides a video compression method, comprising: decomposing the colors of all pixels in a target video frame into R, G, and B, placing them in a three-dimensional coordinate system, and establishing a correspondence between each pixel and its coordinate position; performing blurred recombination and division on all pixel blocks of the target video frame according to the pixel distribution of each pixel; dividing pixels with similar RGB values ​​into pixel blocks according to a first preset rule to obtain a first target pixel block; extracting pixel blocks with the same RGB values ​​but dissimilar coordinates from the first target pixel block, and dividing them according to a second preset rule to obtain a second target pixel block; extracting the envelope region of the second target pixel block, traversing and analyzing the vector changes of all moving pixels on the envelope line of the envelope region, wherein moving pixels are pixels in motion; splitting and optimizing the moving blocks according to the vector changes of the moving pixels; determining the minimum compression change block based on the optimized moving blocks, and compressing the minimum compression change block.

[0005] Optionally, the step of dividing pixels with similar RGB values ​​into pixel blocks according to a first preset rule to obtain a first target pixel block includes: defining a first target pixel block Z{A1,A2,A3…An}; when An(Rn,Gn,Bn) satisfies Rn+1-Rn<=M,Gn+1-Gn<=M,Bn+1-Bn<=M, {An} is defined as the first target pixel block Z, where M is a predefined real number greater than zero.

[0006] Optionally, the step of extracting pixel blocks with the same RGB values ​​but not close coordinates from the first target pixel block and dividing them according to a second preset rule to obtain a second target pixel block includes: taking pixel point A(Xn,Yn) from the first target pixel block. When |Xn±1-Xn|<=1 and |Yn±1-Yn|=<1, the physical coordinates of pixel point A (Xn,Yn) and pixel point (Xn±1;Yn±1) are close to each other. Then, pixel point (Xn±1;Yn±1) and pixel point A are divided into one block. Based on this principle, the block can be divided into N parts to obtain the divided second target pixel block.

[0007] Optionally, the step of splitting the envelope region and optimizing the motion block based on the vector changes of the moving pixels includes: when the RGB of a pixel in the envelope changes, the pixel is considered to be in motion; when the RGB of a pixel does not change, the pixel is discarded and the search continues, and so on, gradually narrowing the envelope of the pixel change points to find the smallest pixel motion block.

[0008] Optionally, the step of splitting the envelope region and optimizing the motion blocks based on the vector changes of the moving pixels further includes: determining whether the pixel block within the envelope is the smallest pixel motion block; if so, recording the RGB value changes caused by the movement of pixels on the envelope to neighboring pixels to predict the movement trajectory of the moving pixels on the envelope; calculating the vector relationship between the frame rate and the moving pixels according to a preset formula, and combining the predicted movement trajectory of the moving pixels on the envelope to determine the minimum compression change region.

[0009] Optionally, the step of recording the RGB value changes caused by a pixel moving to a neighboring pixel on the envelope to predict the movement trajectory of a pixel on the envelope includes: dividing the area around pixel A into 8 equal parts; recording the RGB values ​​of 9 pixels in each part and comparing the RGB value changes caused by the change in the coordinates of the 9 pixels when pixel A moves to the coordinates of the 9 pixels, and predicting the movement change of pixel A, wherein pixel A is any pixel on the envelope.

[0010] Optionally, the preset formula is: QA = XA / X0 = (VA * T0) / X0

[0011] Wherein, the inter-frame change time is T0; the motion change speed of pixel A is VA; the distance between adjacent pixels is X0; the distance that pixel A may travel within the inter-frame change time T0 is XA; and the number of pixels that pixel A may pass through within the inter-frame change time T0 is QA.

[0012] This invention also provides a terminal, which includes a memory, a processor, and a video compression program stored in the memory and executable on the processor. When the video compression program is executed by the processor, it implements the steps of the video compression method described above.

[0013] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the video compression method described above.

[0014] Compared to existing technologies, the video compression method, terminal, and computer-readable storage medium described above can improve video compression coding efficiency by blurring and recombining image pixel blocks, extracting the envelope of the pixel blocks, analyzing the vector change region of the pixel block envelope on the moving pixels using a technique similar to radar scanning, and combining the relationship between the pixel vector change in this region and the frame rate change. Attached Figure Description

[0015] Figure 1 This is a module diagram of a terminal according to a preferred embodiment of the present invention.

[0016] Figure 2 This is a program module diagram of a preferred embodiment of the video compression system of the terminal of the present invention.

[0017] Figure 3 It is a schematic diagram of the three-dimensional coordinates before and after blurring and recombining all pixel blocks of the target video frame and dividing them.

[0018] Figure 4 This is a schematic diagram of dividing pixels with similar RGB values ​​into pixel blocks according to the first preset rule to obtain the first target pixel block.

[0019] Figure 5 This is a schematic diagram of dividing pixel blocks with the same RGB values ​​but different coordinates into N=6 equal parts according to a second preset rule.

[0020] Figure 6 This is a schematic diagram of the envelope of three types of pixel blocks.

[0021] Figure 7 This is a schematic diagram of the vector motion of pixels on the envelope.

[0022] Figure 8 This is a schematic diagram of the vector motion changes of point A predicted by pixels on the envelope around 360°.

[0023] Figure 9 This is a flowchart of a video compression method according to a preferred embodiment of the present invention.

[0024] Explanation of main component symbols

[0025] Terminal 1

[0026] Video Compression System 10

[0027] Memory 20

[0028] Processor 30

[0029] Coordinate Establishment Module 101

[0030] Pixel partitioning module 102

[0031] Extraction module 103

[0032] Optimization Module 104

[0033] Compression module 105

[0034] Steps S300 to S312

[0035] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0036] See Figure 1 The diagram shown illustrates the operating environment of a preferred embodiment of the terminal according to the present invention. Terminal 1 includes a running video compression system 10. Terminal 1 also includes a memory 20 and a processor 30, etc.

[0037] The memory 20 includes at least one type of readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. The processor 30 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip.

[0038] See Figure 2 The diagram shown is a program block diagram of a preferred embodiment of the video compression system 10 of the present invention.

[0039] The video compression system 10 includes a coordinate establishment module 101, a pixel division module 102, an extraction module 103, an optimization module 104, and a compression module 105. The modules are configured to be executed by one or more processors (in this embodiment, one processor 30) to complete the invention. A module, as referred to in this invention, is a computer program segment that executes a specific instruction. The memory 20 is used to store program code and other data of the video compression system 10. The processor 30 is used to execute the program code stored in the memory 20.

[0040] The coordinate establishment module 101 is used to decompose the color of all pixels in the target video frame into R, G, and B, place them in a three-dimensional coordinate system, and establish the correspondence between each pixel and its coordinate position.

[0041] like Figure 3 The RGB 3D standard image shows the correspondence between each pixel and its coordinate position.

[0042] The pixel segmentation module 102 is used to perform fuzzy recombination and segmentation of all pixel blocks in the target video frame according to the pixel distribution of each pixel.

[0043] like Figure 3 Based on the pixel distribution that is difficult for the human eye to distinguish, the target video frame undergoes fuzzy recombination and segmentation of all pixel blocks to obtain an RGB standard image recombination and segmentation (e.g., Figure 3 As shown in (b), where, Figure 3 Image (a) shows the RGB 3D standard image before pixel block recombination and segmentation. In this embodiment, all pixel blocks of the target video frame are blurred and recombined, and divided into different colors. In this embodiment, using pixels that are difficult for the human eye to distinguish for blurred color recombination and block segmentation can reduce the number of block segments and thus reduce the amount of computation.

[0044] The pixel division module 102 is also used to divide pixels with similar RGB values ​​into pixel blocks according to a first preset rule to obtain a first target pixel block.

[0045] Specifically, define the first target pixel block Z{A1,A2,A3…An}; when An(Rn,Gn,Bn) satisfies Rn+1-Rn<=M,Gn+1-Gn<=M,Bn+1-Bn<=M, define {An} as the first target pixel block Z, where M is a predefined real number greater than zero.

[0046] In this embodiment, points with similar RGB values ​​are identified as the first target pixel block (i.e., pixels of the same color constitute the first target pixel block, for example, green pixels constitute a green pixel block, red pixels constitute a red pixel block, etc. Here, green and red are merely examples and are not limited to any particular color; other colors can also be used). The pixel segmentation module 102 performs blurring, recombination, and segmentation on all pixel blocks of the target video frame. After dividing them into different colors, it further segments the video frame according to color based on pixel values. Pixels whose value difference is less than a preset value M (e.g., 10) are considered as pixels of the same color, thus grouping pixels of the same color into the same pixel block. Figure 4 As shown, for example, if the current frame only has 4 colors, it is divided into... Figure 4 (b) contains four pixel blocks. Figure 4In the middle (a), the RGB standard image is reconstructed and divided after pixel block recombination and division.

[0047] The pixel segmentation module 102 is also used to extract pixel blocks with the same RGB values ​​but not similar coordinates from the first target pixel block, and segment them according to the second preset rule to obtain the second target pixel block.

[0048] Specifically, take pixel A(Xn,Yn) in the first target pixel block. When |Xn±1-Xn|<=1 and |Yn±1-Yn|=<1, the physical coordinates of pixel A (Xn,Yn) and pixel (Xn±1;Yn±1) are adjacent. Then, pixel (Xn±1;Yn±1) and pixel A are divided into one block. Based on this principle, the block can be divided into N parts to obtain the second target pixel block after division.

[0049] In this embodiment, pixels of the same color in a video frame may be scattered in multiple locations. Therefore, it is necessary to further divide the recombined pixel blocks according to regions. In this embodiment, pixel blocks of the same color are divided into N parts based on the points with similar X and Y axis coordinates. Figure 5 As shown, the pixel block Z with the same RGB values ​​but different coordinates after recombination is divided into 6 equal parts.

[0050] The extraction module 103 is used to extract the envelope region of the second target pixel block, and to traverse and analyze the vector changes of all moving pixels on the envelope line of the envelope region.

[0051] Among them, moving pixels are pixels that are in motion. For example... Figure 6 As shown, a pixel block composed of adjacent points with the same RGB values ​​and X and Y axis coordinates may have three types of envelopes.

[0052] The optimization module 104 is used to split the envelope region and optimize the motion block according to the vector changes of the moving pixels.

[0053] Specifically, when the RGB values ​​of a pixel in the envelope change, the pixel is considered to be in motion. When the RGB values ​​of a pixel do not change, the pixel is discarded and the search continues. This process is repeated to gradually narrow the envelope of the pixel change points and find the smallest pixel moving block.

[0054] like Figure 7As shown, pixels within the envelope of the region are of the same color. Even if a pixel moves, it will not cause a color change. Therefore, compression is not necessary. Instead, we only need to shrink the pixel block to the region containing the pixels on the envelope, such as the rectangular region containing Block 1, Block 2, and Block 3. We then analyze the movement of the pixels on the envelope. If a pixel moves outward from the envelope, it may cause a color change; if it moves inward from the envelope, it will not cause a color change. Therefore, we can further divide the rectangular region containing Block 1, Block 2, and Block 3 to shrink the envelope of the pixel change points.

[0055] In this embodiment, by optimizing the moving pixels within the pixel block envelope, the area to be compressed is further reduced, thereby improving compression efficiency.

[0056] The process of splitting and optimizing motion blocks in the envelope region based on the vector changes of the moving pixels also includes: determining whether the pixel block within the envelope is the smallest moving pixel block; if so, recording the RGB value changes caused by the movement of pixels on the envelope to neighboring pixels to predict the movement trajectory of the moving pixels on the envelope; calculating the vector relationship between the frame rate and the moving pixels according to a preset formula, and combining the predicted movement trajectory of the moving pixels on the envelope to determine the minimum compression change region.

[0057] The following is a prediction of the movement trajectory of a single pixel:

[0058] like Figure 8 As shown, with point A as the center, a radar-like scanning envelope is established to predict the vector motion changes of pixel A around 360°. The area around pixel A is divided into 8 equal parts; the RGB values ​​of the 9 pixels in each part are recorded and compared to predict the motion changes of point A when the coordinates of the 9 pixels change. Figure 8 The middle circle indicates the possible positions A' that pixel A can reach by moving in all directions. Pixel A is any pixel on the envelope.

[0059] For point A, the preset formula is: QA = XA / X0 = (VA * T0) / X0;

[0060] Wherein, the inter-frame change time is T0; the motion change speed of pixel A is VA; the distance between adjacent pixels is X0; the possible distance XA that pixel A can move within the inter-frame change time T0; and the number of pixels that pixel A may pass through within the inter-frame change time T0 is QA.

[0061] For example, when it is predicted that A moves to the region between 180° and 225°, the RGB values ​​of the region it passes through will change. Based on the trend of change, the trajectory of the moving pixels of A can be predicted as shown by the trajectory line A-A' in the figure.

[0062] In this embodiment, by using radar scanning to monitor the changes in the RGB values ​​of surrounding pixels caused by changes in pixel vectors, the movement trajectory of moving pixels can be predicted using a relatively simple calculation method.

[0063] Compression module 105 is used to determine the minimum compression change block based on the optimized motion block and to compress the minimum compression change block.

[0064] Once the smallest pixel motion block of all pixels on the envelope is found, the superposition of all the smallest pixel motion blocks is the minimum compression change block. Video compression can be completed by compressing only the minimum compression change block, thus reducing the amount of compression.

[0065] In this embodiment, by blurring and recombining image pixel blocks and extracting the envelope of the pixel blocks, and using a technique similar to radar scanning, the vector change region of the pixel block envelope on the line moving pixel points is analyzed. Combining the relationship between the pixel point vector change in this region and the frame rate change, the best image pixel block that needs to be compressed is found and determined, and data redundancy in the image is removed, thereby improving the efficiency of video compression coding.

[0066] See Figure 9 The diagram shown is a flowchart of a video compression method according to a preferred embodiment of the present invention. The video compression method is applied to terminal 1 and can be executed by the processor 30. Figure 2 It is implemented by modules 101 to 105 shown.

[0067] Step S300: Decompose the color of all pixels in the target video frame into R, G, and B, and place them in a three-dimensional coordinate system to establish the correspondence between each pixel and its coordinate position.

[0068] like Figure 3 The RGB 3D standard image shows the correspondence between each pixel and its coordinate position.

[0069] Step S302: Based on the pixel distribution of each pixel, perform blurred recombination and division on all pixel blocks of the target video frame.

[0070] like Figure 3 Based on the pixel distribution that is difficult for the human eye to distinguish, the target video frame undergoes fuzzy recombination and segmentation of all pixel blocks to obtain an RGB standard image recombination and segmentation (e.g., Figure 3 As shown in (b), where, Figure 3Image (a) shows the RGB 3D standard image before pixel block recombination and segmentation. In this embodiment, all pixel blocks of the target video frame are blurred and recombined, and divided into different colors. In this embodiment, using pixels that are difficult for the human eye to distinguish for blurred color recombination and block segmentation can reduce the number of block segments and thus reduce the amount of computation.

[0071] Step S304: Divide pixels with similar RGB values ​​into pixel blocks according to the first preset rule to obtain the first target pixel block.

[0072] Specifically, define the first target pixel block Z{A1,A2,A3…An}; when An(Rn,Gn,Bn) satisfies Rn+1-Rn<=M,Gn+1-Gn<=M,Bn+1-Bn<=M, define {An} as the first target pixel block Z, where M is a predefined real number greater than zero.

[0073] In this embodiment, points with similar RGB values ​​are identified as the first target pixel block. That is, pixels of the same color constitute the first target pixel block. For example, green pixels form a green pixel block, red pixels form a red pixel block, etc. Here, green and red are merely examples and are not limited to any particular color; other colors can also be used. In step S302, all pixel blocks of the target video frame are blurred, recombined, and divided into different colors. Then, based on the pixel values, a video frame is further divided according to color. Pixels whose value difference is less than a preset value M (e.g., 10) are considered pixels of the same color, thus grouping pixels of the same color into the same pixel block. Figure 4 As shown, for example, if the current frame only has 4 colors, it is divided into... Figure 4 (b) contains four pixel blocks. Figure 4 In the middle (a), the RGB standard image is reconstructed and divided after pixel block recombination and division.

[0074] Step S306: Extract pixel blocks with the same RGB values ​​but different coordinates from the first target pixel block, and divide them according to the second preset rule to obtain the second target pixel block.

[0075] Specifically, take pixel A(Xn,Yn) in the first target pixel block. When |Xn±1-Xn|<=1 and |Yn±1-Yn|=<1, the physical coordinates of pixel A (Xn,Yn) and pixel (Xn±1;Yn±1) are adjacent. Then, pixel (Xn±1;Yn±1) and pixel A are divided into one block. Based on this principle, the block can be divided into N parts to obtain the second target pixel block after division.

[0076] In this embodiment, pixels of the same color in a video frame may be scattered in multiple locations. Therefore, it is necessary to further divide the recombined pixel blocks according to regions. In this embodiment, pixel blocks of the same color are divided into N parts based on the points with similar X and Y axis coordinates. Figure 5 As shown, the pixel block Z with the same RGB values ​​but different coordinates after recombination is divided into 6 equal parts.

[0077] Step S308: Extract the envelope region of the second target pixel block, and traverse and analyze the vector changes of all moving pixels on the envelope line of the envelope region.

[0078] Among them, moving pixels are pixels that are in motion. For example... Figure 6 As shown, a pixel block composed of adjacent points with the same RGB values ​​and X and Y axis coordinates may have three types of envelopes.

[0079] Step S310: The envelope region is split and the motion block is optimized based on the vector changes of the moving pixels.

[0080] Specifically, when the RGB values ​​of a pixel in the envelope change, the pixel is considered to be in motion. When the RGB values ​​of a pixel do not change, the pixel is discarded and the search continues. This process is repeated to gradually narrow the envelope of the pixel change points and find the smallest pixel moving block.

[0081] like Figure 7 As shown, pixels within the envelope of the region are of the same color. Even if a pixel moves, it will not cause a color change. Therefore, compression is not necessary. Instead, we only need to shrink the pixel block to the region containing the pixels on the envelope, such as the rectangular region containing Block 1, Block 2, and Block 3. We then analyze the movement of the pixels on the envelope. If a pixel moves outward from the envelope, it may cause a color change; if it moves inward from the envelope, it will not cause a color change. Therefore, we can further divide the rectangular region containing Block 1, Block 2, and Block 3 to shrink the envelope of the pixel change points.

[0082] In this embodiment, by optimizing the moving pixels within the pixel block envelope, the area to be compressed is further reduced, thereby improving compression efficiency.

[0083] The process of splitting and optimizing motion blocks in the envelope region based on the vector changes of the moving pixels also includes: determining whether the pixel block within the envelope is the smallest moving pixel block; if so, recording the RGB value changes caused by the movement of pixels on the envelope to neighboring pixels to predict the movement trajectory of the moving pixels on the envelope; calculating the vector relationship between the frame rate and the moving pixels according to a preset formula, and combining the predicted movement trajectory of the moving pixels on the envelope to determine the minimum compression change region.

[0084] The following is a prediction of the movement trajectory of a single pixel:

[0085] like Figure 8 As shown, with point A as the center, a radar-like scanning envelope is established to predict the vector motion changes of pixel A around 360°. The area around pixel A is divided into 8 equal parts; the RGB values ​​of the 9 pixels in each part are recorded and compared to predict the motion changes of point A when the coordinates of the 9 pixels change. Figure 8 The middle circle indicates the possible positions A' that pixel A can reach by moving in all directions. Pixel A is any pixel on the envelope.

[0086] For point A, the preset formula is: QA = XA / X0 = (VA * T0) / X0;

[0087] Wherein, the inter-frame change time is T0; the motion change speed of pixel A is VA; the distance between adjacent pixels is X0; the possible distance XA that pixel A can move within the inter-frame change time T0; and the number of pixels that pixel A may pass through within the inter-frame change time T0 is QA.

[0088] For example, when it is predicted that A moves to the region between 180° and 225°, the RGB values ​​of the region it passes through will change. Based on the trend of change, the trajectory of the moving pixels of A can be predicted as shown by the trajectory line A-A' in the figure.

[0089] In this embodiment, by using radar scanning to monitor the changes in the RGB values ​​of surrounding pixels caused by changes in pixel vectors, the movement trajectory of moving pixels can be predicted using a relatively simple calculation method.

[0090] Step S312: Determine the minimum compression change block based on the optimized motion block, and compress the minimum compression change block.

[0091] Once the smallest pixel motion block of all pixels on the envelope is found, the superposition of all the smallest pixel motion blocks is the minimum compression change block. Video compression can be completed by compressing only the minimum compression change block, thus reducing the amount of compression.

[0092] By applying the above method to the aforementioned terminal, it is possible to extract the envelope of the pixel blocks by blurring and recombining them, and then analyze the vector change region of the pixel block envelope along the moving pixels using a technique similar to radar scanning. By combining the relationship between the vector change of the pixels in this region and the frame rate change, the optimal image pixel block to be compressed can be found and determined, and data redundancy in the image can be removed, thereby improving the efficiency of video compression coding.

[0093] It is worth noting that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A video compression method, characterized in that, The method includes: The color of all pixels in the target video frame is decomposed into R, G, and B, and placed in a three-dimensional coordinate system to establish the correspondence between each pixel and its coordinate position. Based on the pixel distribution of each pixel, all pixel blocks of the target video frame are blurred, recombined, and divided. According to the first preset rule, pixels with similar RGB values ​​are divided into pixel blocks to obtain the first target pixel block; Extract pixel blocks with the same RGB values ​​but different coordinates from the first target pixel block, and divide them according to the second preset rule to obtain the second target pixel block; Extract the envelope region of the second target pixel block, traverse and analyze the vector changes of all moving pixels on the envelope line of the envelope region, wherein the moving pixels are pixels in motion. The envelope region is split and the motion block is optimized based on the vector changes of the moving pixels; The minimum compression change block is determined based on the optimized motion block, and the minimum compression change block is compressed. The step of dividing pixels with similar RGB values ​​into pixel blocks according to a first preset rule to obtain a first target pixel block includes: Define the first target pixel block Z{A1,A2,A3…A n }; When A n (R n G n B n Satisfying R n+1 -R n <=M, G n+1 -G n <=M, B n+1 -B n <=M, define {A n Let Z be the first target pixel block, where M is a predefined real number greater than zero.

2. The video compression method as described in claim 1, characterized in that, The step of extracting pixel blocks with the same RGB values ​​but dissimilar coordinates from the first target pixel block and dividing them according to a second preset rule to obtain a second target pixel block includes: Take pixel A(X) from the first target pixel block n ,Y n ), when |X n±1 -X n |<=1 and|Y n±1 -Y n When |=<1, the coordinates of pixel A (X) n ,Y n ) and pixels (X) n±1 ;Y n±1 If the physical coordinates of the pixels are close to each other, then the pixel points (X) will be placed in the same order. n±1 ;Y n±1 ) and pixel A are divided into one block, and based on this principle, they can be divided into N parts to obtain the second target pixel block after division.

3. The video compression method as described in claim 1, characterized in that, The step of splitting the envelope region and optimizing the motion block based on the vector changes of the moving pixels includes: When the RGB values ​​of a pixel in the envelope change, the pixel is considered to be in motion. If the RGB values ​​of a pixel do not change, the pixel is discarded and the search continues. This process is repeated to gradually narrow the envelope of the pixel change points and find the smallest moving pixel block.

4. The video compression method as described in claim 3, characterized in that, The step of splitting the envelope region and optimizing the motion block based on the vector changes of the moving pixels further includes: Determine whether the pixel block within the envelope is the smallest moving pixel block; If so, record the changes in RGB values ​​caused by pixels moving to neighboring pixels on the envelope to predict the movement trajectory of moving pixels on the envelope; The frame rate and the vector relationship between moving pixels are calculated based on a preset formula. Combined with the predicted movement trajectory of moving pixels on the envelope, the minimum compression change area is determined.

5. The video compression method as described in claim 4, characterized in that, The method of predicting the movement trajectory of pixels on the envelope by recording the RGB value changes caused by pixels moving to neighboring pixels includes: Divide the area around pixel A into 8 equal parts; record the RGB values ​​of the 9 pixels included in each part and compare the changes in RGB values ​​caused by the change of pixel A to the coordinates of the 9 pixels to predict the motion change of pixel A. Here, pixel A is any pixel on the envelope.

6. The video compression method as described in claim 4, characterized in that, The preset formula is: QA = XA / X0 = (VA*T0) / X0; Wherein, the inter-frame change time is T0; the motion change speed of pixel A is VA; the distance between adjacent pixels is X0; the possible distance XA that pixel A can move within the inter-frame change time T0; and the number of pixels that pixel A may pass through within the inter-frame change time T0 is QA.

7. A terminal, characterized in that, The terminal includes a memory, a processor, and a video compression program stored in the memory and executable on the processor. When the video compression program is executed by the processor, it implements the steps of the video compression method as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the video compression method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Smart card for storage and retrieval of digitally compressed color images

    US20020104891A1

  • Method and apparatus to compress multi-spectral images to a single color image for display

    US6211971B1