CN115086668A - Video compression method, system, equipment and computer readable storage medium - Google Patents

Video compression method, system, equipment and computer readable storage medium Download PDF

Info

Publication number
CN115086668A
CN115086668A CN202210856065.0A CN202210856065A CN115086668A CN 115086668 A CN115086668 A CN 115086668A CN 202210856065 A CN202210856065 A CN 202210856065A CN 115086668 A CN115086668 A CN 115086668A
Authority
CN
China
Prior art keywords
block
data
fifo
target
storage queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210856065.0A
Other languages
Chinese (zh)
Other versions
CN115086668B (en
Inventor
张峰
李拓
邹晓峰
满宏涛
张贞雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210856065.0A priority Critical patent/CN115086668B/en
Publication of CN115086668A publication Critical patent/CN115086668A/en
Priority to PCT/CN2022/130403 priority patent/WO2024016520A1/en
Application granted granted Critical
Publication of CN115086668B publication Critical patent/CN115086668B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses a video compression method, a system, equipment and a computer readable storage medium, which are used for acquiring video data to be compressed; converting the video data into target video data in a YUV format; determining YUV writing logic of target video data; respectively writing adjacent data in the target video data into corresponding storage queues according to YUV writing logic; reading out a target BLOCK data BLOCK to be compressed from a storage queue; and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result. In the application, the baseboard management controller can store adjacent data in the target video by means of different storage queues, and the video compression efficiency of the baseboard management controller can be improved by avoiding repeated compression of adjacent and same BLOCK data BLOCKs.

Description

Video compression method, system, equipment and computer readable storage medium
Technical Field
The present application relates to the field of video compression technologies, and in particular, to a video compression method, system, device, and computer-readable storage medium.
Background
Currently, a Baseboard Management Controller (BMC) may transmit local video information to a remote end through a network for remote display and monitoring, in this process, in order to facilitate video transmission, JPEG (joint Photographic Experts group) compression may be performed on a video, that is, RGB data of an original video is converted into YUV data through a color space, and then Y, U, V data is cached by using a storage resource in a chip, and is sent into a JPEG (joint Photographic Property) core according to a requirement of BLOCK format conversion, and DCT (DCT for Discrete Cosine Transform) conversion, quantization and encoding are completed inside the IP core, thereby completing compression.
However, in the process of compressing a video, since there is a case where pixel data of adjacent block areas in the video does not change or changes little in the video, when compressing all video data, the performance of the bmc is consumed, and the video compression efficiency of the bmc is reduced.
In summary, those skilled in the art need to solve the above problems to improve video compression efficiency.
Disclosure of Invention
The application aims to provide a video compression method which can solve the technical problem of improving the video compression efficiency to a certain extent. The application also provides a video compression system, an electronic device and a computer readable storage medium.
In order to achieve the above object, the present application provides the following technical solutions:
a video compression method, comprising:
acquiring video data to be compressed;
converting the video data into target video data in a YUV format;
determining YUV writing logic of the target video data;
according to the YUV writing logic, respectively writing adjacent data in the target video data into corresponding storage queues;
reading out a target BLOCK data BLOCK to be compressed from the storage queue;
and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
Preferably, the writing the adjacent data in the target video data into the corresponding storage queues according to the YUV writing logic includes:
determining the dividing mode of the adjacent data under the YUV writing logic;
and respectively writing the adjacent data in the target video data into the corresponding storage queues according to the YUV writing logic and the dividing mode.
Preferably, the writing the adjacent data in the target video data into the corresponding storage queues according to the YUV write logic and the dividing manner includes:
and respectively writing the adjacent data in the target video data into the corresponding storage queues based on a ping-pong cache mode according to the YUV writing logic and the dividing mode.
Preferably, the division manner includes a division manner in which row data and column data of the target video data are taken as a unit.
Preferably, the writing the adjacent data in the target video data into the corresponding storage queues based on a ping-pong buffer manner according to the YUV write logic and the dividing manner includes:
if the YUV write logic is in YUV420 mode, storing Y data of columns i, i +16, i +32, …, 0-15, 32-47, 64-79, …, 32m-32m +15 of rows i, i +16n in the target video data into a storage queue Y _ FIFO _ i _ a, storing Y data of columns 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 of rows i, i +16, i +32, …, i +16n in the target video data into a storage queue Y _ FIFO _ i _ B, and i =0, 1, 2, … 15; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, 16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, … 94, …, 16+32m +2, …, 16+32m +14 in j, j =0, 2, 4, … in j +16n in the target video data; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in k, k +16, k +32, …, k +16n lines 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in the target video data into a storage queue V _ FIFO _ k _ B, where k =0, 2, 4, …; 15+16n is used to represent the total number of rows of the target video data, and 16+32m +15 is used to represent the total number of columns of the target video data.
Preferably, the reading out the target BLOCK data BLOCK to be compressed from the storage queue includes:
reading the storage queue Y _ FIFO _ i _ a 16 times, and simultaneously reading the storage queue Y _ FIFO _ i _ B16 times to obtain the adjacent target BLOCK data BLOCK of Y type, i =0, 1, 2, … 15; reading the storage queue U _ FIFO _ j _ a 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B8 times to obtain the adjacent target BLOCK data BLOCK of U type, j =0, 2, 4, … 14; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times to obtain the adjacent target BLOCK data BLOCK of type V, k =0, 2, 4, … 14.
Preferably, the writing the adjacent data in the target video data into the corresponding storage queues based on a ping-pong buffer manner according to the YUV write logic and the dividing manner includes:
if the YUV write logic is in YUV422 mode, storing Y data of columns i, i +16, i +32, …, 0-15, 32-47, 64-79, …, 32m-32m +15 of rows i, i +16n in the target video data into a storage queue Y _ FIFO _ i _ a, storing Y data of columns 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 of rows i, i +16, i +32, …, i +16n in the target video data into a storage queue Y _ FIFO _ i _ B, and i =0, 1, 2, … 15; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, j +16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, … 94, …, 16+32m +2, …, 16+32m +14 in j, j =0, 1, 2, … in j +16n in the target video data into a storage queue U _ FIFO _ j _ B; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in the target video data in a k, k +16, k +32, …, k +16n row in a storage queue V _ FIFO _ k _ a, storing V data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, … 94, …, 16+32m +2, …, 16+32m +14 in a storage queue V _ FIFO _ k _ B, k =0, 1, 2, … in the target video data; 15+16n is used to represent the total number of rows of the target video data, and 16+32m +15 is used to represent the total number of columns of the target video data.
Preferably, the reading out the target BLOCK data BLOCK to be compressed from the storage queue includes:
reading the storage queue Y _ FIFO _ i _ a 16 times, and simultaneously reading the storage queue Y _ FIFO _ i _ B16 times to obtain the adjacent target BLOCK data BLOCK of Y type, i =0, 1, 2, … 15; reading the storage queue U _ FIFO _ j _ a 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B8 times to obtain the adjacent target BLOCK data BLOCK of U type, j =0, 1, 2, … 15; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times to obtain the adjacent target BLOCK data BLOCK of type V, k =0, 1, 2, … 15.
Preferably, the writing the adjacent data in the target video data into the corresponding storage queues based on a ping-pong buffer manner according to the YUV write logic and the dividing manner includes:
if the YUV write logic is YUV444 mode, storing Y data of columns 0-7, 16-23, 32-39, …, 8m-8m +7 of rows i, i +8, i +16, …, i +8n in the target video data into a storage queue Y _ FIFO _ i _ a, storing Y data of columns 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 of rows i, i +8, i +16, …, i +8n in the target video data into a storage queue Y _ FIFO _ i _ B, i =0, 1, 2, … 7; storing U data of 0-7, 16-23, 32-39, …, 8m-8m +7 columns of j, j +8, j +16, …, j +8n rows in the target video data into a storage queue U _ FIFO _ j _ A, storing U data of 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 columns of j, j +8, j +16, …, j +8n rows in the target video data into a storage queue U _ FIFO _ j _ B, wherein j =0, 1, 2, … 7; storing V data of columns 0-7, 16-23, 32-39, …, 8m-8m +7 of lines k, k +8, k +16, …, k +8n of the target video data into a storage queue V _ FIFO _ k _ a, storing V data of columns 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 of lines k, k +8, k +16, …, k +8n of the target video data into a storage queue V _ FIFO _ k _ B, k =0, 1, 2, … 7; 7+8n is used to represent the total number of rows of the target video data, and 8+8m +7 is used to represent the total number of columns of the target video data.
Preferably, the reading out the target BLOCK data BLOCK to be compressed from the storage queue includes:
reading the storage queue Y _ FIFO _ i _ a 8 times, and simultaneously reading the storage queue Y _ FIFO _ i _ B8 times to obtain the adjacent target BLOCK data BLOCK of Y type, i =0, 1, 2, … 7; reading the storage queue U _ FIFO _ j _ a 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B8 times to obtain the adjacent target BLOCK data BLOCK of U type, j =0, 1, 2, … 7; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times, to obtain the target BLOCK of BLOCK data adjacent to the V type, k =0, 1, 2, … 7.
Preferably, the compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when adjacent BLOCK data BLOCKs are the same to obtain a compression result includes:
determining a first BLOCK data BLOCK and a second BLOCK data BLOCK which are adjacent in the target BLOCK data BLOCK;
acquiring a third BLOCK data BLOCK which is completely compressed and is adjacent to the first BLOCK data BLOCK, and acquiring a fourth BLOCK data BLOCK which is completely compressed and is adjacent to the second BLOCK data BLOCK;
determining a compression result of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on a compression result of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK.
Preferably, the determining the compression result of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on the compression result of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK includes:
judging whether the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK, judging whether the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, and judging whether the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain a compression result of the first BLOCK data BLOCK, and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, compressing the second BLOCK data BLOCK to obtain a compression result of the second BLOCK data BLOCK, and taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain a compression result of the first BLOCK data BLOCK and the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is different from the second BLOCK data BLOCK, the first BLOCK data BLOCK is compressed to obtain a compression result of the first BLOCK data BLOCK, and the second BLOCK data BLOCK is compressed to obtain a compression result of the second BLOCK data BLOCK.
A video compression system comprising:
the first acquisition module is used for acquiring video data to be compressed;
the first conversion module is used for converting the video data into target video data in a YUV format;
a first determining module, configured to determine YUV write logic of the target video data;
the first writing module is used for respectively writing adjacent data in the target video data into corresponding storage queues according to the YUV writing logic;
the first reading module is used for reading out a target BLOCK data BLOCK to be compressed from the storage queue;
and the first compression module is used for compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
An electronic device, comprising:
a receiving port for receiving video data to be compressed;
the RGB-to-YUV component is connected with the receiving port and is used for converting the video data into target video data in a YUV format;
a YUV conversion block component connected with the RGB to YUV component and used for determining YUV writing logic of the target video data; according to the YUV writing logic, respectively writing adjacent data in the target video data into corresponding storage queues;
the compression processing component is connected with the YUV BLOCK conversion component and is used for reading out a target BLOCK data BLOCK to be compressed from the storage queue; and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
Preferably, the compression processing assembly includes:
the data BLOCK comparator is connected with the YUV conversion BLOCK assembly and used for reading the target BLOCK data BLOCK to be compressed from the storage queue and judging whether the target BLOCK is the same as other adjacent BLOCK data BLOCKs or not to obtain a comparison result;
and the video compression component is connected with the YUV conversion BLOCK component and the data BLOCK comparator and used for compressing the target BLOCK data BLOCK according to the comparison result and the compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same so as to obtain the compression result. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the video compression method as set forth in any one of the preceding claims.
The application provides a video compression method, which comprises the steps of obtaining video data to be compressed; converting the video data into target video data in a YUV format; determining YUV writing logic of target video data; respectively writing adjacent data in the target video data into corresponding storage queues according to YUV writing logic; reading out a target BLOCK data BLOCK to be compressed from a storage queue; and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result. In the application, adjacent data in target video data can be written into corresponding storage queues respectively according to YUV writing logic, adjacent data in the target video data are stored by means of different storage queues, a target BLOCK data BLOCK to be compressed is read from the storage queues, only one BLOCK data BLOCK is compressed according to a compression rule that the adjacent BLOCK data BLOCKs are the same, the target BLOCK data BLOCK is compressed, a compression result is obtained, repeated compression of the adjacent and same BLOCK data BLOCKs is avoided, performance consumption can be reduced, and video compression efficiency can be improved. The video compression system, the electronic device and the computer readable storage medium provided by the application also solve the corresponding technical problems.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a first flowchart of a video compression method according to an embodiment of the present application;
FIG. 2 is a sequence diagram of the generation of BLOCK data BLOCKs;
fig. 3 is a second flowchart of a video compression method according to an embodiment of the present application;
fig. 4 is a third flowchart of a video compression method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a baseboard management controller;
FIG. 6 is a flow chart of the VIDEO composition internal data processing;
FIG. 7 is a diagram illustrating the relationship between A, B, C, D BLOCKs of BLOCK data;
fig. 8 is a schematic structural diagram of a video compression system according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 10 is another schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a first flowchart of a video compression method according to an embodiment of the present application.
The video compression method provided by the embodiment of the application can comprise the following steps:
step S101: video data to be compressed is acquired.
In practical applications, the video data to be compressed may be obtained first, specifically, the video data sent by the server may be obtained, and the application is not limited specifically herein.
It should be noted that an execution subject of the video compression method provided in the embodiment of the present application may be determined according to a specific application scenario, for example, the execution subject of the video compression method provided in the embodiment of the present application may be a substrate management controller, a video compression server, video compression software, and the like, and the present application is not limited in particular herein.
Step S102: and converting the video data into target video data in a YUV format.
In practical applications, the acquired video data is generally RGB data, where R represents Red (Red), G represents Green (Green), and B represents Blue (Blue), and the video data needs to be converted into target video data in YUV format for subsequent compression according to the JPEG compression method.
It should be noted that YUV in the present application is a color coding method, and is often used in each video processing component, and when YUV is used for coding photos or videos, it allows reducing the bandwidth of chrominance in consideration of human perception. YUV is a type of color space (color space) for encoding a true-color, Y represents brightness (Luma) or a gray scale value, and U and V represent Chrominance (Chroma) for specifying a color of a pixel. Further, the JPEG encoding flow may include: the RGB data of the original video is subjected to color space conversion, BLOCK sampling, DCT transformation, quantization, entropy coding, data framing (adding frame header and tail indication information), and the like, which is not specifically limited herein.
Step S103: YUV write logic for the target video data is determined.
Step S104: and respectively writing adjacent data in the target video data into corresponding storage queues according to YUV writing logic.
In practical application, because a plurality of compression modes exist in the JPEG compression process, and YUV write logics of the compression modes are different, so that the determination manner of adjacent data is also different, in order to accurately determine adjacent data in each compression mode, it is necessary to determine the YUV write logics of target video data, and according to the YUV write logics, adjacent data in the target video data are respectively written into corresponding storage queues, so as to store the adjacent video data by means of different storage queues.
Step S105: the target BLOCK data BLOCK to be compressed is read from the store queue.
Step S106: and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
In practical application, after adjacent data in target video data are respectively written into corresponding storage queues according to YUV write logic, a target BLOCK data BLOCK to be compressed can be read from the storage queues, and the target BLOCK data BLOCK is compressed according to a compression rule that when the adjacent BLOCK data BLOCKs are the same, only one BLOCK data BLOCK is compressed, so that a compression result is obtained, and the adjacent and same video data are prevented from being repeatedly compressed.
It should be noted that the type of YUV write logic may be determined according to actual needs, for example, the YUV write logic may be a YUV420 mode, a YUV422 mode, a YUV444 mode, and so on, and for convenience of understanding, it is assumed that the generation order of BLOCK data is as shown in fig. 2, where each small box on the right side in fig. 2 represents 8 × 8 pixels on the left side, a large box represents 16 × 16 pixels, a long box represents 8 × 16 pixels, Cb in the figure represents a U component, Cr represents a V component, by way of example, the YUV420 is used, a Y BLOCK represents a Y component of 1 16 × 16 pixels, a Cb BLOCK represents a U component of 18 × 8 BLOCKs, and a Cr BLOCK represents a V component of 18 × 8 BLOCKs, and only UV data in even and even rows and even columns (or odd columns in odd rows, odd columns in even rows and even columns, in principle, 4Y components share one UV component); taking YUV422 as an example, a Y block represents a Y component of 1 16 × 16 pixel, a Cb block represents a U component of 1 16 × 8 block, and a Cr block represents a V component of 1 16 × 8 block. The 2Y components share one UV component, and UV data of even rows or even columns/odd rows/odd columns are reserved; taking YUV444 as an example, a Y block represents a Y component of 18 × 8 pixel, a Cb block represents a U component of 18 × 8 block, and a Cr block represents a V component of 18 × 8 block, and YUV components of all rows and columns are retained.
The application provides a video compression method, which comprises the steps of obtaining video data to be compressed; converting the video data into target video data in a YUV format; determining YUV writing logic of target video data; respectively writing adjacent data in the target video data into corresponding storage queues according to YUV writing logic; reading out a target BLOCK data BLOCK to be compressed from a storage queue; and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result. In the application, adjacent data in target video data can be written into corresponding storage queues respectively according to YUV writing logic, adjacent data in the target video data are stored by means of different storage queues, a target BLOCK data BLOCK to be compressed is read from the storage queues, only one BLOCK data BLOCK is compressed according to a compression rule that the adjacent BLOCK data BLOCKs are the same, the target BLOCK data BLOCK is compressed, a compression result is obtained, repeated compression of the adjacent and same BLOCK data BLOCKs is avoided, performance consumption can be reduced, and video compression efficiency can be improved.
Referring to fig. 3, fig. 3 is a second flowchart of a video compression method according to an embodiment of the present application.
The video compression method provided by the embodiment of the application can comprise the following steps:
step S201: video data to be compressed is acquired.
Step S202: and converting the video data into target video data in a YUV format.
Step S203: YUV write logic for the target video data is determined.
Step S204: and determining the dividing mode of adjacent data under YUV writing logic.
Step S205: and respectively writing adjacent data in the target video data into corresponding storage queues based on a ping-pong cache mode according to YUV write logic and a division mode.
In practical application, in the process of respectively writing adjacent data in target video data into corresponding storage queues according to YUV writing logic, the dividing mode of the adjacent data under the YUV writing logic can be determined; and respectively writing adjacent data in the target video data into corresponding storage queues according to YUV writing logic and a dividing mode. In a specific application scenario, in the process of writing adjacent data in target video data into corresponding storage queues respectively according to YUV writing logic and a dividing mode, the adjacent data in the target video data can be written into the corresponding storage queues respectively based on a ping-pong cache mode according to the YUV writing logic and the dividing mode. In addition, the dividing manner may include a dividing manner using row data and column data of the target video data as a unit, and the like, and the present application is not limited specifically herein.
Step S206: the target BLOCK data BLOCK to be compressed is read from the store queue.
Step S207: and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
In practical application, in the existing YUV420 mode, the storage principle of video data is to retain all Y data and U/V data of even rows and even columns, and assuming that the storage medium is a FIFO (First Input First Output, First in First out queue), the storage process is as follows:
write the Y data of line 0/16/32/48 … into Y _ FIFO _ 0;
write the Y data of line 1/17/33/49 … into Y _ FIFO _ 1;
write Y data for line 2/18/34/50 … into Y _ FIFO _ 2;
……
write the Y data of line 15/31/47/63 … into Y _ FIFO _ 15;
write the even column U data of line 0/16/32/48 … into U _ FIFO _ 0;
writing the even column U data of line 2/18/34/50 … into U _ FIFO _ 1;
……
write the even column U data of line 14/30/46/62 … into U _ FIFO _ 7;
writing the even column V data of line 0/16/32/48 … into V _ FIFO _ 0;
writing the even column V data of line 2/18/34/50 … into V _ FIFO _ 1;
……
writing the even column V data of line 14/30/46/62 … into V _ FIFO _ 7;
the reading process of the BLOCK data BLOCK is as follows: sequentially reading 16 times of Y _ FIFO _0, 16 times of Y _ FIFO _1 … … 16 times of Y _ FIFO _ 15; u _ FIFO _0 for 8 times, U _ FIFO _1 for 8 times, U _ FIFO _7 for 8 times; v _ FIFO _0, V _ FIFO _1, V _ FIFO _7, 8 times 8; and then sequentially circulate.
In the present application, according to the YUV write logic and the division manner, the process of writing the neighboring data in the target video data into the corresponding storage queue based on the ping-pong buffer manner is that if the YUV write logic is in the YUV420 mode, the Y data in the columns of the i, i +16, i +32, …, i +16n row 0-15, 32-47, 64-79, …, 32m-32m +15 in the target video data is stored into the storage queue Y _ FIFO _ i _ a, the Y data in the columns of the i, i +16, i +32, …, i +16n row 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 in the target video data is stored into the storage queue Y _ FIFO _ i _ B, i =0, 1, 2, … 15; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, j +16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in j, j =0, 2, 4, 3614 in j +16n in the target video data into a storage queue U _ FIFO _ j _ B; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in rows k, k +16, k +32, …, k +16n in the target video data into a storage queue V _ FIFO _ k _ a, storing V data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in rows k, k +16, k =0, 2, 4, … in rows k, k +16, V _ FIFO _ k _ B; 15+16n is used to characterize the total number of rows of the target video data, and 16+32m +15 is used to characterize the total number of columns of the target video data. In the present application, the symbol "-" means "to".
Correspondingly, in the process of reading out the target BLOCK data BLOCK to be compressed from the storage queue, reading out the storage queue Y _ FIFO _ i _ a 16 times, and simultaneously reading out the storage queue Y _ FIFO _ i _ B16 times, to obtain a target BLOCK data BLOCK which is 16 × 16 in size and adjacent, i =0, 1, 2, … 15; reading 8 times of storage queues U _ FIFO _ j _ A, and simultaneously reading 8 times of storage queues U _ FIFO _ j _ B to obtain adjacent target BLOCK data BLOCKs with the U type size of 8 × 8, wherein j =0, 2, 4, … 14; reading the 8 times of storage queue V _ FIFO _ k _ a and simultaneously reading the 8 times of storage queue V _ FIFO _ k _ B results in a V-type data BLOCK of size 8 × 8 and adjacent target BLOCK, k =0, 2, 4, … 14.
In practical application, in the existing YUV422 mode, the storage principle of video data is to retain all Y data and U/V data in an even column, and the storage process is as follows:
write the Y data of line 0/16/32/48 … into Y _ FIFO _ 0;
write the Y data of line 1/17/33/49 … into Y _ FIFO _ 1;
write the Y data of line 2/18/34/50 … into Y _ FIFO _ 2;
……
write the Y data of line 15/31/47/63 … into Y _ FIFO _ 15;
write the even column U data of line 0/16/32/48 … into U _ FIFO _ 0;
writing the even column U data of line 1/17/33/49 … into U _ FIFO _ 1;
write the even column U data of line 2/18/34/50 … into U _ FIFO _ 2;
……
writing the U data of the 15/31/47/63 … th row even column into the U _ FIFO _ 15;
writing 0/16/32/48 … th row even column V data into V _ FIFO _ 0;
writing the even column V data of line 1/17/33/49 … into V _ FIFO _ 1;
writing 2/18/34/50 … th row even column V data into V _ FIFO _ 2;
……
writing 15/31/47/63 … th row even column V data into V _ FIFO _ 15;
the reading process of the BLOCK data BLOCK is as follows: sequentially reading 16 times of Y _ FIFO _0, 16 times of Y _ FIFO _1 … … 16 times of Y _ FIFO _15, 8 times of U _ FIFO _0, 8 times of U _ FIFO _1, … … 8 times of U _ FIFO _ 15; v _ FIFO _0, V _ FIFO _1, 8V _ FIFO _1, … … 8V _ FIFO _15, 8 times.
In the application, in the process of writing adjacent data in target video data into corresponding storage queues respectively based on a ping-pong buffer mode according to YUV write logic and a division mode, if the YUV write logic is in a YUV422 mode, Y data in columns of 0-15, 32-47, 64-79, …, 32m-32m +15 of rows i, i +16, i +32, …, i +16n in the target video data is stored into a storage queue Y _ FIFO _ i _ a, Y data in columns of 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 of rows i +16, i +32, …, i +16n in the target video data is stored into a storage queue Y _ FIFO _ i _ B, i =0, 1, 2, … 15; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, j +16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in j, j =0, 1, 2, 3615 in j +16n in the storage queue U _ FIFO _ j _ B; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in rows k, k +16, k +32, …, k +16n in the target video data into a storage queue V _ FIFO _ k _ a, storing V data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in rows k, k +16, k =0, 1, 2, 3615 in rows k, k +16, V _ FIFO _ k _ B; 15+16n is used to represent the total number of rows of the target video data, and 16+32m +15 is used to represent the total number of columns of the target video data.
Correspondingly, in the process of reading out the target BLOCK data BLOCK to be compressed from the storage queue, reading out the storage queue Y _ FIFO _ i _ a for 16 times, and simultaneously reading out the storage queue Y _ FIFO _ i _ B for 16 times, to obtain a target BLOCK data BLOCK which is 16 × 16 in size and adjacent in Y type, i =0, 1, 2, … 15; reading 8 times of storage queues U _ FIFO _ j _ A, and simultaneously reading 8 times of storage queues U _ FIFO _ j _ B to obtain adjacent target BLOCK data BLOCKs with the U type size of 16 × 8, wherein j =0, 1, 2, … 15; reading the 8 times of storage queue V _ FIFO _ k _ a and simultaneously reading the 8 times of storage queue V _ FIFO _ k _ B results in a V-type data BLOCK with size 16 × 8 and adjacent target BLOCK, k =0, 1, 2, … 15.
In practical application, in the existing YUV444 mode, the storage principle of video data is to keep Y/U/V data of all rows and columns, and the storage process is as follows:
write Y data for line 0/8/16/24 … into Y _ FIFO _ 0;
write the Y data of line 1/9/17/25 … into Y _ FIFO _ 1;
write the Y data of line 2/10/18/26 … into Y _ FIFO _ 2;
……
write the Y data of line 7/15/23/31 … into Y _ FIFO _ 7;
write the U data of line 0/8/16/24 … into U _ FIFO _ 0;
write the U data of line 1/9/17/25 … into U _ FIFO _ 1;
write the U data of line 2/10/18/26 … into U _ FIFO _ 2;
……
write the U data of line 7/15/23/31 … into U _ FIFO _ 7;
write the V data of line 0/8/16/24 … into V _ FIFO _ 0;
writing the V data of line 1/9/17/25 … into V _ FIFO _ 1;
write the V data of line 2/10/18/26 … into V _ FIFO _ 2;
……
write the V data of line 7/15/23/31 … into V _ FIFO _ 7;
the reading process of the BLOCK data BLOCK is as follows: sequentially reading Y _ FIFO _0 for 8 times, Y _ FIFO _1 … … 8 for 8 times and Y _ FIFO _7 for 8 times; u _ FIFO _0 for 8 times, U _ FIFO _1 for 8 times, U _ FIFO _7 for 8 times; v _ FIFO _0, V _ FIFO _1, and V _ FIFO _7, 8 times.
In the application, according to YUV write logic and a division mode, if the YUV write logic is in a YUV444 mode in the process of respectively writing adjacent data in target video data into corresponding storage queues based on a ping-pong buffer mode, Y data in columns of 0-7, 16-23, 32-39, …, 8m-8m +7 of rows i, i +8, i +16, …, i +8n in the target video data is stored into a storage queue Y _ FIFO _ i _ a, Y data in columns of 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 of rows i +8, i +16, …, i +8n in the target video data is stored into a storage queue Y _ FIFO _ i _ B, i =0, 1, 2, … 7; storing U data of 0-7, 16-23, 32-39, …, 8m-8m +7 columns of j, j +8, j +16, …, j +8n lines in target video data into a storage queue U _ FIFO _ j _ A, storing U data of 8-15, 24-31, 40-47, …, 8+8m-8, m +7 columns of j, j +8, j +16, …, j +8n lines in target video data into a storage queue U _ FIFO _ j _ B, wherein j =0, 1, 2, … 7; storing V data of 0-7, 16-23, 32-39, …, 8m-8m +7 columns of k, k +8, k +16, …, k +8n lines in the target video data into a storage queue V _ FIFO _ k _ a, storing V data of 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 columns of k, k +8, k +16, …, k +8n lines in the target video data into a storage queue V _ FIFO _ k _ B, k =0, 1, 2, … 7; 7+8n is used to represent the total number of rows of the target video data, and 8+8m +7 is used to represent the total number of columns of the target video data.
Correspondingly, in the process of reading out the target BLOCK data BLOCK to be compressed from the storage queue, 8 times of storage queue Y _ FIFO _ i _ a are read, and 8 times of storage queue Y _ FIFO _ i _ B are read simultaneously, so that the adjacent target BLOCK data BLOCK with the size of 8 × 8 in the type Y is obtained, i =0, 1, 2, … 7; reading 8 times of storage queues U _ FIFO _ j _ A, and simultaneously reading 8 times of storage queues U _ FIFO _ j _ B to obtain adjacent target BLOCK data BLOCKs with U type size of 8 × 8, wherein j =0, 1, 2, … 7; reading the 8 times of storage queue V _ FIFO _ k _ a and simultaneously reading the 8 times of storage queue V _ FIFO _ k _ B results in a V-type data BLOCK of size 8 × 8 and adjacent target BLOCK, k =0, 1, 2, … 7.
Referring to fig. 4, fig. 4 is a third flowchart of a video compression method according to an embodiment of the present disclosure.
The video compression method provided by the embodiment of the application can comprise the following steps:
step S301: video data to be compressed is acquired.
Step S302: and converting the video data into target video data in a YUV format.
Step S303: YUV write logic for the target video data is determined.
Step S304: and respectively writing adjacent data in the target video data into corresponding storage queues according to YUV writing logic.
Step S305: the target BLOCK data BLOCK to be compressed is read from the store queue.
Step S306: and determining a first BLOCK data BLOCK and a second BLOCK data BLOCK which are adjacent in the target BLOCK data BLOCK.
Step S307: and acquiring a third BLOCK data BLOCK which is completely compressed and is adjacent to the first BLOCK data BLOCK, and acquiring a fourth BLOCK data BLOCK which is completely compressed and is adjacent to the second BLOCK data BLOCK.
Step S308: and determining the compression results of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on the compression results of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK.
In practical application, when a target BLOCK data BLOCK is compressed according to a compression rule that only one BLOCK data BLOCK is compressed when adjacent BLOCK data BLOCKs are the same, and a compression result is obtained, a first BLOCK data BLOCK and a second BLOCK data BLOCK which are adjacent to each other can be determined in the target BLOCK data BLOCK; acquiring a third BLOCK data BLOCK which is completely compressed and is adjacent to the first BLOCK data BLOCK, and acquiring a fourth BLOCK data BLOCK which is completely compressed and is adjacent to the second BLOCK data BLOCK; and determining the compression results of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on the compression results of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK. That is, the compression result of the target BLOCK data BLOCK can be quickly determined based on the compression result of the BLOCK data BLOCK whose compression has been completed.
In a specific application scenario, in the process of determining the compression results of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on the compression results of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK, whether the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK or not can be judged, whether the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK or not can be judged, and whether the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK or not can be judged;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain a compression result of the first BLOCK data BLOCK, and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is not the same as the fourth BLOCK data BLOCK, compressing the second BLOCK data BLOCK to obtain a compression result of the second BLOCK data BLOCK, and taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain the compression results of the first BLOCK data BLOCK and the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is different from the second BLOCK data BLOCK, the first BLOCK data BLOCK is compressed to obtain a compression result of the first BLOCK data BLOCK, and the second BLOCK data BLOCK is compressed to obtain a compression result of the second BLOCK data BLOCK.
It should be noted that, in a specific application scenario, the compression results of the first BLOCK data BLOCK and the second BLOCK data BLOCK may be determined by means of a comparator based on the compression results of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK, specifically, it is assumed that the implementation subject of the present application is a baseboard management controller and the structure of the baseboard management controller is shown in fig. 5, a VIDEO COMPRESS internal data processing flow is shown in fig. 6, the third BLOCK data BLOCK is a, the fourth BLOCK data BLOCK is B, the first BLOCK data BLOCK is C, the second BLOCK is D, and it is assumed that a _ BLOCK data is Y data of 0 th row to 15 th row, 0 column to 15 column, B _ BLOCK data is Y data of 0 th row to 15 th row, 16 column to 31 th column, and C _ BLOCK data is Y data of 16 th row to 31 th row, 0 column to 15 th column, and D _ BLOCK data is Y data of 16 th row to 31 th column, the position relationship between the four data blocks is shown in fig. 7, and the compression process may be as follows:
BLOCK _ DATA _ COMPARE module COMPAREs a _ BLOCK and C _ BLOCK based on comparator 1; comparing B _ BLOCK and D _ BLOCK based on comparator 2; comparing C _ BLOCK and D _ BLOCK based on comparator 3;
after C and D are read out, judging C and A, judging D and B, if the C and A data are consistent (the error of the comparison result is less than 10 percent (the threshold value can be configured in a register by a user), then C is not compressed, D is the same as B, D is not compressed, and the comparison result is represented by COMPARE _ FLAG = 3' B001, wherein the COMPARE _ FLAG represents a FLAG bit of the comparison result;
if C is different from A, C is compressed, and if D is the same as B, D is not compressed, and the comparison result is represented by COMPARE _ FLAG = 3' B010;
if C is the same as A, C is not compressed, and D is not the same as B, D is compressed, and the comparison result is represented by COMPARE _ FLAG = 3' B011;
if C is different from A, B is different from D, C and D are compared, if D is the same as C, C is compressed, D is not compressed, and the comparison result is represented by COMPARE _ FLAG = 3' B100; if D and C are different, C and D are compressed, and the comparison result is represented by COMPARE _ FLAG = 3' b 101;
5 types of results are output through a BLOCK _ DATA _ COMPARE module, and meanwhile, the judgment result is also output to a later-stage VIDEO COMPARE module;
then, the COMPRESS _ DATA _ BUFFER sub-module BUFFERs compressed DATA of the BLOCK DATA (maximum BUFFER 16 lines of YUV compressed DATA, and updates in real time), and records the sequence number of the current compressed BLOCK DATA, such as recording compressed DATA that is 1 BLOCK Y DATA, and compressed DATA that is 2BLOCK U DATA.
Meanwhile, a FLAG _ DETECT submodule added at the input end DETECTs a COMPARE _ FLAG signal corresponding to the current BLOCK data. If COMPARE _ FLAG = 3' B001, it indicates that the current C _ BLOCK and a _ BLOCK DATA are judged to be consistent, and the D _ BLOCK and B _ BLOCK DATA are judged to be consistent, then the C and D DATA do not need to be compressed repeatedly, and a control signal is directly output to a COMPARE _ DATA _ BUFFER submodule, which finds out the corresponding a and B compressed DATA from the corresponding BLOCK compressed DATA BUFFER, and directly outputs the compressed DATA to a subsequent framing submodule. If COMPARE _ FLAG = 3' B010, it indicates that the C _ BLOCK data and the a _ BLOCK data are inconsistent, and the D _ BLOCK data and the B _ BLOCK data are judged to be consistent, C data compression is performed, but D data is not compressed, and B compressed data is found directly from the compressed data buffer. If COMPARE _ FLAG = 3' B011, it indicates that the C _ BLOCK data is consistent with the a _ BLOCK data, and the D _ BLOCK data is determined to be inconsistent with the B _ BLOCK data, the D data is compressed, the C data is not compressed, and the compressed data of a is directly found from the compressed data buffer. If COMPARE _ FLAG = 3' b100, it indicates that the data of C and D are identical, only C may be compressed, and D may directly use the compressed data of C. If COMPARE _ FLAG = 3' b101, the data representing C and D are inconsistent, and the data of C and D are both compressed.
According to analysis, repeated compression of BLOCK area BLOCK data of the same frame adjacent BLOCK is avoided, the efficiency of video compression is greatly improved, especially under large resolution, the change of display data of a host operating system is very small, an interface displayed by a host end (server) basically does not change or certain areas of pictures change very little. Therefore, if the repeated compression of the BLOCK region BLOCK data of the adjacent BLOCK in the same frame is avoided, the efficiency of video compression can be greatly improved, and the performance of the execution main body of the video compression system is further improved. It should be noted that, although the number of the needed FIFOs is larger than that of the conventional scheme, because BLOCK data can be processed quickly, the depth of the FIFO of the present application is greatly reduced, for example, 48 FIFOs are needed in the conventional scheme, the depth is 16384, the width is 8bits, the total RAM resource is 768KB, and 96 FIFOs are needed in the present application, but the depth is only 4096 and the width is 8bits, the total RAM resource is changed from 48 × 16384 = 8/8=768KB to 96 × 4096 × 8/8=384KB, (16 rows and 16 columns of YUV data need to be added, the needed resource is 768B (negligible) and the compressed video data buffer, 16 rows of YUV compressed data are calculated according to 1920 × 1200 resolution, the 10 times compression ratio, and the needed space is 16 × 1200 × 3/10=5.6KB, which can also be ignored). Therefore, the video compression efficiency can be greatly improved under the condition of reducing RAM resources.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a video compression system according to an embodiment of the present disclosure.
The video compression system provided by the embodiment of the application can include:
a first obtaining module 101, configured to obtain video data to be compressed;
a first conversion module 102, configured to convert video data into target video data in a YUV format;
a first determining module 103, configured to determine YUV write logic of target video data;
the first writing module 104 is configured to write adjacent data in the target video data into corresponding storage queues according to the YUV writing logic;
a first reading module 105, configured to read a target BLOCK data BLOCK to be compressed from a storage queue;
the first compression module 106 is configured to compress the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
In an embodiment of the present invention, a video compression system, a first writing module may include:
the first determining unit is used for determining the dividing mode of adjacent data under YUV writing logic;
and the first writing unit is used for respectively writing the adjacent data in the target video data into the corresponding storage queues according to the YUV writing logic and the division mode.
In an embodiment of the video compression system, the first writing unit may be specifically configured to: and respectively writing adjacent data in the target video data into corresponding storage queues based on a ping-pong cache mode according to YUV write logic and a division mode.
According to the video compression system provided by the embodiment of the application, the division mode comprises a division mode taking row data and column data of target video data as units.
In an embodiment of the video compression system, the first writing unit may be specifically configured to: if the YUV write logic is YUV420 mode, storing Y data of columns i, i +16, i +32, …, 0-15, 32-47, 64-79, …, 32m-32m +15 of rows i, i +16n in the target video data into a storage queue Y _ FIFO _ i _ a, storing Y data of columns i, i +16, i +32, …, 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 of rows i, i =0, 1, 2, … 15 in the storage queue Y _ FIFO _ i _ B; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, j +16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in j, j =0, 2, 4, 3614 in j +16n in the target video data into a storage queue U _ FIFO _ j _ B; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in rows k, k +16, k +32, …, k +16n in the target video data into a storage queue V _ FIFO _ k _ a, storing V data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in rows k, k +16, k =0, 2, 4, … in rows k, k +16, V _ FIFO _ k _ B; 15+16n is used to represent the total number of rows of the target video data, and 16+32m +15 is used to represent the total number of columns of the target video data.
In an embodiment of the present application, a video compression system, a first reading module may include:
a first reading unit, configured to read the 16 times storage queue Y _ FIFO _ i _ a, and simultaneously read the 16 times storage queue Y _ FIFO _ i _ B, to obtain a Y-type adjacent target BLOCK data BLOCK, i =0, 1, 2, … 15; reading the storage queue U _ FIFO _ j _ a for 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B for 8 times to obtain adjacent target BLOCK data BLOCKs of U type, j =0, 2, 4, … 14; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times, results in the adjacent target BLOCK data BLOCK of type V, k =0, 2, 4, … 14.
In an embodiment of the video compression system, the first writing unit may be specifically configured to: if the YUV write logic is in YUV422 mode, storing Y data of columns 0-15, 32-47, 64-79, …, 32m-32m +15 of rows i, i +16, i +32, …, i +16n in the target video data into a storage queue Y _ FIFO _ i _ A, storing Y data of columns 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 of rows i, i +16, i +32, …, i +16n in the target video data into a storage queue Y _ FIFO _ i _ B, wherein i =0, 1, 2, … 15; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, j +16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in j, j =0, 1, 2, 3615 in j +16n in the storage queue U _ FIFO _ j _ B; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in rows k, k +16, k +32, …, k +16n in the target video data into a storage queue V _ FIFO _ k _ a, storing V data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in rows k, k +16, k =0, 1, 2, 3615 in rows k, k +16, V _ FIFO _ k _ B; 15+16n is used to represent the total number of rows of the target video data, and 16+32m +15 is used to represent the total number of columns of the target video data.
In an embodiment of the present application, a video compression system, a first reading module may include:
a second reading unit, configured to read the 16 times storage queue Y _ FIFO _ i _ a, and read the 16 times storage queue Y _ FIFO _ i _ B at the same time, to obtain an adjacent target BLOCK data BLOCK of Y type, i =0, 1, 2, … 15; reading the storage queue U _ FIFO _ j _ a for 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B for 8 times to obtain adjacent target BLOCK data BLOCKs of U type, j =0, 1, 2, … 15; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times, results in the adjacent target BLOCK data BLOCK of type V, k =0, 1, 2, … 15.
In an embodiment of the video compression system, the first writing unit may be specifically configured to: if the YUV write logic is YUV444 mode, storing Y data of the i, i +8, i +16, …, Y +8 th column of 0-7, 16-23, 32-39, …, 8m-8m +7 th row in the target video data into the storage queue Y _ FIFO _ i _ a, storing Y data of the i, i +8, i +16, …, 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 th column in the target video data into the storage queue Y _ FIFO _ i _ B, wherein i =0, 1, 2, … 7; storing U data of 0-7, 16-23, 32-39, …, 8m-8m +7 columns of j, j +8, j +16, …, j +8n rows in the target video data into a storage queue U _ FIFO _ j _ A, storing U data of 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 columns of j, j +8, j +16, …, j +8n rows in the target video data into a storage queue U _ FIFO _ j _ B, wherein j =0, 1, 2, … 7; storing V data of 0-7, 16-23, 32-39, …, 8m-8m +7 columns of k, k +8, k +16, …, k +8n lines in the target video data into a storage queue V _ FIFO _ k _ a, storing V data of 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 columns of k, k +8, k +16, …, k +8n lines in the target video data into a storage queue V _ FIFO _ k _ B, k =0, 1, 2, … 7; 7+8n is used to represent the total number of rows of the target video data, and 8+8m +7 is used to represent the total number of columns of the target video data.
In an embodiment of the present invention, a video compression system, a first reading module may include:
a third reading unit, configured to read the 8 times storage queue Y _ FIFO _ i _ a, and simultaneously read the 8 times storage queue Y _ FIFO _ i _ B, to obtain a neighboring target BLOCK data BLOCK of Y type, i =0, 1, 2, … 7; reading the storage queue U _ FIFO _ j _ a for 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B for 8 times to obtain adjacent target BLOCK data BLOCKs of U type, j =0, 1, 2, … 7; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times, results in the adjacent target BLOCK data BLOCK of type V, k =0, 1, 2, … 7.
In an embodiment of the present application, a video compression system, a first compression module may include:
a second determining unit, configured to determine, in the target BLOCK data BLOCK, a first BLOCK data BLOCK and a second BLOCK data BLOCK that are adjacent to each other;
a first obtaining unit, configured to obtain a third BLOCK data BLOCK that is already compressed and is adjacent to the first BLOCK data BLOCK, and obtain a fourth BLOCK data BLOCK that is already compressed and is adjacent to the second BLOCK data BLOCK;
and the first compression unit is used for determining the compression results of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on the compression results of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK.
In an embodiment of the video compression system, the first compression unit may be specifically configured to: judging whether the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK, judging whether the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, and judging whether the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain a compression result of the first BLOCK data BLOCK, and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, compressing the second BLOCK data BLOCK to obtain a compression result of the second BLOCK data BLOCK, and taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain the compression results of the first BLOCK data BLOCK and the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is different from the second BLOCK data BLOCK, the first BLOCK data BLOCK is compressed to obtain a compression result of the first BLOCK data BLOCK, and the second BLOCK data BLOCK is compressed to obtain a compression result of the second BLOCK data BLOCK.
The application also provides an electronic device and a computer readable storage medium, which both have the corresponding effects of the video compression method provided by the embodiment of the application. Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
An electronic device provided in an embodiment of the present application includes
A receiving port 201 for receiving video data to be compressed;
an RGB2YUV (RGB to YUV) component 202 connected to the receiving port 201 for converting video data into target video data in YUV format;
a YUV2BLOCK component 203 coupled to the RGB2YUV component 202 for determining YUV write logic for the target video data; respectively writing adjacent data in the target video data into corresponding storage queues according to YUV writing logic;
the compression processing component 204 is connected with the YUV2BLOCK component 203 and is used for reading out a target BLOCK data BLOCK to be compressed from the storage queue; and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
Referring to fig. 10, in another electronic device provided in the embodiment of the present application, the compressing component 204 may include:
the data BLOCK comparator 211 connected to the YUV2BLOCK component 203 is configured to read a target BLOCK data BLOCK to be compressed from the storage queue, and determine whether the target BLOCK is the same as another BLOCK data BLOCK adjacent to the target BLOCK, so as to obtain a comparison result;
and a VIDEO compression component 212 connected to the YUV2BLOCK component 203 and the data BLOCK comparator 211, configured to COMPRESS the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, based on the comparison result, so as to obtain a compression result.
It should be noted that the electronic device provided in this embodiment may be expanded according to a specific application scenario, for example, the receiving port may be connected to a server, a camera, a client, and the like, so as to receive video data to be compressed, which is transmitted by the server, the camera, the client, and the like; the electronic device may further be connected to a storage medium, such as a DDR (double data rate synchronous dynamic random access memory), which is used to store the compression result of the VIDEO data, and transmit the compression result stored in the storage medium to a corresponding VIDEO data receiving end when needed, for example, an EMAC (ethernet media access control module) may be disposed in the electronic device, and the storage medium is connected to a VIDEO component, and the EMAC is connected to the storage medium, so that the compression result of the VIDEO data is transmitted to the corresponding VIDEO data receiving end through the EMAC, where the structure is shown in fig. 11; in addition, a display unit connected to the VIDEO component may be further disposed in the electronic device, so that the electronic device may directly display a compression result of the VIDEO data and the like based on the display unit, and the present application is not particularly limited herein.
The computer-readable storage medium provided in the embodiments of the present application stores a computer program, and when the computer program is executed by a processor, the steps of the video compression method described in any of the following embodiments are implemented.
The computer-readable storage media to which this application relates include Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage media known in the art.
For a description of a relevant part in a video compression system, an electronic device, and a computer-readable storage medium provided in the embodiments of the present application, please refer to a detailed description of a corresponding part in a video compression method provided in the embodiments of the present application, which is not repeated herein. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (16)

1. A method of video compression, comprising:
acquiring video data to be compressed;
converting the video data into target video data in a YUV format;
determining YUV writing logic of the target video data;
according to the YUV writing logic, respectively writing adjacent data in the target video data into corresponding storage queues;
reading out a target BLOCK data BLOCK to be compressed from the storage queue;
and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
2. The method according to claim 1, wherein said writing the neighboring data in the target video data into the corresponding storage queues according to the YUV write logic respectively comprises:
determining the dividing mode of the adjacent data under the YUV writing logic;
and respectively writing the adjacent data in the target video data into the corresponding storage queues according to the YUV writing logic and the dividing mode.
3. The method according to claim 2, wherein said writing the neighboring data in the target video data into the corresponding storage queue according to the YUV write logic and the partition manner respectively comprises:
and respectively writing the adjacent data in the target video data into the corresponding storage queues based on a ping-pong cache mode according to the YUV writing logic and the dividing mode.
4. The method of claim 3, wherein the division comprises a division in units of row data and column data of the target video data.
5. The method according to claim 4, wherein said writing the neighboring data in the target video data into the corresponding storage queue based on a ping-pong buffer manner according to the YUV write logic and the dividing manner, respectively comprises:
if the YUV write logic is in YUV420 mode, storing Y data of columns i, i +16, i +32, …, 0-15, 32-47, 64-79, …, 32m-32m +15 of rows i, i +16n in the target video data into a storage queue Y _ FIFO _ i _ a, storing Y data of columns 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 of rows i, i +16, i +32, …, i +16n in the target video data into a storage queue Y _ FIFO _ i _ B, and i =0, 1, 2, … 15; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, 16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, … 94, …, 16+32m +2, …, 16+32m +14 in j, j =0, 2, 4, … in j +16n in the target video data; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in k, k +16, k +32, …, k +16n lines 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in the target video data into a storage queue V _ FIFO _ k _ B, where k =0, 2, 4, …; 15+16n is used to represent the total number of rows of the target video data, and 16+32m +15 is used to represent the total number of columns of the target video data.
6. The method of claim 5, wherein reading out the target BLOCK data BLOCK to be compressed from the store queue comprises:
reading the storage queue Y _ FIFO _ i _ a 16 times, and simultaneously reading the storage queue Y _ FIFO _ i _ B16 times to obtain the adjacent target BLOCK data BLOCK of Y type, i =0, 1, 2, … 15; reading the storage queue U _ FIFO _ j _ a 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B8 times to obtain the adjacent target BLOCK data BLOCK of U type, j =0, 2, 4, … 14; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times, to obtain the target BLOCK of BLOCK data adjacent to the V type, k =0, 2, 4, … 14.
7. The method according to claim 4, wherein said writing the neighboring data in the target video data into the corresponding storage queue based on a ping-pong buffer manner according to the YUV write logic and the dividing manner, respectively comprises:
if the YUV write logic is in a YUV422 mode, storing Y data of columns 0-15, 32-47, 64-79, …, 32m-32m +15 of rows i, i +16, i +32, …, i +16n in the target video data into a storage queue Y _ FIFO _ i _ A, storing Y data of columns 16-31, 48-63, 80-95, …, 16+32m-16+32m +15 of rows i, i +16, i +32, …, i +16n in the target video data into a storage queue Y _ FIFO _ i _ B, and i =0, 1, 2, … 15; storing U data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in j, j +16, j +32, …, j +16n in the target video data into a storage queue U _ FIFO _ j _ a, storing U data of columns 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, … 94, …, 16+32m +2, …, 16+32m +14 in j, j =0, 1, 2, … in j +16n in the target video data into a storage queue U _ FIFO _ j _ B; storing V data of columns 0, 2, 4, …, 14, 32, 34, 36, …, 46, 64, 66, 68, …, 78, …, 32m +2, …, 32m +14 in k, k +16, k +32, …, k +16n lines 16, 18, 20, …, 30, 48, 50, 52, …, 62, 80, 82, 84, …, …, 16+32m +2, …, 16+32m +14 in the target video data into a storage queue V _ FIFO _ k _ B, where k =0, 1, 2, …; 15+16n is used to represent the total number of rows of the target video data, and 16+32m +15 is used to represent the total number of columns of the target video data.
8. The method of claim 7, wherein reading out a target BLOCK of data to be compressed from the store queue comprises:
reading the storage queue Y _ FIFO _ i _ a 16 times, and simultaneously reading the storage queue Y _ FIFO _ i _ B16 times to obtain the adjacent target BLOCK data BLOCK of Y type, i =0, 1, 2, … 15; reading the storage queue U _ FIFO _ j _ a 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B8 times to obtain the adjacent target BLOCK data BLOCK of U type, j =0, 1, 2, … 15; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times, to obtain the target BLOCK of BLOCK data adjacent to the V type, k =0, 1, 2, … 15.
9. The method according to claim 4, wherein said writing the neighboring data in the target video data into the corresponding storage queue based on a ping-pong buffer manner according to the YUV write logic and the dividing manner, respectively comprises:
if the YUV write logic is YUV444 mode, storing Y data of columns 0-7, 16-23, 32-39, …, 8m-8m +7 of rows i, i +8, i +16, …, i +8n in the target video data into a storage queue Y _ FIFO _ i _ a, storing Y data of columns 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 of rows i, i +8, i +16, …, i +8n in the target video data into a storage queue Y _ FIFO _ i _ B, i =0, 1, 2, … 7; storing U data of 0-7, 16-23, 32-39, …, 8m-8m +7 columns of j, j +8, j +16, …, j +8n rows in the target video data into a storage queue U _ FIFO _ j _ A, storing U data of 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 columns of j, j +8, j +16, …, j +8n rows in the target video data into a storage queue U _ FIFO _ j _ B, wherein j =0, 1, 2, … 7; storing V data of 0-7, 16-23, 32-39, …, 8m-8m +7 columns of k, k +8, k +16, …, k +8n lines in the target video data into a storage queue V _ FIFO _ k _ a, storing V data of 8-15, 24-31, 40-47, …, 8+8m-8+8m +7 columns of k, k +8, k +16, …, k +8n lines in the target video data into a storage queue V _ FIFO _ k _ B, k =0, 1, 2, … 7; 7+8n is used to represent the total number of rows of the target video data, and 8+8m +7 is used to represent the total number of columns of the target video data.
10. The method of claim 9, wherein reading out a target BLOCK of data to be compressed from the store queue comprises:
reading the storage queue Y _ FIFO _ i _ a 8 times, and simultaneously reading the storage queue Y _ FIFO _ i _ B8 times to obtain the adjacent target BLOCK data BLOCK of Y type, i =0, 1, 2, … 7; reading the storage queue U _ FIFO _ j _ a 8 times, and simultaneously reading the storage queue U _ FIFO _ j _ B8 times to obtain the adjacent target BLOCK data BLOCK of U type, j =0, 1, 2, … 7; reading the storage queue V _ FIFO _ k _ a 8 times, and simultaneously reading the storage queue V _ FIFO _ k _ B8 times, to obtain the target BLOCK of BLOCK data adjacent to the V type, k =0, 1, 2, … 7.
11. The method according to any one of claims 1 to 10, wherein the compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when adjacent BLOCK data BLOCKs are the same to obtain a compression result comprises:
determining a first BLOCK data BLOCK and a second BLOCK data BLOCK which are adjacent in the target BLOCK data BLOCK;
acquiring a third BLOCK data BLOCK which is completely compressed and is adjacent to the first BLOCK data BLOCK, and acquiring a fourth BLOCK data BLOCK which is completely compressed and is adjacent to the second BLOCK data BLOCK;
determining a compression result of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on a compression result of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK.
12. The method of claim 11, wherein the determining the compression result of the first BLOCK data BLOCK and the second BLOCK data BLOCK based on the compression result of the third BLOCK data BLOCK and the fourth BLOCK data BLOCK comprises:
judging whether the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK, judging whether the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, and judging whether the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK and the second BLOCK data BLOCK is the same as the fourth BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain a compression result of the first BLOCK data BLOCK, and taking the compression result of the fourth BLOCK data BLOCK as the compression result of the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is the same as the third BLOCK data BLOCK and the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, compressing the second BLOCK data BLOCK to obtain a compression result of the second BLOCK data BLOCK, and taking the compression result of the third BLOCK data BLOCK as the compression result of the first BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is the same as the second BLOCK data BLOCK, compressing the first BLOCK data BLOCK to obtain a compression result of the first BLOCK data BLOCK and the second BLOCK data BLOCK;
if the first BLOCK data BLOCK is different from the third BLOCK data BLOCK, the second BLOCK data BLOCK is different from the fourth BLOCK data BLOCK, and the first BLOCK data BLOCK is different from the second BLOCK data BLOCK, the first BLOCK data BLOCK is compressed to obtain a compression result of the first BLOCK data BLOCK, and the second BLOCK data BLOCK is compressed to obtain a compression result of the second BLOCK data BLOCK.
13. A video compression system, comprising:
the first acquisition module is used for acquiring video data to be compressed;
the first conversion module is used for converting the video data into target video data in a YUV format;
a first determining module, configured to determine YUV write logic of the target video data;
the first writing module is used for respectively writing adjacent data in the target video data into corresponding storage queues according to the YUV writing logic;
the first reading module is used for reading out a target BLOCK data BLOCK to be compressed from the storage queue;
and the first compression module is used for compressing the target BLOCK data BLOCK according to the compression rule that when the adjacent BLOCK data BLOCKs are the same, only one BLOCK data BLOCK is compressed, so that a compression result is obtained.
14. An electronic device, comprising:
a receiving port for receiving video data to be compressed;
the RGB-to-YUV component is connected with the receiving port and is used for converting the video data into target video data in a YUV format;
a YUV conversion block component connected with the RGB to YUV component and used for determining YUV writing logic of the target video data; according to the YUV writing logic, respectively writing adjacent data in the target video data into corresponding storage queues;
the compression processing component is connected with the YUV BLOCK conversion component and is used for reading out a target BLOCK data BLOCK to be compressed from the storage queue; and compressing the target BLOCK data BLOCK according to a compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same, so as to obtain a compression result.
15. The electronic device of claim 14, wherein the compression processing component comprises:
the data BLOCK comparator is connected with the YUV conversion BLOCK assembly and used for reading the target BLOCK data BLOCK to be compressed from the storage queue and judging whether the target BLOCK is the same as other adjacent BLOCK data BLOCKs or not to obtain a comparison result;
and the video compression component is connected with the YUV conversion BLOCK component and the data BLOCK comparator and used for compressing the target BLOCK data BLOCK according to the comparison result and the compression rule that only one BLOCK data BLOCK is compressed when the adjacent BLOCK data BLOCKs are the same so as to obtain the compression result.
16. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a video compression method as claimed in any one of claims 1 to 12.
CN202210856065.0A 2022-07-21 2022-07-21 Video compression method, system, equipment and computer readable storage medium Active CN115086668B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210856065.0A CN115086668B (en) 2022-07-21 2022-07-21 Video compression method, system, equipment and computer readable storage medium
PCT/CN2022/130403 WO2024016520A1 (en) 2022-07-21 2022-11-07 Video compression method, system and device, and computer non-volatile readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210856065.0A CN115086668B (en) 2022-07-21 2022-07-21 Video compression method, system, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN115086668A true CN115086668A (en) 2022-09-20
CN115086668B CN115086668B (en) 2023-01-10

Family

ID=83260554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210856065.0A Active CN115086668B (en) 2022-07-21 2022-07-21 Video compression method, system, equipment and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN115086668B (en)
WO (1) WO2024016520A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499667A (en) * 2022-11-17 2022-12-20 山东云海国创云计算装备产业创新中心有限公司 Video processing method, device and equipment and readable storage medium
CN117032598A (en) * 2023-10-09 2023-11-10 苏州元脑智能科技有限公司 YUV video transmission frame, baseboard management controller, method, equipment and medium
WO2024016520A1 (en) * 2022-07-21 2024-01-25 苏州元脑智能科技有限公司 Video compression method, system and device, and computer non-volatile readable storage medium
WO2024098715A1 (en) * 2022-11-11 2024-05-16 苏州元脑智能科技有限公司 Video compression method and system for baseboard management control chip, and related components

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422801A (en) * 2021-12-31 2022-04-29 山东云海国创云计算装备产业创新中心有限公司 Method, system, device and storage medium for optimizing video compression control logic
CN114443513A (en) * 2022-04-08 2022-05-06 苏州浪潮智能科技有限公司 Video data reading and writing method and related device
CN114501024A (en) * 2022-04-02 2022-05-13 苏州浪潮智能科技有限公司 Video compression system, method, computer readable storage medium and server

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012244235A (en) * 2011-05-16 2012-12-10 Renesas Electronics Corp Data compression method, apparatus, and program
CN107547904B (en) * 2017-09-05 2020-09-18 苏州浪潮智能科技有限公司 FPGA-based YUV data 8x8block conversion method and device in video compression
CN109743578B (en) * 2018-12-29 2021-08-10 惠科股份有限公司 Data processing method and data processing system
CN115086668B (en) * 2022-07-21 2023-01-10 苏州浪潮智能科技有限公司 Video compression method, system, equipment and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422801A (en) * 2021-12-31 2022-04-29 山东云海国创云计算装备产业创新中心有限公司 Method, system, device and storage medium for optimizing video compression control logic
CN114501024A (en) * 2022-04-02 2022-05-13 苏州浪潮智能科技有限公司 Video compression system, method, computer readable storage medium and server
CN114443513A (en) * 2022-04-08 2022-05-06 苏州浪潮智能科技有限公司 Video data reading and writing method and related device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024016520A1 (en) * 2022-07-21 2024-01-25 苏州元脑智能科技有限公司 Video compression method, system and device, and computer non-volatile readable storage medium
WO2024098715A1 (en) * 2022-11-11 2024-05-16 苏州元脑智能科技有限公司 Video compression method and system for baseboard management control chip, and related components
CN115499667A (en) * 2022-11-17 2022-12-20 山东云海国创云计算装备产业创新中心有限公司 Video processing method, device and equipment and readable storage medium
CN115499667B (en) * 2022-11-17 2023-07-14 山东云海国创云计算装备产业创新中心有限公司 Video processing method, device, equipment and readable storage medium
CN117032598A (en) * 2023-10-09 2023-11-10 苏州元脑智能科技有限公司 YUV video transmission frame, baseboard management controller, method, equipment and medium
CN117032598B (en) * 2023-10-09 2024-01-26 苏州元脑智能科技有限公司 YUV video transmission system, baseboard management controller, method, equipment and medium

Also Published As

Publication number Publication date
WO2024016520A1 (en) 2024-01-25
CN115086668B (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN115086668B (en) Video compression method, system, equipment and computer readable storage medium
WO2015120818A1 (en) Picture coding and decoding methods and devices
WO2019105179A1 (en) Intra-frame prediction method and device for color component
US8873625B2 (en) Enhanced compression in representing non-frame-edge blocks of image frames
EP3089453A1 (en) Image coding and decoding methods and devices
CN107155093B (en) Video preview method, device and equipment
CN113709489B (en) Video compression method, device, equipment and readable storage medium
EP3002948A1 (en) Decoder, decoding method, and codec system
US9967565B2 (en) Image compression method based on local dynamic quantizing
WO2020224551A1 (en) Information compression/decompression methods and apparatuses, and storage medium
US10110896B2 (en) Adaptive motion JPEG encoding method and system
CN115460414A (en) Video compression method and system of baseboard management control chip and related components
CN115209145A (en) Video compression method, system, device and readable storage medium
CA2774940C (en) Joint scalar embedded graphics coding for color images
CN116634089B (en) Video transmission method, device, equipment and storage medium
CN103975583A (en) Capturing multiple video channels for video analytics and encoding
CN111815502A (en) FPGA (field programmable Gate array) acceleration method for multi-image processing based on WebP (Web Page) compression algorithm
CN116347089A (en) JPEG image processing method and device, electronic equipment and storage medium
CN106817583B (en) HEVC SAO calculation method and device
CN107172425B (en) Thumbnail generation method and device and terminal equipment
CN114554126B (en) Baseboard management control chip, video data transmission method and server
TWI825410B (en) Image processing methods, devices, photographic equipment and storage media
CN117750025B (en) Image data processing method, device, chip, equipment and medium
US20240064298A1 (en) Loop filtering, video encoding, and video decoding methods and apparatus, storage medium, and electronic device
JP3645690B2 (en) Image compression apparatus and camera

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant