A bus-controllable multiple sampling circuit suitable for composite video coding
By designing a bus-controllable multiple sampling circuit and using elastic buffer structure and register signal value transmission, the timing alignment of video data in composite video circuits is achieved, which solves the problem of data timing misalignment in the existing technology and realizes multi-bit Efficient transmission of video signals.
Patent Information
- Application Number
- CN202211128535.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-16
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-09-16
AI Technical Summary
The existing multi-sampling circuit module cannot connect the sampled data and timing in the composite video circuit, resulting in unsatisfied timing relationships between lines, fields and data after video data sampling, and cannot be effectively processed.
A bus-controllable multiple sampling circuit is designed, including a bus control module, a video data processing module and a composite video encoding module. It achieves cross-clock domain synchronization of data through an elastic buffer structure, and uses register signal values to transmit sampling frequency and threshold values. , ensure the timing alignment of line, field and video data, and adopt optimal solutions to achieve correct data transmission through bit splicing and read address bit width expansion.
It realizes the simultaneous transmission of multi-bit video signal data, ensures the correct transmission of video data at multiple sampling frequencies, solves the problem of data timing connection, and improves the efficiency and accuracy of video processing.
Smart Images

Figure CN115499656B
Abstract
Description
Technical Field
[0001] The present invention relates to video processing technology, and in particular to a multiple sampling technology used in composite video processing. Background Art
[0002] The existing multiple sampling circuit modules are generally only suitable for A / D conversion circuits. If video sampling is applied, the problem of the data and timing after sampling in the composite video circuit cannot be matched. That is, after the multiple sampling circuit module samples the video data, the timing relationship between the input lines, fields and data is no longer satisfied.
[0003] For example, the Chinese patent publication “Oversampling A / D conversion circuit”, publication number CN1801951A, discloses that the data processing is to process the analog signal in the A / D conversion module, and is not applicable to composite video sampling.
[0004] For example, the Chinese patent publication “A method for simultaneous channel estimation of multi-sampling rate data streams”, publication number CN103532885A, discloses a multiple sampling process for data designed for the field of wireless communications, which cannot be used in FPGA circuit design. Summary of the invention
[0005] The present invention aims at the shortcomings of the prior art and provides a solution capable of realizing multiple sampling and simultaneous transmission of multi-bit video signal data.
[0006] In order to solve the above technical problems, the present invention is solved by the following technical solutions:
[0007] A bus-controllable multiple sampling circuit includes the following structure:
[0008] A bus control module, located in the bus clock domain;
[0009] The video data processing module is located in the pixel clock domain and is used to receive and process the video data and transmit the register signal value configured by the bus control module across the clock domain to the video processing module; the register signal value includes a write data trigger signal;
[0010] The composite video encoding module is located in the encoding clock domain, connected to the output end of the multiple sampling circuit module, and receives the read data;
[0011] A multiple sampling circuit module is connected to the bus control module, wherein the multiple sampling circuit module includes an elastic buffer structure, and data is synchronously transmitted to the composite video encoding module through the elastic buffer structure;
[0012] The writing end of the multiple sampling circuit module is connected to the video data processing module, both of which are located in the pixel clock domain;
[0013] The readout end of the multiple sampling circuit module is connected to the composite video encoding module, both of which are located in the encoding clock domain;
[0014] The bus control module transmits the configured register signal value across the clock domain to the multiple sampling circuit module and the video data processing module in the encoding clock domain;
[0015] The register signal value includes a sampling frequency and a threshold value transmitted to the encoding clock domain. When the storage amount of data in the elastic buffer structure reaches the threshold value, the data is read out to the composite video encoding module, wherein the frequency of the pixel clock and the frequency of the encoding clock are configured according to the sampling frequency.
[0016] Wherein, the register signal value also includes an encoding enable signal, and the bus control module transmits the encoding enable signal across the clock domain to the pixel clock domain as a write enable signal;
[0017] When the encoding clock domain reset is pulled high, the encoding enable signal is synchronized from the pixel clock domain to the encoding clock domain as a read enable signal;
[0018] At the same time, the reset and write enable signals in the pixel clock domain are high, data is written to the elastic buffer structure, and the write address increases;
[0019] When the storage amount of data in the elastic buffer structure reaches a threshold, the read enable signal in the encoding clock domain is pulled high, the data is read out, and the read address increases.
[0020] The written data includes the combined logic data of field, line and video data yuv;
[0021] The read data includes the combined logical data of field, line and video data yuv.
[0022] Wherein, the row, field, data y, data u, and data v in the pixel clock domain are spliced into input data by a bit splicing method and written into the elastic buffer structure at the same time;
[0023] In the encoding clock domain, the data in the elastic buffer structure is read out, and the data is row, field, data y, data u, data v in sequence, and when transmitting, all the data in the effective area and the blanking area are transmitted.
[0024] As a preferred solution, different from the traditional direct writing of video data yuv, this solution writes and transmits the line, field and video data yuv together as data, ensuring that the line, field and video data are always time-aligned. The line, field and video data yuv are combined by the combinational logic circuit in the digital circuit, that is, the corresponding line, field, video data y, video data u, and video data v under each clock are a whole.
[0025] As a preferred solution, the expansion of the read address bit width is used to realize multiple cumulative counting of the same data, so that the elastic buffer structure can read data from the same address multiple times to realize the function of increasing the number of points of the same data. The read address bit width of the encoding clock domain is configured according to the sampling frequency, and the read address bit width is an extended bit width based on the write address bit width. The number of read address points increases, and the amount of read data remains unchanged.
[0026] As a preferred solution, the bus control module is connected to a bus clock domain synchronization pixel clock domain unit and a bus clock domain synchronization encoding clock domain unit;
[0027] The video data processing module transmits the register signal value configured by the bus control module to the video data processing module across the clock domain through the bus clock domain synchronization pixel clock domain unit;
[0028] The multiple sampling circuit module is connected to the bus clock domain synchronization encoding clock domain unit, and transmits the register signal value configured by the bus control module to the multiple sampling circuit module across the clock domain through the bus clock domain synchronization pixel clock domain unit.
[0029] As a preferred solution, the multiple sampling circuit module is also connected to the bus clock domain synchronization pixel clock domain unit, and transmits an error flag to the bus clock domain synchronization pixel clock domain unit; the multiple sampling circuit module is connected to the bus clock domain synchronization encoding clock domain unit, and transmits an error flag to the bus clock domain synchronization encoding clock domain unit.
[0030] Specifically, when writing data, the write address is synchronized to the encoding clock domain; when reading data, the read address is synchronized to the pixel clock domain; in the pixel clock domain, the write address and the read address are analyzed and the error flag is identified; in the encoding clock domain, the write address and the read address are analyzed and the error flag is identified;
[0031] When an error flag appears in the pixel clock domain or the encoding clock domain, the error signal is sent back to the bus control module.
[0032] Among them, the error flag includes a full flag and an empty flag;
[0033] In the pixel clock domain, if the upper two bits of the write address Gray code are opposite to the upper two bits of the read address Gray code, and the remaining bits are equal, it is a full flag;
[0034] In the encoding clock domain, if the write address Gray code and the read address Gray code are equal, it is an empty flag.
[0035] As a preferred solution, an error flag is set, and the video data transmission status is fed back through bus transmission to ensure that the video data can still be correctly transmitted at multiple sampling frequencies. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 It is a block diagram of a bus-controllable multiple sampling circuit module suitable for composite video coding;
[0038] Figure 2 It is the timing diagram of reading and writing data of the multiple sampling circuit;
[0039] Figure 3 is to write a data flow diagram;
[0040] Figure 4 It is to read the data flow diagram;
[0041] Figure 5 It is a schematic diagram of line, field and data yuv combined transmission;
[0042] Figure 6 It is the timing diagram of the double sampling circuit;
[0043] Figure 7 This is the timing diagram of the double sampling circuit without using the read address bit width expansion. DETAILED DESCRIPTION
[0044] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.
[0045] A bus-controllable multiple sampling circuit module, such as Figure 1 , including the following structure:
[0046] A bus control module, located in the bus clock domain;
[0047] The video data processing module is located in the pixel clock domain and is used to receive and process the video data and transmit the register signal value configured by the bus control module across the clock domain to the video processing module; the register signal value includes a write data trigger signal;
[0048] The composite video encoding module is located in the encoding clock domain, connected to the output end of the multiple sampling circuit module, and receives the read data;
[0049] A multiple sampling circuit module is connected to the bus control module, wherein the multiple sampling circuit module includes an elastic buffer structure, and data is synchronously transmitted to the composite video encoding module through the elastic buffer structure;
[0050] The writing end of the multiple sampling circuit module is connected to the video data processing module, both of which are located in the pixel clock domain;
[0051] The readout end of the multiple sampling circuit module is connected to the composite video encoding module, both of which are located in the encoding clock domain;
[0052] The bus control module transmits the configured register signal value across the clock domain to the multiple sampling circuit module and the video data processing module in the encoding clock domain;
[0053] The register signal value includes a sampling frequency and a threshold value transmitted to the encoding clock domain. When the storage amount of data in the elastic buffer structure reaches the threshold value, the data is read out to the read data encoding module, wherein the frequency of the pixel clock and the frequency of the encoding clock are configured according to the sampling frequency, that is, the frequency of the encoding clock domain is a multiple of the frequency of the pixel clock domain.
[0054] Among them, the video processing module mainly processes the video data input from the outside, such as: video data conversion, video data gain processing, video data low-pass filtering processing, etc. The multiple sampling circuit module synchronizes the processed video data (single clock frequency) to the composite video encoding module (multiple clock frequency) for video encoding. As a preferred embodiment, the elastic buffer structure in the multiple sampling circuit module uses 16 registers to realize cross-clock domain synchronization of data, which greatly saves area.
[0055] Next, the method of writing and reading data will be described.
[0056] Wherein, the register signal value also includes an encoding enable signal, and the bus control module transmits the encoding enable signal across the clock domain to the pixel clock domain as a write enable signal;
[0057] When the encoding clock domain reset is pulled high, the encoding enable signal is synchronized from the pixel clock domain to the encoding clock domain as a read enable signal; at the same time, the reset and write enable signals in the pixel clock domain are high, data is written to the elastic buffer structure, and the write address increases; when the storage amount of data in the elastic buffer structure reaches the threshold, the read enable signal in the encoding clock domain is pulled high, data is read out, and the read address increases.
[0058] Specifically, refer to Figure 2 The timing diagram of
[0059] When the encoding clock domain reset is pulled high, the encoding enable signal (i_encode_en_pix) is synchronized to the encoding clock domain through a two-stage trigger circuit. At the same time, when the reset (i_pix_rstn) and write enable signal (i_encode_en_pix) in the pixel clock domain are both high, data is written to the elastic buffer structure, where the written data is transmitted corresponding to each point through combinational logic and the write address is increased.
[0060] The written data includes the combined logic data of field, line, and video data yuv; the line, field, data y, data u, and data u in the pixel clock domain are spliced into input data through a bit splicing method and written into the elastic buffer structure at the same time;
[0061] Figure 2 In the dotted box, the field vvalid, line hvalid, video data y[9:0], video data u[9:0], and video data v[9:0] correspond to each other in this clock cycle. The com_input[31:0] below will input the line, field, and video data through the combinational logic to realize the new data input signal com_input={vvalid,hvalid,y,u,v}. Among them, write_en is the write enable signal. When the write enable is high, the write address wp increases at the rising edge of the clock.
[0062] like Figure 3 and Figure 4 , convert the write address into Gray code and synchronize it to the encoding clock domain, and convert it into binary form in the encoding clock domain. When the storage amount of data in the elastic buffer structure (the amount of data written - the amount of data read) is equal to the preset data transmission threshold (i_trans_threshold), the encoding clock domain read enable is pulled high to start reading data.
[0063] The data read out is read out at each point through combinational logic, and the read address starts to increase, and the read address is converted into Gray code form and synchronized to the pixel clock domain.
[0064] The data read out include the combined logic data of field, line and video data yuv. In the encoding clock domain, the data in the elastic buffer structure is read out. The data are line, field, data y, data u and data v in sequence. When transmitting, all the data in the effective area and the blanking area are transmitted.
[0065] like Figure 5As shown, the row (hvalid), field (vvalid), data y (y[9:0]), data u (u[9:0]), and data v (v[9:0]) in the pixel clock domain are spliced into a 32-bit data through the bit splicing technology and written into the elastic buffer structure at the same time; in the encoding clock domain, the 32-bit data in the elastic buffer structure is read out, and the 32-bit data is row (hvalid), field (vvalid), data y (y[9:0]), data u (u[9:0]), and data v (v[9:0]) in sequence, and when transmitting, all the data in the valid area and the blanking area are transmitted.
[0066] As a preferred solution, an error flag is set to feedback the video data transmission status through bus transmission to ensure that the video data can still be correctly transmitted at multiple sampling frequencies;
[0067] When writing data, the write address is synchronized to the encoding clock domain; when reading data, the read address is synchronized to the pixel clock domain; in the pixel clock domain, the write address and the read address are analyzed and the error flag is identified; in the encoding clock domain, the write address and the read address are analyzed and the error flag is identified;
[0068] When an error flag appears in the pixel clock domain or the encoding clock domain, the error signal is sent back to the bus control module.
[0069] Specifically, the error flags include a full flag and an empty flag;
[0070] In the pixel clock domain, if the upper two bits of the write address Gray code are opposite to the upper two bits of the read address Gray code, and the remaining bits are equal, it is a full flag;
[0071] In the encoding clock domain, if the write address Gray code and the read address Gray code are equal, it is an empty flag.
[0072] Further, in order to better transmit signals through the bus, the bus control module is connected with a bus clock domain synchronization pixel clock domain unit and a bus clock domain synchronization encoding clock domain unit;
[0073] The register signal value configured by the bus control module is transmitted across the clock domain to the video data processing module through the bus clock domain synchronization pixel clock domain unit;
[0074] The multiple sampling circuit module is connected to the bus clock domain synchronization encoding clock domain unit, and transmits the register signal value configured by the bus control module to the multiple sampling circuit module across the clock domain through the bus clock domain synchronization pixel clock domain unit.
[0075] As a preferred solution, in the above-mentioned error reporting mechanism, the multiple sampling circuit module is also connected to the bus clock domain synchronization pixel clock domain unit, and transmits an error flag to the bus clock domain synchronization pixel clock domain unit; the multiple sampling circuit module is connected to the bus clock domain synchronization encoding clock domain unit, and transmits an error flag to the bus clock domain synchronization encoding clock domain unit.
[0076] Furthermore, the expansion of the read address bit width is used to realize multiple cumulative counting of the same data, so that the elastic buffer structure can read data from the same address multiple times to realize the function of increasing the number of points of the same data. The read address bit width of the encoding clock domain is configured according to the sampling frequency. The read address bit width is an extended bit width based on the write address bit width. The number of read address points increases, and the amount of read data remains unchanged.
[0077] pass Figure 6 The public timing diagram further explains that, taking 2x frequency as an example:
[0078] In the figure:
[0079] i_pix_clk is the pixel clock domain clock;
[0080] wp is the pixel clock domain write address, 5 bits;
[0081] wdata is the pixel clock domain input data, 32 bits;
[0082] i_encode_clk is the clock signal in the encoding clock domain;
[0083] rp is the read address of the encoding clock domain, 6 bits;
[0084] Taking 2x frequency sampling as an example, the data bit width is 6 bits. If 4x frequency sampling is to be achieved, the bit width becomes 7 bits, and so on.
[0085] rp_valid is the truly valid read address in the encoding clock domain. Its bit width is the same as that of the write address, which is 5 bits. The change of sampling frequency will not change the bit width of rp_valid.
[0086] It can be seen from the figure that in the same time, the time for writing and reading data is consistent in the single-frequency clock domain and the double-frequency clock domain. The difference is that in single-frequency, one clock cycle is used to write one data to one address, while in double-frequency, two clock cycles are used to read two identical data at two adjacent addresses. In the composite video encoding circuit of the multi-frequency clock domain, it is necessary to achieve the same amount of data unchanged and the number of points increased in the same time.
[0087] Based on this goal, the address count is increased by expanding the read address (i.e., expanding the bit width of rp), but the data volume remains unchanged. Finally, the address is selected according to the actual corresponding circuit through the effective read address rp_valid. For example, in a 2x frequency circuit, the address of rp is divided by 2; in a 4x frequency circuit, the address of rp is divided by 4, and so on. Finally, it is concluded that one address of rp_valid corresponds to two points in the encoding clock domain, thereby realizing the increase of sampling points.
[0088] Compare Figure 6 and Figure 7 , the data changes of the two signals rdata[31:0], the elastic buffer structure uses one address to read data, one clock corresponds to reading one data, the address of rp_valid[4:0] is divided by 2 based on rp[5:0], then it is equivalent to the two addresses of rp[5:0] being equal to one address of rp_valid[4:0]. In the clock domain of i_encode_clk, for one address, the data of the same address is read in two clock cycles, and the data read out is the same data of two cycles, thus achieving double sampling.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0090] The units may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0091] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0092] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0093] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A bus-controllable multiple sampling circuit suitable for composite video coding, characterized in that: Includes the following structures: A bus control module, located in the bus clock domain; A video data processing module is located in the pixel clock domain and is used to receive and process video data. The register signal value configured by the bus control module is transmitted across the clock domain to the video data processing module; the register signal value includes a write data trigger signal; The composite video encoding module is located in the encoding clock domain, connected to the output end of the multiple sampling circuit module, and receives the read data; A multiple sampling circuit module is connected to the bus control module, wherein the multiple sampling circuit module includes an elastic buffer structure, and data is synchronously transmitted to the composite video encoding module through the elastic buffer structure; The writing end of the multiple sampling circuit module is connected to the video data processing module, both of which are located in the pixel clock domain; The readout end of the multiple sampling circuit module is connected to the composite video encoding module, both of which are located in the encoding clock domain; The bus control module transmits the configured register signal value across the clock domain to the multiple sampling circuit module and the video data processing module in the encoding clock domain; The register signal value includes a sampling frequency and a threshold value transmitted to the encoding clock domain, and when the storage amount of data in the elastic buffer structure reaches the threshold value, the data is read out to the composite video encoding module, wherein the frequency of the pixel clock and the frequency of the encoding clock are configured according to the sampling frequency; Wherein, the bus control module is connected with a bus clock domain synchronization pixel clock domain unit and a bus clock domain synchronization encoding clock domain unit; The video data processing module transmits the register signal value configured by the bus control module to the video data processing module across the clock domain through the bus clock domain synchronization pixel clock domain unit; The multiple sampling circuit module is connected to the bus clock domain synchronization encoding clock domain unit, and transmits the register signal value configured by the bus control module to the multiple sampling circuit module across the clock domain through the bus clock domain synchronization pixel clock domain unit.
2. A bus-controllable multiple sampling circuit suitable for composite video coding according to claim 1, characterized in that: The register signal value also includes an encoding enable signal, and the bus control module transmits the encoding enable signal across the clock domain to the pixel clock domain as a write enable signal; When the encoding clock domain reset is pulled high, the encoding enable signal is synchronized from the pixel clock domain to the encoding clock domain as a read enable signal; At the same time, the reset and write enable signals in the pixel clock domain are high, data is written to the elastic buffer structure, and the write address increases; When the storage amount of data in the elastic buffer structure reaches a threshold, the read enable signal in the encoding clock domain is pulled high, the data is read out, and the read address increases.
3. A bus-controllable multiple sampling circuit suitable for composite video coding according to claim 1 or 2, characterized in that: in, The data written includes the combined logical data of field, line and video data yuv; The read data includes the combined logical data of field, line and video data yuv.
4. A bus-controllable multiple sampling circuit suitable for composite video coding according to claim 3, characterized in that: The row, field, data y, data u, and data v in the pixel clock domain are spliced into input data through a bit splicing method and written into the elastic buffer structure at the same time; In the encoding clock domain, the data in the elastic buffer structure is read out, and the data is row, field, data y, data u, data v in sequence, and when transmitting, all the data in the effective area and the blanking area are transmitted.
5. The bus-controllable multiple sampling circuit suitable for composite video coding according to claim 1, characterized in that: The read address bit width of the encoding clock domain is configured according to the sampling frequency, and the read address bit width is an extended bit width based on the write address bit width. The number of read address points increases, and the amount of read data remains unchanged.
6. The bus-controllable multiple sampling circuit suitable for composite video coding according to claim 1, characterized in that: in, The multiple sampling circuit module is also connected to the bus clock domain synchronization pixel clock domain unit, and transmits an error flag to the bus clock domain synchronization pixel clock domain unit; the multiple sampling circuit module is connected to the bus clock domain synchronization encoding clock domain unit, and transmits an error flag to the bus clock domain synchronization encoding clock domain unit.
7. A bus-controllable multiple sampling circuit suitable for composite video coding according to claim 1 or 6, characterized in that: When writing data, synchronize the write address to the encoding clock domain; When reading data, synchronize the read address to the pixel clock domain; Analyze the write address and read address and identify the error flag in the pixel clock domain; In the encoding clock domain, the write address and the read address are analyzed to identify the error flag; When an error flag appears in the pixel clock domain or the encoding clock domain, the error signal is sent back to the bus control module.
8. The bus-controllable multiple sampling circuit suitable for composite video coding according to claim 7, characterized in that: in, The error flags include a full flag and an empty flag; In the pixel clock domain, if the upper two bits of the write address Gray code are opposite to the upper two bits of the read address Gray code, and the remaining bits are equal, it is a full flag; In the encoding clock domain, if the write address Gray code and the read address Gray code are equal, it is an empty flag.
Citation Information
Patent Citations
Method for simultaneous channel estimation of multiplied sampling rate data flow
CN103532885A
Over-sampling a / d converting circuit
CN1801951A
Video coding method, device and system and medium
CN109729353A
Image processing apparatus, image processing system, and imaging apparatus
JP2009182993A
