WO2023213002A1 - Video data processing system based on fpga - Google Patents

Video data processing system based on fpga Download PDF

Info

Publication number
WO2023213002A1
WO2023213002A1 PCT/CN2022/103811 CN2022103811W WO2023213002A1 WO 2023213002 A1 WO2023213002 A1 WO 2023213002A1 CN 2022103811 W CN2022103811 W CN 2022103811W WO 2023213002 A1 WO2023213002 A1 WO 2023213002A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
fpga
signal
hdmi
input end
Prior art date
Application number
PCT/CN2022/103811
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 WO2023213002A1 publication Critical patent/WO2023213002A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • H04N7/0127Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level by changing the field or frame frequency of the incoming video signal, e.g. frame rate converter
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G3/00Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
    • G09G3/20Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
    • G09G3/34Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters by control of light from an independent source
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • H04N7/0105Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level using a storage device with different write and read speed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • H04N7/0125Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level one of the standards being a high definition standard
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/67Circuits for processing colour signals for matrixing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/77Circuits for processing the brightness signal and the chrominance signal relative to each other, e.g. adjusting the phase of the brightness signal relative to the colour signal, correcting differential gain or differential phase

Definitions

  • the invention relates to the technical field of video data processing, specifically a video data processing system based on FPGA.
  • FPGA field programmable gate array. In layman's terms, it is a blank digital logic circuit that can be programmed arbitrarily to achieve different functions by modifying the internal program. Due to its strong ability to process big data, it is widely used in high-speed data processing fields, such as high-definition video data streams.
  • Option 1 Although the cost is low and the price is low, it can only run on the Windows platform. Currently, Linux, Mac, and Android TV are not available, and cannot be used on multiple platforms such as TVs or Android systems; due to the need to record the screen in real time for video processing, It takes up a lot of computer resources; the delay is large and the frame rate is low. Since the data needs to be forwarded multiple times, the delay on the light strip is larger than the screen, causing out-of-synchronization problems.
  • Option 2 Although it solves the cross-platform problem, it requires HDMI2.0 splitter, HDMI high-definition conversion chip and high-performance arm processing chip, which causes high cost. Moreover, HDMI2.0 has massive data and relies on CPU to calculate. It will cause overload and large delay problems.
  • the present invention provides a video data processing system based on FPGA to solve the problems raised in the above background technology.
  • a video data processing system based on FPGA including an HDMI receiving module, an HDMI transmitting module and an LED driving module.
  • the input end of the HDMI receiving module is connected to the external HDMI input terminal.
  • the output end is connected to the signal
  • the input end of the HDMI transmitting module is connected to the output end of the external HDMI output terminal
  • the input end of the LED drive module is connected to the input end of the external LED light strip interface, so
  • the output end of the HDMI receiving module is connected to the input end of the HDMI transmitting module for signal connection, and is used to restore the TMDS data of the HDMI cable to the original video data
  • the FPGA-based video data processing system also includes a decryption module.
  • the output signal of the decryption module is connected to the input end of the color space conversion module.
  • the output signal of the color space conversion module is connected to the resolution scaling module.
  • the output end signal of the resolution scaling module is connected to the input end of the frame extraction module
  • the output end signal of the frame extraction module is connected to the input end of the HDR decoding module
  • the output end signal of the HDR decoding module is connected
  • There is an input end of the data buffer module the output end signal of the data buffer module is connected to the input end of the memory module
  • the output end signal of the memory module is connected to the input end of the pixel average calculation module
  • the pixel average calculation module The output signal is connected to the input end of the frame delay module, and the output signal of the frame delay module is connected to the input end of the LED driver module.
  • the FPGA-based video data processing system is also provided with a parameter module, which is used to calculate each lamp bead by detecting the input resolution and the number of detected chips of the LED strip.
  • the chip model of the LED light strip is ws2812 chip.
  • the input signal of the memory module is connected to a memory read and write address module.
  • the memory read and write module is an address counter of RAM. When writing data, it is written line by line; when reading At this time, the data is randomly taken out according to the address required by the light strip. The random address is calculated based on the address mapping of the RAM coordinates according to the position of the light strip.
  • the output end of the LED drive module is also signal-connected to the input end of the LED drive quantity detection module.
  • the LED drive quantity detection module is used to detect external voltages through the current increment method when the system is turned on. The number of chips on the LED strip.
  • the color space conversion module is used to convert YCbCr to RGB color space.
  • RGB grayscale values in different standard formats can be calculated through a series of matrix operations; when the input HDMI signal source is After formatting YCbCr, the color space conversion module will automatically perform color space conversion and convert the YCbCr color space to RGB color space.
  • the resolution scaling module is used to convert 4K signals to the resolution of 1080P format.
  • the purpose of reducing the bandwidth of the pipeline is achieved by reducing the resolution of the input signal.
  • the system bandwidth exceeds 165M*24bit, the system enables the resolution reduction module.
  • the input signal is 3840*2160, the actual output resolution is 1920*1080, and the FPGA system bandwidth is reduced to 1/4 of the original.
  • the frame extraction module is used to convert signals higher than 60Hz into signals not higher than 60Hz.
  • the frame extraction module detects the frame rate of the input signal in real time. When it exceeds 60Hz, the frame rate is Divide by 2. If it still exceeds 60Hz, continue dividing by 2 until it is less than 60Hz to ensure that the load points of the back-end ws2812 chip are not affected.
  • the HDR decoding module is used to determine whether the input signal is in HDR format by detecting the header of the HDR data packet, identify the HDR data, and perform a remapping calculation on the grayscale of the data. Avoid the problem of RGB data desaturation.
  • the data buffer module is used to buffer data and isolate the internal and external clock domains of the FPGA; the signal from HDMI is sent line by line, written to the buffer according to the control of the DE signal, and FIFO is used to match The speed difference is used to match the internal speed of the FPGA.
  • the parameter module is used to calculate the rectangular pixel area of the TV set corresponding to each LED lamp bead by detecting the resolution of the HDMI signal and the number of lamp beads of the LED lamp strip, thereby obtaining The average value of the RGB in the rectangular area is used as the RGB gray value; at the same time, the parameter module can configure various parameters of the FPGA and define the parameters of the FPGA as a table.
  • the present invention provides a video data processing system based on FPGA, which has the following beneficial effects:
  • This FPGA-based video data processing system is used for TV background atmosphere lights, controls LED lamp beads and detects the number of driver chips to change colors synchronously with the TV periphery to enhance the atmosphere. It has the ability to process massive data in parallel and is low-cost. , low latency, fast processing speed, and user-free debugging configuration, etc., it solves the problems of low integration, low reliability, high cost, serious system delay and easy heat generation of the current system.
  • Figure 1 is a schematic structural diagram of an FPGA-based video data processing system proposed by the present invention
  • FIG. 2 is a schematic diagram of an LED drive quantity detection module of an FPGA-based video data processing system proposed by the present invention
  • Figure 3 is a schematic structural diagram of a pixel mean calculation module of an FPGA-based video data processing system proposed by the present invention
  • Figure 4 is a rendering of screen-light synchronization of an FPGA-based video data processing system proposed by the present invention
  • FIG. 5 is a schematic diagram of the driving method of the LED driving module of the FPGA-based video data processing system proposed by the present invention.
  • a video data processing system based on FPGA includes an HDMI receiving module, an HDMI transmitting module and an LED driver module.
  • the input end of the HDMI receiving module is signal connected to the output end of the external HDMI input terminal, so The input end of the HDMI transmitting module is connected to the output end of the external HDMI output terminal, the input end of the LED drive module is connected to the input end of the external LED light strip interface, and the output end of the HDMI receiving module is connected to the input end of the LED light strip interface.
  • Connect the signal to the input end of the HDMI transmitter module to restore the TMDS data of the HDMI cable to the original video data.
  • the HDMI receiving module converts 3 sets of HDMI differential data and 1 set of differential clock into raw data; the HDMI transmitting module converts raw data into 3 sets of HDMI differential data and 1 set of differential clock.
  • the FPGA-based video data processing system also includes a decryption module, which is used for HDMI data decryption.
  • the output signal of the decryption module is connected to the input end of the color space conversion module.
  • the color space conversion module includes the conversion of YCbCr to RGB color space. RGB grayscales in different standard formats can be calculated through a series of matrix operations. value.
  • the output signal of the color space conversion module is connected to the input end of the resolution scaling module, and the 4K signal is converted into a resolution of 1080P format.
  • the output signal of the resolution scaling module is connected to the input end of the frame extraction module, and the frame extraction module converts a signal higher than 60 Hz (for example, 240 Hz) into a signal not higher than 60 Hz.
  • the output signal of the frame extraction module is connected to the input end of the HDR decoding module.
  • the HDR decoding module identifies the HDR data by detecting the header of the HDR data packet, thereby avoiding the problem of RGB data saturation decrease.
  • the output signal of the HDR decoding module is connected to the input end of the data buffer module.
  • the data buffer module is an HDMI data buffer and is used to buffer data and isolate the internal and external clock domains of the FPGA.
  • the output signal of the data buffer module is connected to the input end of the memory module.
  • the memory module caches one or more frames of images to prepare data for the subsequent averaging module to ensure that there will be no more errors when the data is processed. Reading and writing changes.
  • the output signal of the memory module is connected to the input end of the pixel average calculation module. Since each LED lamp bead corresponds to the rectangular area of the a*b area on the screen, the pixel average calculation module calculates the The average value of RGB.
  • the output signal of the pixel average calculation module is connected to the input end of the frame delay module, and the frame delay module is used to cache one frame to multiple frames.
  • the output signal of the frame delay module is connected to the input end of the LED driver module.
  • the LED driver module is a driver module of the ws2812 chip and converts 24-bit RGB data into single-line serial RGB. NRZ format, used to drive LED light strips.
  • the FPGA-based video data processing system is also provided with a parameter module, which is used to calculate the number of chips corresponding to each lamp bead by detecting the input resolution and the number of detected LED lamp strip chips.
  • the rectangular area of the LED light strip is a ws2812 chip.
  • the parameter module is used to calculate the TV set corresponding to each LED light bead by detecting the resolution of the HDMI signal and the number of LED light beads. rectangular pixel area, thereby obtaining the average value of RGB in the rectangular area, and the average value is used as the RGB gray value; at the same time, the parameter module can configure various parameters of the FPGA and define the parameters of the FPGA as a table to achieve .
  • the input signal of the memory module is connected to a memory read and write address module.
  • the memory read and write module is an address counter of the RAM. When writing data, it writes line by line; when reading, According to the address required by the light strip, the data is randomly taken out. The random address is based on the position of the light strip and the coordinates of the RAM are calculated through address mapping.
  • the output end of the LED drive module is also connected to the input end of the LED drive quantity detection module.
  • the LED drive quantity detection module is used to detect external LED lights through the current increment method when the system is turned on. Bring the number of chips above.
  • the HDMI receiving module and HDMI transmitting module can be implemented with either a dedicated chip or an FPGA transceiver to restore the TMDS data of the HDMI cable to the original video data.
  • the decryption module adopts high-bandwidth digital content protection technology.
  • HDTV High Definition Television
  • HDCP technology has emerged. Only after entering the authorized key can the HDMI signal be correctly decrypted. If there is no HDCP signal, the module will automatically bypass it.
  • the color space conversion module when the input HDMI signal source is in YCbCr format, the module will automatically perform color space conversion. Since the back-end LED lamp beads adopt RGB format, the YCbCr color space needs to be converted into RGB color. space. Conversion of RGB and YCbCr color spaces. Commonly used color gamut spaces are BT.601 (SDTV, standard definition TV), BT.709 (HDTV, high definition TV), BT.2020 (UHDTV, ultra high definition TV). In different color gamuts In space, the transformation matrix is inconsistent. Therefore, you only need to configure different coefficients to calculate and adapt to different color spaces.
  • Y Brightness (Luminance or Luma), which is the grayscale value. "Brightness” is established from the RGB input signal by adding specific parts of the RGB signal together.
  • Cb reflects the difference between the blue part of the RGB input signal and the brightness value of the RGB signal.
  • the value range of each component of RGB and YCbCr is 0-255, and there is a linear transformation relationship between YCbCr and RGB.
  • the resolution scaling module because the throughput of the FPGA's processing data volume is directly related to the cost, in order to reduce the cost of the FPGA and the system bandwidth, it can be achieved by reducing the resolution of the input signal under the bandwidth condition of HDMI2.018G.
  • the bandwidth purpose of the pipeline when the system bandwidth exceeds 165M*24bit, the system will automatically enable the resolution scaling module.
  • the input signal is 3840*2160, the actual output resolution is 1920*1080.
  • the system bandwidth of the FPGA Reduced to 1/4 of the original, but the frame rate does not change in any way.
  • the frame extraction module in the specifications of HDMI2.0, 1080P can go up to 240Hz and the timing is within this range. Then there is a problem.
  • the maximum frame The frame rate is 60Hz. If it exceeds this frame rate, the system frame rate must be reduced.
  • the solution is to detect the frame rate of the input signal in real time. When it exceeds 60Hz, divide the frame rate by 2. If it still exceeds, continue dividing by 2 until it is less than 60Hz. This will not affect the load points of the back-end ws2812 chip.
  • the data buffer module is usually used as a data buffer.
  • the signal from HDMI is sent line by line and written to the buffer according to the control of the DE signal.
  • a FIFO needs to be used to match the speed difference.
  • FIFO is used to solve the cross-clock domain problem.
  • the memory module needs to cache one frame of data in order to facilitate back-end data processing.
  • a large-capacity RAM is selected to store the HDMI RGB data.
  • This RAM can be implemented using an independent chip or a high-speed internal FPGA. RAM to implement caching.
  • ping-pong operation mode that is, when port A is written, port B can be read. When port A is reading, port B can be written.
  • the maximum ram capacity we need is: 2*1920*1080*24bit.
  • the memory read and write address module that is, the address counter of ram, since there will be read data and write data at the same time, we need a set of read and write address modules to let ram know which location of data we are accessing, and when writing When entering, we write it line by line.
  • the random address is based on the position of the light strip and the coordinates of the RAM are calculated through address mapping.
  • the LED driver quantity detection module uses the current increment method to detect the number of chips on the lamp strip when it is turned on. Since each customer's TV size is different, each customer's light strip length is different, so users do not need to configure their own number of LED lamp beads to achieve a debugging-free effect. As shown in Figure 2, the schematic diagram of the LED driver quantity detection module, we take 4 driver chips as an example to illustrate the detection of the number of driver chips through software:
  • the parameter module module can calculate the rectangular pixel area of the TV corresponding to each LED lamp bead by detecting the resolution of the HDMI signal and the number of LED lamp beads, thereby obtaining the average RGB in the rectangular area. value, and the average value is used as the RGB grayscale value.
  • the second function of this module is to configure various parameters of the FPGA. Since there are various transformations in the input parameters, and the FPGA is not good at floating point operations, we need to define the parameters of the FPGA as tables to achieve this.
  • the pixel average calculation module is shown in Figure 3. For example, we have N horizontal LEDs, M vertical LEDs, and the input resolution of the TV is X0*Y0. In this way, we can calculate the pixel value of each LED through the formula Corresponding TV pixels.
  • the frame delay module as shown in Figure 4, because MEMC requires the internal buffering of many frames in the TV, causes the light strip to be displayed earlier than the TV picture. On some TVs with MEMC functions, the delay of the TV is For time matching, the signal on the light strip needs to be partially delayed to achieve the effect of screen light synchronization.
  • the LED driver module is shown in Figure 5.
  • the driving method is: convert the 24-bit RGB data inside the system from parallel to serial 24-bit and store it in the buffer, and then follow the instructions of G7-G0, R7-R0, and B7-B0. In sequence, it is converted into NRZ square waves corresponding to 1 and 0 through the PWM module, thereby realizing single-line transmission of LED light. After receiving the signal, the driving signal will be forwarded to the last chip step by step.
  • This FPGA-based video data processing system is used for TV background atmosphere lights, controls LED lamp beads and detects the number of driver chips to change colors synchronously with the TV periphery to enhance the atmosphere. It has the ability to process massive data in parallel and is low-cost. , low latency, fast processing speed, and user-free debugging configuration, etc., it solves the problems of low integration, low reliability, high cost, serious system delay and easy heat generation of the current system.
  • references to the terms “one embodiment,” “some embodiments,” “an example,” “specific examples,” or “some examples” or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of the invention. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Television Systems (AREA)

Abstract

The present invention relates to the technical field of video data processing, and disclosed is a video data processing system based on an FPGA, comprising an hdmi receiving module, an hdmi transmitting module, and an LED driving module. An input end of the hdmi receiving module is in signal connection with an output end of an external hdmi input terminal; an input end of the hdmi transmitting module is in signal connection with an output end of an external hdmi output terminal; an input end of the LED driving module is in signal connection with an input end of an external LED lamp strip interface; and an output end of the hdmi receiving module is in signal connection with the input end of the hdmi transmitting module. The video data processing system based on the FPGA has the advantages of parallel processing of mass data, low latency, high processing speed, and no need of debugging in configuration of a user, and solves the problems that existing systems are low in integration level, low in reliability, high in cost, serious in system latency, and prone to heating.

Description

一种基于FPGA的视频数据处理系统A video data processing system based on FPGA 技术领域Technical field
本发明涉及视频数据处理技术领域,具体为一种基于FPGA的视频数据处理系统。 The invention relates to the technical field of video data processing, specifically a video data processing system based on FPGA.
背景技术Background technique
FPGA为现场可编程门阵列。通俗一点为一块空白的数字逻辑电路,可以任意的编程通过修改内部的程序实现不同的功能。由于对大数据处理具备较强的能力,因此广泛的应用于高速数据的处理领域,例如高清视频数据流。FPGA is a field programmable gate array. In layman's terms, it is a blank digital logic circuit that can be programmed arbitrarily to achieve different functions by modifying the internal program. Due to its strong ability to process big data, it is widely used in high-speed data processing fields, such as high-definition video data streams.
现有技术中,传统的视频氛围灯如下解决方案:In the existing technology, traditional video atmosphere lights have the following solutions:
1)安装在PC上面,用于在电脑上面实时的录制屏幕,然后分析屏幕的边缘数据,求加权平均之后,通过USB转串口发送给mcu,mcu收到该灯带的RGB数据,控制灯带的RGB亮度。1) Installed on the PC, it is used to record the screen in real time on the computer, then analyze the edge data of the screen, calculate the weighted average, and send it to the MCU through the USB to serial port. The MCU receives the RGB data of the light strip and controls the light strip. RGB brightness.
2)通过hdmi分配器1进2出的方式,将输出的一路直接环出,另外一路通过hdmi转usb送给arm处理器,arm处理器收到该RGB数据之后,在内部做视频处理,最后计算出边缘的RGB亮度值发送给LED灯带。2) Through the way of 1 in and 2 out of the HDMI splitter, one output channel is directly looped out, and the other channel is sent to the arm processor through HDMI to USB. After the arm processor receives the RGB data, it performs video processing internally, and finally The RGB brightness value of the edge is calculated and sent to the LED strip.
以上的两种方案存在有如下的缺陷:The above two solutions have the following shortcomings:
方案1)虽然成本低价格便宜,但是只能运行在windows平台上面,linux 或者mac 、安卓电视目前都没有,不能在多个平台使用例如电视机或者安卓系统;由于需要实时录制屏幕做视频处理,对电脑资源占用大;延迟大,帧率低,由于数据需要经过多次转发,造成灯带上的延迟比屏幕大,造成不同步的问题。Option 1) Although the cost is low and the price is low, it can only run on the Windows platform. Currently, Linux, Mac, and Android TV are not available, and cannot be used on multiple platforms such as TVs or Android systems; due to the need to record the screen in real time for video processing, It takes up a lot of computer resources; the delay is large and the frame rate is low. Since the data needs to be forwarded multiple times, the delay on the light strip is larger than the screen, causing out-of-synchronization problems.
方案2)虽然解决了跨平台的问题,但是需要hdmi2.0的分配器、hdmi高清转换芯片以及高性能的arm处理芯片造成成本较高,而且hdmi2.0由于有海量的数据,靠cpu来计算会造成负载过重且存在延时较大的问题。Option 2) Although it solves the cross-platform problem, it requires HDMI2.0 splitter, HDMI high-definition conversion chip and high-performance arm processing chip, which causes high cost. Moreover, HDMI2.0 has massive data and relies on CPU to calculate. It will cause overload and large delay problems.
为了解决上述问题,我们提出了一种基于FPGA的视频数据处理系统,具有并行处理海量数据、低成本、低延迟、处理速度快、用户免调试配置等优点。In order to solve the above problems, we proposed a video data processing system based on FPGA, which has the advantages of parallel processing of massive data, low cost, low latency, fast processing speed, and user-free debugging configuration.
技术解决方案Technical solutions
针对现有技术的不足,本发明提供了一种基于FPGA的视频数据处理系统,以解决上述背景技术中提出的问题。In view of the shortcomings of the existing technology, the present invention provides a video data processing system based on FPGA to solve the problems raised in the above background technology.
为实现上述目的,本发明提供如下技术方案:一种基于FPGA的视频数据处理系统,包括hdmi接收模块、hdmi发射模块以及LED驱动模块,所述hdmi接收模块的输入端与外部的hdmi输入端子的输出端进行信号连接,所述hdmi发射模块的输入端与外部的hdmi输出端子的输出端进行信号连接,所述LED驱动模块的输入端与外部的LED灯带接口的输入端进行信号连接,所述hdmi接收模块的输出端与hdmi发射模块的输入端进行信号连接,用于将hdmi的线缆的TMDS数据还原为原始的视频数据;In order to achieve the above purpose, the present invention provides the following technical solution: a video data processing system based on FPGA, including an HDMI receiving module, an HDMI transmitting module and an LED driving module. The input end of the HDMI receiving module is connected to the external HDMI input terminal. The output end is connected to the signal, the input end of the HDMI transmitting module is connected to the output end of the external HDMI output terminal, and the input end of the LED drive module is connected to the input end of the external LED light strip interface, so The output end of the HDMI receiving module is connected to the input end of the HDMI transmitting module for signal connection, and is used to restore the TMDS data of the HDMI cable to the original video data;
所述基于FPGA的视频数据处理系统还包括有解密模块,所述解密模块的输出端信号连接有颜色空间转换模块的输入端,所述颜色空间转换模块的输出端信号连接有分辨率缩放模块的输入端,所述分辨率缩放模块的输出端信号连接有抽帧模块的输入端,所述抽帧模块的输出端信号连接有HDR解码模块的输入端,所述HDR解码模块的输出端信号连接有数据缓冲模块的输入端,所述数据缓冲模块的输出端信号连接有内存模块的输入端,所述内存模块的输出端信号连接有像素均值计算模块的输入端,所述像素均值计算模块的输出端信号连接有帧延迟模块的输入端,所述帧延迟模块的输出端信号连接在LED驱动模块的输入端。The FPGA-based video data processing system also includes a decryption module. The output signal of the decryption module is connected to the input end of the color space conversion module. The output signal of the color space conversion module is connected to the resolution scaling module. At the input end, the output end signal of the resolution scaling module is connected to the input end of the frame extraction module, the output end signal of the frame extraction module is connected to the input end of the HDR decoding module, and the output end signal of the HDR decoding module is connected There is an input end of the data buffer module, the output end signal of the data buffer module is connected to the input end of the memory module, the output end signal of the memory module is connected to the input end of the pixel average calculation module, and the pixel average calculation module The output signal is connected to the input end of the frame delay module, and the output signal of the frame delay module is connected to the input end of the LED driver module.
进一步优化本技术方案,所述基于FPGA的视频数据处理系统还设置有参数模块,所述参数模块用于通过检测输入的分辨率以及检测到的LED灯带的芯片数量,从而计算每个灯珠所对应的矩形区域,所述LED灯带的芯片选用型号为ws2812芯片。To further optimize this technical solution, the FPGA-based video data processing system is also provided with a parameter module, which is used to calculate each lamp bead by detecting the input resolution and the number of detected chips of the LED strip. For the corresponding rectangular area, the chip model of the LED light strip is ws2812 chip.
进一步优化本技术方案,所述内存模块的输入端信号连接有内存读写地址模块,所述内存读写模块为RAM的地址计数器,写入数据时,按照逐行写入的方式;在读出时,按照灯带需要的地址,随机的取出数据,该随机地址是按照灯带的位置通过地址映射计算出RAM的坐标。To further optimize this technical solution, the input signal of the memory module is connected to a memory read and write address module. The memory read and write module is an address counter of RAM. When writing data, it is written line by line; when reading At this time, the data is randomly taken out according to the address required by the light strip. The random address is calculated based on the address mapping of the RAM coordinates according to the position of the light strip.
进一步优化本技术方案,所述LED驱动模块的输出端还信号连接有LED驱动数量检测模块的输入端,所述LED驱动数量检测模块用于在系统开机时,通过电流增量法来检测外部的LED灯带上面的芯片数量。To further optimize this technical solution, the output end of the LED drive module is also signal-connected to the input end of the LED drive quantity detection module. The LED drive quantity detection module is used to detect external voltages through the current increment method when the system is turned on. The number of chips on the LED strip.
进一步优化本技术方案,所述颜色空间转换模块,用于YCbCr向RGB的颜色空间的转换,通过一系列的矩阵运算即可算出不同标准的格式RGB灰度值;当输入的hdmi的信号源为YCbCr的格式后,颜色空间转换模块将自动的进行颜色空间转换,将YCbCr颜色空间转换为RGB颜色空间。To further optimize this technical solution, the color space conversion module is used to convert YCbCr to RGB color space. RGB grayscale values in different standard formats can be calculated through a series of matrix operations; when the input HDMI signal source is After formatting YCbCr, the color space conversion module will automatically perform color space conversion and convert the YCbCr color space to RGB color space.
进一步优化本技术方案,所述分辨率缩放模块,用于将4K信号转换为1080P格式的分辨率,在hdmi2.018G的带宽条件下,通过降低输入信号的分辨率来达到降低流水线的带宽目的,当系统带宽超过165M*24bit的时候,系统启用分辨率缩小模块,此时当输入信号为3840*2160的时候,实际输出分辨率为1920*1080,FPGA的系统带宽降低到原来的1/4。To further optimize this technical solution, the resolution scaling module is used to convert 4K signals to the resolution of 1080P format. Under the bandwidth condition of HDMI2.018G, the purpose of reducing the bandwidth of the pipeline is achieved by reducing the resolution of the input signal. When the system bandwidth exceeds 165M*24bit, the system enables the resolution reduction module. At this time, when the input signal is 3840*2160, the actual output resolution is 1920*1080, and the FPGA system bandwidth is reduced to 1/4 of the original.
进一步优化本技术方案,所述抽帧模块,用于将高于60Hz的信号转换为不高于60Hz的信号,所述抽帧模块实时检测输入信号的帧率,当超过60Hz之后,将帧率除以2,若还是超过60Hz,继续除以2直到小于60Hz为止,保证不影响后端的ws2812芯片的带载点数。To further optimize this technical solution, the frame extraction module is used to convert signals higher than 60Hz into signals not higher than 60Hz. The frame extraction module detects the frame rate of the input signal in real time. When it exceeds 60Hz, the frame rate is Divide by 2. If it still exceeds 60Hz, continue dividing by 2 until it is less than 60Hz to ensure that the load points of the back-end ws2812 chip are not affected.
进一步优化本技术方案,所述HDR解码模块,用于通过检测HDR数据包的包头,来判断输入的信号是否为HDR的格式,识别HDR的数据,并对数据的灰阶做一次重新映射计算,避免RGB数据饱和度下降的问题。To further optimize this technical solution, the HDR decoding module is used to determine whether the input signal is in HDR format by detecting the header of the HDR data packet, identify the HDR data, and perform a remapping calculation on the grayscale of the data. Avoid the problem of RGB data desaturation.
进一步优化本技术方案,所述数据缓冲模块,用于缓冲数据以及隔离FPGA内部和外部的时钟域;从hdmi的信号为逐行发送,按照DE信号的控制写入到缓冲区,采用FIFO来匹配速度差,用于和FPGA的内部做速度匹配。To further optimize this technical solution, the data buffer module is used to buffer data and isolate the internal and external clock domains of the FPGA; the signal from HDMI is sent line by line, written to the buffer according to the control of the DE signal, and FIFO is used to match The speed difference is used to match the internal speed of the FPGA.
进一步优化本技术方案,所述参数模块,用于通过检测hdmi信号的分辨率、LED灯带的灯珠数量就可以计算出每个LED灯珠所对应的电视机的矩形像素点区域,从而得到将该矩形区域内的RGB的平均值,该平均值作为该RGB灰度值;同时参数模块可以配置FPGA的各个参数,将FPGA的参数定义为表格的方式来实现。To further optimize this technical solution, the parameter module is used to calculate the rectangular pixel area of the TV set corresponding to each LED lamp bead by detecting the resolution of the HDMI signal and the number of lamp beads of the LED lamp strip, thereby obtaining The average value of the RGB in the rectangular area is used as the RGB gray value; at the same time, the parameter module can configure various parameters of the FPGA and define the parameters of the FPGA as a table.
有益效果beneficial effects
与现有技术相比,本发明提供了一种基于FPGA的视频数据处理系统,具备以下有益效果:Compared with the existing technology, the present invention provides a video data processing system based on FPGA, which has the following beneficial effects:
该基于FPGA的视频数据处理系统,用于电视机背景氛围灯,控制LED灯珠以及检测驱动芯片数量用于和电视周边同步变化颜色,起到烘托氛围的效果,具有并行处理海量数据、低成本、低延迟、处理速度快、用户免调试配置等优点,解决了目前系统的集成度不高、可靠性不高、成本高;系统延迟严重以及容易发热的问题。This FPGA-based video data processing system is used for TV background atmosphere lights, controls LED lamp beads and detects the number of driver chips to change colors synchronously with the TV periphery to enhance the atmosphere. It has the ability to process massive data in parallel and is low-cost. , low latency, fast processing speed, and user-free debugging configuration, etc., it solves the problems of low integration, low reliability, high cost, serious system delay and easy heat generation of the current system.
附图说明Description of the drawings
图1为本发明提出的一种基于FPGA的视频数据处理系统的结构示意图;Figure 1 is a schematic structural diagram of an FPGA-based video data processing system proposed by the present invention;
图2为本发明提出的一种基于FPGA的视频数据处理系统的LED驱动数量检测模块的原理图;Figure 2 is a schematic diagram of an LED drive quantity detection module of an FPGA-based video data processing system proposed by the present invention;
图3为本发明提出的一种基于FPGA的视频数据处理系统的像素均值计算模块的结构示意图;Figure 3 is a schematic structural diagram of a pixel mean calculation module of an FPGA-based video data processing system proposed by the present invention;
图4为本发明提出的一种基于FPGA的视频数据处理系统的屏光同步的效果图;Figure 4 is a rendering of screen-light synchronization of an FPGA-based video data processing system proposed by the present invention;
图5为本发明提出的一种基于FPGA的视频数据处理系统的LED驱动模块的驱动方法示意图。FIG. 5 is a schematic diagram of the driving method of the LED driving module of the FPGA-based video data processing system proposed by the present invention.
本发明的实施方式Embodiments of the invention
下面将结合本发明的实施例,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
实施例一:Example 1:
请参阅图1,一种基于FPGA的视频数据处理系统,包括hdmi接收模块、hdmi发射模块以及LED驱动模块,所述hdmi接收模块的输入端与外部的hdmi输入端子的输出端进行信号连接,所述hdmi发射模块的输入端与外部的hdmi输出端子的输出端进行信号连接,所述LED驱动模块的输入端与外部的LED灯带接口的输入端进行信号连接,所述hdmi接收模块的输出端与hdmi发射模块的输入端进行信号连接,用于将hdmi的线缆的TMDS数据还原为原始的视频数据。Please refer to Figure 1. A video data processing system based on FPGA includes an HDMI receiving module, an HDMI transmitting module and an LED driver module. The input end of the HDMI receiving module is signal connected to the output end of the external HDMI input terminal, so The input end of the HDMI transmitting module is connected to the output end of the external HDMI output terminal, the input end of the LED drive module is connected to the input end of the external LED light strip interface, and the output end of the HDMI receiving module is connected to the input end of the LED light strip interface. Connect the signal to the input end of the HDMI transmitter module to restore the TMDS data of the HDMI cable to the original video data.
其中,hdmi接收模块将hdmi的3组差分数据和1组差分时钟转换为raw data的模块;hdmi发射模块将raw data转换为hdmi的3组差分数据和1组差分时钟的模块。Among them, the HDMI receiving module converts 3 sets of HDMI differential data and 1 set of differential clock into raw data; the HDMI transmitting module converts raw data into 3 sets of HDMI differential data and 1 set of differential clock.
所述基于FPGA的视频数据处理系统还包括有解密模块,所述解密模块用于hdmi的数据解密。The FPGA-based video data processing system also includes a decryption module, which is used for HDMI data decryption.
所述解密模块的输出端信号连接有颜色空间转换模块的输入端,所述颜色空间转换模块包含YCbCr向RGB的颜色空间的转换,通过一系列的矩阵运算即可算出不同标准的格式RGB灰度值。The output signal of the decryption module is connected to the input end of the color space conversion module. The color space conversion module includes the conversion of YCbCr to RGB color space. RGB grayscales in different standard formats can be calculated through a series of matrix operations. value.
所述颜色空间转换模块的输出端信号连接有分辨率缩放模块的输入端,所述将4K信号转换为1080P格式的分辨率。The output signal of the color space conversion module is connected to the input end of the resolution scaling module, and the 4K signal is converted into a resolution of 1080P format.
所述分辨率缩放模块的输出端信号连接有抽帧模块的输入端,所述抽帧模块将高于60Hz的信号(例如240Hz)转换为不高于60Hz的信号。The output signal of the resolution scaling module is connected to the input end of the frame extraction module, and the frame extraction module converts a signal higher than 60 Hz (for example, 240 Hz) into a signal not higher than 60 Hz.
所述抽帧模块的输出端信号连接有HDR解码模块的输入端,所述HDR解码模块通过检测HDR数据包的包头,来识别HDR的数据,从而避免RGB数据饱和度下降的问题。The output signal of the frame extraction module is connected to the input end of the HDR decoding module. The HDR decoding module identifies the HDR data by detecting the header of the HDR data packet, thereby avoiding the problem of RGB data saturation decrease.
所述HDR解码模块的输出端信号连接有数据缓冲模块的输入端,所述数据缓冲模块为hdmi的数据缓冲区,用于缓冲数据以及隔离FPGA内部和外部的时钟域。The output signal of the HDR decoding module is connected to the input end of the data buffer module. The data buffer module is an HDMI data buffer and is used to buffer data and isolate the internal and external clock domains of the FPGA.
所述数据缓冲模块的输出端信号连接有内存模块的输入端,所述内存模块缓存一帧或者多帧图像,为后面的均值模块做数据准备,以确保数据在处理的时候,不会再有读写变化。The output signal of the data buffer module is connected to the input end of the memory module. The memory module caches one or more frames of images to prepare data for the subsequent averaging module to ensure that there will be no more errors when the data is processed. Reading and writing changes.
所述内存模块的输出端信号连接有像素均值计算模块的输入端,所述像素均值计算模块,由于每个LED灯珠和屏幕上面的a*b区域的矩形区域来对应,求出该区域内的RGB的平均值。The output signal of the memory module is connected to the input end of the pixel average calculation module. Since each LED lamp bead corresponds to the rectangular area of the a*b area on the screen, the pixel average calculation module calculates the The average value of RGB.
所述像素均值计算模块的输出端信号连接有帧延迟模块的输入端,所述帧延迟模块用于缓存1帧到多帧。The output signal of the pixel average calculation module is connected to the input end of the frame delay module, and the frame delay module is used to cache one frame to multiple frames.
所述帧延迟模块的输出端信号连接在LED驱动模块的输入端,所述LED驱动模块为ws2812芯片的驱动模块,将24bit的RGB数据转换为单线串行的RGB NRZ的格式,用于驱动LED灯带。The output signal of the frame delay module is connected to the input end of the LED driver module. The LED driver module is a driver module of the ws2812 chip and converts 24-bit RGB data into single-line serial RGB. NRZ format, used to drive LED light strips.
更进一步的,所述基于FPGA的视频数据处理系统还设置有参数模块,所述参数模块用于通过检测输入的分辨率以及检测到的LED灯带的芯片数量,从而计算每个灯珠所对应的矩形区域,所述LED灯带的芯片选用型号为ws2812芯片,参数模块用于通过检测hdmi信号的分辨率、LED灯带的灯珠数量就可以计算出每个LED灯珠所对应的电视机的矩形像素点区域,从而得到将该矩形区域内的RGB的平均值,该平均值作为该RGB灰度值;同时参数模块可以配置FPGA的各个参数,将FPGA的参数定义为表格的方式来实现。Furthermore, the FPGA-based video data processing system is also provided with a parameter module, which is used to calculate the number of chips corresponding to each lamp bead by detecting the input resolution and the number of detected LED lamp strip chips. The rectangular area of the LED light strip is a ws2812 chip. The parameter module is used to calculate the TV set corresponding to each LED light bead by detecting the resolution of the HDMI signal and the number of LED light beads. rectangular pixel area, thereby obtaining the average value of RGB in the rectangular area, and the average value is used as the RGB gray value; at the same time, the parameter module can configure various parameters of the FPGA and define the parameters of the FPGA as a table to achieve .
更进一步的,所述内存模块的输入端信号连接有内存读写地址模块,所述内存读写模块为RAM的地址计数器,写入数据时,按照逐行写入的方式;在读出时,按照灯带需要的地址,随机的取出数据,该随机地址是按照灯带的位置通过地址映射计算出RAM的坐标。Furthermore, the input signal of the memory module is connected to a memory read and write address module. The memory read and write module is an address counter of the RAM. When writing data, it writes line by line; when reading, According to the address required by the light strip, the data is randomly taken out. The random address is based on the position of the light strip and the coordinates of the RAM are calculated through address mapping.
更进一步的,所述LED驱动模块的输出端还信号连接有LED驱动数量检测模块的输入端,所述LED驱动数量检测模块用于在系统开机时,通过电流增量法来检测外部的LED灯带上面的芯片数量。Furthermore, the output end of the LED drive module is also connected to the input end of the LED drive quantity detection module. The LED drive quantity detection module is used to detect external LED lights through the current increment method when the system is turned on. Bring the number of chips above.
实施例二:Example 2:
基于实施例一所述的一种基于FPGA的视频数据处理系统,对各个模块之间的实现流程做进一步的解释。Based on the FPGA-based video data processing system described in Embodiment 1, the implementation process between each module is further explained.
所述hdmi接收模块和hdmi发射模块,既可以用专用芯片实现,也可以用FPGA的收发器实现,将hdmi的线缆的TMDS的数据还原为原始的视频数据。The HDMI receiving module and HDMI transmitting module can be implemented with either a dedicated chip or an FPGA transceiver to restore the TMDS data of the HDMI cable to the original video data.
所述解密模块,采用了高带宽数字内容保护技术。HDTV(高清电视)时代即将来临,为了保证HDMI或者DVI传输的高清晰信号不会被非法录制,就出现了HDCP技术。只有输入授权的key之后,才能正确的解密出hdmi信号,如果不带hdcp的信号,该模块自动的旁路。The decryption module adopts high-bandwidth digital content protection technology. The era of HDTV (High Definition Television) is coming. In order to ensure that high-definition signals transmitted by HDMI or DVI will not be illegally recorded, HDCP technology has emerged. Only after entering the authorized key can the HDMI signal be correctly decrypted. If there is no HDCP signal, the module will automatically bypass it.
所述颜色空间转换模块,当输入的hdmi的信号源为YCbCr的格式后,模块将自动的进行颜色空间转换,由于后端LED的灯珠采用RGB格式,故需要将YCbCr颜色空间转换为RGB颜色空间。RGB与YCbCr颜色空间的转换,常用的色域空间有BT.601(SDTV,标清电视),BT.709(HDTV,高清电视),BT.2020(UHDTV,超高清电视),在不同的色域空间下,转换矩阵是不一致的。因此,只需要配置不同的系数即可计算出适配不同的颜色空间。The color space conversion module, when the input HDMI signal source is in YCbCr format, the module will automatically perform color space conversion. Since the back-end LED lamp beads adopt RGB format, the YCbCr color space needs to be converted into RGB color. space. Conversion of RGB and YCbCr color spaces. Commonly used color gamut spaces are BT.601 (SDTV, standard definition TV), BT.709 (HDTV, high definition TV), BT.2020 (UHDTV, ultra high definition TV). In different color gamuts In space, the transformation matrix is inconsistent. Therefore, you only need to configure different coefficients to calculate and adapt to different color spaces.
在YCbCr的格式中:In the format of YCbCr:
Y:明亮度(Luminance或Luma),也就是灰阶值。“亮度”是透过RGB输入信号来建立的,方法是将RGB信号的特定部分叠加到一起。Y: Brightness (Luminance or Luma), which is the grayscale value. "Brightness" is established from the RGB input signal by adding specific parts of the RGB signal together.
Cb:反映的是RGB输入信号蓝色部分与RGB信号亮度值之间的差异。Cb: reflects the difference between the blue part of the RGB input signal and the brightness value of the RGB signal.
Cr:反映了RGB输入信号红色部分与RGB信号亮度值之间的差异。Cr: reflects the difference between the red part of the RGB input signal and the brightness value of the RGB signal.
RGB和YCbCr各分量的值的范围均为0-255,同时YCbCr和RGB存在线性的变换关系。The value range of each component of RGB and YCbCr is 0-255, and there is a linear transformation relationship between YCbCr and RGB.
所述分辨率缩放模块,由于FPGA的处理数据量的吞吐量和成本直接相关,为了降低FPGA的成本以及系统带宽,可以在hdmi2.018G的带宽条件下,通过降低输入信号的分辨率来达到降低流水线的带宽目的,当系统带宽超过165M*24bit的时候,系统将自动的启用分辨率缩放模块,此时当输入信号为3840*2160的时候,实际输出分辨率为1920*1080,FPGA的系统带宽降低到原来的1/4,但是帧率不做任何的改变。The resolution scaling module, because the throughput of the FPGA's processing data volume is directly related to the cost, in order to reduce the cost of the FPGA and the system bandwidth, it can be achieved by reducing the resolution of the input signal under the bandwidth condition of HDMI2.018G. For the bandwidth purpose of the pipeline, when the system bandwidth exceeds 165M*24bit, the system will automatically enable the resolution scaling module. At this time, when the input signal is 3840*2160, the actual output resolution is 1920*1080. The system bandwidth of the FPGA Reduced to 1/4 of the original, but the frame rate does not change in any way.
所述抽帧模块,在hdmi2.0的规范中,1080P可以上到240Hz也属于该范围的timing,那么就存在一个问题,在ws2812芯片的datasheet中,当带载点数为512点是,最大帧率为60Hz,如果超过该帧率,那么就必须降低系统帧率。解决办法为,实时的检测输入信号的帧率,当超过60Hz之后,将帧率除以2,如果还是超过,继续除以2直到小于60Hz为止。这样就不会影响后端的ws2812芯片的带载点数。The frame extraction module, in the specifications of HDMI2.0, 1080P can go up to 240Hz and the timing is within this range. Then there is a problem. In the datasheet of the ws2812 chip, when the number of loading points is 512 points, the maximum frame The frame rate is 60Hz. If it exceeds this frame rate, the system frame rate must be reduced. The solution is to detect the frame rate of the input signal in real time. When it exceeds 60Hz, divide the frame rate by 2. If it still exceeds, continue dividing by 2 until it is less than 60Hz. This will not affect the load points of the back-end ws2812 chip.
所述数据缓冲模块,通常用作数据的缓冲。例如从hdmi的信号为逐行发送,按照DE信号的控制写入到缓冲区,为了和FPGA的内部做速度匹配,需要采用FIFO来匹配速度差。另外一方面,由于hdmi数据是走了跨时钟域,为了解决这个问题,采用FIFO来解决跨时钟域的问题。The data buffer module is usually used as a data buffer. For example, the signal from HDMI is sent line by line and written to the buffer according to the control of the DE signal. In order to match the speed with the inside of the FPGA, a FIFO needs to be used to match the speed difference. On the other hand, since HDMI data travels across clock domains, in order to solve this problem, FIFO is used to solve the cross-clock domain problem.
所述内存模块,为了方便后端的数据做处理,需要缓存一帧的数据,此时选用大容量的RAM来存储hdmi的RGB数据,此RAM既可以采用独立芯片实现,也可以采用FPGA内部的高速RAM来实现缓存。为了实现流水线的操作方式,我们定义RAM为乒乓操作方式,即A口写入的时候,B口可以读出。A口读出的时候,B口可以写入。此时我们需要最大的ram容量为:2*1920*1080*24bit。The memory module needs to cache one frame of data in order to facilitate back-end data processing. At this time, a large-capacity RAM is selected to store the HDMI RGB data. This RAM can be implemented using an independent chip or a high-speed internal FPGA. RAM to implement caching. In order to realize the pipeline operation mode, we define RAM as ping-pong operation mode, that is, when port A is written, port B can be read. When port A is reading, port B can be written. At this time, the maximum ram capacity we need is: 2*1920*1080*24bit.
所述内存读写地址模块,即ram的地址计数器,由于会同时的存在读数据和写数据,我们需要一组读写地址模块来让ram知道,我们存取的是哪个位置的数据,在写入的时候,我们是按照逐行写入的方式来实现。在读出的时候,我们是按照灯带需要的地址,随机的取出我们需要的数据,该随机地址是按照灯带的位置通过地址映射计算出RAM的坐标。The memory read and write address module, that is, the address counter of ram, since there will be read data and write data at the same time, we need a set of read and write address modules to let ram know which location of data we are accessing, and when writing When entering, we write it line by line. When reading out, we randomly take out the data we need according to the address required by the light strip. The random address is based on the position of the light strip and the coordinates of the RAM are calculated through address mapping.
所述LED驱动数量检测模块,在开机的时候,通过电流增量法来检测灯带上面芯片数量。由于每个客户的电视尺寸都不一样,每个客户的灯带长度都不一样,这样用户无需配置自己的LED灯珠数量,实现免调试的效果。如图2所示的LED驱动数量检测模块的原理图,我们以4个驱动芯片为例来阐述通过软件的方式检测到驱动芯片的数量:The LED driver quantity detection module uses the current increment method to detect the number of chips on the lamp strip when it is turned on. Since each customer's TV size is different, each customer's light strip length is different, so users do not need to configure their own number of LED lamp beads to achieve a debugging-free effect. As shown in Figure 2, the schematic diagram of the LED driver quantity detection module, we take 4 driver chips as an example to illustrate the detection of the number of driver chips through software:
1)开机初始化,将WS2812全部打灰度0,将VDD上面的电流记为I0初始电流;1) Power on and initialize, set all WS2812 grayscales to 0, and record the current on VDD as the I0 initial current;
2)软件点亮U1,U2U3U4灭,记录电流为I1,增量电流=I1-I0;2) The software lights U1, U2U3U4 goes off, the recorded current is I1, and the incremental current = I1-I0;
3)软件点亮U2,U1U3U4灭,记录电流为I2,增量电流=0;3) The software lights U2, U1U3U4 goes off, the recorded current is I2, and the incremental current = 0;
4)软件点亮U3,U1U2U4灭,记录电流为I3,增量电流=0;4) The software lights U3, U1U2U4 goes off, the recorded current is I3, and the incremental current = 0;
5)软件点亮U4,U1U2U3灭,记录电流为I4,增量电流=0;5) The software lights U4, U1U2U3 goes off, the recorded current is I4, and the incremental current = 0;
6)软件点亮U5,U1U2U3U4灭,实际上软件并不知道实际不存在U5,记录电流为I5.增量电流此时可以检测到接近:-(I1-I0)的值,则判断此时的芯片个数为4个。同理,可以用该方法用于其他的需要通过电流变化检测的场合来判断工作的模块的个数。6) The software lights up U5 and U1U2U3U4 goes off. In fact, the software does not know that U5 does not actually exist. The recorded current is I5. The incremental current can detect a value close to: -(I1-I0) at this time, then it is judged that the value at this time is The number of chips is 4. In the same way, this method can be used in other situations where current change detection is required to determine the number of working modules.
所述参数模块模块,通过检测hdmi信号的分辨率、LED的灯珠数量就可以计算出每个LED灯珠所对应的电视机的矩形像素点区域,从而得到将该矩形区域内的RGB的平均值,该平均值作为该RGB灰度值。该模块的第二功能为配置FPGA的各个参数,由于输入的参数存在各种的变换,而FPGA不擅长做浮点运算,从而我们需要把FPGA的参数定义为表格的方式来实现。The parameter module module can calculate the rectangular pixel area of the TV corresponding to each LED lamp bead by detecting the resolution of the HDMI signal and the number of LED lamp beads, thereby obtaining the average RGB in the rectangular area. value, and the average value is used as the RGB grayscale value. The second function of this module is to configure various parameters of the FPGA. Since there are various transformations in the input parameters, and the FPGA is not good at floating point operations, we need to define the parameters of the FPGA as tables to achieve this.
所述像素均值计算模块,如图3所示,例如我们的水平LED有N个,垂直LED有M个,电视的输入分辨率为X0*Y0.这样,我们可以通过公式计算出每个LED所对应的电视像素。The pixel average calculation module is shown in Figure 3. For example, we have N horizontal LEDs, M vertical LEDs, and the input resolution of the TV is X0*Y0. In this way, we can calculate the pixel value of each LED through the formula Corresponding TV pixels.
A=X0/N;A=X0/N;
B=Y0/M;B=Y0/M;
因此只需要求出A*B的区域内的RGB的平均值就是该LED灯珠对应的RGB的值。Therefore, we only need to find the average value of RGB in the area A*B, which is the RGB value corresponding to the LED lamp bead.
所述帧延迟模块,如图4所示,由于MEMC需要杂电视的内部缓存很多帧,从而导致灯带的显示比电视画面更加的提前,在某些具备MEMC功能的电视机上和电视机的延时匹配,需要把灯带上面的信号做部分的延时,才能达到屏光同步的效果。The frame delay module, as shown in Figure 4, because MEMC requires the internal buffering of many frames in the TV, causes the light strip to be displayed earlier than the TV picture. On some TVs with MEMC functions, the delay of the TV is For time matching, the signal on the light strip needs to be partially delayed to achieve the effect of screen light synchronization.
所述LED驱动模块,如图5所示,驱动方法:将系统内部的24bit的RGB数据,通过并行转串行的24bit 存入缓冲区,然后按照G7-G0,R7-R0,B7-B0的顺序,通过PWM模块转换为1 和 0对应的NRZ方波,从而实现了LED的灯光单线传输。驱动信号收到该信号之后,会通过逐级的转发到最后一个芯片。The LED driver module is shown in Figure 5. The driving method is: convert the 24-bit RGB data inside the system from parallel to serial 24-bit and store it in the buffer, and then follow the instructions of G7-G0, R7-R0, and B7-B0. In sequence, it is converted into NRZ square waves corresponding to 1 and 0 through the PWM module, thereby realizing single-line transmission of LED light. After receiving the signal, the driving signal will be forwarded to the last chip step by step.
本发明的有益效果是:The beneficial effects of the present invention are:
该基于FPGA的视频数据处理系统,用于电视机背景氛围灯,控制LED灯珠以及检测驱动芯片数量用于和电视周边同步变化颜色,起到烘托氛围的效果,具有并行处理海量数据、低成本、低延迟、处理速度快、用户免调试配置等优点,解决了目前系统的集成度不高、可靠性不高、成本高;系统延迟严重以及容易发热的问题。This FPGA-based video data processing system is used for TV background atmosphere lights, controls LED lamp beads and detects the number of driver chips to change colors synchronously with the TV periphery to enhance the atmosphere. It has the ability to process massive data in parallel and is low-cost. , low latency, fast processing speed, and user-free debugging configuration, etc., it solves the problems of low integration, low reliability, high cost, serious system delay and easy heat generation of the current system.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, reference to the terms "one embodiment," "some embodiments," "an example," "specific examples," or "some examples" or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of the invention. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言,可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由所附权利要求及其等同物限定。Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art will understand that various changes, modifications, and substitutions can be made to these embodiments without departing from the principles and spirit of the invention. and modifications, the scope of the invention is defined by the appended claims and their equivalents.

Claims (10)

  1. 一种基于FPGA的视频数据处理系统,其特征在于,包括hdmi接收模块、hdmi发射模块以及LED驱动模块,所述hdmi接收模块的输入端与外部的hdmi输入端子的输出端进行信号连接,所述hdmi发射模块的输入端与外部的hdmi输出端子的输出端进行信号连接,所述LED驱动模块的输入端与外部的LED灯带接口的输入端进行信号连接,所述hdmi接收模块的输出端与hdmi发射模块的输入端进行信号连接,用于将hdmi的线缆的TMDS数据还原为原始的视频数据;A video data processing system based on FPGA, which is characterized in that it includes an HDMI receiving module, an HDMI transmitting module and an LED driving module. The input end of the HDMI receiving module is signal-connected to the output end of the external HDMI input terminal, and the The input end of the HDMI transmitting module is connected to the output end of the external HDMI output terminal. The input end of the LED drive module is connected to the input end of the external LED light strip interface. The output end of the HDMI receiving module is connected to the input end of the external HDMI output terminal. The input end of the HDMI transmitter module is connected to the signal, which is used to restore the TMDS data of the HDMI cable to the original video data;
    所述基于FPGA的视频数据处理系统还包括有解密模块,所述解密模块的输出端信号连接有颜色空间转换模块的输入端,所述颜色空间转换模块的输出端信号连接有分辨率缩放模块的输入端,所述分辨率缩放模块的输出端信号连接有抽帧模块的输入端,所述抽帧模块的输出端信号连接有HDR解码模块的输入端,所述HDR解码模块的输出端信号连接有数据缓冲模块的输入端,所述数据缓冲模块的输出端信号连接有内存模块的输入端,所述内存模块的输出端信号连接有像素均值计算模块的输入端,所述像素均值计算模块的输出端信号连接有帧延迟模块的输入端,所述帧延迟模块的输出端信号连接在LED驱动模块的输入端。The FPGA-based video data processing system also includes a decryption module. The output signal of the decryption module is connected to the input end of the color space conversion module. The output signal of the color space conversion module is connected to the resolution scaling module. At the input end, the output end signal of the resolution scaling module is connected to the input end of the frame extraction module, the output end signal of the frame extraction module is connected to the input end of the HDR decoding module, and the output end signal of the HDR decoding module is connected There is an input end of the data buffer module, the output end signal of the data buffer module is connected to the input end of the memory module, the output end signal of the memory module is connected to the input end of the pixel average calculation module, and the pixel average calculation module The output signal is connected to the input end of the frame delay module, and the output signal of the frame delay module is connected to the input end of the LED driver module.
  2. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述基于FPGA的视频数据处理系统还设置有参数模块,所述参数模块用于通过检测输入的分辨率以及检测到的LED灯带的芯片数量,从而计算每个灯珠所对应的矩形区域,所述LED灯带的芯片选用型号为ws2812芯片。An FPGA-based video data processing system according to claim 1, characterized in that the FPGA-based video data processing system is also provided with a parameter module, and the parameter module is used to detect input resolution and detection The number of chips in the LED light strip is obtained to calculate the rectangular area corresponding to each lamp bead. The chip model of the LED light strip is ws2812 chip.
  3. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述内存模块的输入端信号连接有内存读写地址模块,所述内存读写模块为RAM的地址计数器,写入数据时,按照逐行写入的方式;在读出时,按照灯带需要的地址,随机的取出数据,该随机地址是按照灯带的位置通过地址映射计算出RAM的坐标。A video data processing system based on FPGA according to claim 1, characterized in that the input signal of the memory module is connected to a memory read and write address module, and the memory read and write module is an address counter of RAM, and the write When data is input, it is written line by line; when read, data is randomly taken out according to the address required by the light strip. The random address is calculated based on the address mapping of the RAM coordinates according to the position of the light strip.
  4. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述LED驱动模块的输出端还信号连接有LED驱动数量检测模块的输入端,所述LED驱动数量检测模块用于在系统开机时,通过电流增量法来检测外部的LED灯带上面的芯片数量。A video data processing system based on FPGA according to claim 1, characterized in that the output end of the LED driving module is also signal-connected to the input end of the LED driving quantity detection module, and the LED driving quantity detection module uses When the system is turned on, the number of chips on the external LED strip is detected through the current increment method.
  5. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述颜色空间转换模块,用于YCbCr向RGB的颜色空间的转换,通过一系列的矩阵运算即可算出不同标准的格式RGB灰度值;当输入的hdmi的信号源为YCbCr的格式后,颜色空间转换模块将自动的进行颜色空间转换,将YCbCr颜色空间转换为RGB颜色空间。A video data processing system based on FPGA according to claim 1, characterized in that the color space conversion module is used to convert YCbCr to RGB color space, and different standards can be calculated through a series of matrix operations. format RGB grayscale value; when the input HDMI signal source is in YCbCr format, the color space conversion module will automatically perform color space conversion and convert the YCbCr color space to RGB color space.
  6. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述分辨率缩放模块,用于将4K信号转换为1080P格式的分辨率,在hdmi2.018G的带宽条件下,通过降低输入信号的分辨率来达到降低流水线的带宽目的,当系统带宽超过165M*24bit的时候,系统启用分辨率缩小模块,此时当输入信号为3840*2160的时候,实际输出分辨率为1920*1080,FPGA的系统带宽降低到原来的1/4。An FPGA-based video data processing system according to claim 1, characterized in that the resolution scaling module is used to convert 4K signals to a resolution of 1080P format, under the bandwidth condition of HDMI2.018G, By reducing the resolution of the input signal, the bandwidth of the pipeline is reduced. When the system bandwidth exceeds 165M*24bit, the system enables the resolution reduction module. At this time, when the input signal is 3840*2160, the actual output resolution is 1920 *1080, the system bandwidth of FPGA is reduced to 1/4 of the original.
  7. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述抽帧模块,用于将高于60Hz的信号转换为不高于60Hz的信号,所述抽帧模块实时检测输入信号的帧率,当超过60Hz之后,将帧率除以2,若还是超过60Hz,继续除以2直到小于60Hz为止,保证不影响后端的ws2812芯片的带载点数。A video data processing system based on FPGA according to claim 1, characterized in that the frame extraction module is used to convert signals higher than 60 Hz into signals not higher than 60 Hz, and the frame extraction module real-time Detect the frame rate of the input signal. When it exceeds 60Hz, divide the frame rate by 2. If it still exceeds 60Hz, continue dividing by 2 until it is less than 60Hz, ensuring that it does not affect the load points of the back-end ws2812 chip.
  8. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述HDR解码模块,用于通过检测HDR数据包的包头,来判断输入的信号是否为HDR的格式,识别HDR的数据,并对数据的灰阶做一次重新映射计算,避免RGB数据饱和度下降的问题。An FPGA-based video data processing system according to claim 1, characterized in that the HDR decoding module is used to determine whether the input signal is in HDR format by detecting the header of the HDR data packet, and to identify the HDR data, and perform a remapping calculation on the gray scale of the data to avoid the problem of RGB data desaturation.
  9. 根据权利要求1所述的一种基于FPGA的视频数据处理系统,其特征在于,所述数据缓冲模块,用于缓冲数据以及隔离FPGA内部和外部的时钟域;从hdmi的信号为逐行发送,按照DE信号的控制写入到缓冲区,采用FIFO来匹配速度差,用于和FPGA的内部做速度匹配。A video data processing system based on FPGA according to claim 1, characterized in that the data buffer module is used to buffer data and isolate the internal and external clock domains of the FPGA; the signal from HDMI is sent line by line, Write to the buffer according to the control of the DE signal, and use FIFO to match the speed difference, which is used to match the internal speed of the FPGA.
  10. 根据权利要求2所述的一种基于FPGA的视频数据处理系统,其特征在于,所述参数模块,用于通过检测hdmi信号的分辨率、LED灯带的灯珠数量就可以计算出每个LED灯珠所对应的电视机的矩形像素点区域,从而得到将该矩形区域内的RGB的平均值,该平均值作为该RGB灰度值;同时参数模块可以配置FPGA的各个参数,将FPGA的参数定义为表格的方式来实现。A video data processing system based on FPGA according to claim 2, characterized in that the parameter module is used to calculate each LED by detecting the resolution of the HDMI signal and the number of lamp beads of the LED lamp strip. The rectangular pixel area of the TV corresponding to the lamp bead is used to obtain the average value of the RGB in the rectangular area, and the average value is used as the RGB gray value; at the same time, the parameter module can configure various parameters of the FPGA, and the parameters of the FPGA Defined as a table to achieve.
PCT/CN2022/103811 2022-05-06 2022-07-05 Video data processing system based on fpga WO2023213002A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210485800.1A CN117082195A (en) 2022-05-06 2022-05-06 FPGA-based video data processing system
CN202210485800.1 2022-05-06

Publications (1)

Publication Number Publication Date
WO2023213002A1 true WO2023213002A1 (en) 2023-11-09

Family

ID=88646173

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/103811 WO2023213002A1 (en) 2022-05-06 2022-07-05 Video data processing system based on fpga

Country Status (2)

Country Link
CN (1) CN117082195A (en)
WO (1) WO2023213002A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866627A (en) * 2010-06-29 2010-10-20 彩虹集团公司 Method for controlling direct illumination-type white light LED backlight
CN101894524A (en) * 2010-06-24 2010-11-24 彩虹集团公司 Direct type white light LED backlight source control method
CN101937652A (en) * 2010-09-27 2011-01-05 彩虹集团公司 Method for counting backlight of direct type white LED backlight
CN104660918A (en) * 2015-03-11 2015-05-27 南京航空航天大学 Airborne system for mixing and displaying videos in real time
US20160118026A1 (en) * 2013-04-01 2016-04-28 The Hong Kong Polytechnic University Drive method and system for led display panel
CN113823234A (en) * 2021-11-22 2021-12-21 南京熊猫电子制造有限公司 RGB Mini-LED field sequence backlight control system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101894524A (en) * 2010-06-24 2010-11-24 彩虹集团公司 Direct type white light LED backlight source control method
CN101866627A (en) * 2010-06-29 2010-10-20 彩虹集团公司 Method for controlling direct illumination-type white light LED backlight
CN101937652A (en) * 2010-09-27 2011-01-05 彩虹集团公司 Method for counting backlight of direct type white LED backlight
US20160118026A1 (en) * 2013-04-01 2016-04-28 The Hong Kong Polytechnic University Drive method and system for led display panel
CN104660918A (en) * 2015-03-11 2015-05-27 南京航空航天大学 Airborne system for mixing and displaying videos in real time
CN113823234A (en) * 2021-11-22 2021-12-21 南京熊猫电子制造有限公司 RGB Mini-LED field sequence backlight control system and method

Also Published As

Publication number Publication date
CN117082195A (en) 2023-11-17

Similar Documents

Publication Publication Date Title
CN104917990B (en) Video frame rate compensation is carried out by adjusting vertical blanking
CN102097050B (en) A kind of apparatus and method realizing display seamless switching
CN102843522B (en) The video-splicing transaction card of Based PC IE, its control system and control method
CN103248797A (en) Video resolution enhancing method and module based on FPGA (field programmable gate array)
CN211184115U (en) Vehicle-mounted display control terminal with multi-channel video display function
US10055809B2 (en) Systems and methods for time shifting tasks
WO2020063506A1 (en) Smart terminal, image processing method and computer-readable storage medium
CN109714621A (en) A kind of multichannel dynamic video analogy method and its processing system that timing is configurable
WO2023000620A1 (en) Multi-screen display method and device
CN107566770B (en) PG signal transmission control unit and method based on PCIe and HDMI
CN201249721Y (en) Vehicle lane departure prewarning device
WO2018000676A1 (en) Method and device for configuring image mode
CN207251800U (en) A kind of intelligent SDI video switching boxs based on FPGA
CN202077127U (en) Video signal format conversion circuit
CN115209145A (en) Video compression method, system, device and readable storage medium
CN107707829B (en) Multi-interface intelligent SDI video conversion box realized based on FPGA
WO2023213002A1 (en) Video data processing system based on fpga
CN106878650B (en) DVI to VGA video conversion device and method thereof
WO2021016974A1 (en) Data processing method, device and system, system controller and module controller
CN201601736U (en) LED video signal processor
CN101483768A (en) Electronic apparatus
CN101227598B (en) High-resolution video monitoring system
CN202168141U (en) Video stitching processing card based on PCIE
CN201937760U (en) Network monitor used for video monitoring
CN201185457Y (en) System for monitoring high-resolution video

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: 22940696

Country of ref document: EP

Kind code of ref document: A1