A video compression method, device, medium and product

By determining the reference pixel points of each pixel point in video compression and converting the identification data based on similarity, the problem of excessive resource consumption of traditional video compression methods is solved, and more efficient video compression is achieved.

CN119767007BActive Publication Date: 2025-06-20SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510252583.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-20
Estimated Expiration
2045-03-05

AI Technical Summary

Technical Problem

Traditional video compression methods require color space conversion and BLOCK format conversion to all pixel data, resulting in excessive consumption of computing resources and storage resources.

Method used

Repeated processing of the same data is avoided by determining the reference pixel point corresponding to each pixel point and determining whether to convert the pixel data into identification data based on the similarity of the pixel data.

Benefits of technology

The computing resources and storage resources required for video compression are reduced, and the overall performance of video compression is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119767007B_ABST
    Figure CN119767007B_ABST
Patent Text Reader

Abstract

The present invention discloses a video compression method, device, medium and product, relating to the field of video processing, including: determining a reference pixel point corresponding to each pixel point from the original video data; determining whether to convert the pixel data of each pixel point in the original video data into identification data based on the similarity between the pixel data of each pixel point and the reference pixel point, so as to obtain the converted video data; the identification data of each pixel point is used to determine a target reference pixel point corresponding to each pixel point, and the similarity between the target reference pixel point and each pixel point meets the similarity condition; performing color space conversion and data block format conversion on the non-identification data in the converted video data in sequence, and compressing the video data in the data block format to obtain the compressed video data corresponding to the original video data. The present invention reduces the computing resources and storage resources required for video compression by avoiding repeated processing of the same data in the video data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing, and particularly to a video compression method, device, medium and product. Background Art

[0002] The processing flow of traditional video compression is to first capture video data in RGB (Red, Green, Blue) format, then convert the RGB format video data through a color space conversion to generate YUV (a color encoding method, where Y represents luminance, and U and V represent chrominance) format video data. The YUV format video data is then subjected to a BLOCK (data block) format conversion to obtain BLOCK format YUV data, and finally, video compression is performed to obtain compressed format video data.

[0003] In actual application scenarios, adjacent frames of video data may change relatively little, and there may also be a large amount of identical data within the same frame. For example, the data of adjacent rows within the same frame of video data or the data in some video frames may be the same. However, in traditional video compression, all pixel data in the video data needs to undergo color space conversion and BLOCK format conversion. Among them, color space conversion requires multiple multiplication and addition operations for each pixel data, and BLOCK format conversion requires storage for each pixel data. Therefore, traditional video compression generally requires a large amount of computing resources and storage resources.

[0004] It can be seen that how to reduce the computing resources and storage resources required for video compression is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of the embodiments of the present invention is to provide a video compression method, device, medium and product, which can avoid repeated processing of identical data in video data to solve the problem that video compression requires a large amount of computing resources and storage resources. The specific solutions are as follows:

[0006] In a first aspect, the present invention provides a video compression method, including:

[0007] Determine a reference pixel point corresponding to each pixel point from the original video data;

[0008] Based on the similarity between the pixel data of each pixel point and the reference pixel point, determine whether to convert the pixel data of each pixel point in the original video data into identification data to obtain the converted video data; the identification data of each pixel point is used to determine a target reference pixel point corresponding to each pixel point, and the similarity between the target reference pixel point and each pixel point meets a preset similarity condition;

[0009] Perform color space conversion and data block format conversion on the non-identification data in the converted video data in sequence to obtain video data in data block format;

[0010] Compress the video data in data block format to obtain compressed video data corresponding to the original video data.

[0011] Optionally, determine whether to convert the pixel data of each pixel point in the original video data into identification data based on the similarity between the pixel data of each pixel point and the reference pixel points, including:

[0012] Determine the similarity between the pixel data of each pixel point and the pixel data of each reference pixel point respectively, and determine whether the maximum similarity among the similarities is greater than a preset similarity threshold;

[0013] If the maximum similarity is greater than the preset similarity threshold, convert the pixel data of each pixel point in the original video data into identification data.

[0014] Optionally, convert the pixel data of each pixel point in the original video data into identification data, including:

[0015] Based on the maximum similarity, determine the corresponding target reference pixel point from each reference pixel point;

[0016] According to the pixel position of the target reference pixel point in the original video data, determine the identification data corresponding to each pixel point, and convert the pixel data of each pixel point in the original video data into the identification data corresponding to each pixel point.

[0017] Optionally, perform color space conversion and data block format conversion on the non-identification data in the converted video data in sequence to obtain video data in data block format, including:

[0018] Perform color space conversion on the non-identification data in the converted video data, and determine combined video data based on the non-identification data after color space conversion and the identification data in the converted video data;

[0019] Perform data block format conversion on the non-identification data in the combined video data to obtain video data in data block format.

[0020] Optionally, when the non-identification data in the combined video data is pixel data in YUV format, perform data block format conversion on the non-identification data in the combined video data to obtain video data in data block format, including:

[0021] Write the non-identification data in the combined video data into the storage array based on a preset YUV sampling format; the storage array is an array composed of a preset number of memories for storing Y components, a preset number of memories for storing U components, and a preset number of memories for storing V components;

[0022] Create a data reading control table by using the storage positions of the non-identification data in the combined video data in the storage array and based on the identification data in the combined video data; the data reading control table records the array storage positions corresponding to each pixel point in the combined video data respectively; the array storage position includes the storage positions of each component in the pixel point in the storage array respectively;

[0023] Use the data reading control table and based on the data block size corresponding to any component, sequentially read the block data of the corresponding size and corresponding to any component from the storage array; the data block size corresponding to any component is the data block size determined based on the preset YUV sampling format;

[0024] Determine the video data in the data block format based on the block data corresponding to each component respectively.

[0025] Optionally, writing the non-identification data in the combined video data into the storage array based on the preset YUV sampling format includes:

[0026] Based on the preset YUV sampling format, determine the memories corresponding to each component included in the pixel point to be written in the combined video data; the data of the pixel point to be written in the combined video data is non-identification data;

[0027] Construct a data writing control table according to the memories corresponding to each component included in the pixel point to be written;

[0028] Use the data writing control table to write each component included in the pixel point to be written into the corresponding memory in the storage array respectively.

[0029] Optionally, creating a data reading control table by using the storage positions of the non-identification data in the combined video data in the storage array and based on the identification data in the combined video data includes:

[0030] Based on the storage positions of the non-identification data in the combined video data in the storage array, determine the array storage positions corresponding to each written pixel point in the combined video data respectively; the data of the written pixel point in the combined video data is non-identification data;

[0031] According to the identification data of each identification pixel point in the combined video data, determine the target reference pixel points corresponding to each identification pixel point respectively; the data of the identification pixel point in the combined video data is identification data;

[0032] Determine the array storage locations corresponding to each identification pixel point by using the array storage locations corresponding to each written pixel point respectively and based on each target reference pixel point;

[0033] Create a data reading control table based on the array storage locations corresponding to each written pixel point and each identification pixel point respectively.

[0034] Optionally, determining the reference pixel point corresponding to each pixel point from the original video data includes:

[0035] Determine the reference pixel point corresponding to each pixel point based on each initial pixel point in the original video data; the initial pixel point is the pixel point in the target video frame and / or the pixel point in the current video frame that meets the preset position condition;

[0036] Wherein, the target video frame is the video frame in the original video data that is before the current video frame; the current video frame is the video frame where each pixel point in the original video data is located.

[0037] Optionally, the preset position condition includes that the initial data row where the initial pixel point is located in the corresponding video frame is before the target data row where each pixel point is located in the corresponding video frame, and / or, when the initial data row is the target data row, the initial data column where the initial pixel point is located in the corresponding video frame is before the target data column where each pixel point is located in the corresponding video frame.

[0038] Optionally, when the preset YUV sampling format is YUV444 format, determining the reference pixel point corresponding to each pixel point based on each initial pixel point in the original video data includes:

[0039] Determine each initial pixel point as each first target pixel point, and determine the reference pixel point corresponding to each pixel point based on each first target pixel point.

[0040] Optionally, when the preset YUV sampling format is YUV422 format, determining the reference pixel point corresponding to each pixel point based on each initial pixel point in the original video data includes:

[0041] Determine the second target pixel points that meet the first preset condition from each initial pixel point, and determine the reference pixel point corresponding to each pixel point based on each second target pixel point;

[0042] Wherein, the first preset condition includes that the difference between the column number of the data column where the second target pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is an even number.

[0043] Optionally, when the preset YUV sampling format is the YUV420 format, determining a reference pixel point corresponding to each pixel point based on each initial pixel point in the original video data includes:

[0044] Determining third target pixel points that meet the second preset condition from the initial pixel points, and determining the reference pixel point corresponding to each pixel point based on the third target pixel points;

[0045] Wherein, the second preset condition includes that the difference between the column number of the data column where the third target pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is an even number, and the difference between the row number of the data row where the third target pixel point is located in the corresponding video frame and the row number of the data row where each pixel point is located in the corresponding video frame is an even number.

[0046] Optionally, determining the reference pixel point corresponding to each pixel point based on each target pixel point includes:

[0047] Determining pixel points that meet the preset adjacent condition from each target pixel point to obtain the reference pixel point corresponding to each pixel point;

[0048] Wherein, the preset adjacent condition includes a preset row adjacent condition and / or a preset column adjacent condition; the preset row adjacent condition includes that the difference between the row number of the data row where the reference pixel point is located in the corresponding video frame and the row number of the data row where each pixel point is located in the corresponding video frame is not greater than the first preset difference; the preset column adjacent condition includes that the difference between the column number of the data column where the reference pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is not greater than the second preset difference.

[0049] In a second aspect, the present invention provides an electronic device, including:

[0050] A memory for storing a computer program;

[0051] A processor for executing the computer program to implement the foregoing video compression method.

[0052] In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the foregoing video compression method is implemented.

[0053] In a fourth aspect, the present invention provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the foregoing video compression method is implemented.

[0054] In the present invention, reference pixel points corresponding to each pixel point are determined from the original video data; based on the similarity between the pixel data of each pixel point and the reference pixel points, it is determined whether to convert the pixel data of each pixel point in the original video data into identification data to obtain the converted video data; the identification data of each pixel point is used to determine the target reference pixel points corresponding to each pixel point, and the similarity between the target reference pixel points and each pixel point meets a preset similarity condition; the non-identification data in the converted video data is sequentially subjected to a color space conversion and a data block format conversion to obtain the video data in data block format; the video data in data block format is compressed to obtain the compressed video data corresponding to the original video data.

[0055] Advantageous effects: In the present invention, for each pixel point in the original video data, a corresponding reference pixel point is determined, and based on the similarity between each pixel point and the reference pixel point, it is determined whether to convert the pixel data of each pixel point in the original video data into identification data. That is, when the similarity between each pixel point and the reference pixel point is relatively high, the pixel data of each pixel point in the original video data is converted into identification data, and when the similarity between each pixel point and the reference pixel point is relatively low, the pixel data of each pixel point in the original video data is retained, so that the converted video data is a video data composed of identification data and different pixel data. Further, by sequentially performing a color space conversion and a data block format conversion on the different pixel data in the converted video data, and finally compressing the video data in data block format to obtain the compressed video data; in this way, by introducing identification data, the present invention avoids repeatedly performing a color space conversion and a data block format conversion on the same pixel data in the video data, which not only reduces the computing resources and storage resources required for video compression, but also optimizes the overall performance of video compression. Description of the Drawings

[0056] In order to more clearly illustrate the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0057] Figure 1 It is a flowchart of a video compression method provided by an embodiment of the present invention;

[0058] Figure 2 It is a schematic diagram of Y component data calculation provided by an embodiment of the present invention;

[0059] Figure 3 It is a schematic diagram of U component data calculation provided by an embodiment of the present invention;

[0060] Figure 4 A schematic diagram of V - component data calculation provided by an embodiment of the present invention;

[0061] Figure 5 A flowchart of data block format conversion provided by an embodiment of the present invention;

[0062] Figure 6 A schematic diagram of a storage array provided by an embodiment of the present invention;

[0063] Figure 7 An internal architecture diagram of a server management control chip provided by an embodiment of the present invention;

[0064] Figure 8 A structural diagram of a data capture module provided by an embodiment of the present invention;

[0065] Figure 9 A structural diagram of a color space conversion module provided by an embodiment of the present invention;

[0066] Figure 10 A structural diagram of a data block format conversion module provided by an embodiment of the present invention;

[0067] Figure 11 A structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0068] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.

[0069] In traditional video compression, all pixel data in video data need to be subjected to color space conversion and BLOCK format conversion; among them, color space conversion requires multiple multiplication and addition operations for each pixel data, and BLOCK format conversion requires storage of each pixel data. Therefore, traditional video compression generally requires a large amount of computing resources and storage resources. For this reason, the present invention provides a video compression method, which reduces the computing resources and storage resources required for video compression by avoiding repeated processing of the same data in video data.

[0070] See Figure 1 As shown, an embodiment of the present invention provides a video compression method, including:

[0071] Step S11: Determine a reference pixel point corresponding to each pixel point from the original video data.

[0072] The video compression method provided by the embodiments of the present invention can be applied to any chip integrated with video compression function, such as a server management control chip. Among them, the server management control chip can monitor the status of the server (temperature, fan, operation of the main CPU (Central Processing Unit), etc.), and at the same time, compress video data and transmit it to the remote end for remote display and monitoring.

[0073] Specifically, in the embodiments of the present invention, the original video data is first obtained, and for each pixel point in the original video data, a reference pixel point corresponding to each pixel point is determined from the original video data.

[0074] Exemplarily, when the video compression method provided by the embodiments of the present invention is applied to a server management control chip, the monitoring video data of the server host is obtained and transmitted to the VGA (Video Graphic Array) module inside the server management control chip through PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard), so as to use the VGA module to convert the monitoring video data into the original video data in RGB format, and store the monitoring video data and the original video data in RGB format in the DDR (Double Data Rate) memory during this process. Then, the data capture module inside the server management control chip obtains the original video data in RGB format from the VGA module according to the VGA interface protocol, and determines the reference pixel point corresponding to each pixel point from the original video data.

[0075] Among them, the determination of the reference pixel point corresponding to each pixel point in the original video data is specifically to determine the reference pixel point corresponding to each pixel point based on each initial pixel point in the original video data; where the initial pixel point is a pixel point in the target video frame and / or a pixel point in the current video frame that meets the preset position condition; and the target video frame is a video frame in the original video data that is before the current video frame; the current video frame is the video frame where each pixel point in the original video data is located.

[0076] That is, for each pixel point in the original video data, the current video frame where each pixel point is located and / or the target video frame before the current video frame are determined from the original video data, and the initial pixel point is determined based on the pixel points in the target video frame and / or the pixel points in the current video frame that meet the preset position condition, so as to determine the reference pixel point corresponding to each pixel point based on each initial pixel point.

[0077] It should be noted that the preset position condition includes that the initial data row where the initial pixel is located in the corresponding video frame is before the target data row where each pixel is located in the corresponding video frame, and / or when the initial data row is the target data row, the initial data column where the initial pixel is located in the corresponding video frame is before the target data column where each pixel is located in the corresponding video frame.

[0078] Exemplarily, if each pixel is located in the third row and the third column of the current video frame, the initial pixels in the current video frame that meet the preset position condition may include the pixels in the first two rows of the current video frame and the pixels in the first two columns of the third row.

[0079] Step S12: Based on the similarity between the pixel data of each pixel and the reference pixel, determine whether to convert the pixel data of each pixel in the original video data into identification data to obtain the converted video data; the identification data of each pixel is used to determine the target reference pixel corresponding to each pixel, and the similarity between the target reference pixel and each pixel meets the preset similarity condition.

[0080] In the embodiment of the present invention, after determining the reference pixel corresponding to each pixel from the original video data, based on the similarity between the pixel data of each pixel and the pixel data of the reference pixel, determine whether to convert the pixel data of each pixel in the original video data into identification data, that is, when the similarity between the pixel data of each pixel and the pixel data of the reference pixel is relatively high, convert the pixel data of each pixel in the original video data into identification data, and when the similarity between the pixel data of each pixel and the pixel data of the reference pixel is relatively low, retain the pixel data of each pixel in the original video data, so as to obtain the converted video data composed of identification data and different pixel data.

[0081] Specifically, determine the similarity between the pixel data of each pixel and the pixel data of each reference pixel respectively, and determine whether the maximum similarity among the similarities is greater than the preset similarity threshold; if the maximum similarity is greater than the preset similarity threshold, convert the pixel data of each pixel in the original video data into identification data; if the maximum similarity is less than or equal to the preset similarity threshold, retain the pixel data of each pixel in the original video data. Among them, the preset similarity threshold can be set according to the actual quality requirements of video compression. In this way, in the embodiment of the present invention, by comparing the similarity between each pixel and the corresponding reference pixel, when the maximum similarity among the similarities is greater than the preset similarity threshold, the pixel data of each pixel in the original video data is converted into identification data, so that only the non-identification data in the video data can be subjected to color space conversion and data block format conversion subsequently, thereby reducing the requirements for computing resources and storage resources.

[0082] For converting the pixel data of each pixel point in the original video data into identification data, it specifically includes: after determining the similarity between the pixel data of each pixel point and the pixel data of each reference pixel point, if the maximum similarity among the similarities is greater than the preset similarity threshold, then based on the maximum similarity, determine the corresponding target reference pixel point from each reference pixel point, and then according to the pixel position of the target reference pixel point in the original video data, determine the identification data corresponding to each pixel point, and convert the pixel data of each pixel point in the original video data into the identification data corresponding to each pixel point.

[0083] That is, the identification data of each pixel point can be used to determine the target reference pixel point corresponding to each pixel point, and the similarity between the target reference pixel point and each pixel point satisfies the preset similarity condition. Correspondingly, the preset similarity condition includes that the similarity between each pixel point and the target reference pixel point is the maximum similarity among the similarities between each pixel point and each reference pixel point, and the similarity between each pixel point and the target reference pixel point is greater than the preset similarity threshold.

[0084] It should be noted that when there is one pixel point corresponding to the maximum similarity among the reference pixel points, the pixel point corresponding to the maximum similarity among the reference pixel points can be directly determined as the target reference pixel point. When there are more than one pixel points corresponding to the maximum similarity among the reference pixel points, either a pixel point can be randomly selected from the pixel points corresponding to the maximum similarity among the reference pixel points as the target reference pixel point, or a corresponding pixel point can be selected from the pixel points corresponding to the maximum similarity among the reference pixel points according to a preset rule; where the preset rule can include selecting the pixel point with the earliest time, selecting the pixel point with a more forward position, selecting the pixel point with the smallest or largest distance, or any combination of several of them. Of course, other rules can also be customized. In this way, the selection of the target reference pixel point corresponding to each pixel point can meet different selection requirements.

[0085] Further, in the process of determining the identification data corresponding to each pixel point according to the pixel position of the target reference pixel point in the original video data, either the identification data corresponding to each pixel point can be directly determined according to the pixel position of the target reference pixel point in the original video data, or the relative position relationship between the target reference pixel point and each pixel point can be determined according to the pixel positions of the target reference pixel point and each pixel point in the original video data respectively, and then based on the relative position relationship between the target reference pixel point and each pixel point, the identification data corresponding to each pixel point can be determined.

[0086] Among them, the pixel position of a pixel point in the original video data includes the video frame where the pixel point is located in the original video data, the data row and data column where the pixel point is located in the corresponding video frame. Moreover, the identification data can be represented by binary numbers, that is, a corresponding target pixel position can be determined according to the identification data of each pixel point, and then the target reference pixel point corresponding to each pixel point can be determined from the original video data according to the target pixel position.

[0087] When the video compression method provided in the embodiments of the present invention is applied to a server management control chip, the original video data in RGB format can be obtained through the data capture module inside the server management control chip, and the reference pixel point corresponding to each pixel point can be determined from the original video data. Then, based on the similarity between the pixel data of each pixel point and the reference pixel point, it is determined whether to convert the pixel data of each pixel point in the original video data into identification data, so as to obtain the converted video data composed of identification data and different pixel data.

[0088] Step S13: Perform color space conversion and data block format conversion on the non-identification data in the converted video data in sequence to obtain video data in data block format.

[0089] In the embodiments of the present invention, after obtaining the converted video data composed of identification data and different pixel data, the non-identification data in the converted video data, that is, the different pixel data in the converted video data, are sequentially subjected to color space conversion and data block format conversion, so as to obtain video data in data block format.

[0090] Specifically, first, color space conversion is performed on the non-identification data in the converted video data to obtain the non-identification data after color space conversion. Then, combined video data is determined based on the non-identification data after color space conversion and the identification data in the converted video data, and data block format conversion is performed on the non-identification data in the combined video data to obtain video data in data block format.

[0091] Color space conversion is used to convert the non-identification data in the converted video data from one color format to another color format. For example, the non-identification data in the converted video data is converted from RGB format to YUV format.

[0092] In the process of converting the non-identification data in the converted video data from RGB format to YUV format, for any pixel data in RGB format, such as Figure 2As shown, the Y component data is calculated based on the R component data, G component data, and B component data in any pixel data, where the Y component data = PARAM_0 × R component data + PARAM_1 × G component data + PARAM_2 × B component data + PARAM_3. As Figure 3 As shown, the U component data is calculated based on the R component data, G component data, and B component data in any pixel data, where the U component data = PARAM_4 × R component data + PARAM_5 × G component data + PARAM_6 × B component data + PARAM_7. As Figure 4 As shown, the V component data is calculated based on the R component data, G component data, and B component data in any pixel data, where the V component data = PARAM_8 × R component data + PARAM_9 × G component data + PARAM_10 × B component data + PARAM_11. Finally, any pixel data in YUV format is determined based on the calculated Y component data, U component data, and V component data, thereby completing the conversion of any pixel data from RGB format to YUV format.

[0093] Exemplarily, PARAM_0 is set to 0.257, PARAM_1 is set to 0.504, PARAM_2 is set to 0.098, PARAM_3 is set to 16, PARAM_4 is set to 0.148, PARAM_5 is set to -0.291, PARAM_6 is set to 0.439, PARAM_7 is set to 128, PARAM_8 is set to 0.439, PARAM_9 is set to -0.368, PARAM_10 is set to -0.071, and PARAM_11 is set to 128.

[0094] When combining non-identification data in the combined video data that is pixel data in YUV format, the data block format conversion includes sampling and storing the non-identification data in the combined video data into a storage array based on a preset YUV sampling format, determining the array storage positions corresponding to each pixel point in the combined video data based on the storage positions of the non-identification data in the storage array and the identification data in the combined video data, and then sequentially reading data of corresponding sizes from the storage array using the array storage positions corresponding to each pixel point in the combined video data and based on the data block size corresponding to the preset YUV sampling format, thereby obtaining video data in data block format.

[0095] It should be noted that different preset YUV sampling formats correspond to different sampling storage methods. For example, the preset YUV sampling formats include YUV444 format, YUV422 format, and YUV420 format. Among them, the YUV444 format means storing the Y / U / V data of all rows and all columns in the video data; the YUV422 format means storing the Y data of all rows and all columns in the video data, and storing the U / V data of the even columns in the video data; the YUV420 format means storing the Y data of all rows and all columns in the video data, and storing the U / V data of the even rows and even columns in the video data.

[0096] When the video compression method provided in the embodiments of the present invention is applied to a server management control chip, the converted video data can be obtained from a data capture module through a color space conversion module inside the server management control chip, and color space conversion is performed on the non-identification data in the converted video data to obtain combined video data. Then, the combined video data is obtained from the color space conversion module through a data block format conversion module inside the server management control chip, and data block format conversion is performed on the non-identification data in the combined video data to obtain video data in data block format.

[0097] Step S14: Compress the video data in data block format to obtain compressed video data corresponding to the original video data.

[0098] In the embodiments of the present invention, the video data in data block format is compressed using a preset compression format to obtain compressed video data corresponding to the original video data; wherein, the preset compression format includes but is not limited to H.264 (a digital video compression format), JPEG (Joint Photographic Experts Group, an image file compression format).

[0099] When the video compression method provided in the embodiments of the present invention is applied to a server management control chip, the video data in data block format is obtained from the data block format conversion module through a compression module inside the server management control chip, and the video data in data block format is compressed to obtain compressed video data corresponding to the original video data. Then, the compressed video data is obtained from the compression module through a network module inside the server management control chip, and the compressed video data is stored in a DDR memory. At the same time, the compressed video data can also be transmitted to a remote end so that the remote end can decompress the compressed video data and play the decompressed video data.

[0100] Furthermore, considering that different preset YUV sampling formats correspond to different sampling storage methods, in the process of determining the reference pixel points corresponding to each pixel point based on the initial pixel points in the original video data, it is also necessary to adjust the determination of the reference pixel points corresponding to each pixel point according to different preset YUV sampling formats.

[0101] When the preset YUV sampling format is YUV444 format, since the YUV444 format means storing the Y / U / V data of all rows and all columns in each frame of the video data, for the determination of the reference pixel points corresponding to each pixel point, the initial pixel points in the original video data can be directly determined as the first target pixel points, and the reference pixel points corresponding to each pixel point are determined based on the first target pixel points.

[0102] When the preset YUV sampling format is YUV422 format, since the YUV422 format means storing the Y data of all rows and all columns in each frame of the video data and storing the U / V data of the even columns in each frame of the video data, for the determination of the reference pixel points corresponding to each pixel point, it is necessary to first determine the second target pixel points that meet the first preset condition from the initial pixel points in the original video data, and then determine the reference pixel points corresponding to each pixel point based on the second target pixel points. Among them, the first preset condition includes that the difference between the column number of the data column where the second target pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is an even number.

[0103] Exemplarily, when the column number of the data column where each pixel point is located in the corresponding video frame is 3, that is, each pixel point is located in the third column of the corresponding video frame, the column number of the data column where the second target pixel point is located in the corresponding video frame is an odd number, such as 1, 3, 5, etc., that is, the second target pixel point can be located in the first column, third column, fifth column, etc. of the corresponding video frame.

[0104] When the preset YUV sampling format is the YUV420 format, since the YUV420 format means storing all the Y data of all rows and all columns in each frame of the video data, and storing the U / V data of the even rows and even columns in each frame of the video data, therefore, for the determination of the reference pixel points corresponding to each pixel point, it is necessary to first determine the third target pixel points that meet the second preset condition from the initial pixel points in the original video data, and then determine the reference pixel points corresponding to each pixel point based on the third target pixel points. Among them, the second preset condition includes that the difference between the column number of the data column where the third target pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is an even number, and the difference between the row number of the data row where the third target pixel point is located in the corresponding video frame and the row number of the data row where each pixel point is located in the corresponding video frame is an even number.

[0105] Exemplarily, when the column number of the data column where each pixel point is located in the corresponding video frame is 4 and the row number of the data row is 4, that is, each pixel point is located in the fourth column and the fourth row of the corresponding video frame, the column number of the data column where the third target pixel point is located in the corresponding video frame is an even number and the row number of the data row is an even number, such as the pixel point in the second column and the second row, the pixel point in the second column and the fourth row, etc.

[0106] Furthermore, whether it is for the first target pixel points, the second target pixel points, or the third target pixel points, when determining the reference pixel points corresponding to each pixel point based on the target pixel points, either all the target pixel points can be used as the reference pixel points corresponding to each pixel point, or some pixel points can be selected from the target pixel points as the reference pixel points corresponding to each pixel point.

[0107] According to one embodiment, whether it is for the first target pixel points, the second target pixel points, or the third target pixel points, the pixel points that meet the preset adjacent conditions can be determined from the target pixel points to obtain the reference pixel points corresponding to each pixel point. Among them, the preset adjacent conditions include a preset row adjacent condition and / or a preset column adjacent condition; the preset row adjacent condition includes that the difference between the row number of the data row where the reference pixel point is located in the corresponding video frame and the row number of the data row where each pixel point is located in the corresponding video frame is not greater than the first preset difference; the preset column adjacent condition includes that the difference between the column number of the data column where the reference pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is not greater than the second preset difference.

[0108] Among them, the first preset difference and the second preset difference can be set to the same value or different values, which is not limited here.

[0109] Taking the preset adjacent conditions including the preset row adjacent condition and the preset column adjacent condition, and the first preset difference and the second preset difference both being 1 as an example, when the column number of the data column where each pixel point is located in the corresponding video frame is 4 and the row number of the data row is 4, that is, each pixel point is located in the fourth column and the fourth row of the corresponding video frame, the pixel points with column numbers 3, 4, and 5 and row numbers 3, 4, and 5 are determined from the target pixel points as the reference pixel points corresponding to each pixel point.

[0110] Taking the YUV444 format as an example, assuming that the reference pixel points are three pixel points in the same column and the adjacent columns before and after in the row above the current pixel point. Denote the reference pixel point 1 as the pixel point in the forward adjacent column in the row above, the reference pixel point 2 as the pixel point in the same column in the row above, and the reference pixel point 3 as the pixel point in the backward adjacent column in the row above. If the pixel data of the current pixel point is the same as that of the reference pixel point 1, the identification data of the current pixel point can be output as an 8-bit identification bit {6’b11_1111, 2’b01}, where 6’b11_1111 represents the 6-bit binary number 11_1111, and 11_1111 means that the current pixel point has the same pixel point in the row above, that is, the reference pixel point 1, and the reference pixel point 1 is the target reference pixel point corresponding to the current pixel point; 2’b01 represents the 2-bit binary number 01, and 01 means that the target reference pixel point is in the column before the row before the current pixel point. If the pixel data of the current pixel point is the same as that of the reference pixel point 2, the identification data of the current pixel point can be output as an 8-bit identification bit {6’b11_1111, 2’b10}; where 2’b10 represents the 2-bit binary number 10, and 10 means that the target reference pixel point is in the same column in the row before the current pixel point. If the pixel data of the current pixel point is the same as that of the reference pixel point 3, the identification data of the current pixel point can be output as an 8-bit identification bit {6’b11_1111, 2’b11}, where 2’b11 represents the 2-bit binary number 11, and 11 means that the target reference pixel point is in the column after the row before the current pixel point.

[0111] Beneficial effects: In the present invention, for each pixel point in the original video data, a corresponding reference pixel point is determined, and based on the similarity between each pixel point and the reference pixel point, it is determined whether to convert the pixel data of each pixel point in the original video data into identification data. That is, when the similarity between each pixel point and the reference pixel point is relatively high, the pixel data of each pixel point in the original video data is converted into identification data; when the similarity between each pixel point and the reference pixel point is relatively low, the pixel data of each pixel point in the original video data is retained, so that the converted video data is a video data composed of identification data and different pixel data. Further, by sequentially performing color space conversion and data block format conversion on the different pixel data in the converted video data, and finally obtaining compressed video data by compressing the video data in data block format; in this way, by introducing identification data, the present invention avoids repeatedly performing color space conversion and data block format conversion on the same pixel data in the video data, not only reducing the computing resources and storage resources required for video compression, but also optimizing the overall performance of video compression.

[0112] Based on the previous embodiment, when the non-identification data in the combined video data is pixel data in YUV format, it is necessary to perform data block format conversion on the non-identification data in the combined video data to obtain video data in data block format. Based on this, refer to Figure 5 As shown, the embodiment of the present invention provides a specific process for data block format conversion, including:

[0113] Step S21: Write the non-identification data in the combined video data into the storage array based on a preset YUV sampling format; the storage array is an array composed of a preset number of memories for storing Y components, a preset number of memories for storing U components, and a preset number of memories for storing V components.

[0114] Considering that different YUV sampling formats may have different data block sizes for Y / V / U components, correspondingly, different YUV sampling formats may also have different requirements for the number of memories for storing Y / V / U components in the storage array. Therefore, in order to make the storage array applicable to different YUV sampling formats, the number of memories for storing Y / V / U components in the storage array needs to be set to the maximum number among them.

[0115] For example, for the YUV444 format, the data block sizes of the Y / U / V components are all 8×8; for the YUV422 format, the data block size of the Y component is 16×16, and the data block sizes of the U / V components are both 16×8; for the YUV420 format, the data block size of the Y component is 16×16, and the data block sizes of the U / V components are both 8×8. On this basis, in order to make the storage array applicable to the YUV444 format, YUV422 format, and YUV420 format, a storage array can be constructed based on 16 memories for storing the Y component, 16 memories for storing the U component, and 16 memories for storing the V component. Moreover, the memories in the storage array can use RAM (Random Access Memory).

[0116] Figure 6 A specific storage array is shown. This storage array is composed of 16 RAM memories for storing the Y component (Y_RAM_0 to Y_RAM_15), 16 RAM memories for storing the U component (U_RAM_0 to U_RAM_15), and 16 RAM memories for storing the V component (V_RAM_0 to V_RAM_15).

[0117] In the embodiments of the present invention, when the preset YUV sampling format is known, based on the preset YUV sampling format, the memories corresponding to the respective components included in the pixel points to be written in the combined video data can be determined; wherein, the data of the pixel points to be written in the combined video data is non-identification data; then, according to the memories corresponding to the respective components included in the pixel points to be written, a data write control table is constructed, and the respective components included in the pixel points to be written are written into the corresponding memories of the storage array by using the data write control table.

[0118] It can be found that since the combined video data in the embodiments of the present invention is video data composed of identification data and different pixel data, therefore, in the embodiments of the present invention, by writing the non-identification data in the combined video data, that is, writing the different pixel data in the combined video data into the storage array, compared with the traditional video compression that needs to write all the pixel data in the video data into the storage array, the present invention can significantly reduce the storage resources required for video compression.

[0119] Take Figure 6 the shown storage array as an example. When the preset YUV sampling format is the YUV444 format, since the YUV444 format refers to the Y / U / V data of all rows and all columns in each frame of the stored video data, therefore, for the YUV444 format, the storage logic of the Y data in any frame of the video data is as follows:

[0120] Write the Y data of the 0th / 8th / 16th / 24th... row into Y_RAM_0;

[0121] Write the Y data of the 1st / 9th / 17th / 25th... row into Y_RAM_1;

[0122] Write the Y data of the 2nd / 10th / 18th / 26th... row into Y_RAM_2;

[0123] ……;

[0124] Write the Y data of the 7th / 15th / 23rd / 31st... row into Y_RAM_7;

[0125] For the YUV444 format, the storage logic of the U data in any frame of the video data is as follows:

[0126] Write the U data of the 0th / 8th / 16th / 24th... row into U_RAM_0;

[0127] Write the U data of the 1st / 9th / 17th / 25th... row into U_RAM_1;

[0128] Write the U data of the 2nd / 10th / 18th / 26th... row into U_RAM_2;

[0129] ……;

[0130] Write the U data of the 7th / 15th / 23rd / 31st... row into U_RAM_7;

[0131] For the YUV444 format, the storage logic of the V data in any frame of the video data is as follows:

[0132] Write the V data of the 0th / 8th / 16th / 24th... row into V_RAM_0;

[0133] Write the V data of the 1st / 9th / 17th / 25th... row into V_RAM_1;

[0134] Write the V data of the 2nd / 10th / 18th / 26th... row into V_RAM_2;

[0135] ……;

[0136] Write the V data of the 7th / 15th / 23rd / 31st... row into V_RAM_7.

[0137] Taking Figure 6 the storage array shown as an example, when the preset YUV sampling format is YUV422 format, since the YUV422 format means storing all rows and all columns of the Y data in each frame of the video data, and storing the U / V data of the even columns in each frame of the video data, therefore, for the YUV422 format, the storage logic of the Y data in any frame of the video data is as follows:

[0138] Write the Y data of the 0th / 16th / 32nd / 48th... rows into Y_RAM_0;

[0139] Write the Y data of the 1st / 17th / 33rd / 49th... rows into Y_RAM_1;

[0140] Write the Y data of the 2nd / 18th / 34th / 50th... rows into Y_RAM_2;

[0141] ……;

[0142] Write the Y data of the 15th / 31st / 47th / 63rd... rows into Y_RAM_15;

[0143] For the YUV422 format, the storage logic of the U data in any frame of video data is as follows:

[0144] Write the even-column U data of the 0th / 16th / 32nd / 48th... rows into U_RAM_0;

[0145] Write the even-column U data of the 1st / 17th / 33rd / 49th... rows into U_RAM_1;

[0146] Write the even-column U data of the 2nd / 18th / 34th / 50th... rows into U_RAM_2;

[0147] ……;

[0148] Write the even-column U data of the 15th / 31st / 47th / 63rd... rows into U_RAM_15;

[0149] For the YUV422 format, the storage logic of the V data in any frame of video data is as follows:

[0150] Write the even-column V data of the 0th / 16th / 32nd / 48th... rows into V_RAM_0;

[0151] Write the even-column V data of the 1st / 17th / 33rd / 49th... rows into V_RAM_1;

[0152] Write the even-column V data of the 2nd / 18th / 34th / 50th... rows into V_RAM_2;

[0153] ……;

[0154] Write the even-column V data of the 15th / 31st / 47th / 63rd... rows into V_RAM_15.

[0155] With Figure 6Taking the storage array shown as an example, when the preset YUV sampling format is the YUV420 format, since the YUV420 format means storing all the Y data of all rows and all columns in each frame of the stored video data, and storing the U / V data of the even rows and even columns in each frame of the video data, for the YUV420 format, the storage logic of the Y data in any frame of the video data is as follows:

[0156] Write the Y data of the 0 / 16 / 32 / 48... rows into Y_RAM_0;

[0157] Write the Y data of the 1 / 17 / 33 / 49... rows into Y_RAM_1;

[0158] Write the Y data of the 2 / 18 / 34 / 50... rows into Y_RAM_2;

[0159] ……;

[0160] Write the Y data of the 15 / 31 / 47 / 63... rows into Y_RAM_15;

[0161] For the YUV420 format, the storage logic of the U data in any frame of the video data is as follows:

[0162] Write the even-column U data of the 0 / 16 / 32 / 48... rows into U_RAM_0;

[0163] Write the even-column U data of the 2 / 18 / 34 / 50... rows into U_RAM_1;

[0164] ……;

[0165] Write the even-column U data of the 14 / 30 / 46 / 62... rows into U_RAM_7;

[0166] For the YUV420 format, the storage logic of the V data in any frame of the video data is as follows:

[0167] Write the even-column V data of the 0 / 16 / 32 / 48... rows into V_RAM_0;

[0168] Write the even-column V data of the 2 / 18 / 34 / 50... rows into V_RAM_1;

[0169] ……;

[0170] Write the even-column V data of the 14 / 30 / 46 / 62... rows into V_RAM_7.

[0171] For each pixel point to be written in the combined video data, according to the storage logic of the Y / U / V data corresponding to different YUV sampling formats, the memories corresponding to the respective components included in the pixel point to be written in the combined video data can be determined, thereby constructing a data write control table.

[0172] It should be noted that the data write control table can be a control table composed of the frame number of the video frame where the pixel point is located in the video data, the row number and column number of the data row where the pixel point is located in the corresponding video frame, whether the pixel point needs to be written into the storage array, and the numbers of the memories corresponding to the respective components included in the pixel point. Among them, the numbers of the memories in the storage array can be uniquely set according to Arabic numerals; and whether the pixel point needs to be written into the storage array can be determined according to whether the data of the pixel point in the video data is identification data. If the data of the pixel point in the video data is identification data, it is determined that the pixel point does not need to be written into the storage array. If the data of the pixel point in the video data is non-identification data, that is, pixel data, it is determined that the pixel point needs to be written into the storage array.

[0173] Take Figure 6 the storage array shown as an example. Assume that the number of Y_RAM_0 = 0, the number of Y_RAM_1 = 1,..., the number of Y_RAM_15 = 15; the number of U_RAM_0 = 16, the number of U_RAM_1 = 17,..., the number of U_RAM_15 = 31; the number of V_RAM_0 = 32, the number of V_RAM_1 = 33,..., the number of V_RAM_15 = 47; a specific example of the data write control table is shown in Table 1:

[0174] Table 1

[0175]

[0176] Step S22: Create a data read control table by using the storage positions of the non-identification data in the combined video data in the storage array and based on the identification data in the combined video data; the data read control table records the array storage positions corresponding to the respective pixel points in the combined video data; the array storage positions include the storage positions of the respective components in the pixel point in the storage array.

[0177] In an embodiment of the present invention, after writing the non-identification data in the combined video data into the storage array, since the identification data in the combined video data is not written into the storage array and does not carry specific pixel data, in order to obtain complete video data for compression, a data reading control table needs to be created in advance. The data reading control table records the array storage positions corresponding to each pixel point in the combined video data. The array storage position includes the storage positions of each component in the pixel point in the storage array respectively. The storage position of any component in the storage array includes the memory corresponding to the component in the storage array and the storage address in the corresponding memory. In this way, through the data reading control table and the pixel data stored in the storage array, the combined video data composed of identification data and different pixel data can be restored to complete video data, and all the complete video data is composed of pixel data.

[0178] Specifically, for the creation of the data reading control table, the array storage positions corresponding to each written pixel point in the combined video data can be determined first based on the storage positions of the non-identification data in the combined video data in the storage array; wherein, the data of the written pixel point in the combined video data is non-identification data. Then, according to the identification data of each identification pixel point in the combined video data, the target reference pixel points corresponding to each identification pixel point can be determined; wherein, the data of the identification pixel point in the combined video data is identification data. Using the array storage positions corresponding to each written pixel point respectively and based on the target reference pixel points corresponding to each identification pixel point respectively, the array storage positions corresponding to each identification pixel point can be determined, and then based on the array storage positions corresponding to each written pixel point and each identification pixel point respectively, the data reading control table can be created.

[0179] It should be noted that since the data of the written pixel point in the combined video data is non-identification data, the pixel data of each written pixel point in the video data is different pixel data. And the data of the identification pixel point in the combined video data is identification data, and the identification data is used to determine the target reference pixel point corresponding to the identification pixel point. The similarity between the identification pixel point and the corresponding target reference pixel point meets the preset similarity condition, that is, the similarity between the pixel data of the identification pixel point and the corresponding target reference pixel point is relatively high, or the pixel data of the identification pixel point is the same as that of the corresponding target reference pixel point. Therefore, the pixel data of the identification pixel point should be included in the pixel data of the written pixel point. Based on this, using the array storage positions corresponding to each written pixel point respectively and based on the target reference pixel points corresponding to each identification pixel point respectively, the array storage positions corresponding to each identification pixel point can be determined.

[0180] Exemplarily, if the array storage location corresponding to the written pixel point A is known, then when it is determined based on the identification data of the identification pixel point B that the target reference pixel point corresponding to the identification pixel point B is the written pixel point A, the array storage location corresponding to the identification pixel point B is the array storage location corresponding to the written pixel point A. For the identification pixel point C, if it is determined based on the identification data of the identification pixel point C that the target reference pixel point corresponding to the identification pixel point C is the identification pixel point B, then the array storage location corresponding to the identification pixel point C is the array storage location corresponding to the identification pixel point B, which is also the array storage location corresponding to the written pixel point A. Similarly, the array storage locations corresponding to all identification pixel points can be determined, and combined with the array storage locations corresponding to each written pixel point respectively, a data reading control table can be created.

[0181] It should be noted that since the identification data of any pixel point is data determined based on the pixel position of the target reference pixel point corresponding to any pixel point, based on this, subsequently, the target reference pixel point corresponding to the identification pixel point can be determined based on the identification data of the identification pixel point.

[0182] Furthermore, the data reading control table can be a control table composed of the frame number of the video frame where the pixel point is located in the video data, the row number and column number of the data row where the pixel point is located in the corresponding video frame, whether the pixel point has been written into the storage array, and the array storage location corresponding to the pixel point. Among them, the written pixel points in the video data have been written into the storage array, and the identification pixel points in the video data have not been written into the storage array.

[0183] Take Figure 6 the shown storage array as an example. Assume that the number of Y_RAM_0 = 0, the number of Y_RAM_1 = 1,..., the number of Y_RAM_15 = 15; the number of U_RAM_0 = 16, the number of U_RAM_1 = 17,..., the number of U_RAM_15 = 31; the number of V_RAM_0 = 32, the number of V_RAM_1 = 33,..., the number of V_RAM_15 = 47; a specific example of the data reading control table is shown in Table 2:

[0184] Table 2

[0185]

[0186] Among them, YUV_RAM_NUM_Y in Table 2 represents the number of the memory corresponding to the Y component in the written pixel points; YUV_RAM_NUM_U represents the number of the memory corresponding to the U component in the written pixel points; YUV_RAM_NUM_V represents the number of the memory corresponding to the V component in the written pixel points; YUV_RAM_ADDR_Y represents the storage address of the Y component in the written pixel points in the corresponding memory; YUV_RAM_ADDR_U represents the storage address of the U component in the written pixel points in the corresponding memory; YUV_RAM_ADDR_V represents the storage address of the V component in the written pixel points in the corresponding memory. MARK_RAM_NUM_Y represents the number of the memory corresponding to the Y component of the marked pixel points, that is, the number of the memory corresponding to the Y component of the target reference pixel points corresponding to the marked pixel points; MARK_RAM_NUM_U represents the number of the memory corresponding to the U component of the marked pixel points, that is, the number of the memory corresponding to the U component of the target reference pixel points corresponding to the marked pixel points; MARK_RAM_NUM_V represents the number of the memory corresponding to the V component of the marked pixel points, that is, the number of the memory corresponding to the V component of the target reference pixel points corresponding to the marked pixel points; MARK_RAM_ADDR_Y represents the storage address of the Y component in the marked pixel points in the corresponding memory, that is, the storage address of the Y component of the target reference pixel points corresponding to the marked pixel points in the corresponding memory; MARK_RAM_ADDR_U represents the storage address of the U component in the marked pixel points in the corresponding memory, that is, the storage address of the U component of the target reference pixel points corresponding to the marked pixel points in the corresponding memory; MARK_RAM_ADDR_V represents the storage address of the V component in the marked pixel points in the corresponding memory, that is, the storage address of the V component of the target reference pixel points corresponding to the marked pixel points in the corresponding memory.

[0187] Moreover, it can be found from Table 2 that the pixel point A with a frame number of 0, a row number of 0, and a column number of 0 is a written pixel point; the pixel point B with a frame number of 0, a row number of 0, and a column number of 1 is a marked pixel point, and the target reference pixel point corresponding to this marked pixel point is the pixel point A. Therefore, the pixel point A and the pixel point B correspond to the same array storage location.

[0188] Step S23: Use the data reading control table and based on the data block size corresponding to any component, sequentially read block data of the corresponding size and corresponding to any component from the storage array; the data block size corresponding to any component is the data block size determined based on the preset YUV sampling format.

[0189] In an embodiment of the present invention, after creating a data reading control table, it is necessary to determine the data block sizes corresponding to the Y, U, and V components respectively based on a preset YUV sampling format. Then, for any one of the Y, U, and V components, the data reading control table can be used and based on the data block size corresponding to the component, block data corresponding to the component with the corresponding size can be sequentially read from the storage array.

[0190] It should be noted that when the array storage positions corresponding to all pixel points are known according to the data reading control table, for all the data in each block data, they can be read in parallel from the storage array, thereby improving the efficiency of data block format conversion.

[0191] For any one of the Y, U, and V components, the data rows in the combined video data can be traversed as a large loop and the data columns can be traversed as a small loop. According to the data block size corresponding to the component, block data corresponding to the component with the corresponding size can be sequentially read from the storage array.

[0192] Taking the YUV444 format as an example, the data block sizes corresponding to the Y, U, and V components are all 8×8. Among them, for the Y component, first read the pixel points from the first column to the eighth column in the first row to the eighth row of the first frame of the combined video data. At this time, according to the array storage positions corresponding to the Y component in these pixel points in the data reading control table, the corresponding Y component data is read in parallel from the storage array to obtain an 8×8 Y component block data. Then read the pixel points from the ninth column to the sixteenth column in the first row to the eighth row of the first frame of the combined video data, and so on, until all the pixel points in the first row to the eighth row of the first frame are read. After that, further read the pixel points from the first column to the eighth column in the ninth row to the sixteenth row of the first frame of the combined video data, and so on, until all the frames in the combined video data are read. Similarly, the reading of the U component and the V component can both refer to the Y component. Moreover, the reading of the YUV422 format and the YUV420 format can also refer to the reading of the YUV44 format.

[0193] Step S24: Determine video data in a data block format based on the block data corresponding to each component.

[0194] In an embodiment of the present invention, complete video data in a data block format is determined based on the block data corresponding to the Y, U, and V components respectively. And when the video data in the data block format is transmitted to the compression module for compression, since generally the interface of the compression module is 32 bits or 64 bits, while the width of the storage array is 8 bits, the bit width of the video data in the data block format can also be converted first, and then the video data in the data block format after bit width conversion is transmitted to the compression module for video compression.

[0195] As can be seen, in the embodiment of the present invention, by writing the non-identifier data in the combined video data into the storage array, that is, writing the different pixel data in the combined video data into the storage array, compared with the traditional video compression that needs to write all the pixel data in the video data into the storage array, the present invention can significantly reduce the storage resources required for video compression. Moreover, in the embodiment of the present invention, by introducing the identifier data, the combined video data composed of the identifier data and different pixel data can also be restored to the complete video data composed entirely of pixel data.

[0196] Taking Figure 7 the internal architecture diagram of the server management control chip shown as an example, the video compression method proposed by the present invention is described. Among them, the server management control chip includes a VGA module, a data capture module, a color space conversion module, a data block format conversion, a compression module, and a network module. The specific solution is as follows:

[0197] The server management control chip acquires the monitoring video data of the server host and transfers it to the VGA module to use the VGA module to convert the monitoring video data into the original video data in RGB format, and stores the monitoring video data and the original video data in RGB format in the external DDR memory during this process.

[0198] As Figure 8 shown, the capture unit in the data capture module sequentially acquires the original video data in RGB format from the VGA module and transfers it to the line buffer control unit. The line buffer control unit searches for the reference pixel point corresponding to each pixel point in the currently acquired data row from the pixel points already stored in the preset buffer respectively, and then transfers each pixel point and the corresponding reference pixel point to the parallel comparison unit, and stores each pixel point in the preset buffer at the same time. In this way, after all the pixel points in the currently acquired data row have found the corresponding reference pixel points and are transferred to the parallel comparison unit, all the pixel points in the currently acquired data row have also been stored in the preset buffer.

[0199] The parallel comparison unit is used to determine the similarity between the pixel data of each pixel point and each reference pixel point respectively, and judge whether the maximum similarity among the similarities is greater than the preset similarity threshold; if the maximum similarity is greater than the preset similarity threshold, the pixel data of each pixel point in the original video data is converted into identifier data and transferred to the RGB data update unit; if the maximum similarity is less than or equal to the preset similarity threshold, the pixel data of each pixel point in the original video data is retained and transferred to the RGB data update unit.

[0200] The RGB data update unit combines the identification data and the pixel data to obtain the converted video data. That is, the converted video data is video data composed of the identification data and the mutually different RGB pixel data.

[0201] As Figure 9 shown, the RGB data parsing unit in the color space conversion module obtains the converted video data from the RGB data update unit and parses the converted video data to send the parsed RGB pixel data to the Y data calculation unit, the U data calculation unit, and the V data calculation unit respectively for color space conversion, and transmits the converted YUV pixel data to the YUV data combination unit. At the same time, the RGB data parsing unit directly transmits the parsed identification data to the YUV data combination unit.

[0202] The YUV data combination unit combines the converted YUV pixel data and the identification data to obtain the combined video data. That is, the combined video data is video data composed of the identification data and the mutually different YUV pixel data.

[0203] As Figure 10 shown, the YUV data parsing unit in the data block format conversion module obtains the combined video data from the YUV data combination unit and parses the combined video data to transmit the parsed YUV pixel data to the array write controller, and sends the parsed YUV pixel data and the identification data to the write information creation unit and the read information creation unit.

[0204] The write information creation unit determines the memories corresponding to the respective components included in the pixel points to be written based on the preset YUV sampling format to construct a data write control table, where the data of the pixel points to be written in the combined video data is the YUV pixel data; then it sends the data write control table to the array write controller so that the array write controller uses the data write control table to write the YUV pixel data in the combined video data into the storage array.

[0205] The read information creation unit creates a data read control table according to the storage positions of the YUV pixel data in the combined video data in the storage array and in combination with the identification data in the combined video data; where the data read control table records the array storage positions corresponding to the respective pixel points in the combined video data; the array storage positions include the storage positions of the respective components in the pixel points in the storage array, and the storage position of any component in the storage array includes the memory corresponding to the component in the storage array and the storage address in the corresponding memory. Then the read information creation unit sends the data read control table to the array read controller.

[0206] The array reading controller determines the data block sizes corresponding to the Y, U, and V components respectively based on a preset YUV sampling format. For any one of the Y, U, and V components, the corresponding block data of the corresponding size can be sequentially read from the storage array by using a data reading control table and based on the data block size corresponding to the component, so as to determine video data in a data block format based on the block data corresponding to each component respectively.

[0207] The bit-width conversion unit reads the video data in a data block format from the array reading controller, performs bit-width conversion on the video data in a data block format according to the transmission width of the compression module to obtain the video data in a data block format after bit-width conversion, and then transmits the video data in a data block format after bit-width conversion to the compression module.

[0208] The compression module compresses the received video data in a data block format to obtain compressed video data, and transmits the compressed video data to the network module.

[0209] The network module stores the compressed video data in an external DDR memory, and at the same time transmits the compressed video data to a remote end so that the remote end can decompress the compressed video data and play the decompressed video data.

[0210] Advantageous effects: In the present invention, a corresponding reference pixel point is determined for each pixel point in the original video data, and based on the similarity between each pixel point and the reference pixel point, it is determined whether to convert the pixel data of each pixel point in the original video data into identification data. That is, when the similarity between each pixel point and the reference pixel point is relatively high, the pixel data of each pixel point in the original video data is converted into identification data, and when the similarity between each pixel point and the reference pixel point is relatively low, the pixel data of each pixel point in the original video data is retained, so that the converted video data is video data composed of identification data and different pixel data. Further, by sequentially performing color space conversion and data block format conversion on the different pixel data in the converted video data, finally, the compressed video data is obtained by compressing the video data in a data block format; in this way, by introducing identification data, the present invention avoids repeatedly performing color space conversion and data block format conversion on the same pixel data in the video data, not only reducing the computing resources and storage resources required for video compression, but also optimizing the overall performance of video compression; correspondingly, the present invention reduces the chip area by reducing the occupation of storage resources on the chip, and reduces the chip power consumption by reducing the use of computing resources on the chip, thereby optimizing the overall performance of the chip.

[0211] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 11It is a structural diagram of an electronic device shown according to an exemplary embodiment. The content in the figure should not be considered as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 11, at least one memory 12, a power supply 13, a communication interface 14, an input / output interface 15, and a communication bus 16. Among them, the memory 12 is used to store a computer program, which is loaded and executed by the processor 11 to implement the relevant steps in the video compression method disclosed in any of the foregoing embodiments. Additionally, the electronic device in this embodiment may specifically be an electronic computer.

[0212] In this embodiment, the power supply 13 is used to provide operating voltage for each hardware device on the electronic device; the communication interface 14 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and specific limitations are not imposed here; the input / output interface 15 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and specific limitations are not imposed here.

[0213] In addition, as a carrier for resource storage, the memory 12 can be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon may include an operating system 121, a computer program 122, etc., and the storage method can be temporary storage or permanent storage.

[0214] Among them, the operating system 121 is used to manage and control each hardware device and the computer program 122 on the electronic device, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the video compression method executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 122 may further include computer programs that can be used to complete other specific tasks.

[0215] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the video compression method disclosed above is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0216] Furthermore, this application also discloses a computer program product, including a computer program / instructions; wherein, when the computer program / instructions are executed by a processor, the video compression method disclosed above is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0217] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0218] Those skilled in the art can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0219] The steps of the methods or algorithms described in conjunction with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0220] Finally, it should also be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0221] The technical solutions provided in this application have been introduced in detail above. Specific examples are used in this article to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A video compression method, characterized in that: include: Determine a reference pixel point corresponding to each pixel point from the original video data; Based on the similarity between the pixel data of each pixel point and the pixel data of the reference pixel point, determining whether to convert the pixel data of each pixel point in the original video data into identification data to obtain converted video data; The identification data of each pixel point is used to determine a target reference pixel point corresponding to each pixel point, and the similarity between the target reference pixel point and each pixel point satisfies a preset similarity condition; performing color space conversion and data block format conversion on the non-identification data in the converted video data in sequence to obtain video data in a data block format; Compressing the video data in the data block format to obtain compressed video data corresponding to the original video data; When the non-identification data in the combined video data is pixel data in a YUV format, the data block format conversion includes: based on a preset YUV sampling format, sampling and storing the non-identification data in the combined video data into a storage array, and determining the array storage positions corresponding to each pixel point in the combined video data based on the storage position of the non-identification data in the combined video data in the storage array and the identification data in the combined video data, and using the array storage positions corresponding to each pixel point in the combined video data and based on the data block size corresponding to the preset YUV sampling format, sequentially reading data of corresponding sizes from the storage array to obtain video data in a data block format; The combined video data is video data determined based on the identification data in the converted video data and the non-identification data obtained by performing color space conversion on the non-identification data in the converted video data.

2. The video compression method according to claim 1, characterized in that: The determining whether to convert the pixel data of each pixel point in the original video data into identification data based on the similarity between the pixel data of each pixel point and the reference pixel point includes: Determine the similarity between each pixel and the pixel data of each reference pixel, and judge whether the maximum similarity among the similarities is greater than a preset similarity threshold; If the maximum similarity is greater than a preset similarity threshold, the pixel data of each pixel point in the original video data is converted into identification data.

3. The video compression method according to claim 2, characterized in that: The step of converting the pixel data of each pixel point in the original video data into identification data comprises: Based on the maximum similarity, determining the corresponding target reference pixel from each of the reference pixels; According to the pixel position of the target reference pixel in the original video data, identification data corresponding to each pixel is determined, and the pixel data of each pixel in the original video data is converted into identification data corresponding to each pixel.

4. The video compression method according to claim 1, characterized in that: The step of sequentially performing color space conversion and data block format conversion on the non-identification data in the converted video data to obtain video data in a data block format includes: Performing color space conversion on the non-identification data in the converted video data, and determining combined video data based on the non-identification data after the color space conversion and the identification data in the converted video data; The non-identification data in the combined video data is converted into a data block format to obtain video data in a data block format.

5. The video compression method according to claim 4, characterized in that: When the non-identification data in the combined video data is pixel data in a YUV format, performing data block format conversion on the non-identification data in the combined video data to obtain video data in a data block format includes: Writing the non-identification data in the combined video data into a storage array based on a preset YUV sampling format; the storage array is an array composed of a preset number of memories storing Y components, a preset number of memories storing U components, and a preset number of memories storing V components; Creating a data read control table using the storage position of the non-identification data in the combined video data in the storage array and based on the identification data in the combined video data; the data read control table records the array storage positions corresponding to each pixel point in the combined video data; the array storage positions include the storage positions of each component in the pixel point in the storage array; Using the data reading control table and based on the data block size corresponding to any component, sequentially reading block data of corresponding size corresponding to any component from the storage array; the data block size corresponding to any component is a data block size determined based on the preset YUV sampling format; The video data in a data block format is determined based on the block data corresponding to each component.

6. The video compression method according to claim 5, characterized in that: The step of writing the non-identification data in the combined video data into a storage array based on a preset YUV sampling format includes: Based on a preset YUV sampling format, determining memories corresponding to components contained in a pixel point to be written in the combined video data; the data of the pixel point to be written in the combined video data is non-identification data; Constructing a data writing control table according to the memories corresponding to the components contained in the pixel point to be written; The data writing control table is used to write the components contained in the pixel point to be written into the corresponding memory of the storage array respectively.

7. The video compression method according to claim 5, characterized in that: The step of creating a data read control table by utilizing the storage position of the non-identification data in the combined video data in the storage array and based on the identification data in the combined video data comprises: Based on the storage position of the non-identification data in the combined video data in the storage array, determining the array storage position corresponding to each written pixel point in the combined video data; the data of the written pixel point in the combined video data is the non-identification data; According to the identification data of each identification pixel point in the combined video data, determining the target reference pixel point corresponding to each identification pixel point respectively; the data of the identification pixel point in the combined video data is the identification data; Determine the array storage positions corresponding to the respective marked pixels by using the array storage positions corresponding to the respective written pixels and based on the respective target reference pixels; A data reading control table is created based on the array storage positions corresponding to each of the written pixel points and each of the identified pixel points.

8. The video compression method according to claim 5, characterized in that: The step of determining a reference pixel point corresponding to each pixel point from the original video data comprises: Based on each initial pixel point in the original video data, a reference pixel point corresponding to each pixel point is determined; the initial pixel point is a pixel point in the target video frame and / or a pixel point in the current video frame that meets a preset position condition; The target video frame is a video frame in the original video data that is located before the current video frame; and the current video frame is a video frame where each pixel point in the original video data is located.

9. The video compression method according to claim 8, characterized in that: The preset position condition includes that the initial data row where the initial pixel point is located in the corresponding video frame is located before the target data row where each pixel point is located in the corresponding video frame, and / or, when the initial data row is the target data row, the initial data column where the initial pixel point is located in the corresponding video frame is located before the target data column where each pixel point is located in the corresponding video frame.

10. The video compression method according to claim 8, characterized in that: When the preset YUV sampling format is the YUV444 format, determining the reference pixel corresponding to each pixel based on each initial pixel in the original video data includes: The initial pixel points are determined as first target pixel points, and reference pixel points corresponding to each pixel point are determined based on the first target pixel points.

11. The video compression method according to claim 8, characterized in that: When the preset YUV sampling format is the YUV422 format, determining the reference pixel corresponding to each pixel based on each initial pixel in the original video data includes: Determine a second target pixel point that satisfies a first preset condition from each of the initial pixel points, and determine a reference pixel point corresponding to each pixel point based on each of the second target pixel points; The first preset condition includes that the difference between the column number of the data column where the second target pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is an even number.

12. The video compression method according to claim 8, characterized in that: When the preset YUV sampling format is the YUV420 format, determining the reference pixel corresponding to each pixel based on each initial pixel in the original video data includes: Determine a third target pixel point that satisfies a second preset condition from each of the initial pixel points, and determine a reference pixel point corresponding to each pixel point based on each of the third target pixel points; Among them, the second preset condition includes that the difference between the column number of the data column where the third target pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is an even number, and the difference between the row number of the data row where the third target pixel point is located in the corresponding video frame and the row number of the data row where each pixel point is located in the corresponding video frame is an even number.

13. The video compression method according to any one of claims 10 to 12, characterized in that: Determining a reference pixel point corresponding to each pixel point based on each target pixel point includes: Determine pixel points that meet a preset adjacent condition from each target pixel point to obtain a reference pixel point corresponding to each pixel point; Among them, the preset adjacent conditions include preset row adjacent conditions and / or preset column adjacent conditions; the preset row adjacent conditions include that the difference between the row number of the data row where the reference pixel point is located in the corresponding video frame and the row number of the data row where each pixel point is located in the corresponding video frame is not greater than a first preset difference; the preset column adjacent conditions include that the difference between the column number of the data column where the reference pixel point is located in the corresponding video frame and the column number of the data column where each pixel point is located in the corresponding video frame is not greater than a second preset difference.

14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the video compression method according to any one of claims 1 to 13.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the video compression method according to any one of claims 1 to 13 is implemented.

16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the video compression method as described in any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Video compression method, system and device and readable storage medium

    CN115209145A

  • Image compression system, method, equipment and medium

    CN117156287A