WO2023185094A1 - Video compression system and method, computer readable storage medium, and server - Google Patents

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

Info

Publication number
WO2023185094A1
WO2023185094A1 PCT/CN2022/138326 CN2022138326W WO2023185094A1 WO 2023185094 A1 WO2023185094 A1 WO 2023185094A1 CN 2022138326 W CN2022138326 W CN 2022138326W WO 2023185094 A1 WO2023185094 A1 WO 2023185094A1
Authority
WO
WIPO (PCT)
Prior art keywords
component
data
fifo
read
control module
Prior art date
Application number
PCT/CN2022/138326
Other languages
French (fr)
Chinese (zh)
Inventor
张贞雷
李拓
满宏涛
刘同强
周玉龙
邹晓峰
王贤坤
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2023185094A1 publication Critical patent/WO2023185094A1/en

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/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/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • H04N19/426Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements using memory downsizing methods
    • 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

Definitions

  • This application relates to a video compression system, method, computer-readable storage medium and server.
  • the video compression system in traditional baseboard management control chips has the following two solutions:
  • Option 1 After the video data on the host side is transmitted to the baseboard management control chip through PCIe (Peripheral Component Interconnect Express, high-speed serial computer expansion bus standard), RGB (Red Green Blue, red, green and blue) original video information is generated and written to Off-chip DDR (Double Data Rate, double rate synchronous dynamic random access memory) is cached, and the original RGB format video data is converted into YUV (color encoding method, Y represents brightness (Luminance) through the color space conversion module (RGB2YUV) , Luma), U and V are data in the format of chrominance, concentration (Chrominance, Chroma), and then the Y, U, and V data are stored in the DDR space (Y_addr, U_addr, V_addr) at different off-chip starting addresses.
  • PCIe Peripheral Component Interconnect Express, high-speed serial computer expansion bus standard
  • RGB Red Green Blue, red, green and blue
  • DDR Double Data Rate, double rate synchronous dynamic random
  • the CMP video compression control module
  • the CMP video compression control module
  • the CMP generates the address of the off-chip DDR in the order of BLOCK data according to the requirements of the video compression IP, and then inputs it to the video compression control module in the order of BLOCK data.
  • the data Write to DDR EMAC (Ethernet Media Access Control, Ethernet Media Access Control) network card driver reads the compressed data, and transmits the video data to the remote through the network for remote display.
  • EMAC Ethernet Media Access Control, Ethernet Media Access Control
  • Option 2 After the video data on the host side is transferred to the substrate management control chip through PCIe, the original RGB video information is generated and written to the off-chip DDR for caching.
  • the original RGB format video data is converted to the original RGB format video data through the color space conversion module (RGB2YUV). Convert to YUV format data, and then cache the Y, U, and V data using on-chip storage resources (FIFO).
  • FIFO on-chip storage resources
  • the depth of FIFO ((First in First out, first in first out)) is 16384, and the width is 8bits.
  • the required The total storage capacity of FIFO is 768KB, so that the FIFO will not be full and data will not be lost.
  • the disadvantage of traditional solution 1 is that the baseboard management control chip needs to access the off-chip DDR very frequently, resulting in a high memory bandwidth occupied by the video function, which greatly affects other software running on the CPU (Central Processing Unit, central processing unit). Memory access affects the overall performance of the baseboard management control chip.
  • this application proposes a video compression system, method, computer-readable storage medium and server.
  • a video compression system for substrate management control chip The video compression system specifically includes:
  • Color space conversion module memory
  • FIFO array module read and write control module
  • video compression control module video compression control module.
  • the memory includes cache space and compressed data storage space.
  • the FIFO array module includes multiple FIFOs. The FIFO is used to store the Y component or V component or U component data;
  • the baseboard management control chip is configured to write the received RGB video data into the cache space in a row;
  • the color space conversion module is configured to read each line of RGB video data from the cache space in sequence, and convert the RGB video data into Y component, U component and V component data;
  • the FIFO array module is configured to set the bit width of the FIFO based on the number of FIFOs so that the FIFO can store the Y component, U component, or V component data of two adjacent rows at the same time;
  • the read-write control module is configured to read the Y component, U component and V component data at the corresponding position in each clock cycle, and write them in parallel to the corresponding FIFO for caching;
  • the read-write control module is also configured to read the corresponding positions of two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array after receiving the read data request from the video compression control module.
  • the Y component or U component or V component data constitutes BLOCK data and is sent to the video compression control module;
  • the video compression control module is configured to compress the received BLOCK data and write the compressed data into the compressed data storage space.
  • a video compression method for substrate management control chip executed based on the above video compression system, includes the following steps:
  • the baseboard management control chip writes the received RGB video data into the buffer space in rows
  • the color space conversion module reads each line of RGB video data from the cache space in turn, and converts the RGB video data into Y component, U component and V component data;
  • the FIFO array module sets the bit width of the FIFO based on the number of FIFOs so that the FIFO can store the Y component, U component, or V component data of two adjacent rows at the same time;
  • the read-write control module reads the Y component, U component and V component data at the corresponding position of each row in each clock cycle, and writes them in parallel to the corresponding FIFO for caching;
  • the read-write control module After receiving the read data request from the video compression control module, the read-write control module reads the Y components of the corresponding positions of two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array.
  • the U component or V component data is composed of BLOCK data and sent to the video compression control module;
  • the video compression control module compresses the received BLOCK data and writes the compressed data into the compressed data storage space.
  • a non-transitory computer-readable storage medium stores computer-readable instructions that implement the above method steps when executed by a processor.
  • a server includes the above video compression system.
  • Figure 1 is a schematic diagram of a traditional video compression system
  • Figure 2 is a schematic diagram of the BLOCK data composition required by different YUV compression formats
  • Figure 3 is a schematic diagram of a video compression system for a substrate management control chip provided by an embodiment of the present application
  • Figure 4 is a schematic diagram comparing the storage of Y component data in the video compression system provided by the embodiment of the present application and the storage of Y component data in the traditional video compression system;
  • Figure 5 is a schematic diagram comparing the storage of U component data in the video compression system provided by the embodiment of the present application and the storage of U component data in the traditional video compression system;
  • Figure 6 is a schematic diagram comparing the storage of V component data in the video compression system provided by the embodiment of the present application and the storage of V component data in the traditional video compression system;
  • Figure 7 is a block diagram of a video compression method for a baseboard management control chip provided by an embodiment of the present application.
  • Figure 8 is a schematic structural diagram of a non-transitory computer-readable storage medium provided by an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • FIG. 1 it is a schematic diagram of the video compression system of traditional solution 2.
  • FIG. 2 it shows the BLOCK data composition required by different YUV compression formats.
  • Cb represents the U component
  • Cr represents the V component
  • the left side of Figure 2 is the source image picture (Source Image Picture) of the video data in YUV format. After discrete cosine transform (Discrete Cosine Transform, referred to as DCT), Form BLOCK format data for storage.
  • DCT discrete cosine transform
  • height represents the height of the box
  • width represents the width of the box.
  • Each small box represents the 8*8 pixels on the left side of Figure 2
  • the large box represents 16*16 Pixels
  • the rectangular box is 8*16 pixels.
  • the Y block represents the Y component of four 8*8 pixels
  • the Cb block represents the U component of one 8*8 block
  • the Cr block represents the V component of one 8*8 block.
  • Video CMP Video Compression Control Module
  • Video CMP Video Compression Control Module
  • the current compression format is YUV422
  • Video CMP should generate the address sequence of reading the Y component of 16*16, the address sequence of the U component of 8*16, and the address sequence of the V component of 8*16. Then it loops in sequence; if the current compression format is YUV444, Video CMP should generate the address sequence of reading the Y component of 8*8, the address sequence of the U component of 8*8, the address sequence of the V component of 8*8, and then loop in sequence. .
  • the video data on the host side is in RGB format.
  • the RGB original video information is generated and written to the off-chip DDR for caching.
  • the color space The conversion module (RGB2YUV) reads RGB format video data from off-chip DDR, converts the original RGB format video data into YUV format data, and then the read and write control module (FIFO_CTRL) reads the video data in RGB format according to the compression format (supports YUV444/YUV422/YUV420 Compression format) reads the converted YUV format data, caches the Y, U, and V data using the on-chip FIFO array (FIFO_ARRAY), and reads it from the FIFO array according to the requirements of the BLOCK format and sends it to the video compression control module (Video CMP), under the traditional solution, in order to meet the conversion requirements of the BLOCK format, 16 Y_FIFOs, 16 U_FIFO
  • FIFO_CTRL FIFO read-write control module
  • FIFO_CTRL The YUV data writing control logic through FIFO_CTRL is as follows:
  • V_RAM_15 Write the V data of the 15/31/47/63... rows and even columns into V_RAM_15.
  • V_RAM_1 Write the V data of rows 1/9/17/25... into V_RAM_1;
  • FIFO_WR_CTRL The YUV data read control logic through FIFO_WR_CTRL is as follows:
  • RAM_RD_CTRL does not care about the read address issued by Video CMP IP, but only cares about the read enable issued by Video CMP. It reads 16 times Y_FIFO_0, 16 times Y_FIFO_1,..., 16 times Y_FIFO_15, 8 times U_FIFO_0, 8 U_FIFO_1 times,..., U_FIFO_7 8 times, V_FIFO_0 8 times, V_FIFO_1 8 times,..., V_FIFO_7 8 times, and then cycle in sequence.
  • RAM_RD_CTRL does not care about the read address issued by Video CMP, but only cares about the read enable issued by Video CMP IP. It reads 16 times Y_FIFO_0, 16 times Y_FIFO_1,..., 16 times Y_FIFO_15, 8 times U_FIFO_0, 8 times. U_FIFO_1,..., 8 times U_FIFO_15, 8 times V_FIFO_0, 8 times V_FIFO_1,..., 8 times V_FIFO_15, and then loop in sequence.
  • RAM_RD_CTRL does not care about the read address issued by Video CMP IP, but only cares about the read enable issued by Video CMP. It reads Y_FIFO_0 8 times, Y_FIFO_1 8 times,..., Y_FIFO_7 8 times, U_FIFO_0 8 times, 8 times in sequence. U_FIFO_1,..., 8 times U_FIFO_7, 8 times V_FIFO_0, 8 times V_FIFO_1,..., 8 times V_FIFO_7, and then loop in sequence.
  • the above-mentioned traditional video compression system has the following shortcomings: it takes up a lot of on-chip resources, and a large number of FIFOs will cause the following problems: increasing the manufacturing area of the chip, making packaging and manufacturing difficult, causing timing constraints, and reducing video compression efficiency.
  • the data bus interface of Video CMP is 32bits or 64bits.
  • the reading logic of the traditional solution is to read 8bits each time. It needs to cache 4 or 8 entries before transmitting them to Video CMP for compression, which lengthens the compression time and reduces the compression efficiency.
  • the first aspect of the embodiment of the present application proposes a video compression system for a substrate management control chip.
  • the video compression system specifically includes: a color space conversion module 110, a memory 120, FIFO array module 130, read and write control module 140, video compression control module 150, memory 120 includes cache space 121 and compressed data storage space 122, FIFO array module 130 includes multiple FIFOs;
  • the baseboard management control chip is configured to write the received RGB video data into the cache space 121 in a line manner
  • the color space conversion module 110 is configured to read the RGB video data of each row from the cache space 121 in sequence, and convert the RGB video data into Y component, U component and V component data;
  • the FIFO array module 130 is configured to correspondingly set the bit width of the FIFO based on the number of FIFOs so that the FIFO simultaneously stores the Y component or U component or V component data of two adjacent rows;
  • the read-write control module 140 is configured to read the Y component, U component, and V component data at the corresponding position in each clock cycle, and write the corresponding FIFOs in parallel for caching;
  • the read and write control module 140 is also configured to, after receiving a read data request from the video compression control module, read two adjacent rows of data from the corresponding FIFO in sequence in each clock cycle according to the arrangement order of each FIFO in the FIFO array.
  • the Y component, U component, or V component data of the position constitutes BLOCK data and is sent to the video compression control module 150;
  • the video compression control module 150 is configured to compress the received BLOCK data and write the compressed data into the compressed data storage space.
  • the memory can be any one of SRAM (Static Random-Access Memory, static random access memory), SDRAM (synchronous dynamic random-access memory, synchronous dynamic random access memory), and DDR. In this embodiment, choose DDR.
  • the FIFO array module includes 24 FIFOs, and the bit width of each FIFO is set to 16 bits to simultaneously store the Y component, U component, or V component data of two adjacent rows. It should be noted that the FIFO array module can also include other numbers of FIFOs, but the purpose of this application is to simultaneously store the Y component or U component or V component data of two adjacent rows to improve the video data (Y component or U component or V component data). Therefore, preferably, the FIFO array module includes 24 FIFOs, and the bit width of each FIFO is set to 16 bits to ensure that the video The writing speed of data will not be slowed down.
  • the baseboard management control chip is configured to perform the following steps:
  • RGB_DATA Receive the original RGB video data sent by the host, and write the received RGB video data into the cache space (SOURCE_DATA) in rows. For example, if the resolution of the original RGB video data is 1024*768, 768 lines of RGB data are written each time, and the number of RGB data written in each line is 1024. Writing RGB data into the cache space in rows is beneficial to subsequent conversion of RGB data to YUV data.
  • the color space conversion module is configured to perform the following steps:
  • RGB video data Read each row of RGB video data from the cache space in turn, and convert the R component, G component and B component data of the RGB video data into YUV data, that is, Y component data, U component data and V component data, where, RGB video
  • YUV data that is, Y component data, U component data and V component data
  • RGB video The data is 24 bits, and the R component, G component and B component each occupy 8 bits.
  • the FIFO array module is configured to perform the following steps:
  • Figures 4 to 6 Two rows of Y component, U component, or V component data are shown in Figures 4 to 6.
  • the left side of Figures 4 to 6 shows the traditional FIFO array storing Y component data, U component data, and V component data respectively.
  • the right side is a diagram of the FIFO array of this application scheme storing Y component data, U component data, and V component data. It can be seen that setting the bit width of each FIFO to 16 bits reduces the number of FIFOs in the FIFO array, so The required overall cache area is reduced, saving manufacturing costs.
  • the read-write control module includes write control logic and read control logic.
  • the write control logic is configured to perform the following steps:
  • YUV444 or YUV422 or YUV420 Discard the YUV data after format conversion according to the compression format (YUV444 or YUV422 or YUV420) issued by the CPU.
  • the compression format YUV444 or YUV422 or YUV420
  • YUV422 compression format all Y data and U/V data of even columns need to be retained.
  • the YUV420 compression format needs to retain all Y data and the U/V data of even rows and even columns
  • the YUV444 compression format needs to retain the Y/U/V data of all rows and all columns, and the corresponding data is discarded according to the requirements of each compression format.
  • write the retained YUV data into the FIFO array For example: YUV422 compression format, all Y data and U/V data of even columns need to be retained. ;
  • the YUV420 compression format needs to retain all Y data and the U/V data of even rows and even columns;
  • the specific writing process is: read the Y component, U component and V component data of the corresponding row and column at the same time in each clock cycle, and write the Y component, U component and U component data that are simultaneously read.
  • the component and V component data are written to their corresponding FIFOs for caching at the same time. For example: within one clock cycle, the Y component, U component and V component data of row 0 and column 0 are read at the same time, and Y_FIFO_0, U_FIFO_0, V_FIFO_0.
  • the read-write control module can also read and write the data that needs to be retained according to the compression format issued by the CPU during the writing process, and then discard the remaining data.
  • Y_FIFO_NEW_1 are written into the last 8 bits space of Y_FIFO_NEW_1 in sequence.
  • the Y data of rows 20/36/52... are written into the first 8 bits space of Y_FIFO_NEW_2 in sequence
  • the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence
  • the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence.
  • the Y data of rows 38/54... are written into the first 8 bits space of Y_FIFO_NEW_3 in turn, and the Y data of rows 7/23/39/55...
  • Y_FIFO_NEW_1 are written into the last 8 bits space of Y_FIFO_NEW_1 in sequence.
  • the Y data of rows 20/36/52... are written into the first 8 bits space of Y_FIFO_NEW_2 in sequence
  • the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence
  • the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence.
  • the Y data of rows 38/54... are written into the first 8 bits space of Y_FIFO_NEW_3 in sequence
  • V_FIFO_NEW_7 Write the even-numbered column V data of row 0/16/32/48... into the first 8 bits space of V_FIFO_NEW_0, write the even-numbered column V data of row 1/17/33/49... into the last 8 bits space of V_FIFO_NEW_0, Write the even column V data of row 2/18/34/50... into the first 8 bits space of V_FIFO_NEW_1, write the even column V data of row 3/19/35/51... into the last 8 bits space of V_FIFO_NEW_1,...,
  • the V data in the even-numbered columns of rows 14/30/46/62... is written into the first 8bits space of V_FIFO_NEW_7, and the V data in the even-numbered columns of rows 15/31/47/63... is written into the last 8bits space of V_FIFO_NEW_7.
  • V_FIFO_NEW_0 write the V data in the 1/9/17/25... line into the last 8 bits storage space in V_FIFO_NEW_0, and write the 2/
  • the V data of row 10/18/26... is written into the first 8bits storage space of V_FIFO_NEW_1,...
  • the V data of row 6/14/22/30... is written into the first 8bits storage space of V_FIFO_NEW_3
  • the V data of row 7/15 is written into the first 8bits storage space of V_FIFO_NEW_3.
  • the V data of lines /23/31... is written into the last 8bits storage space of V_FIFO_NEW_3.
  • the above scheme realizes the writing of YUV data when the bit width of each FIFO is set to 16bit.
  • the read control logic is configured to perform the following steps:
  • the Y component or U component or The V component data constitutes BLOCK data and is sent to the video compression control module.
  • the first BLOCK composed of Y data consists of the first 16 Y component data of row 0, row 1,..., and row 15.
  • the U component reading process in YUV420 format is:
  • U_FIFO needs to be read 64 times, but in the embodiment of this application, it only needs to be read 32 times.
  • V component reading process in YUV420 format is:
  • V_FIFO needs to be read 64 times, but in the embodiment of this application, it only needs to be read 32 times.
  • the Y component reading process in YUV422 format is:
  • V component reading process in YUV422 format is:
  • V_FIFO_NEW_7 8 times to get rows 14 and 15 of V_BLOCK data traditional solution
  • the Y component reading process in YUV444 format is:
  • V component reading process in YUV444 format is:
  • the read-write control module sends the read data to the video compression control module, which compresses the received BLOCK data and writes the compressed data into the compressed data storage space (CMP_DATA).
  • the YUV data in the FIFO array is read out faster, resulting in a shorter buffering time of the YUV data in the FIFO array. Therefore, the required FIFO capacity will be smaller than that of the traditional video compression system. According to project experience, the highest resolution At the rate of 1920*1200, the required FIFO depth is 4096, and the total required FIFO storage capacity is 192KB, which is much less than the traditional 768KB, thus greatly saving project costs and reducing the FIFO cost in traditional video compression systems. Issues such as timing constraints and packaging and manufacturing difficulties caused by excessive quantities.
  • This embodiment reduces the storage capacity required by the FIFO and saves FIFO by reducing the number of FIFOs in the traditional video compression system and increasing the bit width of each FIFO, as well as optimizing the readout process of the read control logic of the read and write control module.
  • the occupied space on the chip reduces the project cost, reduces the timing constraints and packaging and manufacturing difficulties caused by the excessive number of FIFOs in traditional video compression systems, and improves the readout speed of video data and the speed of video compression.
  • the FIFO array module includes 24 FIFOs, and the FIFO array module is configured to set the 1st to 8th FIFOs to store Y component data, the 9th to 16th FIFOs to store U component data, and the 17th to 24th FIFOs.
  • Each FIFO is set to store V component data, and the bit width of each FIFO is set to 16 bits to simultaneously store Y component or U component or V component data of two adjacent rows.
  • the FIFO array module includes 24 FIFOs, and the bit width of each FIFO is set to 16 bits, so as to ensure that the writing speed of video data will not be slowed down while increasing the video data reading speed.
  • the read-write control module is specifically configured to discard the converted Y component, U component, and V component data according to the compressed format, and after completing the data discarding, read the retained Y component in each clock cycle , U component and V component data are written to their corresponding FIFOs in parallel for caching.
  • the read-write control module converts the format-converted YUV data according to the compression format (YUV444 or YUV422 or YUV420) issued by the CPU, discards the corresponding YUV data, and writes the retained YUV data into the FIFO array.
  • the compression format YUV444 or YUV422 or YUV420
  • YUV422 compression format needs to retain all Y data and U/V data of even columns
  • YUV420 compression format needs to retain all Y data and U/V data of even rows and even columns
  • YUV444 compression format needs to retain all rows and all columns Y/U/V data.
  • the specific writing process is: read the Y component, U component and V component data of the corresponding row and column at the same time in each clock cycle, and write the Y component, U component and V component data read at the same time into their respective corresponding
  • the FIFO is cached. For example: within one clock cycle, the Y component, U component and V component data of the 1st row and 2nd column are simultaneously read, and correspondingly written to Y_FIFO_0, U_FIFO_0, V_FIFO_0.
  • the cache space adopts a ping-pong cache structure, including a first cache space and a second cache space;
  • the substrate management control chip is also configured to write the received RGB video data into the first cache space and the second cache space sequentially in a line manner;
  • the color space conversion module is also configured to sequentially read two adjacent rows of RGB video data from the first cache space and the second cache space, and convert the two adjacent rows of RGB video data into Y components, U components and V components in parallel. component data;
  • the read-write control module is also configured to discard the converted Y component, U component and V component data according to the compressed format, and after completing the data discarding, read two adjacent rows with the same column number in parallel in each clock cycle to retain The Y component, U component and V component data are written in parallel to their corresponding FIFOs for caching.
  • the cache space adopts a ping-pong cache structure, including a first cache space (SOURCE_DATA_0) and a second cache space (SOURCE_DATA_1).
  • the baseboard management control chip writes the received RGB video data into the first cache space and the second cache space sequentially in rows. For example, writes the RGB video data in rows 0/2/4/6... into the SOURCE_DATA_0 address space. , write the RGB video data of lines 1/3/5/7... into the SPURCE_DATA_1 address space. After all the stored RGB video data is read out, the first cache space and the second cache space clear their respective cache spaces. to continue storing the next row of RGB video data.
  • the color space conversion module sequentially reads two adjacent rows of RGB video data from the first cache space and the second cache space, and converts the two adjacent rows of RGB video data into Y component, U component and V component data in parallel, For example, the color space conversion module reads the RGB video data of rows 0 and 1 from SOURCE_DATA_0 and SOURCE_DATA_1 in sequence, and converts the RGB video data of rows 0 and 1 into Y component, U component and V component data in parallel. This Because the RGB video data that needs to be converted increases from the previous 1 line to 2 lines, the number of adders and multipliers in the color space conversion module is correspondingly increased to meet the needs of parallel conversion.
  • the read-write control module discards the converted Y component, U component and V component data according to the compressed format, and after completing the data discarding, reads the reserved Y components of two adjacent rows with the same column number in parallel in each clock cycle , U component and V component data are written in parallel to their corresponding FIFOs for caching, that is, the Y component, U component and V component data reserved in two adjacent rows with the same column number are read simultaneously in each clock cycle and written simultaneously.
  • the respective corresponding FIFOs are cached. For example, in the same clock cycle, write the 0th Y component of row 0 and the 0th Y component of row 1 together into Y_FIFO_NEW_0.
  • the read-write control module uses a double buffer space with a ping-pong structure and optimizes the conversion operation logic of the color space conversion module to enable the read-write control module to write updates in one clock cycle. More YUV video data improves the writing speed of video data, so that the subsequent video compression module can compress data faster and improve the video compression efficiency.
  • the accelerated writing speed of the read-write control module shortens the cache time of the original RGB data in the memory, thus reducing the cache space required.
  • the SoC System on Chip, system on chip
  • the read-write control module is further specifically configured to, after receiving a read data request from the video compression control module, sequentially start from the corresponding FIFO in each clock cycle according to the compression format and the arrangement order of each FIFO in the FIFO array.
  • the Y component or U component or V component data of the corresponding positions of two adjacent rows are read from the FIFO to form BLOCK data that meets the compression format requirements and sent to the video compression control module.
  • RGB video data is converted into Y component, U component and V component data according to the following formula:
  • R represents the R component in the RGB video data
  • G represents the G component in the RGB video data
  • B represents the B component in the RGB video data.
  • the traditional video compression system requires 9 multipliers and 9 adders.
  • the number of multipliers and adders is correspondingly modified to 18.
  • the video compression system further includes a network card, and the network card is configured to read the compressed data from the compressed data storage space and send it to the remote end for remote display.
  • an embodiment of the present application also provides a video compression method for a substrate management control chip. Based on the above video compression system, the following steps are performed:
  • Step S101 The substrate management control chip writes the received RGB video data into the cache space in a line-by-line manner
  • Step S103 The color space conversion module reads the RGB video data of each row from the cache space in sequence, and converts the RGB video data into Y component, U component and V component data;
  • Step S105 The FIFO array module sets the bit width of the FIFO based on the number of FIFOs so that the FIFO stores the Y component, U component, or V component data of two adjacent rows at the same time;
  • Step S107 The read-write control module reads the Y component, U component, and V component data at the corresponding position of each row in each clock cycle, and writes them in parallel to the corresponding FIFO for caching;
  • Step S109 After receiving the read data request from the video compression control module, the read-write control module reads the corresponding positions of two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array.
  • the Y component or U component or V component data constitutes BLOCK data and is sent to the video compression control module;
  • Step S111 The video compression control module compresses the received BLOCK data and writes the compressed data into the compressed data storage space.
  • the embodiments of the present application at least have the following beneficial technical effects: by reducing the number of FIFOs in traditional video compression systems and increasing the bit width of each FIFO, and optimizing the readout process of the read control logic of the read-write control module, the FIFO
  • the required storage capacity saves the space occupied by FIFO on the chip, reduces project costs, reduces timing constraints and packaging and manufacturing difficulties caused by the excessive number of FIFOs in traditional video compression systems, and improves the quality of video data.
  • the read-write control module uses a double buffer space with a ping-pong structure and optimizes the conversion operation logic of the color space conversion module to enable the read-write control module to pass in one
  • the clock cycle writes more YUV video data, which improves the writing speed of video data, so that the subsequent video compression module can compress data faster and improve the video compression efficiency.
  • the non-transitory computer-readable storage medium stores computer-readable instructions that implement the above method steps when executed by a processor.
  • an embodiment of the present application also provides a non-transitory computer-readable storage medium 40.
  • the non-transitory computer-readable storage medium 40 stores Computer readable instructions 410 that when executed by a processor perform the above method.
  • an embodiment of the present application also provides a server 90, including the above video compression system 910.
  • the embodiments of this application may also include corresponding computer equipment.
  • the computer device includes a memory, at least one processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the program, any one of the above methods is performed.
  • the memory as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program corresponding to the video compression method in the embodiment of the present application. directive/module.
  • the processor executes various functional applications and data processing of the device by running non-volatile software programs, instructions and modules stored in the memory, that is, implementing the video compression method of the above method embodiment.
  • the memory may include a program storage area and a data storage area, where the program storage area may store an operating system and an application program required for at least one function; the storage data area may store data created according to use of the device, etc.
  • the memory may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device.
  • the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the local module through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.

Abstract

The present application discloses a video compression system and method, a computer readable storage medium, and a server. The video compression system comprises a color space conversion module, a memory, a FIFO array module, a read-write control module, and a video compression control module; the memory comprises a cache space and a compressed data storage space; the FIFO array module comprises a plurality of FIFOs; the FIFOs are used for storing Y component or V component or U component data; the FIFO array module is configured to correspondingly set the bit widths of the FIFOs on the basis of the number of the FIFOs, such that the FIFOs store the Y component or U component or V component data of two adjacent rows at the same time; and the read-write control module is configured to sequentially read the Y component or U component or V component data at corresponding positions of two adjacent rows from the corresponding FIFOs in each clock period and send the data to the video compression control module.

Description

一种视频压缩系统、方法、计算机可读存储介质及服务器A video compression system, method, computer-readable storage medium and server
相关申请的交叉引用Cross-references to related applications
本申请要求于2022年04月02日提交中国专利局,申请号为202210340428.5,申请名称为“一种视频压缩系统、方法、计算机可读存储介质及服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the China Patent Office on April 2, 2022, with the application number 202210340428.5, and the application name is "A video compression system, method, computer-readable storage medium and server", all of which The contents are incorporated into this application by reference.
技术领域Technical field
本申请涉及一种视频压缩系统、方法、计算机可读存储介质及服务器。This application relates to a video compression system, method, computer-readable storage medium and server.
背景技术Background technique
传统的基板管理控制芯片中视频压缩系统有以下两种方案:The video compression system in traditional baseboard management control chips has the following two solutions:
方案1:主机端的视频数据,通过PCIe(Peripheral Component Interconnect Express,高速串行计算机扩展总线标准)传递到基板管理控制芯片后,生成RGB(Red Green Blue,红绿蓝)原始视频信息后,写到片外DDR(Double Data Rate,双倍速率同步动态随机存储器)进行缓存,通过色彩空间转换模块(RGB2YUV),将原始的RGB格式的视频数据转换为YUV(颜色编码方法,Y表示明亮度(Luminance、Luma),U和V则是色度、浓度(Chrominance、Chroma))格式的数据,然后将Y、U、V数据,分别存储在片外不同起始地址的DDR空间(Y_addr,U_addr,V_addr),同时将Y、U、V的起始地址通过CPU配置给视频压缩IP。CMP(视频压缩控制模块)根据视频压缩IP的要求,按照BLOCK(块)数据的顺序,产生读片外DDR的地址,然后按照BLOCK数据的顺序输入给视频压缩控制模块,完成压缩之后,将数据写入到DDR,EMAC(Ethernet Media Access Control,以太网媒体存取控制)网卡驱动读取完成压缩的数据,通过网络将视频数据传输至远程,进行远程显示。Option 1: After the video data on the host side is transmitted to the baseboard management control chip through PCIe (Peripheral Component Interconnect Express, high-speed serial computer expansion bus standard), RGB (Red Green Blue, red, green and blue) original video information is generated and written to Off-chip DDR (Double Data Rate, double rate synchronous dynamic random access memory) is cached, and the original RGB format video data is converted into YUV (color encoding method, Y represents brightness (Luminance) through the color space conversion module (RGB2YUV) , Luma), U and V are data in the format of chrominance, concentration (Chrominance, Chroma), and then the Y, U, and V data are stored in the DDR space (Y_addr, U_addr, V_addr) at different off-chip starting addresses. ), and at the same time configure the starting addresses of Y, U, and V to the video compression IP through the CPU. The CMP (video compression control module) generates the address of the off-chip DDR in the order of BLOCK data according to the requirements of the video compression IP, and then inputs it to the video compression control module in the order of BLOCK data. After the compression is completed, the data Write to DDR, EMAC (Ethernet Media Access Control, Ethernet Media Access Control) network card driver reads the compressed data, and transmits the video data to the remote through the network for remote display.
方案2:主机端的视频数据,通过PCIe传递到基板管理控制芯片后,生成RGB原始视频信息后,写到片外DDR进行缓存,通过色彩空间转换模块(RGB2YUV),将原始的RGB格式的视频数据转换为YUV格式的数据,然后将Y、U、V数据用片内的存储资源(FIFO)进行缓存,按照BLOCK格式转换的需求(支持YUV444/YUV422/YUV420压缩格式),需要16个Y_FIFO,16个U_FIFO,16个V_FIFO,同时根据项目实践经验,针对最大分辨率下的(1920*1200)下,FIFO((First in First out,先进先出))的深度为16384,宽度为8bits,需要的FIFO的总存储容量为768KB,才能满足FIFO不会出现满的情况,不会出现丢数据的情况。Option 2: After the video data on the host side is transferred to the substrate management control chip through PCIe, the original RGB video information is generated and written to the off-chip DDR for caching. The original RGB format video data is converted to the original RGB format video data through the color space conversion module (RGB2YUV). Convert to YUV format data, and then cache the Y, U, and V data using on-chip storage resources (FIFO). According to the BLOCK format conversion requirements (supports YUV444/YUV422/YUV420 compression format), 16 Y_FIFOs are required, 16 U_FIFO, 16 V_FIFO. At the same time, according to project practical experience, for the maximum resolution (1920*1200), the depth of FIFO ((First in First out, first in first out)) is 16384, and the width is 8bits. The required The total storage capacity of FIFO is 768KB, so that the FIFO will not be full and data will not be lost.
传统方案1存在的缺点是,基板管理控制芯片需要非常频繁的访问片外DDR,导致视频功能占用的内存带宽很高,极大影响CPU(Central Processing Unit,中央处理器)上运行的其他软件对内存的访问,影响基板管理控制芯片的整体性能。The disadvantage of traditional solution 1 is that the baseboard management control chip needs to access the off-chip DDR very frequently, resulting in a high memory bandwidth occupied by the video function, which greatly affects other software running on the CPU (Central Processing Unit, central processing unit). Memory access affects the overall performance of the baseboard management control chip.
传统方案2的缺点是,需要极大的占用很大的片内资源,而对于芯片项目而言,片内的存储资源(FIFO)是很珍贵的,FIFO数量多会增大芯片的面积。同时数量、容量很大的FIFO对于芯片的时序约束、后端设计、封装制造等过程造成很大的难题。The disadvantage of traditional solution 2 is that it requires a large amount of on-chip resources. For chip projects, on-chip storage resources (FIFO) are very precious. A large number of FIFOs will increase the area of the chip. At the same time, the large number and capacity of FIFOs poses great problems to the chip timing constraints, back-end design, packaging and manufacturing processes.
发明内容Contents of the invention
根据本申请公开的各种实施例,本申请提出了一种视频压缩系统、方法、计算机可读存储介质及服务器。According to various embodiments disclosed in this application, this application proposes a video compression system, method, computer-readable storage medium and server.
一种用于基板管理控制芯片的视频压缩系统,视频压缩系统具体包括:A video compression system for substrate management control chip. The video compression system specifically includes:
色彩空间转换模块、存储器、FIFO阵列模块、读写控制模块、视频压缩控制模块,存储器包括缓存空间和压缩数据存储空间,FIFO阵列模块包括多个FIFO,FIFO用于存储Y分量或V分量或U分量数据;Color space conversion module, memory, FIFO array module, read and write control module, video compression control module. The memory includes cache space and compressed data storage space. The FIFO array module includes multiple FIFOs. The FIFO is used to store the Y component or V component or U component data;
基板管理控制芯片配置为将接收到的RGB视频数据以行的方式写入缓存空间;The baseboard management control chip is configured to write the received RGB video data into the cache space in a row;
色彩空间转换模块配置为依次从缓存空间读取每一行的RGB视频数据,并将RGB视频数据转换成Y分量、U分量和V分量数据;The color space conversion module is configured to read each line of RGB video data from the cache space in sequence, and convert the RGB video data into Y component, U component and V component data;
FIFO阵列模块配置为基于FIFO的数量对应设置FIFO的位宽以使FIFO同时存储相邻两行的Y分量或U分量或V分量数据;The FIFO array module is configured to set the bit width of the FIFO based on the number of FIFOs so that the FIFO can store the Y component, U component, or V component data of two adjacent rows at the same time;
读写控制模块配置为在每个时钟周期读取对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;The read-write control module is configured to read the Y component, U component and V component data at the corresponding position in each clock cycle, and write them in parallel to the corresponding FIFO for caching;
读写控制模块还配置为在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给视频压缩控制模块;以及The read-write control module is also configured to read the corresponding positions of two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array after receiving the read data request from the video compression control module. The Y component or U component or V component data constitutes BLOCK data and is sent to the video compression control module; and
视频压缩控制模块配置为对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。The video compression control module is configured to compress the received BLOCK data and write the compressed data into the compressed data storage space.
一种用于基板管理控制芯片的视频压缩方法,基于如上的视频压缩系统执行,包括以下步骤:A video compression method for substrate management control chip, executed based on the above video compression system, includes the following steps:
基板管理控制芯片将接收到的RGB视频数据以行的方式写入缓存空间;The baseboard management control chip writes the received RGB video data into the buffer space in rows;
色彩空间转换模块依次从缓存空间读取每一行的RGB视频数据,并将RGB视频数据转换成Y分量、U分量和V分量数据;The color space conversion module reads each line of RGB video data from the cache space in turn, and converts the RGB video data into Y component, U component and V component data;
FIFO阵列模块基于FIFO的数量对应设置FIFO的位宽以使FIFO同时存储相邻两行的Y分量或U分量或V分量数据;The FIFO array module sets the bit width of the FIFO based on the number of FIFOs so that the FIFO can store the Y component, U component, or V component data of two adjacent rows at the same time;
读写控制模块在每个时钟周期读取每一行对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;The read-write control module reads the Y component, U component and V component data at the corresponding position of each row in each clock cycle, and writes them in parallel to the corresponding FIFO for caching;
读写控制模块在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给视频压缩控制模块;以及After receiving the read data request from the video compression control module, the read-write control module reads the Y components of the corresponding positions of two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array. Or the U component or V component data is composed of BLOCK data and sent to the video compression control module; and
视频压缩控制模块对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。The video compression control module compresses the received BLOCK data and writes the compressed data into the compressed data storage space.
一种非暂态计算机可读存储介质,非暂态计算机可读存储介质存储有被处理器执行时实现如上方法步骤的计算机可读指令。A non-transitory computer-readable storage medium stores computer-readable instructions that implement the above method steps when executed by a processor.
一种服务器,包括如上的视频压缩系统。A server includes the above video compression system.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other embodiments can be obtained based on these drawings without exerting creative efforts.
图1为传统视频压缩系统的示意图;Figure 1 is a schematic diagram of a traditional video compression system;
图2为不同YUV压缩格式要求的BLOCK数据组成示意图;Figure 2 is a schematic diagram of the BLOCK data composition required by different YUV compression formats;
图3为本申请实施例提供的用于基板管理控制芯片的视频压缩系统的示意图;Figure 3 is a schematic diagram of a video compression system for a substrate management control chip provided by an embodiment of the present application;
图4为本申请实施例提供的视频压缩系统存储Y分量数据与传统视频压缩系统存储Y分量数据的对比示意图;Figure 4 is a schematic diagram comparing the storage of Y component data in the video compression system provided by the embodiment of the present application and the storage of Y component data in the traditional video compression system;
图5为本申请实施例提供的视频压缩系统存储U分量数据与传统视频压缩系统存储U分量数据的对比示意图;Figure 5 is a schematic diagram comparing the storage of U component data in the video compression system provided by the embodiment of the present application and the storage of U component data in the traditional video compression system;
图6为本申请实施例提供的视频压缩系统存储V分量数据与传统视频压缩系统存储V分量数据的对比示意图;Figure 6 is a schematic diagram comparing the storage of V component data in the video compression system provided by the embodiment of the present application and the storage of V component data in the traditional video compression system;
图7为本申请实施例提供的用于基板管理控制芯片的视频压缩方法的框图;Figure 7 is a block diagram of a video compression method for a baseboard management control chip provided by an embodiment of the present application;
图8为本申请实施例提供的非暂态计算机可读存储介质的结构示意图;Figure 8 is a schematic structural diagram of a non-transitory computer-readable storage medium provided by an embodiment of the present application;
图9为本申请实施例提供的服务器的结构示意图。Figure 9 is a schematic structural diagram of a server provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本申请实施例进一步详细说明。In order to make the purpose, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to specific embodiments and the accompanying drawings.
需要说明的是,本申请实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本申请实施例的限定,后续实施例对此不再一一说明。It should be noted that all expressions using “first” and “second” in the embodiments of this application are intended to distinguish two entities or parameters with the same name but not the same. It can be seen that “first” and “second” It is only for the convenience of description and should not be understood as a limitation on the embodiments of the present application, and subsequent embodiments will not describe this one by one.
如图1所示,为传统方案2的视频压缩系统的示意图。As shown in Figure 1, it is a schematic diagram of the video compression system of traditional solution 2.
如图2所示,其示出了不同YUV压缩格式要求的BLOCK数据组成。As shown in Figure 2, it shows the BLOCK data composition required by different YUV compression formats.
在图2中,Cb代表U分量,Cr代表V分量,图2的左侧为YUV格式的视频数据的源图像图片(Source Image Picture),经离散余弦变换(Discrete Cosine Transform,简称DCT)后,组成BLOCK格式数据进行存储,图2的右侧,height代表方框的高度,width代表方框的宽度,每一个小方框表示图2左侧的8*8像素点,大方框表示16*16像素点,长方框是8*16像素点。以YUV420举例,Y块表示4个8*8像素点的Y分量,Cb块表示1个8*8块的U分量,Cr块表示1个8*8块的V分量。In Figure 2, Cb represents the U component, and Cr represents the V component. The left side of Figure 2 is the source image picture (Source Image Picture) of the video data in YUV format. After discrete cosine transform (Discrete Cosine Transform, referred to as DCT), Form BLOCK format data for storage. On the right side of Figure 2, height represents the height of the box, and width represents the width of the box. Each small box represents the 8*8 pixels on the left side of Figure 2, and the large box represents 16*16 Pixels, the rectangular box is 8*16 pixels. Taking YUV420 as an example, the Y block represents the Y component of four 8*8 pixels, the Cb block represents the U component of one 8*8 block, and the Cr block represents the V component of one 8*8 block.
也就是说,若当前的压缩格式是YUV420,Video CMP(视频压缩控制模块)要产生读16*16的Y分量的地址顺序,8*8的U分量的地址顺序,8*8的V分量的地址顺序,然后依次循环;若当前的压缩格式是YUV422,Video CMP要产生读16*16的Y分量的地址顺序,8*16的U分量的地址顺序,8*16的V分量的地址顺序,然后依次循环;若当前的压缩格式是YUV444,Video CMP要产生读8*8的Y分量的地址顺序,8*8的U分量的地址顺序,8*8的V分量的地址顺序,然后依次循环。In other words, if the current compression format is YUV420, Video CMP (Video Compression Control Module) must generate an address sequence for reading the 16*16 Y component, an address sequence for the 8*8 U component, and an 8*8 V component. Address sequence, and then loop in sequence; if the current compression format is YUV422, Video CMP should generate the address sequence of reading the Y component of 16*16, the address sequence of the U component of 8*16, and the address sequence of the V component of 8*16. Then it loops in sequence; if the current compression format is YUV444, Video CMP should generate the address sequence of reading the Y component of 8*8, the address sequence of the U component of 8*8, the address sequence of the V component of 8*8, and then loop in sequence. .
如图1所示的视频压缩系统,主机端(HOST)的视频数据是RGB格式的,通过PCIe传递到基板管理控制芯片后,生成RGB原始视频信息后,写到片外DDR进行缓存,色彩空间转换模块(RGB2YUV)从片外DDR读取RGB格式的视频数据,将原始的RGB格式的视频数据转换为YUV格式的数据,然后读写控制模块(FIFO_CTRL)根据压缩格式(支持YUV444/YUV422/YUV420压缩格式)读取转换后的YUV格式的数据,将Y、U、V数据用片内的FIFO阵列(FIFO_ARRAY)进行缓存,并按照BLOCK格式的需求从FIFO阵列读出后发送给视频压缩控制模块(Video CMP),传统方案下,为满足BLOCK格式的转换需求,需要16个Y_FIFO,16个U_FIFO,16个V_FIFO组成FIFO阵列。As shown in the video compression system shown in Figure 1, the video data on the host side (HOST) is in RGB format. After being transmitted to the substrate management control chip through PCIe, the RGB original video information is generated and written to the off-chip DDR for caching. The color space The conversion module (RGB2YUV) reads RGB format video data from off-chip DDR, converts the original RGB format video data into YUV format data, and then the read and write control module (FIFO_CTRL) reads the video data in RGB format according to the compression format (supports YUV444/YUV422/YUV420 Compression format) reads the converted YUV format data, caches the Y, U, and V data using the on-chip FIFO array (FIFO_ARRAY), and reads it from the FIFO array according to the requirements of the BLOCK format and sends it to the video compression control module (Video CMP), under the traditional solution, in order to meet the conversion requirements of the BLOCK format, 16 Y_FIFOs, 16 U_FIFOs, and 16 V_FIFOs are needed to form a FIFO array.
在视频数据压缩过程中,FIFO_CTRL(FIFO读写控制模块)不关心Video CMP发出的读地址,而由FIFO_CTRL本身产生读写控制逻辑,去读取相应的FIFO。During the video data compression process, FIFO_CTRL (FIFO read-write control module) does not care about the read address issued by Video CMP, and FIFO_CTRL itself generates read-write control logic to read the corresponding FIFO.
通过FIFO_CTRL进行YUV数据写控制逻辑如下:The YUV data writing control logic through FIFO_CTRL is as follows:
在YUV420格式下,保留全部的Y数据,保留偶数行偶数列的U/V数据,具体如下:In YUV420 format, retain all Y data and retain U/V data of even rows and even columns, as follows:
将第0/16/32/48…行的Y数据写进Y_RAM_0;Write the Y data of row 0/16/32/48... into Y_RAM_0;
将第1/17/33/49…行的Y数据写进Y_RAM_1;Write the Y data of row 1/17/33/49... into Y_RAM_1;
将第2/18/34/50…行的Y数据写进Y_RAM_2;Write the Y data of row 2/18/34/50... into Y_RAM_2;
……
将第15/31/47/63…行的Y数据写进Y_RAM_15;Write the Y data of row 15/31/47/63... into Y_RAM_15;
将第0/16/32/48…行的偶数列U数据写进U_RAM_0;Write the even column U data of row 0/16/32/48... into U_RAM_0;
将第2/18/34/50…行的偶数列U数据写进U_RAM_1;Write the even column U data of row 2/18/34/50... into U_RAM_1;
……
将第14/30/46/62…行的偶数列U数据写进U_RAM_7;Write the even column U data of row 14/30/46/62... into U_RAM_7;
将第0/16/32/48…行的偶数列U数据写进V_RAM_0;Write the even column U data of row 0/16/32/48... into V_RAM_0;
将第2/18/34/50…行的偶数列U数据写进V_RAM_1;Write the even column U data of row 2/18/34/50... into V_RAM_1;
……
将第14/30/46/62…行的偶数列U数据写进V_RAM_7。Write the even column U data of row 14/30/46/62... into V_RAM_7.
在YUV422格式下,保留全部的Y数据,保留偶数列的U/V数据,具体如下:In YUV422 format, retain all Y data and retain the U/V data of even columns, as follows:
将第0/16/32/48…行的Y数据写进Y_RAM_0;Write the Y data of row 0/16/32/48... into Y_RAM_0;
将第1/17/33/49…行的Y数据写进Y_RAM_1;Write the Y data of row 1/17/33/49... into Y_RAM_1;
将第2/18/34/50…行的Y数据写进Y_RAM_2;Write the Y data of row 2/18/34/50... into Y_RAM_2;
……
将第15/31/47/63…行的Y数据写进Y_RAM_15;Write the Y data of row 15/31/47/63... into Y_RAM_15;
将第0/16/32/48…行的偶数列U数据写进U_RAM_0;Write the even column U data of row 0/16/32/48... into U_RAM_0;
将第1/17/33/49…行的偶数列U数据写进U_RAM_1;Write the even column U data of row 1/17/33/49... into U_RAM_1;
将第2/18/34/50…行的偶数列U数据写进U_RAM_2;Write the even column U data of row 2/18/34/50... into U_RAM_2;
……
将第15/31/47/63…行偶数列的U数据写进U_RAM_15;Write the U data of the 15/31/47/63... rows and even columns into U_RAM_15;
将第0/16/32/48…行的偶数列V数据写进V_RAM_0;Write the even column V data of row 0/16/32/48... into V_RAM_0;
将第1/17/33/49…行的偶数列V数据写进V_RAM_1;Write the even column V data of row 1/17/33/49... into V_RAM_1;
将第2/18/34/50…行的偶数列V数据写进V_RAM_2;Write the even column V data of row 2/18/34/50... into V_RAM_2;
……
将第15/31/47/63…行偶数列的V数据写进V_RAM_15。Write the V data of the 15/31/47/63... rows and even columns into V_RAM_15.
在YUV444格式下,保留全部行全部列的Y/U/V数据,具体如下:In YUV444 format, retain the Y/U/V data of all rows and all columns, as follows:
将第0/8/16/24…行的Y数据写进Y_RAM_0;Write the Y data of row 0/8/16/24... into Y_RAM_0;
将第1/9/17/25…行的Y数据写进Y_RAM_1;Write the Y data of row 1/9/17/25... into Y_RAM_1;
将第2/10/18/26…行的Y数据写进Y_RAM_2;Write the Y data of row 2/10/18/26... into Y_RAM_2;
……
将第7/15/23/31…行的Y数据写进Y_RAM_7;Write the Y data of row 7/15/23/31... into Y_RAM_7;
将第0/8/16/24…行的U数据写进U_RAM_0;Write the U data of line 0/8/16/24... into U_RAM_0;
将第1/9/17/25…行的U数据写进U_RAM_1;Write the U data of lines 1/9/17/25... into U_RAM_1;
将第2/10/18/26…行的U数据写进U_RAM_2;Write the U data in line 2/10/18/26... into U_RAM_2;
……
将第7/15/23/31…行的U数据写进U_RAM_7;Write the U data in line 7/15/23/31... into U_RAM_7;
将第0/8/16/24…行的V数据写进V_RAM_0;Write the V data in line 0/8/16/24... into V_RAM_0;
将第1/9/17/25…行的V数据写进V_RAM_1;Write the V data of rows 1/9/17/25... into V_RAM_1;
将第2/10/18/26…行的V数据写进V_RAM_2;Write the V data of row 2/10/18/26... into V_RAM_2;
……
将第7/15/23/31…行的V数据写进V_RAM_7。Write the V data of line 7/15/23/31... into V_RAM_7.
通过FIFO_WR_CTRL进行YUV数据读控制逻辑如下:The YUV data read control logic through FIFO_WR_CTRL is as follows:
在YUV420格式下,RAM_RD_CTRL不关心Video CMP IP发出的读地址,而只关心Video CMP发出的读使能,依次去读16次Y_FIFO_0,16次Y_FIFO_1,……,16次Y_FIFO_15,8次U_FIFO_0,8次U_FIFO_1,……,8次U_FIFO_7,8次V_FIFO_0,8次V_FIFO_1,……,8次V_FIFO_7,然后依次循环。In the YUV420 format, RAM_RD_CTRL does not care about the read address issued by Video CMP IP, but only cares about the read enable issued by Video CMP. It reads 16 times Y_FIFO_0, 16 times Y_FIFO_1,..., 16 times Y_FIFO_15, 8 times U_FIFO_0, 8 U_FIFO_1 times,..., U_FIFO_7 8 times, V_FIFO_0 8 times, V_FIFO_1 8 times,..., V_FIFO_7 8 times, and then cycle in sequence.
YUV422格式下,RAM_RD_CTRL不关心Video CMP发出的读地址,而只关心Video CMP IP发出的读使能,依次去读16次Y_FIFO_0,16次Y_FIFO_1,……,16次Y_FIFO_15,8次U_FIFO_0,8次U_FIFO_1,……,8次U_FIFO_15,8次V_FIFO_0,8次V_FIFO_1,……,8次V_FIFO_15,然后依次循环。In the YUV422 format, RAM_RD_CTRL does not care about the read address issued by Video CMP, but only cares about the read enable issued by Video CMP IP. It reads 16 times Y_FIFO_0, 16 times Y_FIFO_1,..., 16 times Y_FIFO_15, 8 times U_FIFO_0, 8 times. U_FIFO_1,..., 8 times U_FIFO_15, 8 times V_FIFO_0, 8 times V_FIFO_1,..., 8 times V_FIFO_15, and then loop in sequence.
YUV444格式下,RAM_RD_CTRL不关心Video CMP IP发出的读地址,而只关心Video CMP发出的读使能,依次去读8次Y_FIFO_0,8次Y_FIFO_1,……,8次Y_FIFO_7,8次U_FIFO_0,8次U_FIFO_1,……,8次U_FIFO_7,8次V_FIFO_0,8次V_FIFO_1,……,8次V_FIFO_7,然后依次循环。In YUV444 format, RAM_RD_CTRL does not care about the read address issued by Video CMP IP, but only cares about the read enable issued by Video CMP. It reads Y_FIFO_0 8 times, Y_FIFO_1 8 times,..., Y_FIFO_7 8 times, U_FIFO_0 8 times, 8 times in sequence. U_FIFO_1,..., 8 times U_FIFO_7, 8 times V_FIFO_0, 8 times V_FIFO_1,..., 8 times V_FIFO_7, and then loop in sequence.
上述传统的视频压缩系统,存在以下缺点:占用较多片内资源,FIFO数量多会引发以下问题:增大芯片的制造面积、封装制造困难、引起时序约束、降低视频压缩效率等问题。例如,Video CMP的数据总线接口是32bits或64bits,传统方案的读逻辑是每次读8bits,需要缓存4笔或8笔之后才能传输给Video CMP进行压缩,加长了压缩时间,降低了压缩效率。The above-mentioned traditional video compression system has the following shortcomings: it takes up a lot of on-chip resources, and a large number of FIFOs will cause the following problems: increasing the manufacturing area of the chip, making packaging and manufacturing difficult, causing timing constraints, and reducing video compression efficiency. For example, the data bus interface of Video CMP is 32bits or 64bits. The reading logic of the traditional solution is to read 8bits each time. It needs to cache 4 or 8 entries before transmitting them to Video CMP for compression, which lengthens the compression time and reduces the compression efficiency.
基于上述目的,本申请实施例的第一个方面,提出了一种用于基板管理控制芯片的视频压缩系统,如图3所示,视频压缩系统具体包括:色彩空间转换模块110、存储器120、FIFO阵列模块130、读写控制模块140、视频压缩控制模块150,存储器120包括缓存空间121和压缩数据存储空间122,FIFO阵列模块130包括多个FIFO;Based on the above purpose, the first aspect of the embodiment of the present application proposes a video compression system for a substrate management control chip. As shown in Figure 3, the video compression system specifically includes: a color space conversion module 110, a memory 120, FIFO array module 130, read and write control module 140, video compression control module 150, memory 120 includes cache space 121 and compressed data storage space 122, FIFO array module 130 includes multiple FIFOs;
基板管理控制芯片配置为将接收到的RGB视频数据以行的方式写入缓存空间121;The baseboard management control chip is configured to write the received RGB video data into the cache space 121 in a line manner;
色彩空间转换模块110配置为依次从缓存空间121读取每一行的RGB视频数据,并将RGB视频数据转换成Y分量、U分量和V分量数据;The color space conversion module 110 is configured to read the RGB video data of each row from the cache space 121 in sequence, and convert the RGB video data into Y component, U component and V component data;
FIFO阵列模块130配置为基于FIFO的数量对应设置FIFO的位宽以使FIFO同时存储相邻两行的Y分量或U分量或V分量数据;The FIFO array module 130 is configured to correspondingly set the bit width of the FIFO based on the number of FIFOs so that the FIFO simultaneously stores the Y component or U component or V component data of two adjacent rows;
将第1~8个FIFO设置为存储Y分量数据、第9~16个FIFO设置为存储U分量数据、第17~24个FIFO设置为存储V分量数据,并将每个FIFO的位宽设置为16比特以同时存储相邻两行的Y分量或U分量或V分量数据;Set the 1st to 8th FIFOs to store Y component data, the 9th to 16th FIFOs to store U component data, the 17th to 24th FIFOs to store V component data, and set the bit width of each FIFO to 16 bits to simultaneously store the Y component, U component, or V component data of two adjacent rows;
读写控制模块140配置为在每个时钟周期读取对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;The read-write control module 140 is configured to read the Y component, U component, and V component data at the corresponding position in each clock cycle, and write the corresponding FIFOs in parallel for caching;
读写控制模块140还配置为在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给视频压缩控制模块150;The read and write control module 140 is also configured to, after receiving a read data request from the video compression control module, read two adjacent rows of data from the corresponding FIFO in sequence in each clock cycle according to the arrangement order of each FIFO in the FIFO array. The Y component, U component, or V component data of the position constitutes BLOCK data and is sent to the video compression control module 150;
视频压缩控制模块150配置为对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。The video compression control module 150 is configured to compress the received BLOCK data and write the compressed data into the compressed data storage space.
具体的,存储器可以为SRAM(Static Random-Access Memory,静态随机存取存储器)、SDRAM(synchronous dynamic random-access memory,同步动态随机存取存储器)和DDR等存储器中的任意一种,本实施例选用DDR。Specifically, the memory can be any one of SRAM (Static Random-Access Memory, static random access memory), SDRAM (synchronous dynamic random-access memory, synchronous dynamic random access memory), and DDR. In this embodiment, Choose DDR.
本实施例中,FIFO阵列模块包括24个FIFO,并将每个FIFO的位宽设置为16比特以同时存储相邻两行的Y分量或U分量或V分量数据。需要说明的是,FIFO阵列模块还可包括其他数量的FIFO,但由于本申请的目的为同时存储相邻两行的Y分量或U分量或V分量数据,以提高视频数据(Y分量或U分量或V分量数据)的读出速度,因此,优选的,FIFO阵列模块包括24个FIFO,并将每个FIFO的位宽设置为16比特,以在提高视频数据读出速度的前提下,保证视频数据的写入速度不会减慢。In this embodiment, the FIFO array module includes 24 FIFOs, and the bit width of each FIFO is set to 16 bits to simultaneously store the Y component, U component, or V component data of two adjacent rows. It should be noted that the FIFO array module can also include other numbers of FIFOs, but the purpose of this application is to simultaneously store the Y component or U component or V component data of two adjacent rows to improve the video data (Y component or U component or V component data). Therefore, preferably, the FIFO array module includes 24 FIFOs, and the bit width of each FIFO is set to 16 bits to ensure that the video The writing speed of data will not be slowed down.
基板管理控制芯片配置为执行以下步骤:The baseboard management control chip is configured to perform the following steps:
接收主机发送的原始的RGB视频数据,并将接收到的RGB视频数据以行的方式写入缓存空间(SOURCE_DATA)。例如,原始的RGB视频数据的分辨率为1024*768,则每次写入768行RGB数据,每行写入的RGB数据的数量为1024个。将RGB数据以行方式写入缓存空间,有利于后续进行RGB数据到YUV数据的转换。Receive the original RGB video data sent by the host, and write the received RGB video data into the cache space (SOURCE_DATA) in rows. For example, if the resolution of the original RGB video data is 1024*768, 768 lines of RGB data are written each time, and the number of RGB data written in each line is 1024. Writing RGB data into the cache space in rows is beneficial to subsequent conversion of RGB data to YUV data.
色彩空间转换模块配置为执行以下步骤:The color space conversion module is configured to perform the following steps:
依次从缓存空间读取每一行的RGB视频数据,并将RGB视频数据的R分量、G分量和B分量数据转换成YUV数据,即Y分量数据、U分量数据和V分量数据,其中,RGB视频数据为24bit,R分量、G分量和B分量分别占8bit。Read each row of RGB video data from the cache space in turn, and convert the R component, G component and B component data of the RGB video data into YUV data, that is, Y component data, U component data and V component data, where, RGB video The data is 24 bits, and the R component, G component and B component each occupy 8 bits.
FIFO阵列模块配置为执行以下步骤:The FIFO array module is configured to perform the following steps:
将前8个FIFO设置为存储Y分量数据、中间8个FIFO设置为存储U分量数据、后8个FIFO设置为存储V分量数据,并将每个FIFO的位宽设置为16bit以同时存储相邻两行的Y分量或U分量或V分量数据,如图4~图6所示,图4~图6左侧分别为传统的FIFO阵列存储Y分量数据、U分量数据、V分量数据的示意,右侧为本申请方案的FIFO阵列存储Y分量数据、U分量数据、V分量数据的示意,由此可以看出将每个FIFO的位宽设置为16bit,减少了FIFO阵列中FIFO的数量,所需的总体缓存占用的面积减少,节约了制造成本。Set the first 8 FIFOs to store Y component data, the middle 8 FIFOs to store U component data, the last 8 FIFOs to store V component data, and set the bit width of each FIFO to 16 bits to store adjacent Two rows of Y component, U component, or V component data are shown in Figures 4 to 6. The left side of Figures 4 to 6 shows the traditional FIFO array storing Y component data, U component data, and V component data respectively. The right side is a diagram of the FIFO array of this application scheme storing Y component data, U component data, and V component data. It can be seen that setting the bit width of each FIFO to 16 bits reduces the number of FIFOs in the FIFO array, so The required overall cache area is reduced, saving manufacturing costs.
读写控制模块包括写控制逻辑和读控制逻辑,写控制逻辑配置为执行以下步骤:The read-write control module includes write control logic and read control logic. The write control logic is configured to perform the following steps:
将进行了格式转换后的YUV数据,按照CPU下发的压缩格式(YUV444或YUV422或YUV420)进行YUV数据丢弃后,例如:YUV422压缩格式,需保留全部的Y数据和偶数列的U/V数据;YUV420压缩格式需保留全部的Y数据和偶数行偶数列的U/V数据;YUV444压缩格式需保留全部行全部列的Y/U/V数据,根据各个压缩格式的要求进行相应的数据丢弃后,将保留的YUV数据写入FIFO阵列,具体的写入过程为:在每个时钟周期读取同时对应行对应列的Y分量、U分量和V分量数据,将同时读取的Y分量、U分量和V分量数据分别同时写入各自对应的FIFO进行缓存,例如:在一个时钟周期内,同时读取第0行第0列的Y分量、U分量和V分量数据,分别对应写入Y_FIFO_0、U_FIFO_0、V_FIFO_0。Discard the YUV data after format conversion according to the compression format (YUV444 or YUV422 or YUV420) issued by the CPU. For example: YUV422 compression format, all Y data and U/V data of even columns need to be retained. ; The YUV420 compression format needs to retain all Y data and the U/V data of even rows and even columns; the YUV444 compression format needs to retain the Y/U/V data of all rows and all columns, and the corresponding data is discarded according to the requirements of each compression format. , write the retained YUV data into the FIFO array. The specific writing process is: read the Y component, U component and V component data of the corresponding row and column at the same time in each clock cycle, and write the Y component, U component and U component data that are simultaneously read. The component and V component data are written to their corresponding FIFOs for caching at the same time. For example: within one clock cycle, the Y component, U component and V component data of row 0 and column 0 are read at the same time, and Y_FIFO_0, U_FIFO_0, V_FIFO_0.
更进一步的,读写控制模块还可以在写入过程中,根据CPU下发的压缩格式读取并写入需要保留的数据后,再对其余的数据进行丢弃。Furthermore, the read-write control module can also read and write the data that needs to be retained according to the compression format issued by the CPU during the writing process, and then discard the remaining data.
结合图4~图6,对读写控制模块的写控制逻辑的写入过程进行说明,具体写入过程如下:Combined with Figures 4 to 6, the writing process of the write control logic of the read-write control module is explained. The specific writing process is as follows:
1)YUV420格式1)YUV420 format
a)Y分量a) Y component
将第0/16/32/48……行的Y数据依次写进Y_FIFO_NEW_0的前8bits空间,将第1/17/33/49……行的Y数据依次写进Y_FIFO_NEW_0的后8bits空间,将第2/18/34/50……行的Y数据依次写进Y_FIFO_NEW_1的前8bits空间,将第3/19/35/51……行的Y数据依次写进Y_FIFO_NEW_1的后8bits空间,将第4/20/36/52……行的Y数据依次写进Y_FIFO_NEW_2的前8bits空间,将第5/21/37/53……行的Y数据依次写进Y_FIFO_NEW_2的后8bits空间,将第6/22/38/54……行的Y数据依次写进Y_FIFO_NEW_3的前8bits空间,将第7/23/39/55……行的Y数据依次写进Y_FIFO_NEW_3 的后8bits空间,……,将第14/30/46/62……行的Y数据依次写进Y_FIFO_NEW_7的前8bits空间,将第15/31/47/63……行的Y数据依次写进Y_FIFO_NEW_7的后8bits空间。Write the Y data of rows 0/16/32/48... into the first 8 bits space of Y_FIFO_NEW_0 in sequence, write the Y data of rows 1/17/33/49... into the last 8 bits space of Y_FIFO_NEW_0 in sequence, and write the Y data of rows 1/17/33/49... into the last 8 bits space of Y_FIFO_NEW_0 in sequence. The Y data of rows 2/18/34/50... are written into the first 8 bits space of Y_FIFO_NEW_1 in sequence, the Y data of rows 3/19/35/51... are written into the last 8 bits space of Y_FIFO_NEW_1 in sequence, and the Y data of rows 3/19/35/51... are written into the last 8 bits space of Y_FIFO_NEW_1 in sequence. The Y data of rows 20/36/52... are written into the first 8 bits space of Y_FIFO_NEW_2 in sequence, the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence, and the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence. The Y data of rows 38/54... are written into the first 8 bits space of Y_FIFO_NEW_3 in turn, and the Y data of rows 7/23/39/55... are written into the last 8 bits space of Y_FIFO_NEW_3 in sequence,..., the Y data of rows 7/23/39/55... are written into the last 8 bits space of Y_FIFO_NEW_3,... The Y data of rows /46/62... are written into the first 8 bits space of Y_FIFO_NEW_7 in sequence, and the Y data of rows 15/31/47/63... are written into the last 8 bits space of Y_FIFO_NEW_7 in sequence.
b)U分量b)U component
将第0/16/32/48…行的偶数列U数据写进U_FIFO_NEW_0的前8bits空间,将第2/18/34/50…行的偶数列U数据写进U_FIFO_NEW_0的后8bits空间,……,将第12/28/44/60…行的偶数列U数据写进U_FIFO_NEW_3的前8bits空间,将第14/30/46/62…行的偶数列U数据写进U_FIFO_NEW_3的后8bits空间。Write the even-numbered column U data of row 0/16/32/48... into the first 8bits space of U_FIFO_NEW_0, and write the even-numbered column U data of row 2/18/34/50... into the last 8bits space of U_FIFO_NEW_0,... , write the even-numbered column U data in row 12/28/44/60... into the first 8bits space of U_FIFO_NEW_3, and write the even-numbered column U data in row 14/30/46/62... into the last 8bits space of U_FIFO_NEW_3.
c)V分量c)V component
将第0/16/32/48…行的偶数列V数据写进V_FIFO_NEW_0的前8bits空间,将第2/18/34/50…行的偶数列V数据写进V_FIFO_NEW_0的后8bits空间,……,将第12/28/44/60…行的偶数列V数据写进V_FIFO_NEW_3的前8bits空间,将第14/30/46/62…行的偶数列V数据写进V_FIFO_NEW_3的后8bits空间。Write the even column V data of row 0/16/32/48... into the first 8 bits space of V_FIFO_NEW_0, and write the even column V data of row 2/18/34/50... into the last 8 bits space of V_FIFO_NEW_0,... , write the even column V data in the 12/28/44/60... row into the first 8 bits space of V_FIFO_NEW_3, and write the even column V data in the 14/30/46/62... row into the last 8 bits space of V_FIFO_NEW_3.
2)YUV422压缩格式2)YUV422 compression format
a)Y分量a) Y component
将第0/16/32/48……行的Y数据依次写进Y_FIFO_NEW_0的前8bits空间,将第1/17/33/49……行的Y数据依次写进Y_FIFO_NEW_0的后8bits空间,将第2/18/34/50……行的Y数据依次写进Y_FIFO_NEW_1的前8bits空间,将第3/19/35/51……行的Y数据依次写进Y_FIFO_NEW_1的后8bits空间,将第4/20/36/52……行的Y数据依次写进Y_FIFO_NEW_2的前8bits空间,将第5/21/37/53……行的Y数据依次写进Y_FIFO_NEW_2的后8bits空间,将第6/22/38/54……行的Y数据依次写进Y_FIFO_NEW_3的前8bits空间,将第7/23/39/55……行的Y数据依次写进Y_FIFO_NEW_3的后8bits空间,……,将第14/30/46/62……行的Y数据依次写进Y_FIFO_NEW_7的前8bits空间,将第15/31/47/63……行的Y数据依次写进Y_FIFO_NEW_7的后8bits空间。Write the Y data of rows 0/16/32/48... into the first 8 bits space of Y_FIFO_NEW_0 in sequence, write the Y data of rows 1/17/33/49... into the last 8 bits space of Y_FIFO_NEW_0 in sequence, and write the Y data of rows 1/17/33/49... into the last 8 bits space of Y_FIFO_NEW_0 in sequence. The Y data of rows 2/18/34/50... are written into the first 8 bits space of Y_FIFO_NEW_1 in sequence, the Y data of rows 3/19/35/51... are written into the last 8 bits space of Y_FIFO_NEW_1 in sequence, and the Y data of rows 3/19/35/51... are written into the last 8 bits space of Y_FIFO_NEW_1 in sequence. The Y data of rows 20/36/52... are written into the first 8 bits space of Y_FIFO_NEW_2 in sequence, the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence, and the Y data of rows 5/21/37/53... are written into the last 8 bits space of Y_FIFO_NEW_2 in sequence. The Y data of rows 38/54... are written into the first 8 bits space of Y_FIFO_NEW_3 in sequence, and the Y data of rows 7/23/39/55... are written into the last 8 bits space of Y_FIFO_NEW_3 in sequence, ..., and the Y data of rows 7/23/39/55... are written into the last 8 bits space of Y_FIFO_NEW_3. The Y data of rows /46/62... are written into the first 8 bits space of Y_FIFO_NEW_7 in sequence, and the Y data of rows 15/31/47/63... are written into the last 8 bits space of Y_FIFO_NEW_7 in sequence.
b)U分量b)U component
将第0/16/32/48…行的偶数列U数据写进U_FIFO_NEW_0的前8bits空间,将第1/17/33/49…行的偶数列U数据写进U_FIFO_NEW_0的后8bits空间,将第2/18/34/50…行的偶数列U数据写进U_FIFO_NEW_1的前8bits空间,将第3/19/35/51…行的偶数列U数据写进U_FIFO_NEW_1的后8bits空间,……,将第14/30/46/62…行偶数列的U数据写进U_FIFO_NEW_7的前8bits空间,将第15/31/47/63…行偶数列的U数据写进U_FIFO_NEW_7的后8bits空间。Write the even column U data of row 0/16/32/48... into the first 8 bits space of U_FIFO_NEW_0, write the even column U data of row 1/17/33/49... into the last 8 bits space of U_FIFO_NEW_0, Write the even column U data of row 2/18/34/50... into the first 8 bits space of U_FIFO_NEW_1, write the even column U data of row 3/19/35/51... into the last 8 bits space of U_FIFO_NEW_1,..., The U data in the even-numbered columns of rows 14/30/46/62... is written into the first 8bits space of U_FIFO_NEW_7, and the U data in the even-numbered columns of rows 15/31/47/63... is written into the last 8bits space of U_FIFO_NEW_7.
c)V分量c)V component
将第0/16/32/48…行的偶数列V数据写进V_FIFO_NEW_0的前8bits空间,将第1/17/33/49…行的偶数列V数据写进V_FIFO_NEW_0的后8bits空间,将第2/18/34/50…行的偶数列V数据写进V_FIFO_NEW_1的前8bits空间,将第3/19/35/51…行的偶数列V数据写进V_FIFO_NEW_1的后8bits空间,……,将第14/30/46/62…行偶数列的V数据写进V_FIFO_NEW_7的前8bits空间,将第15/31/47/63…行偶数列的V数据写进V_FIFO_NEW_7的后8bits空间。Write the even-numbered column V data of row 0/16/32/48... into the first 8 bits space of V_FIFO_NEW_0, write the even-numbered column V data of row 1/17/33/49... into the last 8 bits space of V_FIFO_NEW_0, Write the even column V data of row 2/18/34/50... into the first 8 bits space of V_FIFO_NEW_1, write the even column V data of row 3/19/35/51... into the last 8 bits space of V_FIFO_NEW_1,..., The V data in the even-numbered columns of rows 14/30/46/62... is written into the first 8bits space of V_FIFO_NEW_7, and the V data in the even-numbered columns of rows 15/31/47/63... is written into the last 8bits space of V_FIFO_NEW_7.
3)YUV444格式3)YUV444 format
a)Y分量a) Y component
将第0/8/16/24…行的Y数据写进Y_FIFO_NEW_0的前8bits存储空间,将第1/9/17/25…行的Y数据写进Y_FIFO_NEW_0的后8bits存储空间,将第2/10/18/26…行的Y数据写进Y_FIFO_NEW_1的前8bits存储空间,将第6/14/22/30…行的Y数据写进Y_FIFO_NEW_3的前8bits存储空间,将第7/15/23/31…行的Y数据写进Y_FIFO_NEW_3的后8bits存储空间。Write the Y data of row 0/8/16/24... into the first 8 bits storage space of Y_FIFO_NEW_0, write the Y data of row 1/9/17/25... into the last 8 bits storage space of Y_FIFO_NEW_0, and write the Y data of row 1/9/17/25... into the last 8 bits storage space of Y_FIFO_NEW_0. Write the Y data of row 10/18/26... into the first 8bits storage space of Y_FIFO_NEW_1, write the Y data of row 6/14/22/30... into the first 8bits storage space of Y_FIFO_NEW_3, and write the Y data of row 6/14/22/30... into the first 8bits storage space of Y_FIFO_NEW_3. The Y data of rows 31... is written into the last 8bits storage space of Y_FIFO_NEW_3.
b)U分量b)U component
将第0/8/16/24…行的U数据写进U_FIFO_NEW_0的前8bits存储空间,将第1/9/17/25…行的U数据写进U_FIFO_NEW_0的后8bits存储空间,将第2/10/18/26…行的U数据写进U_FIFO_NEW_1的前8bits存储空间,……,将第6/14/22/30…行的U数据写进U_FIFO_NEW_3的前8bits存储空间,将第7/15/23/31…行的U数据写进U_FIFO_NEW_3的后8bits存储空间。Write the U data of the 0/8/16/24... line into the first 8 bits storage space of U_FIFO_NEW_0, write the U data of the 1/9/17/25... line into the last 8 bits storage space of U_FIFO_NEW_0, and write the 2/ The U data of row 10/18/26... is written into the first 8 bits storage space of U_FIFO_NEW_1,..., and the U data of row 6/14/22/30... is written into the first 8 bits storage space of U_FIFO_NEW_3, and the U data of row 7/15 is written into the first 8 bits storage space of U_FIFO_NEW_3. The U data of line /23/31... is written into the last 8bits storage space of U_FIFO_NEW_3.
c)V分量c)V component
将第0/8/16/24…行的V数据写进V_FIFO_NEW_0的前8bits存储空间,将第1/9/17/25…行的V数据写进V_FIFO_NEW_0的后8bits存储空间,将第2/10/18/26…行的V数据写进V_FIFO_NEW_1的前8bits存储空间,……,将第6/14/22/30…行的V数据写进V_FIFO_NEW_3的前8bits存储空间,将第7/15/23/31…行的V数据写进V_FIFO_NEW_3的后8bits存储空间。Write the V data in the 0/8/16/24... line into the first 8 bits storage space of V_FIFO_NEW_0, write the V data in the 1/9/17/25... line into the last 8 bits storage space in V_FIFO_NEW_0, and write the 2/ The V data of row 10/18/26... is written into the first 8bits storage space of V_FIFO_NEW_1,..., the V data of row 6/14/22/30... is written into the first 8bits storage space of V_FIFO_NEW_3, and the V data of row 7/15 is written into the first 8bits storage space of V_FIFO_NEW_3. The V data of lines /23/31... is written into the last 8bits storage space of V_FIFO_NEW_3.
上述方案实现了每个FIFO的位宽设置为16bit时,YUV数据的写入。The above scheme realizes the writing of YUV data when the bit width of each FIFO is set to 16bit.
读控制逻辑配置为执行以下步骤:The read control logic is configured to perform the following steps:
在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给视频压缩控制模块。After receiving the read data request from the video compression control module, in each clock cycle, the Y component or U component or The V component data constitutes BLOCK data and is sent to the video compression control module.
首先以YUV420格式下读取相邻两行对应位置的Y分量数据组成第一个BLOCK数据为例,对读出的过程进行说明。First, taking the YUV420 format to read the Y component data of the corresponding positions of two adjacent lines to form the first BLOCK data as an example, the readout process will be explained.
第一个由Y数据组成的BLOCK,由第0行,第1行,……,第15行的前16个Y分量数据组成,读16次Y_FIFO_NEW_0,一次读出16bits,共读出16*16=256bits数据,用Y_FIFO_NEW_0的前8bits空间的数据(共16*8=128bits)组成BLOCK数据的第1行,用Y_FIFO_NEW_0的后8bits空间的数据(共16*8=128bits)组成BLOCK数据的第2行,读16次Y_FIFO_NEW_1,用Y_FIFO_NEW_1的前8bits空间的数据(共16*8=64bits)组成BLOCK数据的第3行,用Y_FIFO_NEW_1的后8bits空间的数据(共16*8=64bits)组成BLOCK数据的第4行,……,读16次Y_FIFO_NEW_7,用Y_FIFO_NEW_7的前8bits空间的数据(共16*8=64bits)组成BLOCK数据的第14行,用Y_FIFO_NEW_7的后8bits空间的数据(共16*8=64bits)组成BLOCK数据的第15行。The first BLOCK composed of Y data consists of the first 16 Y component data of row 0, row 1,..., and row 15. Y_FIFO_NEW_0 is read 16 times, 16bits are read once, and a total of 16*16 is read. =256bits data, use the data in the first 8bits space of Y_FIFO_NEW_0 (total 16*8=128bits) to form the first row of BLOCK data, and use the data in the last 8bits space of Y_FIFO_NEW_0 (total 16*8=128bits) to form the second line of BLOCK data Row, read Y_FIFO_NEW_1 16 times, use the data in the first 8bits of Y_FIFO_NEW_1 (a total of 16*8=64bits) to form the third line of BLOCK data, and use the data in the last 8bits of Y_FIFO_NEW_1 (a total of 16*8=64bits) to form the BLOCK data The 4th line,..., read Y_FIFO_NEW_7 16 times, use the data in the first 8bits space of Y_FIFO_NEW_7 (a total of 16*8=64bits) to form the 14th line of BLOCK data, and use the data in the last 8bits space of Y_FIFO_NEW_7 (a total of 16*8 =64bits) constitutes the 15th line of BLOCK data.
由此可以看出,在传统方案的一个BLOCK数据全部读出,需要读16*16=256次FIFO,即需要256个时钟才可以读出一个BLOCK数据的全部数据,本申请实施例读出组成一个BLOCK数据需要16*8=128次FIFO,即只需要128个时钟周期就可以读出一个BLOCK数据。因此在写入侧的写入速度与传统方案一致的情况下,本申请实施例的读出速度较传统方案提升了1倍,大大的提高了视频压缩效率。It can be seen from this that in the traditional solution to read out all the data of a BLOCK, it is necessary to read 16*16=256 times of FIFO, that is, it takes 256 clocks to read out all the data of a BLOCK. The readout composition of the embodiment of this application A BLOCK data requires 16*8=128 FIFO times, that is, it only takes 128 clock cycles to read out a BLOCK data. Therefore, when the writing speed on the writing side is consistent with the traditional solution, the read speed of the embodiment of the present application is doubled compared with the traditional solution, greatly improving the video compression efficiency.
继续对YUV420格式下读取其他分量数据、YUV422格式下读出Y、U、V分量数据和YUV444格式下 读出Y、U、V分量数据组成BLOCK数据的过程进行说明。Continue to explain the process of reading other component data in YUV420 format, reading Y, U, and V component data in YUV422 format, and reading Y, U, and V component data to form BLOCK data in YUV444 format.
YUV420格式下的U分量读取过程为:The U component reading process in YUV420 format is:
读8次U_FIFO_NEW_0,组成BLOCK的第0、1行,读8次U_FIFO_NEW_1,组成BLOCK的第2、3行,读8次U_FIFO_NEW_2,组成BLOCK的第4、5行,读8次U_FIFO_NEW_3,组成BLOCK的第6、7行。传统方案下,需要读64次U_FIFO,本申请实施例只需读32次。Read U_FIFO_NEW_0 8 times to form the 0th and 1st lines of BLOCK. Read U_FIFO_NEW_1 8 times to form the 2nd and 3rd lines of BLOCK. Read U_FIFO_NEW_2 8 times to form the 4th and 5th lines of BLOCK. Read U_FIFO_NEW_3 8 times to form the BLOCK. Lines 6 and 7. Under the traditional solution, U_FIFO needs to be read 64 times, but in the embodiment of this application, it only needs to be read 32 times.
YUV420格式下的V分量读取过程为:The V component reading process in YUV420 format is:
读8次V_FIFO_NEW_0,组成BLOCK的第0、1行,读8次V_FIFO_NEW_1,组成BLOCK的第2、3行,读8次V_FIFO_NEW_2,组成BLOCK的第4、5行,读8次V_FIFO_NEW_3,组成BLOCK的第6、7行,传统方案下,需要读64次V_FIFO,本申请实施例只需要读32次。Read V_FIFO_NEW_0 8 times to form lines 0 and 1 of BLOCK. Read V_FIFO_NEW_1 8 times to form lines 2 and 3 of BLOCK. Read V_FIFO_NEW_2 8 times to form lines 4 and 5 of BLOCK. Read V_FIFO_NEW_3 8 times to form lines 4 and 5 of BLOCK. In lines 6 and 7, under the traditional scheme, V_FIFO needs to be read 64 times, but in the embodiment of this application, it only needs to be read 32 times.
然后依次循环,读阵列中对应的FIFO中下一个位置的Y、U、V分量数据组成下一个BLOCK数据。Then it loops in sequence to read the Y, U, and V component data at the next position in the corresponding FIFO in the array to form the next BLOCK data.
YUV422格式的Y分量读取过程为:The Y component reading process in YUV422 format is:
读16次Y_FIFO_NEW_0,得到Y_BLOCK数据的第0和1行,读16次Y_FIFO_NEW_1,得到Y_BLOCK数据的第2和3行,……,读16次Y_FIFO_NEW_7,得到Y_BLOCK数据的第14和15行,传统方案下,需要读Y_FIFO,16*16=256次,本申请实施例读16*8=128次。Read Y_FIFO_NEW_0 16 times to get rows 0 and 1 of Y_BLOCK data, read Y_FIFO_NEW_1 16 times to get rows 2 and 3 of Y_BLOCK data, ..., read Y_FIFO_NEW_7 16 times to get rows 14 and 15 of Y_BLOCK data, traditional solution Next, Y_FIFO needs to be read, 16*16=256 times, and the embodiment of this application reads 16*8=128 times.
YUV422格式的U分量读取过程为:The U component reading process in YUV422 format is:
读8次U_FIFO_NEW_0,得到U_BLOCK数据的第0和1行,读8次U_FIFO_NEW_1,得到U_BLOCK数据的第2和3行,……,读8次U_FIFO_NEW_7,得到U_BLOCK数据的第14和15行,传统方案下,需要读U_FIFO,16*8=128次,本申请实施例只需要读8*8=64次。Read U_FIFO_NEW_0 8 times to get rows 0 and 1 of U_BLOCK data, read U_FIFO_NEW_1 8 times to get rows 2 and 3 of U_BLOCK data, ..., read U_FIFO_NEW_7 8 times to get rows 14 and 15 of U_BLOCK data, traditional solution Next, U_FIFO needs to be read 16*8=128 times. In the embodiment of this application, it only needs to be read 8*8=64 times.
YUV422格式的V分量读取过程为:The V component reading process in YUV422 format is:
读8次V_FIFO_NEW_0,得到V_BLOCK数据的第0和1行,读8次V_FIFO_NEW_1,得到V_BLOCK数据的第2和3行,……,读8次V_FIFO_NEW_7,得到V_BLOCK数据的第14和15行,传统方案下,需要读V_FIFO,16*8=128次,本申请实施例只需要读8*8=64次。Read V_FIFO_NEW_0 8 times to get rows 0 and 1 of V_BLOCK data, read V_FIFO_NEW_1 8 times to get rows 2 and 3 of V_BLOCK data,..., read V_FIFO_NEW_7 8 times to get rows 14 and 15 of V_BLOCK data, traditional solution Next, V_FIFO needs to be read 16*8=128 times. In the embodiment of this application, it only needs to be read 8*8=64 times.
YUV444格式的Y分量读取过程为:The Y component reading process in YUV444 format is:
读8次Y_FIFO_NEW_0,得到Y_BLOCK数据的第0和1行,读8次Y_FIFO_NEW_1,得到Y_BLOCK数据的第2和3行,……,读8次Y_FIFO_NEW_3,得到Y_BLOCK数据的第6和7行,传统方案下,需要读Y_FIFO,8*8=64次,本申请实施例只需要读8*4=32次。Read Y_FIFO_NEW_0 8 times to get rows 0 and 1 of Y_BLOCK data, read Y_FIFO_NEW_1 8 times to get rows 2 and 3 of Y_BLOCK data,..., read Y_FIFO_NEW_3 8 times to get rows 6 and 7 of Y_BLOCK data, traditional solution Next, Y_FIFO needs to be read 8*8=64 times. In the embodiment of this application, it only needs to read 8*4=32 times.
YUV444格式的U分量读取过程为:The U component reading process in YUV444 format is:
读8次U_FIFO_NEW_0,得到U_BLOCK数据的第0和1行,读8次U_FIFO_NEW_1,得到U_BLOCK数据的第2和3行,……,读8次U_FIFO_NEW_3,得到U_BLOCK数据的第6和7行,传统方案下,需要读U_FIFO,8*8=64次,本设计方案下,只需要读8*4=32次。Read U_FIFO_NEW_0 8 times to get rows 0 and 1 of U_BLOCK data, read U_FIFO_NEW_1 8 times to get rows 2 and 3 of U_BLOCK data, ..., read U_FIFO_NEW_3 8 times to get rows 6 and 7 of U_BLOCK data, traditional solution Under this design, U_FIFO needs to be read 8*8=64 times. In this design, only 8*4=32 times needs to be read.
YUV444格式的V分量读取过程为:The V component reading process in YUV444 format is:
读8次V_FIFO_NEW_0,得到V_BLOCK数据的第0和1行,读8次V_FIFO_NEW_1,得到V_BLOCK数据的第2和3行,……,读8次V_FIFO_NEW_3,得到V_BLOCK数据的第6和7行,传统方案下,需要读V_FIFO,8*8=64次,本申请实施例只需要读8*4=32次。Read V_FIFO_NEW_0 8 times to get rows 0 and 1 of V_BLOCK data, read V_FIFO_NEW_1 8 times to get rows 2 and 3 of V_BLOCK data, ..., read V_FIFO_NEW_3 8 times to get rows 6 and 7 of V_BLOCK data, traditional solution Next, V_FIFO needs to be read 8*8=64 times. In the embodiment of this application, it only needs to read 8*4=32 times.
然后依次循环,读阵列中对应的FIFO中下一个位置的Y、U、V分量数据组成下一个BLOCK数据。Then it loops in sequence to read the Y, U, and V component data at the next position in the corresponding FIFO in the array to form the next BLOCK data.
由此可以看出读写控制模块的视频数据读出速度大大提高,视频压缩效率大大提高。It can be seen that the video data readout speed of the read-write control module is greatly improved, and the video compression efficiency is greatly improved.
读写控制模块将读出的数据发送到视频压缩控制模块,视频压缩控制模块对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间(CMP_DATA)。The read-write control module sends the read data to the video compression control module, which compresses the received BLOCK data and writes the compressed data into the compressed data storage space (CMP_DATA).
本实施例中,FIFO阵列中YUV数据被读出的速度加快,导致YUV数据在FIFO阵列中缓存的时间变短,因此需要的FIFO容量将比传统的视频压缩系统小,根据项目经验,最高分辨率1920*1200下,需要的FIFO深度是4096,需要的FIFO的总的存储容量为192KB,较传统的768KB大大的较少,因此极大节省了项目成本,降低了传统视频压缩系统中由于FIFO数量过多而引起的时序约束、封装制造困难等问题。In this embodiment, the YUV data in the FIFO array is read out faster, resulting in a shorter buffering time of the YUV data in the FIFO array. Therefore, the required FIFO capacity will be smaller than that of the traditional video compression system. According to project experience, the highest resolution At the rate of 1920*1200, the required FIFO depth is 4096, and the total required FIFO storage capacity is 192KB, which is much less than the traditional 768KB, thus greatly saving project costs and reducing the FIFO cost in traditional video compression systems. Issues such as timing constraints and packaging and manufacturing difficulties caused by excessive quantities.
本实施例通过减少传统视频压缩系统中的FIFO数量并增大每个FIFO的位宽,以及优化读写控制模块的读控制逻辑的读出过程,降低了FIFO所需的存储容量,节省了FIFO在芯片上的占用空间,降低了项目成本,降低了传统视频压缩系统中由于FIFO数量过多而引起的时序约束、封装制造困难等问题,提高了视频数据的读出速度以及视频压缩速度。This embodiment reduces the storage capacity required by the FIFO and saves FIFO by reducing the number of FIFOs in the traditional video compression system and increasing the bit width of each FIFO, as well as optimizing the readout process of the read control logic of the read and write control module. The occupied space on the chip reduces the project cost, reduces the timing constraints and packaging and manufacturing difficulties caused by the excessive number of FIFOs in traditional video compression systems, and improves the readout speed of video data and the speed of video compression.
在一些实施方式中,FIFO阵列模块包括24个FIFO,FIFO阵列模块配置为将第1~8个FIFO设置为存储Y分量数据、第9~16个FIFO设置为存储U分量数据、第17~24个FIFO设置为存储V分量数据,并将每个FIFO的位宽设置为16比特以同时存储相邻两行的Y分量或U分量或V分量数据。In some implementations, the FIFO array module includes 24 FIFOs, and the FIFO array module is configured to set the 1st to 8th FIFOs to store Y component data, the 9th to 16th FIFOs to store U component data, and the 17th to 24th FIFOs. Each FIFO is set to store V component data, and the bit width of each FIFO is set to 16 bits to simultaneously store Y component or U component or V component data of two adjacent rows.
本申请实施例,FIFO阵列模块包括24个FIFO,并将每个FIFO的位宽设置为16比特,以在提高视频数据读出速度的前提下,保证视频数据的写入速度不会减慢。In the embodiment of this application, the FIFO array module includes 24 FIFOs, and the bit width of each FIFO is set to 16 bits, so as to ensure that the writing speed of video data will not be slowed down while increasing the video data reading speed.
在一些实施方式中,读写控制模块具体配置为根据压缩格式对转换后的Y分量、U分量和V分量数据进行丢弃,并在完成数据丢弃后,在每个时钟周期读取保留的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存。In some embodiments, the read-write control module is specifically configured to discard the converted Y component, U component, and V component data according to the compressed format, and after completing the data discarding, read the retained Y component in each clock cycle , U component and V component data are written to their corresponding FIFOs in parallel for caching.
读写控制模块按照CPU下发的压缩格式(YUV444或YUV422或YUV420),对进行了格式转换后的YUV数据,进行对应的YUV数据丢弃后,将保留的YUV数据写入FIFO阵列。例如:YUV422压缩格式,需保留全部的Y数据和偶数列的U/V数据;YUV420压缩格式需保留全部的Y数据和偶数行偶数列的U/V数据;YUV444压缩格式需保留全部行全部列的Y/U/V数据。具体的写入过程为:在每个时钟周期读取同时对应行对应列的Y分量、U分量和V分量数据,将同时读取的Y分量、U分量和V分量数据分别同时写入各自对应的FIFO进行缓存,例如:在一时钟周期内,同时读取第1行第2列的Y分量、U分量和V分量数据,分别对应写入Y_FIFO_0、U_FIFO_0、V_FIFO_0。The read-write control module converts the format-converted YUV data according to the compression format (YUV444 or YUV422 or YUV420) issued by the CPU, discards the corresponding YUV data, and writes the retained YUV data into the FIFO array. For example: YUV422 compression format needs to retain all Y data and U/V data of even columns; YUV420 compression format needs to retain all Y data and U/V data of even rows and even columns; YUV444 compression format needs to retain all rows and all columns Y/U/V data. The specific writing process is: read the Y component, U component and V component data of the corresponding row and column at the same time in each clock cycle, and write the Y component, U component and V component data read at the same time into their respective corresponding The FIFO is cached. For example: within one clock cycle, the Y component, U component and V component data of the 1st row and 2nd column are simultaneously read, and correspondingly written to Y_FIFO_0, U_FIFO_0, V_FIFO_0.
在一些实施方式中,缓存空间采用乒乓缓存结构,包括第一缓存空间和第二缓存空间;In some implementations, the cache space adopts a ping-pong cache structure, including a first cache space and a second cache space;
基板管理控制芯片还配置为将接收到的RGB视频数据以行的方式依次写入第一缓存空间和第二缓存空间;The substrate management control chip is also configured to write the received RGB video data into the first cache space and the second cache space sequentially in a line manner;
色彩空间转换模块还配置为依次从第一缓存空间和第二缓存空间读取相邻两行的RGB视频数据,并将相邻两行的RGB视频数据并行地转换成Y分量、U分量和V分量数据;The color space conversion module is also configured to sequentially read two adjacent rows of RGB video data from the first cache space and the second cache space, and convert the two adjacent rows of RGB video data into Y components, U components and V components in parallel. component data;
读写控制模块还配置为根据压缩格式对转换后的Y分量、U分量和V分量数据进行丢弃,并在完成数据丢弃后,在每个时钟周期并行地读取相邻两行相同列号保留的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存。The read-write control module is also configured to discard the converted Y component, U component and V component data according to the compressed format, and after completing the data discarding, read two adjacent rows with the same column number in parallel in each clock cycle to retain The Y component, U component and V component data are written in parallel to their corresponding FIFOs for caching.
结合图3,对本实施例进行说明,本实施例的大部分过程已在上一个实施例进行了详细解释说明,在此不再赘述,本实施中仅对区别部分进行解释说明。This embodiment will be described with reference to Figure 3. Most of the processes of this embodiment have been explained in detail in the previous embodiment and will not be described again. In this embodiment, only the differences will be explained.
为了进一步的加快视频数据处理速度,缓存空间采用乒乓缓存结构,包括第一缓存空间(SOURCE_DATA_0)和第二缓存空间(SOURCE_DATA_1)。In order to further speed up video data processing, the cache space adopts a ping-pong cache structure, including a first cache space (SOURCE_DATA_0) and a second cache space (SOURCE_DATA_1).
基板管理控制芯片将接收到的RGB视频数据以行的方式依次写入第一缓存空间和第二缓存空间,例如,将第0/2/4/6…行的RGB视频数据写入SOURCE_DATA_0地址空间,将第1/3/5/7…行的RGB视频数据写入SPURCE_DATA_1地址空间,第一缓存空间和第二缓存空间在存储的RGB视频数据被全部读出之后,对各自的缓存空间进行清除以继续存储下一行的RGB视频数据。The baseboard management control chip writes the received RGB video data into the first cache space and the second cache space sequentially in rows. For example, writes the RGB video data in rows 0/2/4/6... into the SOURCE_DATA_0 address space. , write the RGB video data of lines 1/3/5/7... into the SPURCE_DATA_1 address space. After all the stored RGB video data is read out, the first cache space and the second cache space clear their respective cache spaces. to continue storing the next row of RGB video data.
色彩空间转换模块依次从第一缓存空间和第二缓存空间读取相邻两行的RGB视频数据,并将相邻两行的RGB视频数据并行地转换成Y分量、U分量和V分量数据,例如,色彩空间转换模块依次从SOURCE_DATA_0和SOURCE_DATA_1读取第0和第1行的RGB视频数据,将第0和第1行的RGB视频数据并行地转换为Y分量、U分量和V分量数据,此处由于需要转换的RGB视频数据从之前的1行增加为2行,相应的增加色彩空间转换模块中的加法器和乘法器的数量以满足并行转换的需求。The color space conversion module sequentially reads two adjacent rows of RGB video data from the first cache space and the second cache space, and converts the two adjacent rows of RGB video data into Y component, U component and V component data in parallel, For example, the color space conversion module reads the RGB video data of rows 0 and 1 from SOURCE_DATA_0 and SOURCE_DATA_1 in sequence, and converts the RGB video data of rows 0 and 1 into Y component, U component and V component data in parallel. This Because the RGB video data that needs to be converted increases from the previous 1 line to 2 lines, the number of adders and multipliers in the color space conversion module is correspondingly increased to meet the needs of parallel conversion.
读写控制模块根据压缩格式对转换后的Y分量、U分量和V分量数据进行丢弃,并在完成数据丢弃后,在每个时钟周期并行地读取相邻两行相同列号保留的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存,即在每个时钟周期同时读取相邻两行相同列号保留的Y分量、U分量和V分量数据,同时写入各自对应的FIFO进行缓存。例如,在同一个时钟周期,将第0行的第0个Y分量和第1行的第0个Y分量,一起写入Y_FIFO_NEW_0。The read-write control module discards the converted Y component, U component and V component data according to the compressed format, and after completing the data discarding, reads the reserved Y components of two adjacent rows with the same column number in parallel in each clock cycle , U component and V component data are written in parallel to their corresponding FIFOs for caching, that is, the Y component, U component and V component data reserved in two adjacent rows with the same column number are read simultaneously in each clock cycle and written simultaneously. The respective corresponding FIFOs are cached. For example, in the same clock cycle, write the 0th Y component of row 0 and the 0th Y component of row 1 together into Y_FIFO_NEW_0.
本实施例在读写控制模块的视频数据读出速度加快的前提下,通过采用乒乓结构的双缓存空间以及优化色彩空间转换模块的转换运算逻辑使读写控制模块通过在一个时钟周期写入更多的YUV视频数据,提高了视频数据的写入速度,以使后级视频压缩模块可以更快的进行数据压缩,提高了视频压缩效率。In this embodiment, on the premise that the video data readout speed of the read-write control module is accelerated, the read-write control module uses a double buffer space with a ping-pong structure and optimizes the conversion operation logic of the color space conversion module to enable the read-write control module to write updates in one clock cycle. More YUV video data improves the writing speed of video data, so that the subsequent video compression module can compress data faster and improve the video compression efficiency.
读写控制模块写入速度的加快,使原始RGB数据在存储器中的缓存时间变短,由此需要的缓存空间减小,SoC(System on Chip,片上系统)可以将更多的存储器的存储空间分配给操作系统和/或其他模块,进一步的提升了SoC系统的性能。The accelerated writing speed of the read-write control module shortens the cache time of the original RGB data in the memory, thus reducing the cache space required. The SoC (System on Chip, system on chip) can use more memory storage space Assigned to the operating system and/or other modules to further improve the performance of the SoC system.
在一些实施方式中,读写控制模块还具体配置为在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期根据压缩格式以及FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成符合压缩格式要求的BLOCK数据发送给视频压缩控制模块。In some embodiments, the read-write control module is further specifically configured to, after receiving a read data request from the video compression control module, sequentially start from the corresponding FIFO in each clock cycle according to the compression format and the arrangement order of each FIFO in the FIFO array. The Y component or U component or V component data of the corresponding positions of two adjacent rows are read from the FIFO to form BLOCK data that meets the compression format requirements and sent to the video compression control module.
在一些实施方式中,按以下公式将RGB视频数据转换成Y分量、U分量和V分量数据:In some implementations, RGB video data is converted into Y component, U component and V component data according to the following formula:
Y=0.257*R+0.504*G+0.098*B+16Y=0.257*R+0.504*G+0.098*B+16
U=-0.148*R-0.291*G+0.439*B+128U=-0.148*R-0.291*G+0.439*B+128
V=0.439*R-0.368*G-0.071*B+128,V=0.439*R-0.368*G-0.071*B+128,
其中,R表示RGB视频数据中的R分量,G表示RGB视频数据中的G分量,B表示RGB视频数据中的B分量。Among them, R represents the R component in the RGB video data, G represents the G component in the RGB video data, and B represents the B component in the RGB video data.
具体的,传统的视频压缩系统需要9个乘法器和9个加法器,在本申请的采用乒乓结构的双缓存空间后,对应的将乘法器和加法器的数量修改为18个。Specifically, the traditional video compression system requires 9 multipliers and 9 adders. After the double buffer space of the ping-pong structure is adopted in this application, the number of multipliers and adders is correspondingly modified to 18.
在一些实施方式中,视频压缩系统还包括网卡,网卡配置为从压缩数据存储空间读取压缩后的数据发送至远端以进行远端显示。In some implementations, the video compression system further includes a network card, and the network card is configured to read the compressed data from the compressed data storage space and send it to the remote end for remote display.
基于同一发明构思,根据本申请的另一个方面,如图7所示,本申请的实施例还提供了一种用于基板管理控制芯片的视频压缩方法,基于如上视频压缩系统,执行以下步骤:Based on the same inventive concept, according to another aspect of the present application, as shown in Figure 7, an embodiment of the present application also provides a video compression method for a substrate management control chip. Based on the above video compression system, the following steps are performed:
步骤S101、基板管理控制芯片将接收到的RGB视频数据以行的方式写入缓存空间;Step S101: The substrate management control chip writes the received RGB video data into the cache space in a line-by-line manner;
步骤S103、色彩空间转换模块依次从缓存空间读取每一行的RGB视频数据,并将RGB视频数据转换成Y分量、U分量和V分量数据;Step S103: The color space conversion module reads the RGB video data of each row from the cache space in sequence, and converts the RGB video data into Y component, U component and V component data;
步骤S105、FIFO阵列模块基于FIFO的数量对应设置FIFO的位宽以使FIFO同时存储相邻两行的Y分量或U分量或V分量数据;Step S105: The FIFO array module sets the bit width of the FIFO based on the number of FIFOs so that the FIFO stores the Y component, U component, or V component data of two adjacent rows at the same time;
步骤S107、读写控制模块在每个时钟周期读取每一行对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;Step S107: The read-write control module reads the Y component, U component, and V component data at the corresponding position of each row in each clock cycle, and writes them in parallel to the corresponding FIFO for caching;
步骤S109、读写控制模块在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给视频压缩控制模块;Step S109: After receiving the read data request from the video compression control module, the read-write control module reads the corresponding positions of two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array. The Y component or U component or V component data constitutes BLOCK data and is sent to the video compression control module;
步骤S111、视频压缩控制模块对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。Step S111: The video compression control module compresses the received BLOCK data and writes the compressed data into the compressed data storage space.
本申请的实施例至少具有以下有益技术效果:通过减少传统视频压缩系统中的FIFO数量并增大每个FIFO的位宽,以及优化读写控制模块的读控制逻辑的读出过程,降低了FIFO所需的存储容量,节省了FIFO在芯片上的占用空间,降低了项目成本,降低了传统视频压缩系统中由于FIFO数量过多而引起的时序约束、封装制造困难等问题,提高了视频数据的读出速度以及视频压缩速度;在读写控制模块的视频数据读出速度加快的前提下,通过采用乒乓结构的双缓存空间以及优化色彩空间转换模块的转换运算逻辑使读写控制模块通过在一个时钟周期写入更多的YUV视频数据,提高了视频数据的写入速度,以使后级视频压缩模块可以更快的进行数据压缩,提高了视频压缩效率。The embodiments of the present application at least have the following beneficial technical effects: by reducing the number of FIFOs in traditional video compression systems and increasing the bit width of each FIFO, and optimizing the readout process of the read control logic of the read-write control module, the FIFO The required storage capacity saves the space occupied by FIFO on the chip, reduces project costs, reduces timing constraints and packaging and manufacturing difficulties caused by the excessive number of FIFOs in traditional video compression systems, and improves the quality of video data. Readout speed and video compression speed; on the premise that the video data readout speed of the read-write control module is accelerated, the read-write control module uses a double buffer space with a ping-pong structure and optimizes the conversion operation logic of the color space conversion module to enable the read-write control module to pass in one The clock cycle writes more YUV video data, which improves the writing speed of video data, so that the subsequent video compression module can compress data faster and improve the video compression efficiency.
本申请实施例的另一方面,还提供了一种非暂态计算机可读存储介质,非暂态计算机可读存储介质存储有被处理器执行时实现如上方法步骤的计算机可读指令。Another aspect of the embodiments of the present application also provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer-readable instructions that implement the above method steps when executed by a processor.
基于同一发明构思,根据本申请的另一个方面,如图8所示,本申请的实施例还提供了一种非暂态计算机可读存储介质40,非暂态计算机可读存储介质40存储有被处理器执行时执行如上方法的计算机可读指令410。Based on the same inventive concept, according to another aspect of the present application, as shown in FIG. 8, an embodiment of the present application also provides a non-transitory computer-readable storage medium 40. The non-transitory computer-readable storage medium 40 stores Computer readable instructions 410 that when executed by a processor perform the above method.
基于同一发明构思,根据本申请的另一个方面,如图9所示,本申请的实施例还提供了一种服务器90,包括如上的视频压缩系统910。Based on the same inventive concept, according to another aspect of the present application, as shown in Figure 9, an embodiment of the present application also provides a server 90, including the above video compression system 910.
本申请实施例还可以包括相应的计算机设备。计算机设备包括存储器、至少一个处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行程序时执行上述任意一种方法。The embodiments of this application may also include corresponding computer equipment. The computer device includes a memory, at least one processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the program, any one of the above methods is performed.
其中,存储器作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性 计算机可执行程序以及模块,如本申请实施例中的视频压缩方法对应的程序指令/模块。处理器通过运行存储在存储器中的非易失性软件程序、指令以及模块,从而执行装置的各种功能应用以及数据处理,即实现上述方法实施例的视频压缩方法。The memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program corresponding to the video compression method in the embodiment of the present application. directive/module. The processor executes various functional applications and data processing of the device by running non-volatile software programs, instructions and modules stored in the memory, that is, implementing the video compression method of the above method embodiment.
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据装置的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a program storage area and a data storage area, where the program storage area may store an operating system and an application program required for at least one function; the storage data area may store data created according to use of the device, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the local module through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本申请实施例公开的范围。Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits and steps have been described generally in terms of their functionality. Whether this functionality is implemented as software or hardware depends on the specific application and the design constraints imposed on the overall system. Those skilled in the art can implement the functions in various ways for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments disclosed in the present application.
以上是本申请公开的示例性实施例,但是应当注意,在不背离权利要求限定的本申请实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。上述本申请实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。此外,尽管本申请实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are exemplary embodiments disclosed in the present application, but it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed in the present application as defined in the claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. The embodiment numbers disclosed in the above embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments. In addition, although the elements disclosed in the embodiments of the present application may be described or claimed in individual form, they may also be understood as plural unless explicitly limited to the singular.
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It will be understood that, as used herein, the singular form "a" and "an" are intended to include the plural form as well, unless the context clearly supports an exception. It will also be understood that as used herein, "and/or" is meant to include any and all possible combinations of one or more of the associated listed items.
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本申请实施例公开的范围(包括权利要求)被限于这些例子;在本申请实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本申请实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本申请实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本申请实施例的保护范围之内。Those of ordinary skill in the art should understand that the above discussion of any embodiments is only illustrative, and is not intended to imply that the scope of the disclosure of the embodiments of the present application (including the claims) is limited to these examples; under the ideas of the embodiments of the present application , the above embodiments or technical features in different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present application, which are not provided in details for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included in the protection scope of the embodiments of the present application.

Claims (20)

  1. 一种用于基板管理控制芯片的视频压缩系统,其特征在于,包括色彩空间转换模块、存储器、FIFO阵列模块、读写控制模块、视频压缩控制模块,所述存储器包括缓存空间和压缩数据存储空间,所述FIFO阵列模块包括多个FIFO,所述FIFO用于存储Y分量或V分量或U分量数据;A video compression system for substrate management control chip, which is characterized in that it includes a color space conversion module, a memory, a FIFO array module, a read-write control module, and a video compression control module. The memory includes a cache space and a compressed data storage space. , the FIFO array module includes multiple FIFOs, the FIFOs are used to store Y component or V component or U component data;
    基板管理控制芯片配置为将接收到的RGB视频数据以行的方式写入所述缓存空间;The baseboard management control chip is configured to write the received RGB video data into the cache space in a line manner;
    所述色彩空间转换模块配置为依次从所述缓存空间读取每一行的RGB视频数据,并将所述RGB视频数据转换成Y分量、U分量和V分量数据;The color space conversion module is configured to read each line of RGB video data from the cache space in sequence, and convert the RGB video data into Y component, U component and V component data;
    所述FIFO阵列模块配置为基于所述FIFO的数量对应设置所述FIFO的位宽以使所述FIFO同时存储相邻两行的Y分量或U分量或V分量数据;The FIFO array module is configured to correspondingly set the bit width of the FIFO based on the number of the FIFO so that the FIFO simultaneously stores Y component or U component or V component data of two adjacent rows;
    所述读写控制模块配置为在每个时钟周期读取对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;The read-write control module is configured to read the Y component, U component and V component data at the corresponding position in each clock cycle, and write them in parallel to the corresponding FIFO for caching;
    所述读写控制模块还配置为在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照所述FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给所述视频压缩控制模块;以及The read-write control module is also configured to, after receiving a read data request from the video compression control module, sequentially read adjacent FIFOs from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array. The Y component, U component or V component data at the corresponding positions of the two rows form BLOCK data and send it to the video compression control module; and
    所述视频压缩控制模块配置为对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。The video compression control module is configured to compress the received BLOCK data and write the compressed data into the compressed data storage space.
  2. 根据权利要求1所述的系统,其特征在于,所述FIFO阵列模块包括24个FIFO,所述FIFO阵列模块配置为将第1~8个FIFO设置为存储Y分量数据、第9~16个FIFO设置为存储U分量数据、第17~24个FIFO设置为存储V分量数据,并将每个FIFO的位宽设置为16比特以同时存储相邻两行的Y分量或U分量或V分量数据。The system according to claim 1, characterized in that the FIFO array module includes 24 FIFOs, and the FIFO array module is configured to set the 1st to 8th FIFOs to store Y component data, the 9th to 16th FIFOs Set to store U component data, the 17th to 24th FIFOs are set to store V component data, and the bit width of each FIFO is set to 16 bits to simultaneously store Y component or U component or V component data of two adjacent rows.
  3. 根据权利要求1所述的系统,其特征在于,所述存储器为静态随机存取存储器、同步动态随机存取存储器或双倍速率同步动态随机存储器。The system according to claim 1, wherein the memory is a static random access memory, a synchronous dynamic random access memory or a double rate synchronous dynamic random access memory.
  4. 根据权利要求2所述的系统,其特征在于,所述读写控制模块具体配置为根据压缩格式对转换后的Y分量、U分量和V分量数据进行丢弃,并在完成数据丢弃后,在每个时钟周期读取保留的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存。The system according to claim 2, characterized in that the read-write control module is specifically configured to discard the converted Y component, U component and V component data according to the compression format, and after completing the data discarding, in each Read the reserved Y component, U component and V component data in one clock cycle, and write them in parallel to their corresponding FIFOs for caching.
  5. 根据权利要求2所述的系统,其特征在于,所述读写控制模块具体配置为根据压缩格式读取转换后且需要保留的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存后,将未写入的Y分量、U分量和V分量数据进行丢弃。The system according to claim 2, characterized in that the read-write control module is specifically configured to read the converted Y component, U component and V component data that need to be retained according to the compressed format, and write the respective corresponding data in parallel. After the FIFO is cached, the unwritten Y component, U component and V component data are discarded.
  6. 根据权利要求4所述的系统,其特征在于,所述压缩格式包括YUV420压缩格式、YUV422压缩格式和YUV444格式之中的至少一种。The system according to claim 4, wherein the compression format includes at least one of YUV420 compression format, YUV422 compression format and YUV444 format.
  7. 根据权利要求6所述的系统,其特征在于,所述压缩格式为YUV422压缩格式,所述读写控制模块具体配置为保留全部的Y数据以及偶数列的U数据或V数据。The system according to claim 6, wherein the compression format is YUV422 compression format, and the read-write control module is specifically configured to retain all Y data and U data or V data of even columns.
  8. 根据权利要求6所述的系统,其特征在于,所述压缩格式为YUV420压缩格式,所述读写控制模块具体配置为保留全部的Y数据以及偶数行偶数列的U数据或V数据。The system according to claim 6, wherein the compression format is YUV420 compression format, and the read-write control module is specifically configured to retain all Y data and U data or V data of even rows and even columns.
  9. 根据权利要求6所述的系统,其特征在于,所述压缩格式为YUV444压缩格式,所述读写控制模块具体配置为保留全部行全部列的Y数据、U数据或V数据。The system according to claim 6, wherein the compression format is YUV444 compression format, and the read-write control module is specifically configured to retain Y data, U data or V data of all rows and all columns.
  10. 根据权利要求2所述的系统,其特征在于,所述缓存空间采用乒乓缓存结构,包括第一缓存空间和第二缓存空间;The system according to claim 2, characterized in that the cache space adopts a ping-pong cache structure and includes a first cache space and a second cache space;
    所述基板管理控制芯片还配置为将接收到的RGB视频数据以行的方式依次写入第一缓存空间和第二缓存空间;The substrate management control chip is further configured to write the received RGB video data into the first cache space and the second cache space sequentially in a line manner;
    所述色彩空间转换模块还配置为依次从所述第一缓存空间和第二缓存空间读取相邻两行的RGB视频数据,并将相邻两行的RGB视频数据并行地转换成Y分量、U分量和V分量数据;以及The color space conversion module is also configured to sequentially read two adjacent rows of RGB video data from the first cache space and the second cache space, and convert the two adjacent rows of RGB video data into Y components in parallel. U component and V component data; and
    所述读写控制模块还配置为根据压缩格式对转换后的Y分量、U分量和V分量数据进行丢弃,并在完成数据丢弃后,在每个时钟周期并行地读取相邻两行相同列号保留的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存。The read-write control module is also configured to discard the converted Y component, U component and V component data according to the compressed format, and after completing the data discarding, read two adjacent rows of the same column in parallel in each clock cycle. The Y component, U component and V component data retained by the number are written to their respective corresponding FIFOs in parallel for caching.
  11. 根据权利要求2所述的系统,其特征在于,所述读写控制模块还具体配置为在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期根据压缩格式以及所述FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成符合所述压缩格式要求的BLOCK数据发送给所述视频压缩控制模块。The system according to claim 2, wherein the read-write control module is further specifically configured to, after receiving a read data request from the video compression control module, read data according to the compression format and the FIFO array in each clock cycle. The arrangement sequence of each FIFO in the FIFO sequentially reads the Y component or U component or V component data of two adjacent rows at corresponding positions to form BLOCK data that meets the requirements of the compression format and sends it to the video compression control module.
  12. 根据权利要求2所述的系统,其特征在于,按以下公式将所述RGB视频数据转换成Y分量、U分量和V分量数据:The system according to claim 2, characterized in that the RGB video data is converted into Y component, U component and V component data according to the following formula:
    Y=0.257*R+0.504*G+0.098*B+16Y=0.257*R+0.504*G+0.098*B+16
    U=-0.148*R-0.291*G+0.439*B+128U=-0.148*R-0.291*G+0.439*B+128
    V=0.439*R-0.368*G-0.071*B+128,V=0.439*R-0.368*G-0.071*B+128,
    其中,R表示RGB视频数据中的R分量,G表示RGB视频数据中的G分量,B表示RGB视频数据中的B分量。Among them, R represents the R component in the RGB video data, G represents the G component in the RGB video data, and B represents the B component in the RGB video data.
  13. 根据权利要求2所述的系统,其特征在于,还包括网卡,所述网卡配置为从所述压缩数据存储空间读取压缩后的数据发送至远端以进行远端显示。The system according to claim 2, further comprising a network card configured to read compressed data from the compressed data storage space and send it to a remote end for remote display.
  14. 一种用于基板管理控制芯片的视频压缩方法,其特征在于,基于权利要求1至7任一项所述视频压缩系统执行,包括:A video compression method for a substrate management control chip, characterized in that it is executed based on the video compression system according to any one of claims 1 to 7, including:
    基板管理控制芯片将接收到的RGB视频数据以行的方式写入缓存空间;The baseboard management control chip writes the received RGB video data into the buffer space in rows;
    色彩空间转换模块依次从所述缓存空间读取每一行的RGB视频数据,并将所述RGB视频数据转换成Y分量、U分量和V分量数据;The color space conversion module sequentially reads the RGB video data of each row from the cache space, and converts the RGB video data into Y component, U component and V component data;
    FIFO阵列模块基于FIFO的数量对应设置所述FIFO的位宽以使所述FIFO同时存储相邻两行的Y分量或U分量或V分量数据;The FIFO array module sets the bit width of the FIFO correspondingly based on the number of FIFOs so that the FIFO stores the Y component or U component or V component data of two adjacent rows at the same time;
    读写控制模块在每个时钟周期读取每一行对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;The read-write control module reads the Y component, U component and V component data at the corresponding position of each row in each clock cycle, and writes them in parallel to the corresponding FIFO for caching;
    所述读写控制模块在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照所述FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量 或V分量数据组成BLOCK数据发送给视频压缩控制模块;以及After receiving the read data request from the video compression control module, the read-write control module reads two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array. The Y component or U component or V component data of the position constitutes BLOCK data and is sent to the video compression control module; and
    所述视频压缩控制模块对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。The video compression control module compresses the received BLOCK data and writes the compressed data into the compressed data storage space.
  15. 根据权利要求14所述的方法,其特征在于,所述FIFO阵列模块包括24个FIFO,所述FIFO阵列模块基于FIFO的数量对应设置所述FIFO的位宽以使所述FIFO同时存储相邻两行的Y分量或U分量或V分量数据,包括:The method according to claim 14, characterized in that the FIFO array module includes 24 FIFOs, and the FIFO array module sets the bit width of the FIFO correspondingly based on the number of FIFOs so that the FIFO stores two adjacent FIFOs at the same time. The Y component, U component, or V component data of the row, including:
    将第1~8个FIFO设置为存储Y分量数据、第9~16个FIFO设置为存储U分量数据、第17~24个FIFO设置为存储V分量数据,并将每个FIFO的位宽设置为16比特以同时存储相邻两行的Y分量或U分量或V分量数据。Set the 1st to 8th FIFOs to store Y component data, the 9th to 16th FIFOs to store U component data, the 17th to 24th FIFOs to store V component data, and set the bit width of each FIFO to 16 bits to simultaneously store the Y component or U component or V component data of two adjacent rows.
  16. 一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现:A non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions are implemented when executed by a processor:
    基板管理控制芯片将接收到的RGB视频数据以行的方式写入缓存空间;The baseboard management control chip writes the received RGB video data into the buffer space in rows;
    色彩空间转换模块依次从所述缓存空间读取每一行的RGB视频数据,并将所述RGB视频数据转换成Y分量、U分量和V分量数据;The color space conversion module sequentially reads the RGB video data of each row from the cache space, and converts the RGB video data into Y component, U component and V component data;
    FIFO阵列模块基于FIFO的数量对应设置所述FIFO的位宽以使所述FIFO同时存储相邻两行的Y分量或U分量或V分量数据;The FIFO array module sets the bit width of the FIFO correspondingly based on the number of FIFOs so that the FIFO stores the Y component or U component or V component data of two adjacent rows at the same time;
    读写控制模块在每个时钟周期读取每一行对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;The read-write control module reads the Y component, U component and V component data at the corresponding position of each row in each clock cycle, and writes them in parallel to the corresponding FIFO for caching;
    所述读写控制模块在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照所述FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给视频压缩控制模块;以及After receiving the read data request from the video compression control module, the read-write control module reads two adjacent rows from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array. The Y component or U component or V component data of the position constitutes BLOCK data and is sent to the video compression control module; and
    所述视频压缩控制模块对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。The video compression control module compresses the received BLOCK data and writes the compressed data into the compressed data storage space.
  17. 根据权利要求16所述的非暂态计算机可读存储介质,其特征在于,所述FIFO阵列模块基于FIFO的数量对应设置所述FIFO的位宽以使所述FIFO同时存储相邻两行的Y分量或U分量或V分量数据,包括:The non-transitory computer-readable storage medium according to claim 16, characterized in that the FIFO array module sets the bit width of the FIFO correspondingly based on the number of FIFOs so that the FIFO stores the Y of two adjacent rows at the same time. Component or U component or V component data, including:
    将第1~8个FIFO设置为存储Y分量数据、第9~16个FIFO设置为存储U分量数据、第17~24个FIFO设置为存储V分量数据,并将每个FIFO的位宽设置为16比特以同时存储相邻两行的Y分量或U分量或V分量数据。Set the 1st to 8th FIFOs to store Y component data, the 9th to 16th FIFOs to store U component data, the 17th to 24th FIFOs to store V component data, and set the bit width of each FIFO to 16 bits to simultaneously store the Y component or U component or V component data of two adjacent rows.
  18. 一种服务器,其特征在于,所述服务器用于基板管理控制芯片的视频压缩系统,所述系统包括色彩空间转换模块、存储器、FIFO阵列模块、读写控制模块、视频压缩控制模块,所述存储器包括缓存空间和压缩数据存储空间,所述FIFO阵列模块包括多个FIFO,所述FIFO用于存储Y分量或V分量或U分量数据;A server, characterized in that the server is used in a video compression system of a substrate management control chip. The system includes a color space conversion module, a memory, a FIFO array module, a read-write control module, and a video compression control module. The memory Including cache space and compressed data storage space, the FIFO array module includes multiple FIFOs, the FIFOs are used to store Y component or V component or U component data;
    基板管理控制芯片配置为将接收到的RGB视频数据以行的方式写入所述缓存空间;The baseboard management control chip is configured to write the received RGB video data into the cache space in a line manner;
    所述色彩空间转换模块配置为依次从所述缓存空间读取每一行的RGB视频数据,并将所述RGB 视频数据转换成Y分量、U分量和V分量数据;The color space conversion module is configured to read each line of RGB video data from the cache space in sequence, and convert the RGB video data into Y component, U component and V component data;
    所述FIFO阵列模块配置为基于所述FIFO的数量对应设置所述FIFO的位宽以使所述FIFO同时存储相邻两行的Y分量或U分量或V分量数据;The FIFO array module is configured to correspondingly set the bit width of the FIFO based on the number of the FIFO so that the FIFO simultaneously stores Y component or U component or V component data of two adjacent rows;
    所述读写控制模块配置为在每个时钟周期读取对应位置的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存;The read-write control module is configured to read the Y component, U component and V component data at the corresponding position in each clock cycle, and write them in parallel to the corresponding FIFO for caching;
    所述读写控制模块还配置为在接收到视频压缩控制模块发出的读数据请求后,在每个时钟周期按照所述FIFO阵列中每个FIFO的排列顺序依次从对应的FIFO中读取相邻两行对应位置的Y分量或U分量或V分量数据组成BLOCK数据发送给所述视频压缩控制模块;以及The read-write control module is also configured to, after receiving a read data request from the video compression control module, sequentially read adjacent FIFOs from the corresponding FIFO in each clock cycle according to the arrangement order of each FIFO in the FIFO array. The Y component, U component or V component data at the corresponding positions of the two rows form BLOCK data and send it to the video compression control module; and
    所述视频压缩控制模块配置为对接收到的BLOCK数据进行压缩,并将压缩后的数据写入压缩数据存储空间。The video compression control module is configured to compress the received BLOCK data and write the compressed data into the compressed data storage space.
  19. 根据权利要求18所述的服务器,其特征在于,所述FIFO阵列模块包括24个FIFO,所述FIFO阵列模块配置为将第1~8个FIFO设置为存储Y分量数据、第9~16个FIFO设置为存储U分量数据、第17~24个FIFO设置为存储V分量数据,并将每个FIFO的位宽设置为16比特以同时存储相邻两行的Y分量或U分量或V分量数据。The server according to claim 18, characterized in that the FIFO array module includes 24 FIFOs, and the FIFO array module is configured to set the 1st to 8th FIFOs to store Y component data, the 9th to 16th FIFOs Set to store U component data, the 17th to 24th FIFOs are set to store V component data, and the bit width of each FIFO is set to 16 bits to simultaneously store Y component or U component or V component data of two adjacent rows.
  20. 根据权利要求18所述的服务器,其特征在于,所述读写控制模块具体配置为根据压缩格式对转换后的Y分量、U分量和V分量数据进行丢弃,并在完成数据丢弃后,在每个时钟周期读取保留的Y分量、U分量和V分量数据,并行地写入各自对应的FIFO进行缓存。The server according to claim 18, characterized in that the read-write control module is specifically configured to discard the converted Y component, U component and V component data according to the compression format, and after completing the data discarding, in each Read the reserved Y component, U component and V component data in one clock cycle, and write them in parallel to their corresponding FIFOs for caching.
PCT/CN2022/138326 2022-04-02 2022-12-12 Video compression system and method, computer readable storage medium, and server WO2023185094A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210340428.5A CN114501024B (en) 2022-04-02 2022-04-02 Video compression system, method, computer readable storage medium and server
CN202210340428.5 2022-04-02

Publications (1)

Publication Number Publication Date
WO2023185094A1 true WO2023185094A1 (en) 2023-10-05

Family

ID=81487850

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/138326 WO2023185094A1 (en) 2022-04-02 2022-12-12 Video compression system and method, computer readable storage medium, and server

Country Status (2)

Country Link
CN (1) CN114501024B (en)
WO (1) WO2023185094A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114501024B (en) * 2022-04-02 2022-07-19 苏州浪潮智能科技有限公司 Video compression system, method, computer readable storage medium and server
CN115086668B (en) * 2022-07-21 2023-01-10 苏州浪潮智能科技有限公司 Video compression method, system, equipment and computer readable storage medium
CN115499667B (en) * 2022-11-17 2023-07-14 山东云海国创云计算装备产业创新中心有限公司 Video processing method, device, equipment and readable storage medium
CN117032598B (en) * 2023-10-09 2024-01-26 苏州元脑智能科技有限公司 YUV video transmission system, baseboard management controller, method, equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003224862A (en) * 2002-01-29 2003-08-08 Nec Access Technica Ltd Graphic controller and display memory capacity reduction system
US7023413B1 (en) * 1997-10-24 2006-04-04 Canon Kabushiki Kaisha Memory controller and liquid crystal display apparatus using the same
CN106021182A (en) * 2016-05-17 2016-10-12 华中科技大学 Line transpose architecture design method based on two-dimensional FFT (Fast Fourier Transform) processor
CN107547904A (en) * 2017-09-05 2018-01-05 郑州云海信息技术有限公司 Yuv data 8x8block conversion methods and device in a kind of video compress based on FPGA
CN113794849A (en) * 2021-11-12 2021-12-14 深圳比特微电子科技有限公司 Device and method for synchronizing image data and image acquisition system
CN114501024A (en) * 2022-04-02 2022-05-13 苏州浪潮智能科技有限公司 Video compression system, method, computer readable storage medium and server

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08512439A (en) * 1993-04-16 1996-12-24 データ トランスレイション,インコーポレイテッド Display of subsampled video image on computer display
JPH10112789A (en) * 1996-10-07 1998-04-28 Fuji Photo Film Co Ltd Printer system and its operation control method
JPH1141396A (en) * 1997-07-15 1999-02-12 Canon Inc Image processor and control method therefor
CN1320823C (en) * 2002-07-19 2007-06-06 三星电子株式会社 Image processing device and method
KR100716791B1 (en) * 2005-08-08 2007-05-14 삼성전기주식회사 Image compression device and image compression method
CA2644379C (en) * 2007-12-19 2015-01-06 Sony Corporation Visually lossless video data compression
US8098959B2 (en) * 2008-10-29 2012-01-17 Aptina Imaging Corporation Method and system for frame rotation within a JPEG compressed pipeline
CN104702860B (en) * 2015-03-19 2017-12-05 深圳市载德光电技术开发有限公司 Video image switching system based on FPGA
CN114051145B (en) * 2022-01-11 2022-04-22 苏州浪潮智能科技有限公司 Video compression processing method, device and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7023413B1 (en) * 1997-10-24 2006-04-04 Canon Kabushiki Kaisha Memory controller and liquid crystal display apparatus using the same
JP2003224862A (en) * 2002-01-29 2003-08-08 Nec Access Technica Ltd Graphic controller and display memory capacity reduction system
CN106021182A (en) * 2016-05-17 2016-10-12 华中科技大学 Line transpose architecture design method based on two-dimensional FFT (Fast Fourier Transform) processor
CN107547904A (en) * 2017-09-05 2018-01-05 郑州云海信息技术有限公司 Yuv data 8x8block conversion methods and device in a kind of video compress based on FPGA
CN113794849A (en) * 2021-11-12 2021-12-14 深圳比特微电子科技有限公司 Device and method for synchronizing image data and image acquisition system
CN114501024A (en) * 2022-04-02 2022-05-13 苏州浪潮智能科技有限公司 Video compression system, method, computer readable storage medium and server

Also Published As

Publication number Publication date
CN114501024A (en) 2022-05-13
CN114501024B (en) 2022-07-19

Similar Documents

Publication Publication Date Title
WO2023185094A1 (en) Video compression system and method, computer readable storage medium, and server
TW201233185A (en) Reformatting data to decrease bandwidth between a video encoder and a buffer
WO2021248936A1 (en) Video storage method and apparatus, and soc system and medium
CN112235579B (en) Video processing method, computer-readable storage medium and electronic device
JP2014123830A (en) Moving image compression/expansion device
WO2024016520A1 (en) Video compression method, system and device, and computer non-volatile readable storage medium
US10110896B2 (en) Adaptive motion JPEG encoding method and system
CN114428595A (en) Image processing method, image processing device, computer equipment and storage medium
CN108134912B (en) Video stream conversion method
WO2023179136A1 (en) Video compression system and server
WO2024074012A1 (en) Video transmission control method, apparatus and device, and nonvolatile readable storage medium
JP2004514354A (en) On-the-fly transfer of data between RGB and YCrCb color space to DCT interface
CN108459969B (en) Data storage and transmission method in 64-bit multi-core server
CN114286035B (en) Image acquisition card, image acquisition method and image acquisition system
Gong et al. Design of high-speed real-time sensor image processing based on FPGA and DDR3
CN101859334B (en) Design method of interconnection cache structure of video decoding module and video display processing module
TWI777360B (en) Data compression method, data compression system and operation method of deep learning acceleration chip
CN101847394B (en) Storage mapping method and device for encoding and displaying video files
CN112153355B (en) Digital image pixel conversion system and method based on FPGA
CN114554171A (en) Image format conversion method, device, display screen control equipment and storage medium
CN114302089A (en) Multi-channel video signal cache control method and system based on FPGA
CN102947859B (en) Image processing apparatus
CN114422801B (en) Method, system, device and storage medium for optimizing video compression control logic
CN112995675A (en) Video acquisition compression and data encapsulation method suitable for airborne downloading
US10146679B2 (en) On die/off die memory management

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22934911

Country of ref document: EP

Kind code of ref document: A1