CN113079379A - Video compression method, device, equipment and computer readable storage medium - Google Patents
Video compression method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN113079379A CN113079379A CN202110327744.4A CN202110327744A CN113079379A CN 113079379 A CN113079379 A CN 113079379A CN 202110327744 A CN202110327744 A CN 202110327744A CN 113079379 A CN113079379 A CN 113079379A
- Authority
- CN
- China
- Prior art keywords
- image
- compressed
- current
- data
- image block
- 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.)
- Pending
Links
- 230000006835 compression Effects 0.000 title claims abstract description 91
- 238000007906 compression Methods 0.000 title claims abstract description 91
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000004590 computer program Methods 0.000 claims description 11
- 239000003550 marker Substances 0.000 claims description 7
- 238000013139 quantization Methods 0.000 claims description 6
- 230000008859 change Effects 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 abstract description 13
- 238000005516 engineering process Methods 0.000 abstract description 8
- 230000000694 effects Effects 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000003139 buffering effect Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
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/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
-
- 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/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- 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/40—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
-
- 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/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
-
- 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/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a video compression method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: acquiring a current frame image to be compressed; comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image block; the variable image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to each target image block; carrying out image compression on the changed image block data to obtain an image block compressed file corresponding to the current frame image to be compressed; the invention obtains the data of the changed image blocks by comparing the image to be compressed of the current frame with the image to be compressed of the previous frame, determines the image blocks to be compressed by utilizing the interframe compression technology, reduces the data volume to be compressed, greatly improves the video compression ratio, reduces the data volume transmitted by a network, reduces the transmission time of the image and ensures the effect of remote display.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a video compression method, apparatus, device, and computer-readable storage medium.
Background
The BMC is a substrate management control chip on the server and is mainly responsible for monitoring information such as temperature, voltage, fans, power supply and the like of system hardware of the server and performing corresponding adjustment work to ensure that the system is in a healthy state. Meanwhile, the BMC provides a remote access network interface for the server, the client terminal remotely accesses the server through the network interface of the BMC and realizes desktop display of the server at the client terminal, so that Video transmission of KVM (Keyboard Video Mouse, Keyboard, Video and Mouse) can be realized; that is, the BMC may transmit the video stream of the server to the client terminal for display.
In the prior art, because a video stream is composed of images of one frame and one frame, video compression is often realized by compressing each frame of image, so as to reduce the data volume of network transmission; in the video compression method for compressing each frame of image, the data amount required for network transmission is still large, so that the transmission time of the image is long, and the remote display is not facilitated. Therefore, how to reduce the amount of video compression data, thereby reducing the amount of network transmission data, reducing the transmission time of images, and ensuring the effect of remote display is a problem that needs to be solved urgently today.
Disclosure of Invention
The invention aims to provide a video compression method, a video compression device, video compression equipment and a computer readable storage medium, which are used for reducing the data volume of video compression, thereby reducing the data volume of network transmission and reducing the transmission time of images.
To solve the above technical problem, the present invention provides a video compression method, including:
acquiring a current frame image to be compressed;
comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image block; the change image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to the target image blocks;
and carrying out image compression on the changed image block data to obtain an image block compressed file corresponding to the current frame image to be compressed.
Optionally, the acquiring the current frame to-be-compressed image includes:
the BMC acquires a current frame image to be compressed output by the video image adapter through the digital video interface;
or the BMC acquires the current frame image to be compressed from the video memory of the video image adapter.
Optionally, the comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the changed image block data includes:
dividing a current frame image to be compressed into image blocks with preset sizes, and acquiring image block data; wherein the tile data comprises the tiles and image coordinates corresponding to each of the tiles;
and comparing the image blocks with the corresponding image blocks in the image to be compressed of the previous frame according to the image coordinates corresponding to each image block, and acquiring the changed image block data in the image block data.
Optionally, the comparing, according to the image coordinate corresponding to each of the image blocks, the image block with the image block corresponding to the image to be compressed in the previous frame to obtain the changed image block data in the image block data, includes:
judging whether the current image block is the same as the image block of the current image coordinate in the previous frame of image to be compressed or not according to the current image coordinate corresponding to the current image block;
if not, determining the current block as the target block.
Optionally, when the preset size is 8 pixels by 8 pixels, the dividing the current frame image to be compressed into the image blocks of the preset size to obtain image block data includes:
caching the current 16 lines of pixels of the current frame image to be compressed output by the digital video interface;
and dividing the current 16 lines of pixels of the cache to obtain the image blocks corresponding to the current 16 lines of pixels.
Optionally, the performing image compression on the changed tile block data to obtain a tile block compressed file corresponding to the current frame image to be compressed includes:
compressing the image of the changed image block data by using a JPEG (joint photographic experts group) compression algorithm to obtain the image block compressed file; wherein the tile compressed file comprises target tiles in JPEG format.
Optionally, when the target image block in the changed image block data is in an RGB format, the compressing the changed image block data by using a JPEG compression algorithm to obtain the image block compressed file includes:
converting a target image block in the changed image block data into a YUV format;
sequentially performing discrete cosine transform, quantization and entropy coding, and converting the target image block in the YUV format into the JPEG format;
generating an image block compressed file according to target image blocks in a JPEG format and image coordinates corresponding to each target image block; wherein the tile compressed file comprises a tile start marker code corresponding to each target tile.
The present invention also provides a video compression apparatus, comprising:
the acquisition module is used for acquiring a current frame image to be compressed;
the comparison module is used for comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image blocks; the change image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to the target image blocks;
and the compression module is used for carrying out image compression on the changed image block data to obtain an image block compressed file corresponding to the current frame image to be compressed.
The present invention also provides a video compression apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the video compression method as described above when executing said computer program.
The invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the video compression method as described above.
The invention provides a video compression method, which comprises the following steps: acquiring a current frame image to be compressed; comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image block; the variable image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to each target image block; carrying out image compression on the changed image block data to obtain an image block compressed file corresponding to the current frame image to be compressed;
therefore, the invention obtains the data of the changed image blocks by comparing the image to be compressed of the current frame with the image to be compressed of the previous frame, determines the image blocks to be compressed by utilizing the interframe compression technology, reduces the data volume to be compressed, greatly improves the video compression ratio, reduces the data volume transmitted by a network, reduces the transmission time of the image and ensures the effect of remote display. In addition, the invention also provides a video compression device, equipment and a computer readable storage medium, which also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a video compression method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another video compression method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating the partitioning of a video block according to another embodiment of the present invention;
fig. 4 is a block diagram of a video compression apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a video compression apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a video compression method according to an embodiment of the invention. The method can comprise the following steps:
step 101: and acquiring the current frame image to be compressed.
The current frame image to be compressed in this step may be data of a frame image that needs to be compressed currently and acquired by the processor. The specific content and image format of the current frame image to be compressed in this step may be set by a designer according to a practical scenario and a user requirement, for example, when the BMC (i.e., the processor) of the server in this step is applied to the KVM, the BMC (i.e., the processor) may obtain an RGB (color coding method) image that needs to be transmitted to the client terminal, i.e., the current frame image to be compressed in the RGB format.
Specifically, the specific manner in which the processor acquires the current frame to-be-compressed image in this step may be set by the designer, for example, when this embodiment is applied to KVM, when the BMC (i.e., the processor) in the server provides a local VGA (Video Graphics Adapter) display function for the server, the VGA may provide the current frame to-be-compressed image (e.g., RGB image) to be compressed for the BMC, that is, the BMC may acquire the current frame to-be-compressed image from the Video Adapter (VGA), as shown in fig. 2, the BMC may acquire the current frame to-be-compressed image output by the Video Adapter through a Digital Video Interface (DVI), or the BMC may also directly read the current frame to-be-compressed image from the display memory of the Video Adapter.
Step 102: comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image block; the image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to the target image blocks.
It can be understood that the purpose of this step may be that the processor determines, through comparison between the current frame image to be compressed and the previous frame image to be compressed, a different tile (i.e., a target tile) in the current frame image to be compressed from the previous frame image to be compressed and coordinate information (i.e., image coordinates) in the image, so as to compress only inconsistent places in adjacent frames.
The specific mode of the processor in this step of comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the changed image block data can be set by a designer according to a practical scene and user requirements, for example, the processor can directly compare the current frame image to be compressed with the previous frame image to be compressed, and determine the areas (i.e. target image blocks) and the corresponding image coordinates which are different (i.e. changed) between the two, thereby obtaining the changed image block data; the processor may also divide the current frame of image to be compressed into blocks of a preset size, compare the blocks with corresponding blocks in the previous frame of image to be compressed according to the respective image coordinates of each block, and determine blocks (i.e., target blocks) in the current frame of image to be compressed that have the same image coordinates as the image coordinates in the previous frame of image to be compressed but have different blocks, thereby obtaining the changed block data. That is to say, the processor may divide the current frame image to be compressed into tiles of a preset size, and obtain tile data; the image block data comprises image blocks and image coordinates corresponding to each image block; and comparing the image blocks with the corresponding image blocks in the previous frame of image to be compressed according to the image coordinates corresponding to each image block, and acquiring the changed image block data in the image block data.
Correspondingly, the specific numerical value of the preset size, that is, the setting of the specification of the specific block partitioned from the current frame image to be compressed, may be set by a designer, as shown in fig. 2 and fig. 3, the preset size may be 8 pixels by 8 pixels, so as to perform image compression with the block size of 8 pixels by 8 pixels, that is, the processor may partition the current frame image to be compressed into blocks with the size of 8 pixels by 8; the predetermined size may also be other pattern specifications, such as 16 pixels by 16 pixels, which is not limited in this embodiment.
Specifically, in order to facilitate the processor to divide the current frame image to be compressed, the processor in this embodiment may further buffer the current frame image to be compressed; as shown in fig. 2, the BMC (i.e., the processor) may buffer a current frame to-be-compressed image output by a Digital Video Interface (DVI). The buffer size of the processor for buffering the current frame image to be compressed can be set by a designer, for example, the size can be set to ensure that tiles with preset sizes are converted and used and data streams (such as data streams output by DCI) acquired by the current frame image to be compressed are not blocked; for example, when the preset size is 8 pixels by 8 pixels, the BMC may buffer the current 16 lines of pixels of the current frame image to be compressed output by the digital video interface; dividing the current 16 lines of cached pixels to obtain image blocks corresponding to the current 16 lines of pixels; that is to say, the BMC may buffer the data of 16 rows of pixels of the current frame image to be compressed output by the DVI, so that after the buffered 16 rows of pixels are converted into corresponding 8 pixels by 8 pixels, the data of the next 16 rows of pixels of the previous frame image to be compressed output by the DVI may continuously update the buffer.
Correspondingly, as shown in fig. 2, the BMC (i.e., the processor) acquires the current frame of image to be compressed from the video memory of the video image adapter (VGA), so as to directly divide the current frame of image to be compressed, thereby reducing the buffering process.
It should be noted that, the specific manner of comparing the image block with the corresponding image block in the previous frame of image to be compressed (such as the image in the previous frame of image buffer area) by the processor according to the respective image coordinates corresponding to each image block in the image block data to obtain the changed image block data in the image block data may be set by the designer, for example, the processor may determine whether the image blocks of the current image coordinates in the current image block and the previous frame of image to be compressed are the same according to the current image coordinates corresponding to the current image block; the current image block is any image block corresponding to the current image to be compressed, and the current image coordinate is the image coordinate corresponding to the current image block; if not, determining the current image block as a target image block; that is, the processor may sequentially detect whether each tile corresponding to the current frame of image to be compressed is the same as the tile having the same image coordinates of the previous frame of image to be compressed, so as to determine different tiles as the target tile.
Correspondingly, when the current image block is different from the image block of the current image coordinate in the previous frame of image to be compressed, the current image block can be determined as a target image block, and whether the current image block is the last image block of the current frame of image to be compressed is judged; if yes, the process can be ended or step 101 is returned to continue to obtain the next frame of image to be compressed; if not, the next image block of the current frame image to be compressed can be used as the current image block, and the step of judging whether the current image block is the same as the image block of the current image coordinate in the previous frame image to be compressed according to the current image coordinate corresponding to the current image block is executed. When the current image block is the same as the image block of the current image coordinate in the previous frame of image to be compressed, whether the current image block is the last image block of the current frame of image to be compressed can be judged; if yes, the process can be ended or step 101 is returned to continue to obtain the next frame of image to be compressed; if not, the next image block of the current frame image to be compressed can be used as the current image block, and the step of judging whether the current image block is the same as the image block of the current image coordinate in the previous frame image to be compressed according to the current image coordinate corresponding to the current image block is executed.
Correspondingly, when the current image block is different from the image block of the current image coordinate in the previous frame of image to be compressed, the current image block can be written into the corresponding position in the previous frame of image buffer area to update the image in the previous frame of image buffer area, so as to reduce the data IO amount of each frame of image buffer.
Specifically, the front edge of each target tile in the changed tile data may be an image coordinate corresponding to the target tile, for example, the image coordinate of the third tile in the second row in fig. 3 may be (2,3), the bit width of the image coordinate differs according to the resolution, for example, the resolution is 1920 × 1200, 1920/8 ═ 240, and the binary is 11110000, the bit width of the image coordinate is 8 × 2 ═ 16, and the image coordinate may be represented as 0000001000000011 in binary.
Step 103: and carrying out image compression on the changed image block data to obtain an image block compressed file corresponding to the current frame image to be compressed.
It is understood that the purpose of this step may be to perform image compression on the changed tile data for the processor, and add the coordinate description (i.e. image coordinates) of each target tile on the basis of compressing the target tile in the changed tile data by using the existing image compression algorithm, so that a decompression terminal (e.g. a client terminal of a KVM) of a subsequent tile compressed file may determine the position of the target tile, thereby performing a refresh display on the last frame of image to be compressed on the display.
Specifically, the specific manner of compressing the image of the changed image block data by the processor in the step to obtain the image block compressed file corresponding to the image to be compressed of the current frame can be set by a designer according to a practical scene and user requirements, for example, the processor can utilize the existing image compression algorithm to compress the image of the target image block in the changed image block data to obtain the image block compressed file; for example, the processor may use a JPEG compression algorithm to perform image compression on the target tile in the changed tile data, and obtain a tile compressed file; wherein the tile compressed file comprises target tiles in JPEG format.
Correspondingly, when the target image block in the variation image block data is in RGB format, the processor may convert the target image block in the variation image block data into YUV (a color coding method) format; converting the target image block in the YUV format into a JPEG format through discrete cosine transform, quantization and entropy coding in sequence; generating an image block compressed file according to the target image blocks in the JPEG format and the image coordinates corresponding to each target image block; the tile compressed file comprises a tile start marker code corresponding to each target tile. As shown in fig. 2, the BMC (i.e., the processor) may convert the target block from RGB data to YUV data by using the RGB2YUV module, and then compress the YUV data into target block data in JPEG format through processes such as DCT (discrete cosine transform), quantization, and entropy coding based on the existing JPEG encoding technology (i.e., JPEG compression algorithm); then, a file header module is added to add a file header to data (such as target block data in a JPEG format and corresponding image coordinates) corresponding to the current image to be compressed, so as to generate a block compressed file (i.e., a JPEG file).
Correspondingly, for the specific way of generating the tile compressed File by the processor according to the target tiles in the JPEG Format and the respective image coordinates of each target tile, that is, the specific way of adding the File header to the data corresponding to the image to be compressed of the current frame, the specific way may be set by the designer, for example, the specific way may be set according to the specific storage Format of the tile compressed File (i.e., the JPEG File), for example, when the tile compressed File adopts the JFIF (JPEG File storage Format) Format, the start of a marker code may be represented by 0xFF, and the File header may include the following meaningful marker codes: 0XFFD8(SOI, Start Of Image, mark code is a fixed value), 0XFFE0(APP0, Application 0, Application reservation mark 0, mark code is a fixed value), 0XFFE1 — 0XFFFF (APPn, Application n, Application reservation mark n (n 1 — 15), 2 bytes), 0XFFDB (DQT, Define Quantization Table, mark code is a fixed value), 0XFFC0(SOFO, Start Of Frame, mark code is a fixed value), 0XFFC4(DHT, Define Huffman Table, mark code is a fixed value), 0 fdd (DRI, Define boundary value), mark code is a fixed value, 0xff, fda, Start Of Frame, Scan Start Of Frame, mark code is a fixed value, 0xff is an fixed value, 0 fdf, Start Of Scan Start Of Frame, mark code is an End Of Frame, and mark code is an End Of field, and mark code is a fixed value, 0XFF00 (indicating that 0XFF is a component of the image stream and needs to be decoded) and 0 XFD 0-0 XFD 7 (constituting the RSTn mark and needing to ignore the whole RSTn mark, namely, not decoding the current 0XFF and the next 0XDn two bytes and adjusting the decoding variables according to the rule of RST mark); the file header may also include a tile start marker code (e.g., 0XFFB0) as the start of compressed data for each target tile, which may be followed by the image coordinates of the tile, which may be followed by the compressed data for the tile; the number of bytes occupied by the image coordinates may be different according to the resolution, for example, 1920 × 1200 resolution corresponds to 2 bytes, and 2048 × 1028 corresponds to 4 bytes.
It should be noted that, as shown in fig. 2, in the video compression method in which the BMC performs image compression on the target tile in the changed tile Data by using the JPEG compression algorithm in this embodiment, compared with the video compression methods commonly used in the industry (such as MPEG and h.264), the algorithm is simple, the hardware implementation difficulty is low, the frequency of accessing the DDR (Double Data Rate) is similar to that of the existing JPEG encoding technology, and is much less than that of the MPEG (a video compression method) or the h.264 (a video compression method), which greatly reduces the requirement for the DDR bandwidth, and increases the inter-frame compression on the basis of the JPEG encoding technology, thereby greatly increasing the compression ratio.
Specifically, in this embodiment, a processor (such as a BMC) is used to compress one frame of image (i.e., a current frame of image to be compressed) in a currently acquired video stream, and for compressing other frame of image in the video stream, the same or similar method as that provided in this embodiment may be used to implement compression of the video stream. The present embodiment does not set any limit to this.
It is understood that, correspondingly, the video compression method provided by the embodiment can be applied to a scene with small picture variation of adjacent video frames, such as KVM, so as to greatly improve the video compression ratio through increased inter-frame compression. In the embodiment, the processor acquires the image block compressed file corresponding to the current frame of image to be compressed, and can transmit the image block compressed file corresponding to the current frame of image to be compressed to the target terminal, so that the target terminal can decode the image block compressed file, refresh the previous frame of image to be compressed displayed by the target terminal, and display the current frame of image to be compressed; as shown in fig. 2, the BMC of the server may cache a tile compressed file corresponding to a current frame of an image to be compressed (e.g., a server desktop system), and then transmit the cached tile compressed file corresponding to the current frame of the image to be compressed to the client terminal, so as to display the current frame of the image to be compressed at the client terminal, thereby implementing remote display of the server desktop system.
In the embodiment of the invention, the current frame image to be compressed is compared with the previous frame image to be compressed to obtain the data of the changed image block, the image block to be compressed is determined by utilizing the interframe compression technology, and the data volume to be compressed is reduced, so that the video compression ratio is greatly improved, the network transmission data volume is reduced, the image transmission time is reduced, and the remote display effect is ensured.
Referring to fig. 4, fig. 4 is a block diagram of a video compression apparatus according to an embodiment of the present invention. The apparatus may include:
an obtaining module 10, configured to obtain a current frame to-be-compressed image;
the comparison module 20 is configured to compare the current frame of image to be compressed with the previous frame of image to be compressed, and obtain changed image block data; the variable image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to each target image block;
and the compression module 30 is configured to perform image compression on the changed tile data to obtain a tile compressed file corresponding to the current frame image to be compressed.
Optionally, the obtaining module 10 may be specifically configured to obtain a current frame to-be-compressed image output by the video image adapter through the digital video interface; or the BMC acquires the current frame image to be compressed from the video memory of the video image adapter.
Optionally, the comparison module 20 may include:
the image block conversion submodule is used for dividing the current frame image to be compressed into image blocks with preset sizes and acquiring image block data; the image block data comprises image blocks and image coordinates corresponding to each image block;
and the comparison submodule is used for comparing the image blocks with the corresponding image blocks in the previous frame of image to be compressed according to the image coordinates corresponding to each image block, and obtaining the changed image block data in the image block data.
Optionally, the comparison sub-module may include:
the judging unit is used for judging whether the current image block is the same as the image block of the current image coordinate in the previous frame of image to be compressed or not according to the current image coordinate corresponding to the current image block; if not, the current block is determined as the target block.
Optionally, when the preset size is 8 pixels by 8 pixels, the tile conversion sub-module may include:
the image caching unit is used for caching the current 16 lines of pixels of the current frame image to be compressed output by the digital video interface;
and the 8 × 8 tile conversion unit is used for dividing the current 16 lines of pixels of the cache to obtain tiles corresponding to the current 16 lines of pixels.
Optionally, the compression module 30 may include:
the JPEG compression submodule is used for carrying out image compression on the variable image block data by utilizing a JPEG compression algorithm to obtain an image block compression file; wherein the tile compressed file comprises target tiles in JPEG format.
Optionally, the JPEG compression sub-module may include:
the RGB2YUV unit is used for converting a target image block in the change image block data into a YUV format;
the JPEG compression unit is used for converting the target image blocks in the YUV format into the JPEG format through discrete cosine transform, quantization and entropy coding in sequence;
adding a file header unit for generating an image block compressed file according to the target image blocks in the JPEG format and the image coordinates corresponding to each target image block; the tile compressed file comprises a tile start marker code corresponding to each target tile.
In this embodiment, the comparison module 20 in the embodiment of the present invention compares the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image block, and determines the image block to be compressed by using the interframe compression technology, so as to reduce the data amount to be compressed, thereby greatly improving the video compression ratio, reducing the data amount transmitted by the network, reducing the transmission time of the image, and ensuring the remote display effect.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a video compression apparatus according to an embodiment of the present invention. The device 1 may comprise:
a memory 11 for storing a computer program; a processor 12 for implementing the steps of the video compression method as provided in the above embodiments when executing the computer program.
The device 1 (e.g. a server in a KVM) may comprise a memory 11, a processor 12 (e.g. a BMC) and a bus 13.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the device 1, for example a hard disk of a server. The memory 11 may in other embodiments also be an external storage device of the device 1, such as a plug-in hard disk provided on a server, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like. Further, the memory 11 may also comprise both internal memory units of the device 1 and external memory devices. The memory 11 can be used not only for storing application software installed in the device 1 but also various types of data, such as: codes of a program that executes a video compression method, and the like, may also be used to temporarily store data that has been output or is to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for executing program code stored in the memory 11 or Processing data, such as code of a program for executing a video compression method.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
Further, the device may further comprise a network interface 14, and the network interface 14 may optionally comprise a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the device 1 and other electronic devices.
Optionally, the device 1 may further comprise a user interface 15, the user interface 15 may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 15 may further comprise a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the device 1 and for displaying a visual user interface.
Fig. 5 shows only the device 1 with the components 11-15, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
In addition, the embodiment of the invention also discloses a computer readable storage medium, which stores a computer program, and the computer program realizes the steps of the video compression method provided by the embodiment when being executed by a processor.
Wherein the storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
The present invention provides a video compression method, apparatus, device and computer readable storage medium. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Claims (10)
1. A method of video compression, comprising:
acquiring a current frame image to be compressed;
comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image block; the change image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to the target image blocks;
and carrying out image compression on the changed image block data to obtain an image block compressed file corresponding to the current frame image to be compressed.
2. The video compression method according to claim 1, wherein said obtaining the current frame to-be-compressed image comprises:
the BMC acquires a current frame image to be compressed output by the video image adapter through the digital video interface;
or the BMC acquires the current frame image to be compressed from the video memory of the video image adapter.
3. The video compression method according to claim 1, wherein the comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the changed tile data comprises:
dividing a current frame image to be compressed into image blocks with preset sizes, and acquiring image block data; wherein the tile data comprises the tiles and image coordinates corresponding to each of the tiles;
and comparing the image blocks with the corresponding image blocks in the image to be compressed of the previous frame according to the image coordinates corresponding to each image block, and acquiring the changed image block data in the image block data.
4. The video compression method according to claim 3, wherein the obtaining the changed tile data in the tile data by comparing the tile with a corresponding tile in an image to be compressed in a previous frame according to the image coordinate corresponding to each of the tiles comprises:
judging whether the current image block is the same as the image block of the current image coordinate in the previous frame of image to be compressed or not according to the current image coordinate corresponding to the current image block;
if not, determining the current block as the target block.
5. The video compression method according to claim 3, wherein when the preset size is 8 pixels by 8 pixels, the dividing the current frame image to be compressed into tiles of the preset size to obtain tile data comprises:
caching the current 16 lines of pixels of the current frame image to be compressed output by the digital video interface;
and dividing the current 16 lines of pixels of the cache to obtain the image blocks corresponding to the current 16 lines of pixels.
6. The video compression method according to any one of claims 1 to 5, wherein the image compressing the changed tile data to obtain a tile compressed file corresponding to the image to be compressed of the current frame includes:
compressing the image of the changed image block data by using a JPEG (joint photographic experts group) compression algorithm to obtain the image block compressed file; wherein the tile compressed file comprises target tiles in JPEG format.
7. The video compression method as claimed in claim 6, wherein when the target tile in the changed tile data is in RGB format, the image compressing the changed tile data by using JPEG compression algorithm to obtain the tile compressed file comprises:
converting a target image block in the changed image block data into a YUV format;
sequentially performing discrete cosine transform, quantization and entropy coding, and converting the target image block in the YUV format into the JPEG format;
generating an image block compressed file according to target image blocks in a JPEG format and image coordinates corresponding to each target image block; wherein the tile compressed file comprises a tile start marker code corresponding to each target tile.
8. A video compression apparatus, comprising:
the acquisition module is used for acquiring a current frame image to be compressed;
the comparison module is used for comparing the current frame image to be compressed with the previous frame image to be compressed to obtain the data of the changed image blocks; the change image block data comprises target image blocks which are different from the previous image to be compressed in the current image to be compressed and image coordinates corresponding to the target image blocks;
and the compression module is used for carrying out image compression on the changed image block data to obtain an image block compressed file corresponding to the current frame image to be compressed.
9. A video compression device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the video compression method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the video compression method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110327744.4A CN113079379A (en) | 2021-03-26 | 2021-03-26 | Video compression method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110327744.4A CN113079379A (en) | 2021-03-26 | 2021-03-26 | Video compression method, device, equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113079379A true CN113079379A (en) | 2021-07-06 |
Family
ID=76610789
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110327744.4A Pending CN113079379A (en) | 2021-03-26 | 2021-03-26 | Video compression method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113079379A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113709490A (en) * | 2021-07-30 | 2021-11-26 | 山东云海国创云计算装备产业创新中心有限公司 | Video compression method, device, system and medium |
CN113824962A (en) * | 2021-08-29 | 2021-12-21 | 山东云海国创云计算装备产业创新中心有限公司 | Method, system, equipment and storage medium for transmitting cursor information |
CN113923421A (en) * | 2021-12-15 | 2022-01-11 | 苏州浪潮智能科技有限公司 | Monitoring video compression method, monitoring system, computer equipment and medium |
CN114051145A (en) * | 2022-01-11 | 2022-02-15 | 苏州浪潮智能科技有限公司 | Video compression processing method, device and medium |
CN114339226A (en) * | 2021-12-28 | 2022-04-12 | 山东云海国创云计算装备产业创新中心有限公司 | Method, device and medium for improving fluency of picture |
CN115209145A (en) * | 2022-09-15 | 2022-10-18 | 苏州浪潮智能科技有限公司 | Video compression method, system, device and readable storage medium |
CN115225725A (en) * | 2022-05-25 | 2022-10-21 | 广州汽车集团股份有限公司 | Data compression storage method and device, vehicle and storage medium |
CN115460414A (en) * | 2022-11-11 | 2022-12-09 | 苏州浪潮智能科技有限公司 | Video compression method and system of baseboard management control chip and related components |
CN115802047A (en) * | 2023-01-19 | 2023-03-14 | 苏州浪潮智能科技有限公司 | Video data transmission method and related device |
WO2023231710A1 (en) * | 2022-05-30 | 2023-12-07 | 华为技术有限公司 | Picture processing method and related device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100103183A1 (en) * | 2008-10-23 | 2010-04-29 | Hung-Ming Lin | Remote multiple image processing apparatus |
CN103281539A (en) * | 2013-06-07 | 2013-09-04 | 华为技术有限公司 | Method, device and terminal for image encoding and decoding processing |
-
2021
- 2021-03-26 CN CN202110327744.4A patent/CN113079379A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100103183A1 (en) * | 2008-10-23 | 2010-04-29 | Hung-Ming Lin | Remote multiple image processing apparatus |
CN103281539A (en) * | 2013-06-07 | 2013-09-04 | 华为技术有限公司 | Method, device and terminal for image encoding and decoding processing |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113709490A (en) * | 2021-07-30 | 2021-11-26 | 山东云海国创云计算装备产业创新中心有限公司 | Video compression method, device, system and medium |
CN113824962A (en) * | 2021-08-29 | 2021-12-21 | 山东云海国创云计算装备产业创新中心有限公司 | Method, system, equipment and storage medium for transmitting cursor information |
CN113824962B (en) * | 2021-08-29 | 2024-05-14 | 山东云海国创云计算装备产业创新中心有限公司 | Method, system, equipment and storage medium for transmitting cursor information |
CN113923421A (en) * | 2021-12-15 | 2022-01-11 | 苏州浪潮智能科技有限公司 | Monitoring video compression method, monitoring system, computer equipment and medium |
CN113923421B (en) * | 2021-12-15 | 2022-03-01 | 苏州浪潮智能科技有限公司 | Monitoring video compression method, monitoring system, computer equipment and medium |
CN114339226A (en) * | 2021-12-28 | 2022-04-12 | 山东云海国创云计算装备产业创新中心有限公司 | Method, device and medium for improving fluency of picture |
CN114339226B (en) * | 2021-12-28 | 2024-02-09 | 山东云海国创云计算装备产业创新中心有限公司 | Method, device and medium for improving smoothness of picture |
WO2023134128A1 (en) * | 2022-01-11 | 2023-07-20 | 苏州浪潮智能科技有限公司 | Video compression processing method, device, and medium |
CN114051145A (en) * | 2022-01-11 | 2022-02-15 | 苏州浪潮智能科技有限公司 | Video compression processing method, device and medium |
CN115225725B (en) * | 2022-05-25 | 2023-08-15 | 广州汽车集团股份有限公司 | Data compression storage method, device, vehicle and storage medium |
CN115225725A (en) * | 2022-05-25 | 2022-10-21 | 广州汽车集团股份有限公司 | Data compression storage method and device, vehicle and storage medium |
WO2023231710A1 (en) * | 2022-05-30 | 2023-12-07 | 华为技术有限公司 | Picture processing method and related device |
CN115209145A (en) * | 2022-09-15 | 2022-10-18 | 苏州浪潮智能科技有限公司 | Video compression method, system, device and readable storage medium |
CN115460414B (en) * | 2022-11-11 | 2023-03-07 | 苏州浪潮智能科技有限公司 | Video compression method and system of baseboard management control chip and related components |
CN115460414A (en) * | 2022-11-11 | 2022-12-09 | 苏州浪潮智能科技有限公司 | Video compression method and system of baseboard management control chip and related components |
CN115802047A (en) * | 2023-01-19 | 2023-03-14 | 苏州浪潮智能科技有限公司 | Video data transmission method and related device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113079379A (en) | Video compression method, device, equipment and computer readable storage medium | |
US20220046261A1 (en) | Encoding method and apparatus for screen sharing, storage medium, and electronic device | |
CN105959724B (en) | Video data processing method and device | |
CN106534859B (en) | Image transmission method and device based on SPICE protocol | |
US20130148740A1 (en) | Method and apparatus for processing partial video frame data | |
CN113873252B (en) | Image processing method and device, electronic equipment and storage medium | |
WO2022095797A1 (en) | Image compression method and apparatus, and intelligent terminal and computer-readable storage medium | |
US9449585B2 (en) | Systems and methods for compositing a display image from display planes using enhanced blending hardware | |
CN113068040A (en) | Image compression method and device, electronic equipment and readable storage medium | |
CN103152573A (en) | Method and system for transmitting image frame between mobile terminal and intelligent television set | |
CN112948151A (en) | Program interface image transmission method, substrate management controller and remote control equipment | |
EP2787738B1 (en) | Tile-based compression for graphic applications | |
CN113573072B (en) | Image processing method and device and related components | |
US9142053B2 (en) | Systems and methods for compositing a display image from display planes using enhanced bit-level block transfer hardware | |
US9648350B2 (en) | Method and apparatus for decoding a progressive JPEG image | |
JP2011234363A (en) | Image processing system and method | |
US20040141655A1 (en) | Method and apparatus for image processing | |
WO2023024832A1 (en) | Data processing method and apparatus, computer device and storage medium | |
CN107318021B (en) | Data processing method and system for remote display | |
CN101065760B (en) | System and method for processing image data | |
CN114217758A (en) | Image display method, image display device, electronic equipment and computer readable storage medium | |
US20090074054A1 (en) | Resolution-converting apparatus, resolution-converting method and previewing apparatus | |
CN107172425B (en) | Thumbnail generation method and device and terminal equipment | |
CN114339226B (en) | Method, device and medium for improving smoothness of picture | |
US20110158524A1 (en) | Image Processing Apparatus And Image Processing Method |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210706 |
|
RJ01 | Rejection of invention patent application after publication |