Video compression method and device, medium and product

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

CN119767007AActive Publication Date: 2025-04-04SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional video compression methods require color space conversion and data block format conversion to all pixel data in the video 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 CN119767007A_ABST
    Figure CN119767007A_ABST
Patent Text Reader

Abstract

The invention discloses a video compression method and device, a medium and a product, and relates to the field of video processing, and the method comprises the steps: determining a reference pixel point corresponding to each pixel point from original video data; determining whether to convert the pixel data of each pixel point in the original video data into identification data or not based on the similarity between the pixel data of each pixel point and the pixel data of the reference pixel point so as to obtain converted video data; the identification data of each pixel point is used for determining 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 similarity condition; and sequentially performing color space conversion and data block format conversion on non-identification data in the converted video data, and compressing the video data in the data block format to obtain compressed video data corresponding to the original video data. According to the invention, the same data in the video data is prevented from being repeatedly processed, so that computing resources and storage resources required by video compression are reduced.
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 in particular 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 color space conversion to generate YUV (a color encoding method, Y represents brightness, U and V represent chrominance) format video data, and then convert the YUV format video data into BLOCK (data block) format to obtain YUV data in BLOCK format, and finally obtain compressed format video data through video compression.

[0003] In actual application scenarios, the adjacent frames of video data may have relatively small changes, and there may be a large amount of identical data in the same frame, for example, the data in adjacent rows of the same frame or the data in some video frames may be the same. However, in traditional video compression, all pixel data in the video data must be converted to color space and converted to BLOCK format; color space conversion requires multiple multiplication and addition operations for each pixel data, and BLOCK format conversion requires each pixel data to be stored. 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 technical personnel in this field need to solve. 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 the same data in the video data, so as to solve the problem that video compression requires a large amount of computing resources and storage resources. The specific scheme is as follows:

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

[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 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 the 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;

[0009] 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;

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

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

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

[0013] 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.

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

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

[0016] 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.

[0017] Optionally, 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 includes:

[0018] 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;

[0019] 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.

[0020] Optionally, 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:

[0021] 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;

[0022] 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, a data reading control table is created; the data reading 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;

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

[0024] The video data in a data block format is determined based on the block data corresponding to each component.

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

[0026] Based on the preset YUV sampling format, determining the memories corresponding to the components of the pixel points to be written in the combined video data; the data of the pixel points to be written in the combined video data is non-identification data;

[0027] Constructing a data writing control table according to the memories corresponding to the components contained in the pixel to be written;

[0028] The data writing control table is used to write each component contained in the pixel point to be written into the corresponding memory of the storage array.

[0029] Optionally, creating a data read control table by 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 includes:

[0030] 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;

[0031] 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 are determined; the data of the identification pixel point in the combined video data is the identification data;

[0032] 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;

[0033] A data reading control table is created based on the array storage locations corresponding to each written pixel point and each identified pixel point.

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

[0035] 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;

[0036] The target video frame is a video frame before the current video frame in the original video data; the current video frame is a video frame where each pixel in the original video data is located.

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

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

[0039] Each initial pixel point is determined as each first target pixel point, and a reference pixel point corresponding to each pixel point is determined based on each first target pixel point.

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

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

[0042] 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] Determine a third target pixel point satisfying a second preset condition from each initial pixel point, and determine a reference pixel point corresponding to each pixel point based on each third target pixel point;

[0045] 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.

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

[0047] 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;

[0048] 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.

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

[0050] Memory for storing computer programs;

[0051] The processor is used to execute the computer program to implement the aforementioned video compression method.

[0052] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the aforementioned video compression method when executed by a processor.

[0053] In a fourth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which implements the aforementioned video compression method when executed by a processor.

[0054] In the present invention, a reference pixel point corresponding to each pixel point is determined from original video data; 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 to obtain converted video data; the identification data of each pixel point is 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 a preset similarity condition; color space conversion and data block format conversion are sequentially performed on non-identification data in the converted video data to obtain video data in data block format; the video data in data block format is compressed to obtain compressed video data corresponding to the original video data.

[0055] Beneficial effect: The present invention determines the corresponding reference pixel for each pixel in the original video data, and determines whether to convert the pixel data of each pixel in the original video data into identification data based on the similarity between each pixel and the reference pixel, that is, when the similarity between each pixel and the reference pixel is high, the pixel data of each pixel in the original video data is converted into identification data, and when the similarity between each pixel and the reference pixel is low, the pixel data of each pixel 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 different pixel data in the converted video data, compressed video data is finally obtained by compressing the video data in data block format; in this way, the present invention introduces identification data to avoid repeated color space conversion and 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0057] Figure 1 A flow chart of a video compression method provided by an embodiment of the present invention;

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

[0059] Figure 3 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 data block format conversion flow chart 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] Fig. 9 A color space conversion module structure diagram provided by an embodiment of the present invention;

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

[0067] Fig.11 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0068] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0069] In traditional video compression, all pixel data in video data must be converted to color space and converted to BLOCK format; wherein, 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. To this end, 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 also 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 in the embodiment of the present invention can be applied to any chip integrated with a video compression function, such as a server management control chip; wherein the server management control chip can monitor the status of the server (temperature, fan, main CPU (Central Processing Unit) operation status, etc.), and can also compress the video data and transmit it to the remote end for remote display and monitoring.

[0073] Specifically, the embodiment of the present invention first obtains original video data, and for each pixel point in the original video data, determines a reference pixel point corresponding to each pixel point from the original video data.

[0074] Exemplarily, when the video compression method provided in the embodiment 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 raw video data in RGB format, and in this process, the monitoring video data and the raw video data in RGB format are stored in a DDR (Double Data Rate) memory. Then, the data capture module inside the server management control chip obtains the raw video data in RGB format from the VGA module according to the VGA interface protocol, and determines the reference pixel corresponding to each pixel from the raw video data.

[0075] Among them, the determination of the reference pixel point corresponding to each pixel point in the original video data is specifically based on the initial pixel points in the original video data, determining the reference pixel point corresponding to each pixel point; wherein 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; and 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.

[0076] That is, for each pixel point in the original video data, the current video frame in which each pixel point is located and / or the target video frame located before the current video frame is 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 conditions, 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 conditions include that the initial data row where the initial pixel point in the corresponding video frame is located is located before the target data row where each pixel point in the corresponding video frame is located, and / or, when the initial data row is the target data row, the initial data column where the initial pixel point in the corresponding video frame is located is located before the target data column where each pixel point in the corresponding video frame is located.

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

[0079] Step S12: 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 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.

[0080] In an embodiment of the present invention, after determining the reference pixel point corresponding to each pixel point from the original video data, it is determined 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 pixel data of the reference pixel point, that is, when the similarity between the pixel data of each pixel point and the pixel data of the reference pixel point is high, the pixel data of each pixel point in the original video data is converted into identification data, and when the similarity between the pixel data of each pixel point and the pixel data of the reference pixel point is low, the pixel data of each pixel point in the original video data is retained, thereby obtaining converted video data composed of identification data and different pixel data.

[0081] Specifically, 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 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 quality requirements of the actual video compression. In this way, the embodiment of the present invention compares the similarity between each pixel and the corresponding reference pixel, so that 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 subsequently converted into color space and data block format, thereby reducing the demand for computing resources and storage resources.

[0082] As 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 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 determining the corresponding target reference pixel point from each reference pixel point based on the maximum similarity, and then 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, and converting 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. Accordingly, 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 only one pixel corresponding to the maximum similarity in the reference pixel points, the pixel corresponding to the maximum similarity in the reference pixel points can be directly determined as the target reference pixel point. When there are more than one pixel corresponding to the maximum similarity in the reference pixel points, a pixel can be randomly selected from the pixel corresponding to the maximum similarity in the reference pixel points as the target reference pixel point, or a corresponding pixel can be selected from the pixel corresponding to the maximum similarity in the reference pixel points according to a preset rule as the target reference pixel point; wherein the preset rule can include selecting the earliest pixel point, selecting the pixel point with a more forward position, selecting the pixel point with the smallest or largest pixel distance, or any one or a combination of several of them, and of course other rules can be customized, so that the selection of the target reference pixel point corresponding to each pixel point can meet different selection requirements.

[0085] Furthermore, 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, the identification data corresponding to each pixel point can be determined directly 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 the identification data corresponding to each pixel point is determined based on the relative position relationship between the target reference pixel point and each pixel point.

[0086] The pixel position of the 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. In addition, the identification data can be represented by a binary number, that is, a corresponding target pixel position can be determined according to the identification data of each pixel point, and then a target reference pixel point corresponding to each pixel point is determined from the original video data according to the target pixel position.

[0087] When the video compression method provided in the embodiment 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, thereby obtaining converted video data composed of identification data and different pixel data.

[0088] Step S13: 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 data block format.

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

[0090] Specifically, the non-identification data in the converted video data is first converted into a color space to obtain the non-identification data after color space conversion, and then the 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 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.

[0091] The 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, converting the non-identification data in the converted video data from an RGB format to a YUV format.

[0092] In the process of converting the non-identification data in the converted video data from the RGB format to the YUV format, for any pixel data in the 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 Y component data = PARAM_0×R component data + PARAM_1×G component data + PARAM_2×B component data + PARAM_3. 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, wherein the U component data = PARAM_4×R component data+PARAM_5×G component data+PARAM_6×B component data+PARAM_7. Figure 4 As shown, V component data is calculated based on the R component data, G component data and B component data in any pixel data, where 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 according to 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 takes a value of 0.257, PARAM_1 takes a value of 0.504, PARAM_2 takes a value of 0.098, PARAM_3 takes a value of 16, PARAM_4 takes a value of 0.148, PARAM_5 takes a value of -0.291, PARAM_6 takes a value of 0.439, PARAM_7 takes a value of 128, PARAM_8 takes a value of 0.439, PARAM_9 takes a value of -0.368, PARAM_10 takes a value of -0.071, and PARAM_11 takes a value of 128.

[0094] When the non-identification data in the combined video data is pixel data in the YUV format, the data block format conversion includes storing the non-identification data samples in the combined video data into a storage array based on a preset YUV sampling format, 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 then reading data of corresponding sizes from the storage array in sequence 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 the 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 refers to storing Y / U / V data of all rows and columns in the video data; the YUV422 format refers to storing Y data of all rows and columns in the video data, and storing U / V data of even columns in the video data; the YUV420 format refers to storing Y data of all rows and columns in the video data, and storing U / V data of even rows and even columns in the video data.

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

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

[0098] In an embodiment of the present invention, video data in a 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) and JPEG (Joint Photographic Experts Group, an image file compression format).

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

[0100] Furthermore, the present invention takes into account that different preset YUV sampling formats correspond to different sampling storage methods. Therefore, 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 the YUV444 format, since the YUV444 format refers to the Y / U / V data of all rows and columns in each frame of the video data, for determining the reference pixel points corresponding to each pixel point, each initial pixel point in the original video data can be directly determined as each first target pixel point, and the reference pixel point corresponding to each pixel point can be determined based on each first target pixel point.

[0102] When the preset YUV sampling format is the YUV422 format, since the YUV422 format refers to storing the Y data of all rows and 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 determining the reference pixel corresponding to each pixel, it is necessary to first determine the second target pixel that meets the first preset condition from each initial pixel in the original video data, and then determine the reference pixel corresponding to each pixel based on each second target pixel. The first preset condition includes that the difference between the column number of the data column where the second target pixel is located in the corresponding video frame and the column number of the data column where each pixel 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 in the corresponding video frame is located is 3, that is, each pixel point is located in the third column in the corresponding video frame, the column number of the data column where the second target pixel point in the corresponding video frame is located is an odd number, such as 1, 3, 5, etc., that is, the second target pixel point can be located in the first column, the third column, the fifth column, etc. in the corresponding video frame.

[0104] When the preset YUV sampling format is the YUV420 format, since the YUV420 format refers to storing the Y data of all rows and 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, for determining the reference pixel corresponding to each pixel, it is necessary to first determine the third target pixel that meets the second preset condition from each initial pixel in the original video data, and then determine the reference pixel corresponding to each pixel based on each third target pixel. Among them, the second preset condition includes that the difference between the column number of the data column where the third target pixel is located in the corresponding video frame and the column number of the data column where each pixel 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 is located in the corresponding video frame and the row number of the data row where each pixel 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 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 second row, the pixel point in the second column and fourth row, etc.

[0106] Furthermore, whether it is the first target pixel point, the second target pixel point, or the third target pixel point, when determining the reference pixel point corresponding to each pixel point based on each target pixel point, 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 each target pixel point as the reference pixel points corresponding to each pixel point.

[0107] According to one of the embodiments, whether it is the first target pixel point, the second target pixel point, or the third target pixel point, the reference pixel point corresponding to each pixel point can be obtained by determining the pixel point that satisfies the preset adjacent condition from each target pixel point. 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.

[0108] The first preset difference and the second preset difference may 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 conditions and the preset column adjacent conditions, and the first preset difference and the second preset difference are both 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 in the corresponding video frame, pixel points with column numbers 3, 4, 5 and row numbers 3, 4, 5 are determined from each target pixel point as reference pixel points corresponding to each pixel point.

[0110] Taking the YUV444 format as an example, assuming that the reference pixel points select three pixels in the same column and the front and back adjacent columns in the previous row of the data row where the current pixel point is located, the reference pixel point 1 is the pixel point in the front adjacent column in the previous row, the reference pixel point 2 is the pixel point in the same column in the previous row, and the reference pixel point 3 is the pixel point in the back adjacent column in the previous row. 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 a 6-bit binary number 11_1111, and 11_1111 represents that the current pixel point has the same pixel point in the previous row, that is, reference pixel point 1, and reference pixel point 1 is the target reference pixel point corresponding to the current pixel point; 2'b01 represents a 2-bit binary number 01, and 01 represents that the target reference pixel point is in the previous row and column of the current pixel point. If the pixel data of the current pixel is the same as that of the reference pixel 2, the identification data of the current pixel can be output as an 8-bit identification bit {6'b11_1111, 2'b10}; wherein 2'b10 represents a 2-bit binary number 10, and 10 represents that the target reference pixel is in the same column as the previous row of the current pixel. If the pixel data of the current pixel is the same as that of the reference pixel 3, the identification data of the current pixel can be output as an 8-bit identification bit {6'b11_1111, 2'b11}, wherein 2'b11 represents a 2-bit binary number 11, and 11 represents that the target reference pixel is in the previous row and the next column of the current pixel.

[0111] Beneficial effect: The present invention determines the corresponding reference pixel for each pixel in the original video data, and determines whether to convert the pixel data of each pixel in the original video data into identification data based on the similarity between each pixel and the reference pixel, that is, when the similarity between each pixel and the reference pixel is high, the pixel data of each pixel in the original video data is converted into identification data, and when the similarity between each pixel and the reference pixel is low, the pixel data of each pixel 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 different pixel data in the converted video data, compressed video data is finally obtained by compressing the video data in data block format; in this way, the present invention introduces identification data to avoid repeated color space conversion and 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.

[0112] Based on the previous embodiment, it can be known that 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. Figure 5 As shown, the embodiment of the present invention provides a specific process of data block format conversion, including:

[0113] Step S21, 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.

[0114] Considering that different YUV sampling formats may have different data block sizes for Y / V / U components, correspondingly, different YUV sampling formats have different requirements for the number of memories 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 storing Y / V / U components in the storage array needs to be set to the maximum number therein.

[0115] For example, for the YUV444 format, the data block size of the Y / U / V components is 8×8; for the YUV422 format, the data block size of the Y component is 16×16, and the data block size of the U / V components is 16×8; for the YUV420 format, the data block size of the Y component is 16×16, and the data block size of the U / V components is 8×8. On this basis, in order to make the storage array suitable for the YUV444 format, the YUV422 format, and the YUV420 format, the storage array can be composed of 16 memories for storing the Y component, 16 memories for storing the U component, and 16 memories for storing the V component. In addition, the memory in the storage array can use RAM (Random Access Memory).

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

[0117] In an embodiment of the present invention, when a preset YUV sampling format is known, the memories corresponding to the components contained in the pixel points to be written in the combined video data can be determined based on the preset YUV sampling format; 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 components contained in the pixel points to be written, a data writing control table is constructed, and the data writing control table is used to write the components contained in the pixel points to be written into the corresponding memories of the storage array.

[0118] It can be found that since the combined video data in the embodiment of the present invention is video data composed of identification data and different pixel data, the embodiment of the present invention writes the non-identification data in the combined video data into the storage array, that is, writes the different pixel data in the combined video data into the storage array. Compared with traditional video compression, which requires all pixel data in the video data to be written into the storage array, the present invention can significantly reduce the storage resources required for video compression.

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

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

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

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

[0123] ……;

[0124] Write the Y data of row 7 / 15 / 23 / 31… into Y_RAM_7;

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

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

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

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

[0129] ……;

[0130] Write the U data of row 7 / 15 / 23 / 31… into U_RAM_7;

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

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

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

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

[0135] ……;

[0136] Write the V data of rows 7 / 15 / 23 / 31… into V_RAM_7.

[0137] by Figure 6 Taking the storage array shown as an example, when the preset YUV sampling format is the YUV422 format, since the YUV422 format refers to storing the Y data of all rows and 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 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 row 0 / 16 / 32 / 48… into Y_RAM_0;

[0139] Write the Y data of row 1 / 17 / 33 / 49… into Y_RAM_1;

[0140] Write the Y data of row 2 / 18 / 34 / 50… into Y_RAM_2;

[0141] ……;

[0142] Write the Y data of row 15 / 31 / 47 / 63… 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-numbered column U data of row 0 / 16 / 32 / 48… into U_RAM_0;

[0145] Write the even-numbered column U data of rows 1 / 17 / 33 / 49… into U_RAM_1;

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

[0147] ……;

[0148] Write the even-numbered column U data of rows 15 / 31 / 47 / 63… 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-numbered column V data of row 0 / 16 / 32 / 48… into V_RAM_0;

[0151] Write the even-numbered column V data of rows 1 / 17 / 33 / 49… into V_RAM_1;

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

[0153] ……;

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

[0155] by Figure 6Taking the storage array shown as an example, when the preset YUV sampling format is the YUV420 format, since the YUV420 format refers to storing the Y data of all rows and 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, 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 row 0 / 16 / 32 / 48… into Y_RAM_0;

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

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

[0159] ……;

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

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

[0162] Write the even-numbered column U data of row 0 / 16 / 32 / 48… into U_RAM_0;

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

[0164] ……;

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

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

[0167] Write the even-numbered column V data of row 0 / 16 / 32 / 48… into V_RAM_0;

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

[0169] ……;

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

[0171] For each pixel to be written in the combined video data, according to the storage logic of Y / U / V data corresponding to different YUV sampling formats, the memory corresponding to each component contained in the pixel to be written in the combined video data can be determined, thereby constructing a data writing control table.

[0172] It should be noted that the data writing control table can be a control table based on the frame number of the video frame where the pixel point is located in the video data, the row number of the data row and the column number of the data column 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 number of the storage device corresponding to each component contained in the pixel point. Among them, the number of each storage device 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 based on 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] by Figure 6 Taking the storage array shown in FIG. 1 as an example, assuming that the number of Y_RAM_0 is 0, the number of Y_RAM_1 is 1, ..., the number of Y_RAM_15 is 15; the number of U_RAM_0 is 16, the number of U_RAM_1 is 17, ..., the number of U_RAM_15 is 31; the number of V_RAM_0 is 32, the number of V_RAM_1 is 33, ..., the number of V_RAM_15 is 47; a specific example of the data write control table is shown in Table 1:

[0174] Table 1

[0175]

[0176] Step S22, creating a data reading 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 reading 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.

[0177] In an embodiment of the present invention, after the non-identification data in the combined video data is written 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 the complete video data for compression, it is necessary to pre-create a data reading control table, which 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, and the storage position of any component in the storage array includes the memory corresponding to any 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 the complete video data is composed entirely of pixel data.

[0178] Specifically, for the creation of a data reading control table, the array storage positions corresponding to each written pixel in the combined video data can be determined 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 in the combined video data is non-identification data. Then, according to the identification data of each identification pixel in the combined video data, the target reference pixel corresponding to each identification pixel is determined; wherein the data of the identification pixel in the combined video data is identification data. Using the array storage positions corresponding to each written pixel and based on the target reference pixel corresponding to each identification pixel, the array storage positions corresponding to each identification pixel are determined, and then based on the array storage positions corresponding to each written pixel and each identification pixel, a data reading control table can be created.

[0179] It should be noted that, since the data of the written pixel points in the combined video data is non-identification data, the pixel data of each written pixel point in the video data is different from each other. 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 high, or the pixel data of the identification pixel point and the corresponding target reference pixel point are the same. 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 and based on the target reference pixel points corresponding to each identification pixel point, the array storage positions corresponding to each identification pixel point can be determined.

[0180] Exemplarily, if the array storage position corresponding to the written pixel point A is known, then when the target reference pixel point corresponding to the identified pixel point B is determined to be the written pixel point A based on the identification data of the identified pixel point B, the array storage position corresponding to the identified pixel point B is the array storage position corresponding to the written pixel point A. For the identified pixel point C, if the target reference pixel point corresponding to the identified pixel point C is determined to be the identified pixel point B based on the identification data of the identified pixel point C, then the array storage position corresponding to the identified pixel point C is the array storage position corresponding to the identified pixel point B, that is, the array storage position corresponding to the written pixel point A. Similarly, the array storage positions corresponding to all the identified pixels can be determined, and then combined with the array storage positions corresponding to each of the written pixels, 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, the target reference pixel point corresponding to the identified pixel point can be determined based on the identification data of the identified pixel point.

[0182] Furthermore, the data reading control table may be a control table based on the frame number of the video frame where the pixel point is located in the video data, the row number of the data row and the column number of the data column 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 position corresponding to the pixel point. Among them, the written pixel points in the video data have been written into the storage array, and the marked pixel points in the video data have not been written into the storage array.

[0183] by Figure 6 Taking the storage array shown in FIG. 1 as an example, assuming that the number of Y_RAM_0 is 0, the number of Y_RAM_1 is 1, ..., the number of Y_RAM_15 is 15; the number of U_RAM_0 is 16, the number of U_RAM_1 is 17, ..., the number of U_RAM_15 is 31; the number of V_RAM_0 is 32, the number of V_RAM_1 is 33, ..., the number of V_RAM_15 is 47; a specific example of the data read 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 written into the pixel; YUV_RAM_NUM_U represents the number of the memory corresponding to the U component written into the pixel; YUV_RAM_NUM_V represents the number of the memory corresponding to the V component written into the pixel; YUV_RAM_ADDR_Y represents the storage address of the Y component written into the pixel in the corresponding memory; YUV_RAM_ADDR_U represents the storage address of the U component written into the pixel in the corresponding memory; YUV_RAM_ADDR_V represents the storage address of the V component written into the pixel in the corresponding memory. MARK_RAM_NUM_Y indicates the number of the memory corresponding to the Y component of the identified pixel, that is, the number of the memory corresponding to the Y component of the target reference pixel corresponding to the identified pixel; MARK_RAM_NUM_U indicates the number of the memory corresponding to the U component of the identified pixel, that is, the number of the memory corresponding to the U component of the target reference pixel corresponding to the identified pixel; MARK_RAM_NUM_V indicates the number of the memory corresponding to the V component of the identified pixel, that is, the number of the memory corresponding to the V component of the target reference pixel corresponding to the identified pixel; MARK_RAM_A DDR_Y represents the storage address of the Y component of the identified pixel in the corresponding memory, that is, the storage address of the Y component of the target reference pixel corresponding to the identified pixel in the corresponding memory; MARK_RAM_ADDR_U represents the storage address of the U component of the identified pixel in the corresponding memory, that is, the storage address of the U component of the target reference pixel corresponding to the identified pixel in the corresponding memory; MARK_RAM_ADDR_V represents the storage address of the V component of the identified pixel in the corresponding memory, that is, the storage address of the V component of the target reference pixel corresponding to the identified pixel in the corresponding memory.

[0187] Furthermore, according to Table 2, it can be found that pixel A with frame number 0, row number 0 and column number 0 is a written pixel; pixel B with frame number 0, row number 0 and column number 1 is an identification pixel, and the target reference pixel corresponding to the identification pixel is pixel A, so pixel A and pixel B correspond to the same array storage position.

[0188] Step S23, using the data reading control table and based on the data block size corresponding to any component, read the block data of the corresponding size corresponding to any component from the storage array in sequence; 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 the data reading control table is created, it is necessary to determine the data block sizes corresponding to the Y, U, and V components respectively based on the preset YUV sampling format, and then for any of the Y, U, and V components, the data reading control table can be used and based on the data block size corresponding to any component, block data of corresponding size corresponding to any component can be read from the storage array in sequence.

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

[0191] For any component among the Y, U, and V components, the data row traversal in the combined video data can be used as a large loop and the data column traversal can be used as a small loop. According to the data block size corresponding to any component, the block data of the corresponding size corresponding to any component can be read from the storage array in sequence.

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

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

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

[0195] It can be seen that the embodiment of the present invention writes the non-identification data in the combined video data into the storage array, that is, writes the different pixel data in the combined video data into the storage array. Compared with the traditional video compression, which requires all the pixel data in the video data to be written into the storage array, the present invention can significantly reduce the storage resources required for video compression. In addition, by introducing identification data, the embodiment of the present invention can also restore the combined video data composed of identification data and different pixel data into complete video data composed entirely of pixel data.

[0196] by Figure 7 Taking the internal architecture diagram of the server management control chip shown in FIG. 1 as an example, the video compression method proposed by the present invention is described, wherein 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 scheme is as follows:

[0197] The server management control chip obtains the monitoring video data of the server host and transmits it to the VGA module, so as to use the VGA module to convert the monitoring video data into raw video data in RGB format, and in the process stores the monitoring video data and the raw video data in RGB format in an external DDR memory.

[0198] like Figure 8 As shown, the capture unit in the data capture module acquires the raw video data in RGB format from the VGA module line by line and transmits it to the line cache control unit. The line cache control unit searches for the reference pixel corresponding to each pixel in the currently acquired data row from the pixel points stored in the preset cache, and then transmits each pixel and the corresponding reference pixel to the parallel comparison unit, and stores each pixel in the preset cache at the same time. In this way, after the corresponding reference pixel is found for all the pixel points in the currently acquired data row and transmitted to the parallel comparison unit, all the pixel points in the currently acquired data row are also stored in the preset cache.

[0199] The parallel comparison unit is used to determine the similarity between each pixel point and the pixel data of each reference pixel point, and to judge whether the maximum similarity among the similarities is greater than a 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 identification data and transmitted 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 transmitted to the RGB data update unit.

[0200] The RGB data updating unit combines the identification data and the pixel data to obtain converted video data, that is, the converted video data is video data based on the identification data and mutually different RGB pixel data.

[0201] like Fig. 9 As shown, the RGB data parsing unit in the color space conversion module obtains the converted video data from the RGB data updating 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 to convert the color space, 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 combining unit combines the converted YUV pixel data and the identification data to obtain combined video data, that is, the combined video data is video data composed of the identification data and different YUV pixel data.

[0203] like Fig.10 As shown, the YUV data parsing unit in the data block format conversion module obtains the combined video data from the YUV data combining 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 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 components contained in the pixel to be written based on the preset YUV sampling format, so as to construct a data write control table, wherein the data of the pixel to be written in the combined video data is YUV pixel data; and then 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 readout information creation unit creates a data readout control table according to the storage position 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; wherein the data readout control table records the array storage positions corresponding to each pixel point in the combined video data; the array storage position includes the storage position of each component in the pixel point in the storage array, and the storage position of any component in the storage array includes the memory corresponding to any component in the storage array and the storage address in the corresponding memory. Then the readout information creation unit sends the data readout control table to the array readout controller.

[0206] The array read controller determines the data block sizes corresponding to the Y, U, and V components respectively based on the preset YUV sampling format, and for any of the Y, U, and V components, the data read control table can be used and based on the data block size corresponding to any component, the block data of the corresponding size corresponding to any component can be read from the storage array in sequence, thereby determining the video data in the data block format based on the block data corresponding to each component.

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

[0208] The compression module compresses the received video data in the 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 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] Beneficial effect: The present invention determines a corresponding reference pixel point for each pixel point in the original video data, and determines whether to convert the pixel data of each pixel point in the original video data into identification data based on the similarity between each pixel point and the reference pixel point. That is, when the similarity between each pixel point and the reference pixel point is 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 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. Furthermore, by sequentially performing color space conversion and data block format conversion on different pixel data in the converted video data, compressed video data is finally obtained by compressing the video data in data block format; in this way, the present invention introduces identification data to avoid repeated color space conversion and 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; accordingly, the present invention reduces the chip area by reducing the occupancy of storage resources on the chip, and reduces chip power consumption by reducing the use of computing resources on the chip, thereby optimizing the overall performance of the chip.

[0211] Furthermore, the present application also discloses an electronic device. Fig.11This is a structural diagram of an electronic device according to an exemplary embodiment, and the content in the diagram cannot 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. 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 aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

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

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

[0214] The operating system 121 is used to manage and control various hardware devices on the electronic device and the computer program 122, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the video compression method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 122 can further include a computer program that can be used to complete other specific tasks.

[0215] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the video compression method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.

[0216] Furthermore, the present application also discloses a computer program product, including a computer program / instruction; wherein the computer program / instruction, when executed by a processor, implements the aforementioned disclosed video compression method. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.

[0217] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0218] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0219] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0220] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0221] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present 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; The video data in the data block format is compressed to obtain compressed video data corresponding to the original 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

  • Data processing method and device

    CN110674108A

  • Image processing method and device based on desktop cloud

    CN114564261A

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

    CN115209145A

  • Neural network data storage format conversion method suitable for universal hardware circuit

    CN115373598A

  • Image compression system, method, equipment and medium

    CN117156287A