CN108540799A - It is a kind of can be with the compression method of difference between one video file two field pictures of Precise Representation - Google Patents
It is a kind of can be with the compression method of difference between one video file two field pictures of Precise Representation Download PDFInfo
- Publication number
- CN108540799A CN108540799A CN201810470423.8A CN201810470423A CN108540799A CN 108540799 A CN108540799 A CN 108540799A CN 201810470423 A CN201810470423 A CN 201810470423A CN 108540799 A CN108540799 A CN 108540799A
- Authority
- CN
- China
- Prior art keywords
- frame
- index
- pixel
- region
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/136—Incoming video signal characteristics or properties
- H04N19/137—Motion inside a coding unit, e.g. average field, frame or block difference
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/182—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/186—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses it is a kind of can with the compression method of difference between one video file two field pictures of Precise Representation, including:S1, reference frame is determined;S2, current frame image is divided into upper left, upper right, lower-left, the region of bottom right four, recurrence division is carried out to each region respectively, at most only there are one until pixel until being divided into each region;S3, current pixel and reference frame corresponding position pixel are subjected to color value comparison, it is identical, 1 is returned, is differed, 0 is returned and stores current color value to data field.S2 calls S3 to compare can be there are four return value, the direct return 1 if being all 1;When being not all 1, return value is sequentially stored into index area and returns to 0;S4, frame head, index, content, which be stitched together, successively to form the complete image of present frame data is partially compressed.The present invention is a kind of lossless compression method, while can produce high compression ratio in certain fields again.
Description
Technical field
The invention belongs to field of video compression, and in particular to one kind can with one video file two field pictures of Precise Representation it
Between difference compression method.
Background technology
Field of video compression generally uses MPEG and H.26X serial algorithm at present, and contraction principle is similar, generally
All be it is little using changing between two frame of video, difference between only storing and may lose visually be not easy to find out it is thin
Section, reaches certain compression ratio.All there are three common defects:First, since code check is usually constant, limited compression
Than being limited by code check, therefore, compression ratio is a relatively-stationary parameter, even if the image in entire video does not have substantially
Variation also will produce out prodigious video file;Second, be all lossy compression, that is, the image and original image seen when playing
Between more or less have differences, cannot be satisfied part and require image quality harsh field;Third, algorithm comparison is complicated, it is related to
Some advanced mathematical knowledges are not easy to voluntarily improve or carry out multithreading optimization.
Invention content
It, can be one with Precise Representation present invention aims at one kind is provided in order to solve the above problem of the existing technology
The compression method of difference between video file two field pictures.The present invention can produce more in video almost unconverted scene
High compression ratio, while the present invention is a kind of lossless compression method, can also use and require image quality harsh scene at some.
The technical solution adopted in the present invention is:
It is a kind of can be with the compression method of difference between one video file two field pictures of Precise Representation, the flow of the compression
For:
S1, reference frame is determined;
S2, recurrence compression is carried out to current frame image, which is divided into upper left, upper right, lower-left, the area of bottom right four
Domain carries out recurrence division to each region respectively, and until being divided into each region, at most only there are one until pixel;
S3, the pixel of the pixel in each region and reference frame frame corresponding position is subjected to color value comparison respectively, it is identical then
1 is returned, is differed, return to 0 and stores current color value to data field, it is direct when the return value that four regions are compared is 1
1 (index value is used for index area) is returned, any operation is not carried out to index file;When the return value that four regions are compared is not complete
When being 1, return value is sequentially stored into index area;
S4, frame head, index, content, which be stitched together, successively to form the complete image of present frame data is partially compressed, when
Indicate that present frame is identical with reference frame when return value in the step S3 is 1, present frame saves as frame head.
For pixel in the case of identical, only there are one return values in region, and in different situations, index of reference text
Multiple storage othernesses in part, can accomplish only frame head in the case where limiting case, that is, two field pictures are identical,
Without index and data field, the limit of memory space is a position shared by a frame image.
Preferably, in the step S1, compared or directly using previous by complete relatively either sample pixel-by-pixel
The mode of frame, determines reference frame.
Preferably, in the step S2, image averaging is divided into upper left, upper right, lower-left and the region of bottom right four.
Preferably, before step S2, virtual extended also is carried out to image, makes Nth powers long and wide identical and for 2.
Further, length and width of the image after virtual extended not less than the image before virtual extended.
If without virtual extended, the length and width of video are not just Nth power just equal and for 2 under normal circumstances, are drawn
It just will appear not the case where being each pixel in just four regions during point.
The compression method further includes decompression flow, and the flow of decompression is:
S5, header is read, positions index area and data field respectively;
If S6, judging that present frame is identical with reference frame according to the total comparison result value being stored in frame head, directly
Present frame is filled with the data of reference frame, is terminated;
S7, primary four index values for reading index area, are assigned to each region unit, the pointer forward 4 of index area, phase respectively
The index value (comparison result before being exactly is stored in the value 0 or 1 of index area) answered then directly is corresponded to former frame if 1
Color value filling;If 0, then repeatedly S7, is that only there are one pixels until reaching region;
If the more corresponding index value of pixel is 1, filled with the color value of the corresponding pixel of reference frame;If 0, then use
The color value of data field is filled, the color value pointer forward 1 of data field;
As soon as if current context is to be in a region, that represents the comparison result of current region, if context
It is a pixel, is exactly the end value that pixel compares.1 be possible to represent be that a region is identical, it is also possible to representative is one
A point is identical, is a region or a point depending on the context currently decompressed, if being currently in the environment of a region, than
Such as the region of the 16*16 of a coordinate from (0,0) to (15,15), this 256 pixels are identical as former frame, then replicate reference
The point of reference frame corresponding position is then replicated if it is a point in frame region.
S8, S7 is repeated, until index point is directed toward 0, the pointer of data field is also directed to 0, and current frame image decompression is completed.
Specifically, in the step S7, the digit of the pointer forward of index area is consistent with the number of region unit.
Beneficial effects of the present invention are:
In the case of the present invention fixes in field of video monitoring, especially camera angle, captured scene is also fixed,
High compression ratio can be produced, an equal amount of space can store the video than the former longer time, have to image quality
The field of rigors, such as film stamper can accomplish completely lossless preservation video file, produce the video effect being more pleasantly surprised
Fruit can protect simultaneously as this compression method is less sensitive for frame number per second in the case where being slightly increased space hold
Deposit the video for meeting or exceeding eye recognition speed limit.This method optimizes convenient for multithreading, is accelerated using video card or special
The hardware of door can accomplish that ultrahigh resolution increases frame number Real Time Compression and decompression, and speed bottle-neck is not present.
Specific implementation mode
With reference to specific embodiment, the present invention is further elaborated.
Embodiment one:
The a kind of of the present embodiment can be with the compression method of difference between one video file two field pictures of Precise Representation, the party
Method can produce higher compression ratio in certain fields, and can accomplish precise restoration image in all spectra.In addition
This method is relatively simple, and demonstration code includes that Compress softwares and annotation have only 300 rows altogether, can be easy to voluntarily improve, the party
There are one the places that natural one point is four in method, it is easy to be transformed into 4 Nth power thread parallel operation, reach quickly
Compression and decompression speed.
It is a kind of can be with the compression method of difference between one video file two field pictures of Precise Representation, including compress and decompress
Contracting.
First, following simple hypothesis and elaboration are done to the principle of the present invention:
1, the image data per frame finally saves as frame head, and difference value index and different colors are arranged in order composition data
Area.
2, difference value index and data zone position and size are calculated according to frame head.
3, hypothesis is identical is indicated with 1 position 1, is differed and is indicated with 1 position 0, in turn virtually without influence.
4, for the sake of simplicity, ignoring part detection and optimization in method explanation and demonstration code, for example the index preserved is
When 1110,111 can be saved as, the last one 0 judges to learn and can be omitted by calculating, some are more suitable for by reference (this location
The memory address of finger, as soon as such as an object account for 100 bytes, use the mode of biography value that will at least generate answering for 100 bytes
Expense processed, and if it is being then by reference 4 bytes on 32 systems, it is 8 bytes on 64 systems, opens
Sell obvious much less) place be directly worth using biography.
5, it is directly stored successively when color data is stored, any optimization is not done before storage and after storage.
6, demonstration program directly assumes that image length and width are 2 Nth power, in the actual environment can be by equal to long and width
It is extended and reaches Nth powers consistent and for 2, detection pixel or region can also be directly added in method whether in video model
In enclosing, when comparing, if corresponding pixel or region not within the scope of picture video, directly return to 1.
Single thread is used only below to describe, multithreading improvement is not the core of the application method.
Compression process is:Original image stream->Coding->File stores.
Specifically flow is:
The first step, either sampling compares or directly simply using by way of former frame complete relatively pixel-by-pixel, really
Determine reference frame.
Second step carries out virtual extended to the length and width of image, makes Nth powers long and wide identical and for 2, and after virtual extended
Image not less than the length and width of the image before virtual extended, this step not necessarily step in practical applications completely can be with
The size for receiving arbitrary length and width even two frames is inconsistent, it is only necessary to carry out some small adjustment to algorithm non-core portion.
Third step carries out recurrence compression to current frame image, which is divided into upper left, upper right, lower-left and bottom right
Four regions carry out recurrence division to four regions respectively, until being divided into upper left, upper right, lower-left, the region of bottom right four most
More, there are one until pixel, are respectively compared the pixel in four regions with the pixel color value of reference frame corresponding position,
It is identical, return to 1, differ, return 0 and store current color value arrive data field, four regions respectively there are one return value, one
Totally four return values, directly returning to 1 when the return value that four regions are compared is 1, (this 1 is return as method function
Value, possible index value at last, as it is possible that it is all that can't carry out any behaviour to index area in the case of 1 to return to 4
Make), any operation is not carried out to index file, when the return value that four regions are compared is not all 1, successively by four return values
It is stored in index area.
4th step, frame head, index, content, which be stitched together, successively to form the complete image of present frame number is partially compressed
According to when four function return values called when being divided for the first time in third step are 1, present frame saves as frame head (index sum number
According to length be 0, it is only necessary to save as frame head).It is comparison that position 0 or 1 indicates two field pictures necessarily to have in frame head
As a result, if it is 1, index area and data field are just without data, if it is 0, with regard to having data certainly.
It repeats third and walks the-the FOUR EASY STEPS, until to the last frame of video.
Decompressing flow is:File->Decoding->Original image stream.
Decompression (frame) detailed process be:
The first step reads header, positions index area and data field respectively.
If second step, present frame are identical with reference frame, the data of reference frame is directly used to fill present frame, knot
Beam.
Third step, primary four index values for reading index area, are assigned to bottom right, lower-left, upper right and the area of upper left four respectively
Domain block, the pointer forward 4 of index area, corresponding index value then directly use the corresponding color value filling of former frame if 1;If
0, then repeatedly third walks, and is that only there are one pixels until reaching region;
If the more corresponding index value of pixel is 1, filled with the color value of the corresponding pixel of reference frame;If 0, then use
The color value of data field is filled, the color value pointer forward 1 of data field.
Third step is repeated, until being finally reached index point is directed toward 0, the pointer of data field is also directed to 0, current frame image solution
Pressure is completed.
For pixel in the case of identical, only there are one return values in four regions, and in different situations, use rope
4 positions in quotation part store otherness, can accomplish only frame in the case where limiting case, that is, two field pictures are identical
Head, without index and data field, the limit of memory space is a position shared by a frame image.
It is one section of simplified C++ source codes realization of the present invention below, can be tested with direct compilation.In this code,
It does not influence to carry out prodigious simplification to practical calculating process in the case of invention core.
The present invention is not limited to above-mentioned optional embodiment, anyone can show that other are various under the inspiration of the present invention
The product of form, however, make any variation in its shape or structure, it is every to fall into the claims in the present invention confining spectrum
Technical solution, be within the scope of the present invention.
Claims (6)
1. a kind of can be with the compression method of difference between one video file two field pictures of Precise Representation, it is characterised in that:It is described
The flow of compression is:
S1, reference frame is determined;
S2, recurrence compression is carried out to current frame image, which is divided into upper left, upper right, lower-left, the region of bottom right four,
Recurrence division is carried out to each region respectively, at most only there are one until pixel until being divided into each region;
S3, the pixel of the pixel in each region and reference frame corresponding position is subjected to color value comparison respectively, it is identical, 1 is returned,
It differs, return to 0 and stores current color value to data field, 1 is directly returned when the return value that four regions are compared is 1,
Any operation is not carried out to index file;When the return value that four regions are compared is not all 1, return value is sequentially stored into index
Area simultaneously returns to 0;
S4, frame head, index, content, which be stitched together, successively to form the complete image of present frame data is partially compressed, when described
When return value in step S3 is 1, present frame saves as frame head.
2. it is according to claim 1 it is a kind of can be with the compression side of difference between one video file two field pictures of Precise Representation
Method, it is characterised in that:In the step S1, compare or directly use former frame by complete relatively either sample pixel-by-pixel
Mode determines reference frame.
3. one kind according to claim 1-2 any one can be with poor between one video file two field pictures of Precise Representation
Different compression method, it is characterised in that:Before step S2, virtual extended also is carried out to image, makes long and wide identical and is 2
Nth power.
4. it is according to claim 3 it is a kind of can be with the compression side of difference between one video file two field pictures of Precise Representation
Method, it is characterised in that:Image after virtual extended is not less than the length and width of the image before virtual extended.
5. one kind according to claim 1-2 any one can be with poor between one video file two field pictures of Precise Representation
Different compression method, it is characterised in that:The compression method further includes decompression flow, and the flow of decompression is:
S5, header is read, positions index area and data field respectively;
If S6, judging that present frame is identical with reference frame according to the total comparison result value being stored in frame head, directly with ginseng
The data filling present frame for examining frame, terminates;
S7, primary four index values for reading index area, are assigned to each region unit respectively, the pointer forward 4 of index area, accordingly
Index value then directly uses the corresponding color value filling of former frame if 1;If 0, then repeatedly S7, is only until reaching region
One pixel;
If the more corresponding index value of pixel is 1, filled with the color value of the corresponding pixel of reference frame;If 0, then data are used
The color value in area is filled, the color value pointer forward 1 of data field;
S8, S7 is repeated, until index point is directed toward 0, the pointer of data field is also directed to 0, and current frame image decompression is completed.
6. it is according to claim 1 it is a kind of can be with the compression side of difference between one video file two field pictures of Precise Representation
Method, it is characterised in that:In the step S7, the digit of the pointer forward of index area is consistent with the number of region unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810470423.8A CN108540799B (en) | 2018-05-16 | 2018-05-16 | Compression method capable of accurately representing difference between two frames of images of video file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810470423.8A CN108540799B (en) | 2018-05-16 | 2018-05-16 | Compression method capable of accurately representing difference between two frames of images of video file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108540799A true CN108540799A (en) | 2018-09-14 |
CN108540799B CN108540799B (en) | 2022-06-03 |
Family
ID=63472166
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810470423.8A Active CN108540799B (en) | 2018-05-16 | 2018-05-16 | Compression method capable of accurately representing difference between two frames of images of video file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108540799B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109982091A (en) * | 2019-04-26 | 2019-07-05 | 京东方科技集团股份有限公司 | A kind of processing method and processing device of image |
CN110896497A (en) * | 2019-10-30 | 2020-03-20 | 厦门天锐科技股份有限公司 | Image processing method, video playing method and device |
CN111294600A (en) * | 2020-03-17 | 2020-06-16 | 广州致远电子有限公司 | Compression method, decompression method and device for video sequence frame |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1522401A (en) * | 2001-10-29 | 2004-08-18 | ض� | Method and apparatus for parallel shift right merge of data |
WO2015059880A1 (en) * | 2013-10-22 | 2015-04-30 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | Motion compensation method, image encoding method, image decoding method, image encoding device and image decoding device |
US20160100175A1 (en) * | 2014-10-06 | 2016-04-07 | Canon Kabushiki Kaisha | Residual colour transform signalled at sequence level for specific coding modes |
CN105814889A (en) * | 2013-12-10 | 2016-07-27 | 佳能株式会社 | Improved palette mode in hevc |
CN105844683A (en) * | 2016-03-23 | 2016-08-10 | 深圳市富途网络科技有限公司 | Pixel difference frame-by-frame animation realization method based on Canvas and WebWorker |
-
2018
- 2018-05-16 CN CN201810470423.8A patent/CN108540799B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1522401A (en) * | 2001-10-29 | 2004-08-18 | ض� | Method and apparatus for parallel shift right merge of data |
WO2015059880A1 (en) * | 2013-10-22 | 2015-04-30 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | Motion compensation method, image encoding method, image decoding method, image encoding device and image decoding device |
CN105814889A (en) * | 2013-12-10 | 2016-07-27 | 佳能株式会社 | Improved palette mode in hevc |
US20160100175A1 (en) * | 2014-10-06 | 2016-04-07 | Canon Kabushiki Kaisha | Residual colour transform signalled at sequence level for specific coding modes |
CN105844683A (en) * | 2016-03-23 | 2016-08-10 | 深圳市富途网络科技有限公司 | Pixel difference frame-by-frame animation realization method based on Canvas and WebWorker |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109982091A (en) * | 2019-04-26 | 2019-07-05 | 京东方科技集团股份有限公司 | A kind of processing method and processing device of image |
CN109982091B (en) * | 2019-04-26 | 2022-04-22 | 京东方科技集团股份有限公司 | Image processing method and device |
CN110896497A (en) * | 2019-10-30 | 2020-03-20 | 厦门天锐科技股份有限公司 | Image processing method, video playing method and device |
CN111294600A (en) * | 2020-03-17 | 2020-06-16 | 广州致远电子有限公司 | Compression method, decompression method and device for video sequence frame |
Also Published As
Publication number | Publication date |
---|---|
CN108540799B (en) | 2022-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10726299B2 (en) | Sorted geometry with color clustering (SGCC) for point cloud compression | |
US6009201A (en) | Efficient table-lookup based visually-lossless image compression scheme | |
US6456658B2 (en) | Brightness-variation compensation method and coding/decoding apparatus for moving pictures | |
US6535648B1 (en) | Mathematical model for gray scale and contrast enhancement of a digital image | |
Nguyen et al. | RAW image reconstruction using a self-contained sRGB-JPEG image with only 64 KB overhead | |
NO301860B1 (en) | Method and apparatus for processing digital data | |
EP1743301A1 (en) | Encoding, decoding and representing high dynamic range images | |
CN108540799A (en) | It is a kind of can be with the compression method of difference between one video file two field pictures of Precise Representation | |
GB2306840A (en) | Data compression | |
US20230101024A1 (en) | Point cloud quality assessment method, encoder and decoder | |
CN107646112B (en) | Method for correcting eye image using machine learning and method for machine learning | |
CA2519358A1 (en) | Color image compression via spectral decorrelation and elimination of spatial redundancy | |
US7421130B2 (en) | Method and apparatus for storing image data using an MCU buffer | |
CN111918065A (en) | Information compression/decompression method and device | |
US20140267916A1 (en) | Selective perceptual masking via scale separation in the spatial and temporal domains using intrinsic images for use in data compression | |
US5623310A (en) | Apparatus for encoding a video signal employing a hierarchical image segmentation technique | |
US11895308B2 (en) | Video encoding and decoding system using contextual video learning | |
US8897378B2 (en) | Selective perceptual masking via scale separation in the spatial and temporal domains using intrinsic images for use in data compression | |
CN116980549A (en) | Video frame processing method, device, computer equipment and storage medium | |
CA3227676A1 (en) | Encoding and decoding method, and apparatus | |
EP1407617B1 (en) | Error concealment for image information | |
US20190373233A1 (en) | Method and arrangements for hdr encoding | |
CN113111770A (en) | Video processing method, device, terminal and storage medium | |
CN106709880A (en) | Grayscale image saving method and grayscale image original pixel acquisition method | |
CN114638748A (en) | Image processing method, image restoration method, computer device, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |