Video compression method and system
Abstract
A system and method for video compression divides colors of all pixel points of a target video frame into R, G, and B values, and all pixels are placed in a three-dimensional coordinate system to establish a correspondence between each pixel point and the coordinate position. Fuzzy recombination and division are performed on all pixel blocks and pixel points with similar RGB values are divided into pixel blocks to obtain a first target pixel block. Pixel blocks with same RGB values but with coordinates which are not close to the first target pixel block are extracted and divided to obtain a second target pixel block. An area enveloping the second target pixel block is extracted, and vector changes of all dynamic pixel points on the enveloping line are traversed and analyzed to determine a minimum compression change block for compression process.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A video compression method, the method comprising:
dividing colors of all pixel points of a target video frame into red (R), green (G), and blue (B) values, and placing all of the pixel points in a three-dimensional coordinate system to establish a corresponding relationship between each of the pixel points and a coordinate position;
performing fuzzy recombination and division to obtain a plurality of pixel blocks of the target video frame according to distribution of each of the pixel points;
dividing the plurality of pixel blocks with similar RGB values into first pixel blocks according to a first preset rule to obtain first target pixel blocks, wherein the dividing the plurality of pixel blocks with similar RGB values into first pixel blocks according to a first preset rule to obtain first target pixel blocks comprises:
defining the first target pixel blocks Z {A 1 , A 2 , A 3 . . . An};
when An (Rn, Gn, Bn) satisfies Rn+1−Rn<=M, Gn+1−Gn<=M, Bn+1−Bn<=M, defining {An} as the first target pixel blocks Z, wherein M is a predefined real number greater than zero;
extracting second pixel blocks with a same RGB value but with coordinates which are not in close proximity in the first target pixel blocks, and dividing the second pixel blocks with the same RGB value but with coordinates which are not in close proximity according to a second preset rule to obtain second target pixel blocks;
extracting an enveloping area of the second target pixel blocks, traversing and analyzing vector changes of all dynamic pixel points on an enveloping line of the enveloping area, wherein the dynamic pixel points are pixels in a dynamic state;
splitting the enveloping area and optimizing an dynamic block according to the vector changes of the dynamic pixel points;
determining a minimum compression change block according to the optimized dynamic block, and compressing the minimum compression change block, wherein the splitting the enveloping area and optimizing a dynamic block according to the vector changes of the dynamic pixel points comprises:
when the RGB value of the pixel points of the enveloping line changes, the pixel points are considered to be in the dynamic state; when the RGB value of the pixel points does not change, the pixel points are discarded and repeating the pixel points discard determination until the enveloping line of the changing pixel points is gradually reduced to find a minimum pixel dynamic block.
2. The video compression method according to claim 1 , wherein the extracting second pixel blocks with a same RGB value but with coordinates which are not in close proximity in the first target pixel blocks, and dividing the second pixel blocks with the same RGB value but with coordinates which are not in close proximity according to a second preset rule to obtain second target pixel blocks comprises:
taking the pixel points A whose coordinate is (Xn, Yn) in each of the first target pixel blocks, if |Xn±1−Xn|<=1 and |Yn±1−Yn|=<1 is true, the coordinate (Xn, Yn) of pixel point A and physical coordinate of the pixel point (Xn±1; Yn±1) are adjacent to each other, then dividing the pixel point (Xn±1; Yn±1) and the pixel point A into one piece, dividing all pixel points into N parts according to the rule, and obtaining the divided second target pixel blocks.
3. The video compression method according to claim 1 , wherein the splitting the enveloping area and optimizing a dynamic block according to the vector changes of the dynamic pixel points further comprises:
determining whether the pixel block in the enveloping line is the minimum pixel dynamic block;
recording changes of the RBG values caused by a movement of pixels on the enveloping line to adjacent pixels; predicting a movement trajectory of the dynamic pixel points on the enveloping line based on the recorded changes of the RBG values when the pixel block in the enveloping line is the minimum pixel dynamic block; and
calculating a vector relationship between a frame rate and the dynamic pixels according to a preset formula, and determining the minimum compression change block in combination with the predicted movement trajectory of the dynamic pixel points on the enveloping line.
4. The video compression method according to claim 3 , the recording RGB value changes caused by a movement of pixels on the enveloping line to adjacent pixels to predict a movement trajectory of the dynamic pixel points on the enveloping line comprises:
dividing an area surrounding the pixel point A into 8 equal parts;
recording and comparing the RGB values of 9 pixel points included in each of the 8 equal parts and comparing the RGB value changes caused by the movement of the pixel point A to the coordinates of the 9 pixel points;
predicting a dynamic change of the pixel point A, wherein the pixel point A is any pixel point on the enveloping line.
5. The video compression method according to claim 3 , wherein the preset formula is:
QA=XA/X 0 =(VA*T 0 )/X 0 ;
wherein, T 0 is a frame-to-frame change time; VA is a dynamic change speed of the pixel point A; the distance between adjacent pixels is X 0 ; T 0 is a distance moved by the pixel point A within the frame-to-frame change time T 0 ; QA is a number of pixels passed by the pixel point A during the movement of the pixel point A within the frame-to-frame change time T 0 .
6. A video compression system comprising:
at least one processor;
a storage unit; and
one or more programs that are stored in the storage unit and executed by the at least one processor, the one or more programs comprising instructions for:
dividing colors of all pixel points of a target video frame into red (R), green (G), and blue (B) values, and placing all pixels in a three-dimensional coordinate system to establish a corresponding relationship between each of the pixel points and a coordinate position;
performing fuzzy recombination and division to obtain a plurality of pixel blocks of the target video frame according to distribution of each pixel point;
dividing the plurality of pixel blocks with similar RGB values into first pixel blocks according to a first preset rule to obtain first target pixel blocks, wherein the dividing the plurality of pixel blocks with similar RGB values into first pixel blocks according to a first preset rule to obtain first target pixel blocks comprises:
defining the first target pixel blocks Z {A 1 , A 2 , A 3 . . . An};
when An (Rn, Gn, Bn) satisfies Rn+1−Rn<=M, Gn+1−Gn<=M, Bn+1−Bn<=M, defining {An} as the first target pixel blocks Z, wherein M is a predefined real number greater than zero;
extracting second pixel blocks with a same RGB value but not with coordinates which are not in close proximity in the first target pixel blocks, and dividing the second pixel blocks with the same RGB value but with coordinates which are not in close proximity according to a second preset rule to obtain second target pixel blocks;
extracting an enveloping area of the second target pixel blocks, traversing and analyzing vector changes of all dynamic pixel points on an enveloping line of the enveloping area, wherein the dynamic pixel points are pixels in a dynamic state;
splitting the enveloping area and optimizing an dynamic block according to the vector changes of the dynamic pixel points;
determining a minimum compression change block according to the optimized dynamic block, and compressing the minimum compression change block, wherein the splitting the enveloping area and optimizing a dynamic block according to the vector changes of the dynamic pixel points comprises:
when the RGB value of the pixel points of the enveloping line changes, the pixel points are considered to be in the dynamic state; when the RGB value of the pixel points does not change, the pixel points are discarded and repeating the pixel points discard determination until the enveloping line of the changing pixel points is gradually reduced to find a minimum pixel dynamic block.
7. The video compression system according to claim 6 , wherein the extracting second pixel blocks with a same RGB value but with coordinates which are not in close proximity in the first target pixel blocks, and dividing the second pixel blocks with the same RGB value but with coordinates which are not in close proximity according to a second preset rule to obtain second target pixel blocks comprises:
taking the pixel points A whose coordinate is (Xn, Yn) in each of the first target pixel blocks, when satisfying |Xn±1−Xn|<=1 and |Yn±1−Yn|=<1, the coordinate (Xn, Yn) of pixel point A and the physical coordinate of the pixel point (Xn±1; Yn±1) are adjacent to each other, then dividing the pixel point (Xn±1; Yn±1) and the pixel point A into one piece, dividing all pixel points into N parts according to the rule, and obtaining the divided second target pixel blocks.
8. The video compression system according to claim 6 , wherein the splitting the enveloping area and optimizing a dynamic block according to the vector changes of the dynamic pixel points further comprises:
determining whether the pixel block in the enveloping line is the minimum pixel dynamic block;
recording RGB value changes caused by a movement of pixels on the enveloping line to adjacent pixels to predict a movement trajectory of the dynamic pixel points on the enveloping line when the pixel block in the enveloping line is the minimum pixel dynamic block;
calculating a vector relationship between a frame rate and the motion pixels according to a preset formula, and determining the minimum compression change block in combination with the predicted movement trajectory of the dynamic pixel points on the enveloping line.
9. The video compression system according to claim 8 , wherein the recording RGB value changes caused by a movement of pixels on the enveloping line to adjacent pixels to predict a movement trajectory of the dynamic pixel points on the enveloping line comprises:
dividing an area surrounding the pixel point A into 8 equal parts; recording and comparing the RGB values of the 9 pixel points included in each equal part and comparing the RGB value changes caused by the movement of the pixel point A to the coordinates of the 9 pixel points, predicting a dynamic change of the pixel point A, wherein the pixel point A is any pixel point on the enveloping line.
10. The video compression system according to claim 8 , wherein the preset formula is:
QA=XA/X 0 =(VA*T 0 )/X 0 ;
wherein, T 0 is a frame-to-frame change time; VA is a dynamic change speed of the pixel point A; the distance between adjacent pixels is X 0 ; T 0 is a distance moved by the pixel point A within the frame-to-frame change time T 0 ; QA is a number of pixels passed by the pixel point A during the movement of the pixel point A within the frame-to-frame change time T 0 .
11. A non-transitory computer-readable storage medium in which computer programs are stored, and the computer programs can be executed by at least one processor, to enforce following steps:
dividing colors of all pixel points of a target video frame into red (R), green (G), and blue (B) values, and placing all of the pixel points in a three-dimensional coordinate system to establish a corresponding relationship between each of the pixel points and a coordinate position;
performing fuzzy recombination and division to obtain a plurality of pixel blocks of the target video frame according to distribution of each of the pixel points;
dividing the plurality of pixel blocks with similar RGB values into first pixel blocks according to a first preset rule to obtain first target pixel blocks, wherein the dividing the plurality of pixel blocks with similar RGB values into first pixel blocks according to a first preset rule to obtain first target pixel blocks comprises:
defining the first target pixel blocks Z {A 1 , A 2 , A 3 . . . An};
when An (Rn, Gn, Bn) satisfies Rn+1−Rn<=M, Gn+1−Gn<=M, Bn+1−Bn<=M, defining {An} as the first target pixel blocks Z, wherein M is a predefined real number greater than zero;
extracting second pixel blocks with a same RGB value but with coordinates which are not in close proximity in the first target pixel blocks, and dividing the second pixel blocks with the same RGB value but with coordinates which are not in close proximity according to a second preset rule to obtain second target pixel blocks;
extracting an enveloping area of the second target pixel blocks, traversing and analyzing vector changes of all dynamic pixel points on an enveloping line of the enveloping area, wherein the dynamic pixel points are pixels in a dynamic state;
splitting the enveloping area and optimizing an dynamic block according to the vector changes of the dynamic pixel points;
determining a minimum compression change block according to the optimized dynamic block, and compressing the minimum compression change block, wherein the splitting the enveloping area and optimizing a dynamic block according to the vector changes of the dynamic pixel points comprises:
when the RGB value of the pixel points of the enveloping line changes, the pixel points are considered to be in the dynamic state; when the RGB value of the pixel points does not change, the pixel points are discarded and repeating the pixel points discard determination until the enveloping line of the changing pixel points is gradually reduced to find a minimum pixel dynamic block.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.