Image rotation data processing device and display terminal
By designing an image rotation data processing device on a low-cost single display chip and utilizing N-line cache and 4-line cache technology, efficient image rotation processing is achieved, which solves the problem of dependence on high-cost CPU or GPU in the existing technology and reduces power consumption. and data transfer volume to support higher resolution and refresh rate video processing.
Patent Information
- Application Number
- CN201911414627.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2039-12-31
AI Technical Summary
It is difficult for low-cost single display chips in the existing technology to achieve efficient image rotation operations, and usually require a high-cost CPU or GPU for rotation processing, resulting in high power consumption and high data transmission volume.
An image rotation data processing device is designed, including an image pre-processing unit, an image rotation data processing unit, a storage control unit and an image rotation data restoration unit. Through N-line cache and 4-line cache technology, the rotation processing and restoration of image data are realized , reducing dependence on high-cost CPU.
It achieves efficient image rotation processing on a low-cost single display chip, reduces power consumption and data transmission volume, supports higher resolution and higher refresh rate video processing, and is low-cost.
Smart Images

Figure CN113126858B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, and in particular to an image rotation data processing device and a display terminal. Background Art
[0002] Digital images are increasingly used in the fields of in-vehicle multimedia systems and medical surveillance cameras. In today's image display, the display screen often needs to be used horizontally or vertically, or vertically or horizontally, which requires the display driver chip to support the rotation function.
[0003] In the existing technical solutions, low-cost single display chips usually do not have frame buffers, do not integrate high-performance central processing units (CPUs), and generally only have built-in MCU cores. Such chips rarely support functions such as rotation. Therefore, software rotation can only be performed using high-performance CPUs or dedicated GPUs in high-cost large systems, and functional modules such as GPUs are usually hung on buses such as AXI. Calling GPUs to perform such rotation processing will inevitably lead to higher power consumption, higher data transmission volume, and unbearable costs.
[0004] Implementing efficient image rotation operations on a small system with a low-cost single display chip is an urgent problem to be solved. Summary of the invention
[0005] In view of this, the technical problem to be solved by the present invention is to provide an image rotation data processing device and a display terminal to solve the deficiencies of the prior art.
[0006] In order to achieve the above object, the present invention adopts the following technical scheme:
[0007] The embodiment of the present invention provides an image rotation data processing device, comprising: an image pre-processing unit, an image rotation data processing unit, a storage control unit, a memory, and an image rotation data restoration unit;
[0008] The image pre-processing unit is used to decode the source image into YCbCr444 format data with line and field effective timing signals;
[0009] The image rotation data processing unit performs line buffering on the received YCbCr444 format image data according to a preset format according to the working mode, and sends the processed data to the storage control unit for frame buffering to realize rotation processing; the working modes include: YCbCr422 normal mode, YCbCr422 rotation mode, YCbCr420 normal mode and YCbCr420 rotation mode;
[0010] The storage control unit is used to receive the image data from the image rotation data processing unit, write the data in the rotation mode or the normal mode to the memory according to the corresponding working mode, perform frame rate conversion at the same time, read out the rotated or non-rotated data in the memory, and write it to the image rotation data restoration unit,
[0011] A memory for caching each frame of image data in a rotation or normal mode after real-time processing;
[0012] The image rotation data restoration unit is used to receive the image data read out from the frame memory by the storage control unit and restore it to the YCbCr422 data format that can be received by the general image post-processing unit.
[0013] Further, the image rotation data processing unit comprises: a first control unit, an image rotation data input cache processing unit, an N-line cache unit and an output interface unit;
[0014] The first control unit is used to receive the input line field effective timing signal, generate a control signal to write the input image data Y, Cb, Cr to the N line cache unit according to the input timing, and control the output interface unit to send a request signal to write the frame cache to the storage control unit according to the input timing; the pixel counter and line counter generated by the control unit are used to control the processing and storage of data and data communication with the storage control unit;
[0015] The image rotation data input buffer processing unit is used to convert the received image data in YCbCr444 format into YCbCr422 or YCbCr420 format according to the working mode;
[0016] N-row buffer units, used to buffer image data after rotation processing and before writing to the frame buffer;
[0017] The output interface unit determines the state of the N-row cache unit according to the timing information of the first control unit, and sends a request for writing the frame cache to the storage control unit when there is processed rotation data. When the storage control unit responds to the request, the image data of the N-row cache unit is taken out and transmitted to the storage control unit.
[0018] Further, when the working mode is the YCbCr422 normal mode, the data cached by the N rows of cache units are arranged such that the Y component is placed in the high byte, the Cb component is placed in the low byte of the odd column, and the Cr component is placed in the low byte of the even column;
[0019] When the working mode is the YCbCr422 rotation mode, the data cached by the N rows of cache units are arranged such that the Y component is placed in the high byte, the Cr component is placed in the low byte of the odd column, and the Cb component is placed in the low byte of the even column;
[0020] When the working mode is the YCbCr420 normal mode, the data cached by the N rows of cache units are repeated in groups of three columns; the Y component is placed in the high byte of the first column, the high and low bytes of the second column, and the low byte of the third column, the Cb component is placed in the low byte of the odd column of the first column and the high byte of the odd column of the third column, and the Cr component is placed in the low byte of the even column of the first column and the high byte of the odd and even column of the third column;
[0021] When the working mode is the YCbCr420 rotation mode, the data cached by the N-row cache unit is repeated in groups of every 3 columns; the Y component is placed in the high byte of the 1st column, the high and low bytes of the 2nd column, and the low byte of the 3rd column, the Cr component is placed in the low byte of the odd column of the 1st column and the high byte of the odd column of the 3rd column, and the Cb component is placed in the low byte of the even column of the 1st column and the high byte of the odd and even columns of the 3rd column.
[0022] Furthermore, the row cache gating of the N row cache is determined by the row counter wlcnt of the control unit, assuming that N=2 n , n is a natural number, then when wlcnt[n-1:0] is equal to 0, the processed data is written to the first row cache, when wlcnt[n-1:0] is equal to 1, it is written to the second row, and so on, when wlcnt[n-1:0] is equal to N-1, it is written to the Nth row cache.
[0023] Furthermore, when the working mode is the normal mode, the first 4 rows of the N-row cache unit are taken, and every 2 rows of cache are spliced into a new row cache to form 2 caches with increased lengths for reading data and writing data respectively; the cache clocks of the 5th to Nth rows of the N-row cache unit are gated and turned off to enter a low power consumption state.
[0024] Further, the image rotation data restoration unit includes: a second control unit, an input interface unit, a 4-line buffer unit and an image rotation data format restoration unit;
[0025] The second control unit is used to generate a signal for reading frame image data in the memory according to the timing required by the display screen, and write the data received by the input interface unit into the 4-row cache unit according to the timing control;
[0026] The input interface unit is used to write input data into the 4-line cache unit according to the control of the second control unit;
[0027] 4 line buffer units, used for buffering the image data of each line read out from the memory so as to be applied to the image rotation data format restoration unit;
[0028] The image rotation data format restoration unit is used to restore the image data in the 4-line buffer unit into a YCbCr422 format that can be processed by the image post-processing unit.
[0029] Furthermore, the image rotation data format restoration unit converts the YCbCr420 data format into the YCbCr422 format as follows:
[0030] When the working mode is the YCbCr420 normal mode, two lines of data are selected each time, and the Y component of the first line and the Cb and Cr components of the first and second lines are spliced in the YCbCr422 format as one line of data to be output; the Y component of the second line and the Cb and Cr components of the first and second lines are spliced in the YCbCr422 format as another line of data to be output;
[0031] When the working mode is the YCbCr420 rotation mode, three lines of data are selected each time, and the data in the first line is used as the first line of data to be output; the Y component of the high byte of the data in the second line and the Cb and Cr components of the low byte of the data in the first line are spliced in accordance with the YCbCr422 format as the second line of data to be output; the Y component of the low byte of the data in the second line and the Cb and Cr components of the high byte of the data in the third line are spliced in accordance with the YCbCr422 format as the third line of data to be output; the high and low bytes of the data in the third line are swapped as the fourth line of data to be output.
[0032] Furthermore, when the storage control unit writes or reads each row of data to or from the memory, the read address and the write address of each row are incremented according to a multiple of a page of the memory.
[0033] Furthermore, it also includes: an image post-processing unit, which is used to perform image scaling and image enhancement processing on the data sent by the image rotation data restoration unit, and send the processed data to the terminal for display.
[0034] An embodiment of the present invention further provides a display device, comprising the above-mentioned image rotation data processing device.
[0035] Compared with the prior art, the present invention has the following beneficial effects: the image rotation data processing device provided by the present invention does not require a high-cost integrated ARM CPU large system and has low cost. 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 work.
[0037] Figure 1 It is a general structural diagram of a high-performance image rotation data processing device of the present invention;
[0038] Figure 2 It is a structural diagram of the image rotation data processing unit of the present invention;
[0039] Figure 3 It is a structural diagram of the image rotation data restoration unit of the present invention;
[0040] Figure 4 Schematic diagram of data storage of N rows of cache units in YCbCr422 normal mode;
[0041] Figure 5 It is a schematic diagram of data storage of 4 rows of cache units in YCbCr422 normal mode;
[0042] Figure 6 It is a schematic diagram of data storage of N rows of cache units when YCbCr422 is rotated 90 degrees;
[0043] Figure 7 This is a schematic diagram of data storage in the frame buffer when YCbCr422 is rotated 90 degrees;
[0044] Figure 8 It is a schematic diagram of data storage in 4-row cache units when YCbCr422 is rotated 90 degrees;
[0045] Fig. 9 Schematic diagram of data storage of N rows of cache units in YCbCr420 normal mode;
[0046] Fig.10 This is a schematic diagram of the output data of 4-row cache units in YCbCr420 normal mode;
[0047] Fig.11 It is a schematic diagram of data storage of N rows of cache units when YCbCr420 is rotated 90 degrees;
[0048] Fig.12 This is a schematic diagram of data storage in the frame buffer when YCbCr420 is rotated 90 degrees;
[0049] Fig.13 This is a schematic diagram of the output data of 4 rows of cache units when YCbCr420 is rotated 90 degrees. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] like Figure 1 , which is a structural diagram of an image rotation data processing device provided by an embodiment of the present invention. The device mainly comprises: an image pre-processing unit 101, an image rotation data processing unit 102, a storage control unit 103, a memory 104, and an image rotation data restoration unit 105.
[0052] The image pre-processing unit 101 is used to decode the source image into YCbCr444 format data with a line-field effective timing signal. The line-field effective timing signal is used as a timing control signal for the image rotation data processing unit.
[0053] The image pre-processing unit 101 receives image data in various input formats, such as ITU656, ITU601, and BT1120, and performs image decoding to obtain YCbCr444 format data with line and field effective timing signals. The image pre-processing unit 101 is also used to scale the source image. For example, the source image is scaled to the size of the display screen or the size of the display screen before rotation. The image pre-processing unit 101 is also used to perform image enhancement processing such as noise reduction, sharpening, brightness, and contrast adjustment. Finally, the data in YCbCr444 format is uniformly output to the image rotation data processing unit.
[0054] The image rotation data processing unit 102 performs row buffering of the received YCbCr444 format image data according to a preset format according to the working mode, and sends the processed data to the storage control unit for frame buffering to realize rotation processing; the working modes include: YCbCr422 normal mode, YCbCr422 rotation mode, YCbCr420 normal mode and YCbCr420 rotation mode.
[0055] like Figure 2 As shown, the image rotation data processing unit 102 includes: a first control unit 1021 , an image rotation data input cache processing unit 1022 , an N-line cache unit 1023 and an output interface unit 1024 .
[0056] The first control unit 1021 is used to receive the input line field effective timing signal Hs line and Vs field, and generate a control signal to write the input image data Y, Cb, Cr to the N line cache unit according to the input timing, and control the output interface unit to send a request signal for writing the frame cache to the storage control unit according to the input timing. Specifically, the control unit generates a pixel counter wpcnt according to Hs. Initially, wpcnt is 0. When Hs is 1, wpcnt automatically increases by 1 for each pixel clock. When Hs changes from 1 to 0, wpcnt is cleared to 0. At the same time, the control unit generates a line counter wlcnt according to Vs and Hs. Initially, wpcnt is 0. When Vs is 1, wlcnt automatically increases by 1 when each Hs changes from 1 to 0. When Vs changes from 1 to 0, wpcnt is cleared to 0. The two counters generated by the control unit can be used to control data processing and storage and data communication with the storage control unit.
[0057] The image rotation data is input to the cache processing unit 1022. In the embodiment of this unit, the image data received is in the YCbCr444 format. In order to reduce the transmission bandwidth of the frame storage and reduce the resources of the line cache unit in the small system, the data format after image processing can be designed to be YCbCr422 or YCbCr420. In this way, it is not necessary to store all the color data of the three components. Because the human eye is not as sensitive to chromaticity information as brightness information, the image quality will not be reduced after being processed by this unit. The image rotation data input cache processing unit 1022 has four working modes to be processed. A variable rotate_mode can be used to distinguish different working modes. rotate_mode is a 2-bit software-configurable control signal. The rotate_mode value is 0 to 3, and the data processing modes represented are as follows: when the rotate_mode value is 0, 1, 2, and 3, it corresponds to the YCbCr422 normal mode, the YCbCr422 rotation mode, the YCbCr420 normal mode, and the YCbCr420 rotation mode, respectively.
[0058] When rotate_mode is 0, the working mode is the YCbCr422 normal mode, and the data cached by the N-row cache unit 1023 are arranged in the order of the Y component in the high byte, the Cb component in the low byte of the odd column, and the Cr component in the low byte of the even column; Figure 4As shown, it is a schematic diagram of data storage of N rows of cache units in the normal mode of YCbCr422, where brightness is stored in the high byte din_h and chrominance is stored in the low byte din_l. The parity column is distinguished by the lowest bit of wpcnt being 0 or 1. When bit 0 of wpcnt is equal to 0, Y is stored in register y_r, Cb is stored in register Cb_r, and y_r is selected to be placed in the high byte din_h of the buffer input, and cr_r is selected to be placed in the low byte din_l. When bit 0 of wpcnt is equal to 1, Y is stored in register y_r, Cr is stored in register Cr_r, and y_r is selected to be placed in the high byte din_h of the buffer input, and cb_r is selected to be placed in the low byte din_l.
[0059] When rotate_mode is equal to 1, the working mode is YCbCr422 rotation mode, and the data cached by the N-row cache unit 1023 are arranged in the order of the Y component in the high byte, the Cr component in the low byte of the odd column, and the Cb component in the low byte of the even column; Figure 6 The figure shows a schematic diagram of data storage in N rows of cache units when YCbCr422 is rotated 90 degrees. The brightness is stored in the high byte din_h and the chrominance is stored in the low byte din_l. The lowest bit of wlcnt is 0 or 1 to distinguish between odd and even rows. When bit 0 of wlcnt is equal to 0, Y is stored in register y_r, Cr is stored in register Cr_r, and y_r is selected to be placed in the high byte din_h of the buffer input, and cr_r is selected to be placed in the low byte din_l. When bit 0 of wlcnt is equal to 1, Y is stored in register y_r, Cb is stored in register Cb_r, and y_r is selected to be placed in the high byte din_h of the buffer input, and cb_r is selected to be placed in the low byte din_l. When rotating 270 degrees, the method is similar to 90 degrees, except that Cb and Cr can be interchanged.
[0060] When rotate_mode is equal to 2, the working mode is YCbCr420 normal mode, and the N-row cache unit caches 1023 data in groups of 3 columns and repeats it; the Y component is placed in the high byte of the first column, the high and low bytes of the second column, and the low byte of the third column, the Cb component is placed in the low byte of the odd column of the first column and the high byte of the odd column of the third column, and the Cr component is placed in the low byte of the even column of the first column and the high byte of the odd and even column of the third column. Fig. 9 As shown, it is a schematic diagram of data storage of N rows of cache units in the normal mode of YCbCr420. It can be seen that the storage method is obviously different from that of YCbCr422. It is no longer a fixed brightness stored in the high byte and chrominance stored in the byte. In order to save storage space and improve data transmission efficiency, the present invention adopts a special YCbCr420 data storage method, which is specifically implemented as follows:
[0061] When wpcnt[1:0] is equal to 0, Y is stored in register Y_r, Cb is stored in register Cb_r, Cr is stored in register Cr_r, and the current write enable is set to invalid.
[0062] When wpcnt[1:0] is equal to 1, Y is stored in register Y_r, and the value in Y_r is gated to din_h. If wlcnt[0] is equal to 0, Cb_r is gated to din_l, and if wlcnt[0] is equal to 1, Cr_r is gated to din_l, and the current write enable is set to valid.
[0063] When wpcnt[1:0] is equal to 2, Cb is stored in register Cb_r and Cr is stored in register Cr_r. At the same time, the value in Y_r is gated to din_h, the current input Y is gated to din_l, and the current write enable is set to valid.
[0064] When wpcnt[1:0] is equal to 3, if wlcnt[0] is equal to 0, Cb_r is gated to din_h, and if wlcnt[0] is equal to 1, Cr_r is gated to din_h. The current input Y is gated to din_l, and the current write enable is set to valid.
[0065] When rotate_mode is equal to 3, the working mode is YCbCr420 rotation mode, and the data of the N-row cache unit cache 1023 cache is repeated in groups of 3 columns; the Y component is placed in the high byte of the first column, the high and low bytes of the second column, and the low byte of the third column, the Cr component is placed in the low byte of the odd column of the first column and the high byte of the odd column of the third column, and the Cb component is placed in the low byte of the even column of the first column and the high byte of the odd and even column of the third column; Fig.11 FIG. 1 is a schematic diagram of data storage of N-row cache units when YCbCr420 is rotated 90 degrees. It can be seen that when YCbCr420 is rotated 90 degrees, the data storage of N-row cache units is similar to that of YCbCr420 in normal mode, except that only the processing of Cb and Cr needs to be exchanged.
[0066] When wpcnt[1:0] is equal to 0, Y is stored in register Y_r, Cb is stored in register Cb_r, Cr is stored in register Cr_r, and the current write enable is set to invalid.
[0067] When wpcnt[1:0] is equal to 1, Y is stored in register Y_r, and the value in Y_r is gated to din_h. If wlcnt[0] is equal to 0, Cr_r is gated to din_l, and if wlcnt[0] is equal to 1, Cb_r is gated to din_l, and the current write enable is set to valid.
[0068] When wpcnt[1:0] is equal to 2, Cb is stored in register Cb_r and Cr is stored in register Cr_r. At the same time, the value in Y_r is gated to din_h, the current input Y is gated to din_l, and the current write enable is set to valid.
[0069] When wpcnt[1:0] is equal to 3, if wlcnt[0] is equal to 0, Cr_r is gated to din_h, and if wlcnt[0] is equal to 1, Cb_r is gated to din_h. The current input Y is gated to din_l, and the current write enable is set to valid.
[0070] When rotating 270 degrees for YCbCr420, the line cache mirroring function will be used. On the basis of rotate_mode equal to 2, the storage of the line cache is mirrored, and din_h and din_l are also swapped.
[0071] The write address Nbufwaddr of the N-line cache is triggered by the signal Hs1 delayed by one beat of Hs. When Hs1 is 0, Nbufwaddr is equal to addr_ini. When Hs1 is 1, Nbufwaddr automatically adds the step size step for each clock. In the non-mirror operation, addr_ini is equal to 0. In the mirror operation, it is related to the actual input horizontal image size hsize (for example, when the resolution of 1280x720 is input, hsize is equal to 1280). When the non-mirror operation is performed, forward storage is performed, and when the mirror operation is performed, reverse storage is performed. In the mirror operation, the specific relationship is: when processing YCbCr422, addr_ini is equal to hsize-1; when processing YCbCr420, addr_ini is equal to hsize plus hsize shifted left by 1 bit, and the result is shifted right by 2 bits after addition, and finally subtracted by 1. The shift processing saves the multiplication operation and can save logic resources.
[0072] Since YCbCr420 has 6 components for every 4 pixels, and YCbCr422 has 8 components for every 4 pixels, YCbCr420 is 3 / 4 of the components of YCbCr422. In the shift operation, shifting left by n bits means multiplying by 2n. Shifting right by n bits means dividing by 2n. The 3 / 4 operation is represented by shifting as the original data plus the original data shifted left by 1 bit, and then shifted right by 2 bits.
[0073] The row cache gating of N row cache is determined by the row counter wlcnt of the control unit, assuming N = 2 n, n is a natural number, then when wlcnt[n-1:0] is equal to 0, the processed data is written into the first row cache, when wlcnt[n-1:0] is equal to 1, the second row cache is written, and so on. When wlcnt[n-1:0] is equal to N-1, the Nth row cache is written. This reciprocating control allows for simple and efficient data storage.
[0074] In particular, in addition to the above working modes, the N-line cache of the present invention is also improved for non-rotation situations, so that higher resolutions can be supported in non-rotation situations while reducing the power consumption of the N-line cache. When the working mode is normal mode, for example: YCbCr422 normal mode and YCbCr420 normal mode; take the first 4 lines of the N-line cache unit, and splice every 2 lines of cache into a new line cache to form 2 caches with increased lengths for reading data and writing data respectively; the 5th to Nth line cache clocks of the N-line cache unit are gated off to enter a low power consumption state.
[0075] Since the lengths of N row caches are fixed after design, and when N is larger, if the length of each cache is designed to be too large, the area will increase exponentially, which is difficult to accept in a small system display chip that focuses on cost. In one embodiment of the present invention, the length of the row cache is designed to be 1280, that is, the input during rotation can support a maximum resolution of 1280x720. If the row cache is not improved, the normal mode can only support a resolution of 1280x720. Since in the normal mode, only frame change and other processing can be performed, there is no need to perform transposition processing between rows and columns like rotation. The rotation data processing unit is only responsible for caching the continuously input row by row data and sending it to the storage control unit through the output interface unit. In this way, in terms of implementation, it is actually only necessary to adopt a ping-pong mechanism of 2 row caches, write one row and read one row, and the output interface unit sends the read data to the storage control unit to realize the data processing in the normal mode. Since the unit has N line caches, the normal mode only needs to process 2 lines of ping-pong. In order to improve the device, the present invention selects 4 line caches for processing in the normal mode. The specific implementation is as follows: select the 1st and 2nd caches to be spliced into a new cache Lbuf01, and the 3rd and 4th caches to be spliced into another new cache Lbuf23. When wlcnt[0] is equal to 0, select the line cache Lbuf01. In physical implementation, if the write address Nbufwaddr is less than 1024, write Lbuf01. Lbuf0, and when Nbufwaddr is greater than or equal to 1024, Lbuf1 in Lbuf01 is written. In implementation, Nbufwaddr
[10] can be used to judge. If it is 0, Lbuf0 is written, and if it is 1, Lbuf1 is written. The write addresses of Lbuf0 and Lbuf1 are equal to the lower 10 bits of Nbufwaddr. In this way, two 1280-length line caches can be used to form a line cache Lbuf01 with a length of 2048 that can support 1920x1080 resolution. Similarly, when wlcnt[0] is equal to 1, the line cache Lbuf23 is selected. Its specific implementation process is the same as that of Lbuf01. In this way, Lbuf01 and Lbuf23 can support normal mode to achieve higher resolution. At the same time, in order to save power, the 5th to Nth line cache clocks are gated off in normal mode to enter a low power state.
[0076] N line cache unit 1023, the N line cache unit is composed of N line caches, and the N line caches are all single-port on-chip RAMs, which are used to cache image data after rotation processing and before being written to the frame cache.
[0077] The output interface unit 1024 determines the status of the N-line cache according to the timing information of the first control unit 1021. If there is processed rotation data, a request for writing the frame cache is sent to the storage control unit. When the storage control unit responds to the request, the image data of the N-line cache unit is taken out and transmitted to the storage control unit.
[0078] Specifically, in the rotation mode, when wlcnt[n-2:0] is equal to 0 and Hs changes from 1 to 0 for two cycles, it indicates that the processed image rotation data has been obtained, and this unit issues a request to write the frame cache. After the request is responded to, if wlcnt[n-1] is equal to 0, the contents of the cache from N / 2+1 to N are read out, and after the rows and columns are transposed to form the rotated data, the data Rot_dat is transmitted to the storage control unit; if wlcnt[n-1] is equal to 1, the contents of the cache from 1 to N / 2 are read out, and after the rows and columns are transposed to form the rotated data, the data Rot_dat is transmitted to the storage control unit.
[0079] In normal mode, when Hs changes from 1 to 0 for two cycles, it indicates that a line of image data has been processed. This unit sends a request to write the frame buffer. After the request is responded, if wlcnt[0] is equal to 0, the content of the line buffer Lbuf23 is read out, and the normal mode data Nor_dat is transmitted to the storage control unit; if wlcnt[0] is equal to 1, the content of the line buffer Lbuf01 is read out, and the data Nor_dat is transmitted to the storage control unit.
[0080] The storage control unit 103 receives the image data from the image rotation data processing unit, and writes the rotation data Rot_dat or the normal mode data Nor_dat to the frame buffer memory 104 according to the corresponding working mode, and performs frame rate conversion at the same time, reads the rotated or non-rotated data in the frame memory 104, and writes it to the image rotation data restoration unit. When the storage control unit 103 writes or reads a row of data to the frame memory 104, in order to improve the data transmission efficiency, the write address and read address of each row are in multiples of the memory page. Row increment, specifically, assuming that the first address of a frame storage is set to 0, each page of the memory occupies 256 word addresses, one word is 16 bits, when a line length of 720 is input in YCbCr422 format, since 720 pixels occupy 2.8125 pages, the rounding calculation shows that each line occupies 3 pages of space. The advantage of calculating the address in this way is that each line starts from a new page head address, which can minimize the switching of continuous access operations when accessing the memory across pages, reduce the time of switching control signals, and greatly improve data transmission efficiency.
[0081] The memory 104 is used to cache each frame of image data in the rotation or normal mode after real-time processing.
[0082] The image rotation data restoration unit 105 receives the image data read out by the storage control unit from the frame memory 104, and restores it into a YCbCr422 data format that can be received by a general image post-processing unit.
[0083] like Figure 3 , which is a structural diagram of the image rotation data restoration unit 105 , includes a second control unit 1051 , an input interface unit 1052 , a 4-line buffer unit 1053 and an image rotation data format restoration unit 1054 .
[0084] The second control unit 1051 generates a signal for reading frame image data in the memory according to the timing Hs_a and Vs_a required by the display screen, and writes the data Rot_dat_a received by the input interface unit into the 4-line cache unit 1053 according to the timing control.
[0085] The input interface unit 1052 receives Rot_dat_a and writes the data into the 4-line cache unit 1053 according to the control of the second control unit 1051 .
[0086] The 4-line buffer unit 1053 is used to buffer the image data read out from the frame memory 104 line by line so as to be applied to the image rotation data format restoration unit 1054 .
[0087] The data input to the 4-line buffer unit is the data read from the memory 104. The data output from the 4-line buffer unit is the data processed by the image rotation data format restoration unit 1054 in the YCbCr422 format.
[0088] like Figure 5 As shown, it is a schematic diagram of data storage in 4-row cache units in normal mode of YCbCr422. It can be seen that in normal mode, since only functions such as frame rate conversion are performed and no rotation is performed, image data are stored in 4-row cache units line by line, and the data arrangement is similar to the input end. The difference is that the image must be pre-fetched before the start of a frame of image, and the row cache is filled and continuously output after the valid Hs_a and Vs_a arrive.
[0089] like Figure 7 , Figure 8 As shown, they are respectively a schematic diagram of data storage in the frame buffer when YCbCr422 is rotated 90 degrees and a schematic diagram of data storage in the 4-line buffer unit. It can be seen that the last point in the first line buffer is actually the first point of the image before rotation, and the chrominance Cb and Cr components are already arranged in a normal YCbCr422 manner after rotation. Since the image rotation data format restoration unit 1054 does not need to perform splicing and conversion processing on the data stored in the 4-line buffer unit, it can be directly output to the subsequent image post-processing module for use.
[0090] like Fig. 9 As shown, it is a schematic diagram of data storage of N rows of cache units in the YCbCr420 normal mode, and in the normal mode, the data storage format of the input of 4 rows of cache units is the same as that of the N rows of cache units.
[0091] like Fig.12 As shown, it is a schematic diagram of data storage in the frame buffer when YCbCr420 is rotated 90 degrees. In fact, the storage content of the 4-row cache unit is the same, except that the row cache unit is written cyclically every 4 rows.
[0092] The image rotation data format restoration unit 1054 is mainly responsible for restoring the image data in the 4-line buffer unit into a format that can be processed by the image post-processing unit. Figure 4 and Figure 8 As shown, the data stored in the 4-line cache unit in YCbCr422 normal mode and rotation is already image data in YCbCr422 format that can be received by the image post-processing unit. As shown, this unit only needs to read out the data in the 4-line cache and send it continuously to the image post-processing unit according to the display timing.
[0093] When the working mode is the YCbCr422 normal mode, the data output by the 4-row cache unit cache is arranged in the same manner as the data stored in the N-row cache unit data; when the working mode is the YCbCr422 rotation mode, the data output by the 4-row cache unit cache is arranged in the same manner as the data stored in the N-row cache unit data after a 90-degree rotation and row-column transposition.
[0094] Since the processing of rotation data is performed in a special format when using YCbCr420, special processing must be performed for the YCbCr420 situation to meet the format requirements of image post-processing. When the working mode is the YCbCr420 normal mode, the data output by the 4-row cache unit cache is arranged as follows: two rows of data stored in the N-row cache unit data are selected each time, and the Y component of the first row and the Cb and Cr components of the first and second rows are spliced in the YCbCr422 format as one row of data cached by the 4-row cache unit; the Y component of the second row and the Cb and Cr components of the first and second rows are spliced in the YCbCr422 format as another row of data cached by the 4-row cache unit; Fig.10 As shown, it is a schematic diagram of the output data of 4-row cache units in the normal mode of YCbCr420. Fig. 9 and Fig.10It can be seen that in the 4-line cache unit, the contents of two lines of cache need to be read out at the same time, and the Y, Cb, and Cr in the two lines of image data are spliced according to the general format of YCbCr422, and finally output continuously. For example, Y00 and Cb00 themselves form a word, Y01 and Cr10 of the next line are spliced into a word, Y02 and Cb02 of the next word in the same line are spliced into a new word, and Y03 and Cr12 of the next line are spliced into a new word. The processing method starting from the 4th word of the 4-line cache is the same as that starting from the 1st word, and the same processing method is repeated for every 4 words until the end of a line, thus completing the restoration of the first line of rotated data in the image rotation data restoration unit. The output of the second row of data still uses the data of the first and second rows in the 4-row cache unit. Y10 and Cb00 of the first row are combined into a word, Y11 and Cr10 of the current row are combined into a new word, Y12 and Cb02 of the first row are combined into a new word, and Y13 and Cr12 of the current row are combined into a new word. As with the first output row, the same processing method is repeated for every 4 words until a row ends. The processing method of the third and fourth rows is the same as that of the first and second rows. A cycle is performed every two rows until a frame of image processing is completed, thus realizing the restoration of the image rotation data format.
[0095] like Fig.12 and Fig.13The following are schematic diagrams of the contents stored in the 4-row cache and the data that the restoration unit needs to output when YCbCr420 is rotated. When the working mode is the YCbCr420 rotation mode, the arrangement of the data output by the 4-row cache unit cache is as follows: the data stored in the N-row cache unit data is rotated 90 degrees and the rows and columns are transposed; three rows of data after the transposition are selected each time, and the data in the first row is used as the first row of data cached by the 4-row cache unit; the Y component of the high byte of the data in the second row and the Cb and Cr components of the low byte of the data in the first row are spliced in the YCbCr422 format as the second row of data cached by the 4-row cache unit; the Y component of the low byte of the data in the second row and the Cb and Cr components of the high byte of the data in the third row are spliced in the YCbCr422 format as the third row of data cached by the 4-row cache unit; the high and low bytes of the data in the third row are swapped as the fourth row of data cached by the 4-row cache unit. Taking 4 points as an example, it can be seen that the output of the first line is completely consistent with the first line of storage, which conforms to the general format of YCbCr422. When outputting the second line, Y31 of the second line and Cb30 of the first line, Y21 and Cr20 of the first line, Y11 and Cb10 of the first line, Y01 and Cr00 of the first line are respectively spelled into a word to output the second line. When outputting the third line, Y32 of the second line and Cb32 of the third line, Y22 of the second line and Cr22 of the third line, Y12 of the second line and Cb12 of the third line, Y02 of the second line and Cr02 of the third line are respectively spelled into a word to output the third line. When outputting the fourth line, it is actually the third line in the output line cache unit, and the high and low bytes of the data of the third line are alternated to form a new word. It can be seen that the content stored in every three lines can output four consecutive lines of restored format data, and a cycle is performed every three lines until the end of one frame to realize the format restoration processing of the rotated data.
[0096] The image rotation data restoration unit 105 cooperates with the aforementioned image rotation data processing unit 102 to effectively solve the memory bandwidth problem caused by data storage in the YCbCr420 format, and can improve the transmission efficiency of image data, which is of great significance in small systems with real-time display.
[0097] The image rotation data processing device also includes an image post-processing unit 106. The image post-processing unit 106 receives the data restored from the image rotation data and can perform image scaling and some common image enhancement processing, including gamma correction and dithering, and finally sends the processed data to the terminal for display.
[0098] The image rotation data processing device provided by the present invention can reduce the number of requests for frequent reading and writing of the frame memory during the image rotation process in a chip supporting rotation display processing, thereby improving the utilization rate of the storage bandwidth and significantly improving the efficiency of data transmission, thereby supporting video processing with higher resolution and higher refresh rate. Through the flexible control of N line caches, the large consumption of line cache resources by the rotation transposition processing can be reduced, providing the support capability of higher resolution and lower power consumption in normal mode. The storage control unit generates a new line address according to the multiple of the page, thereby improving the transmission efficiency of the frame memory. The image rotation data format restoration unit of the device of the present invention enables the data format processed by the present invention to be output to adapt to various processing of the subsequent image processing module, and has good compatibility.
[0099] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0100] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0101] The above preferred embodiments are used to further explain the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention. The scope of rights claimed by the present invention should be based on the scope of the invention application, and is not limited to the above embodiments.
Claims
1. An image rotation data processing device, characterized in that: include: An image pre-processing unit, an image rotation data processing unit, a storage control unit, a memory, and an image rotation data restoration unit; The image pre-processing unit is used to decode the source image into YCbCr444 format data with line and field effective timing signals; The image rotation data processing unit performs line buffering on the received YCbCr444 format image data according to a preset format according to the working mode, and sends the processed data to the storage control unit for frame buffering to realize rotation processing; The working modes include: YCbCr422 normal mode, YCbCr422 rotation mode, YCbCr420 normal mode and YCbCr420 rotation mode; The storage control unit is used to receive the image data from the image rotation data processing unit, write the data in the rotation mode or the normal mode to the memory according to the corresponding working mode, perform frame rate conversion at the same time, read out the rotated or non-rotated data in the memory, and write it to the image rotation data restoration unit, The memory is used to cache each frame of image data in the rotation or normal mode after real-time processing; The image rotation data restoration unit is used to receive the image data read from the frame memory by the storage control unit and restore it to the YCbCr422 data format that can be received by the general image post-processing unit; The image rotation data processing unit comprises: a first control unit, an image rotation data input cache processing unit, an N-line cache unit and an output interface unit; The first control unit is used to receive the input line field effective timing signal, generate a control signal to write the input image data Y, Cb, Cr to the N line cache unit according to the input timing, and control the output interface unit to send a request signal to write the frame cache to the storage control unit according to the input timing; the pixel counter and line counter generated by the control unit are used to control the processing and storage of data and data communication with the storage control unit; The image rotation data input buffer processing unit is used to convert the received image data in YCbCr444 format into YCbCr422 or YCbCr420 format according to the working mode; The N-row cache unit is used to cache the image data after the rotation process and before being written to the frame cache; The output interface unit determines the state of the N-row cache unit according to the timing information of the first control unit, and sends a request to the storage control unit to write the frame cache when there is processed rotation data. When the storage control unit responds to the request, the image data of the N-row cache unit is taken out and transmitted to the storage control unit; The image rotation data restoration unit includes: a second control unit, an input interface unit, a 4-line buffer unit and an image rotation data format restoration unit; The second control unit is used to generate a signal for reading frame image data in the memory according to the timing required by the display screen, and write the data received by the input interface unit into the 4-row cache unit according to the timing control; The input interface unit is used to write input data into the 4-line cache unit according to the control of the second control unit; The four-row buffer units are used to buffer the image data of each row read out from the memory so as to be applied to the image rotation data format restoration unit; The image rotation data format restoration unit is used to restore the image data in the 4-line buffer unit into a YCbCr422 format that can be processed by the image post-processing unit.
2. The image rotation data processing device according to claim 1, characterized in that: When the working mode is the YCbCr422 normal mode, the data cached by the N rows of cache units are arranged such that the Y component is placed in the high byte, the Cb component is placed in the low byte of the odd column, and the Cr component is placed in the low byte of the even column; When the working mode is the YCbCr422 rotation mode, the data cached by the N rows of cache units are arranged such that the Y component is placed in the high byte, the Cr component is placed in the low byte of the odd column, and the Cb component is placed in the low byte of the even column; When the working mode is the YCbCr420 normal mode, the data cached by the N rows of cache units are repeated in groups of three columns; the Y component is placed in the high byte of the first column, the high and low bytes of the second column, and the low byte of the third column, the Cb component is placed in the low byte of the odd column of the first column and the high byte of the odd column of the third column, and the Cr component is placed in the low byte of the even column of the first column and the high byte of the odd and even column of the third column; When the working mode is the YCbCr420 rotation mode, the data cached by the N-row cache unit is repeated in groups of every 3 columns; the Y component is placed in the high byte of the 1st column, the high and low bytes of the 2nd column, and the low byte of the 3rd column, the Cr component is placed in the low byte of the odd column of the 1st column and the high byte of the odd column of the 3rd column, and the Cb component is placed in the low byte of the even column of the 1st column and the high byte of the odd and even columns of the 3rd column.
3. The image rotation data processing device according to claim 1, characterized in that: The row cache gating of the N row cache is determined by the row counter wlcnt of the control unit, assuming N=2 n , n is a natural number, then when wlcnt[n-1:0] is equal to 0, the processed data is written to the first row cache, when wlcnt[n-1:0] is equal to 1, it is written to the second row, and so on, when wlcnt[n-1:0] is equal to N-1, it is written to the Nth row cache.
4. The image rotation data processing device according to claim 1, characterized in that: When the working mode is the normal mode, the first 4 rows of the N-row cache unit are taken, and every 2 rows of cache are spliced into a new row cache to form 2 caches with increased lengths for reading data and writing data respectively; the cache clocks of the 5th to Nth rows of the N-row cache unit are gated and turned off to enter a low power consumption state.
5. The image rotation data processing device according to claim 1, characterized in that: The image rotation data format restoration unit converts the YCbCr420 data format into the YCbCr422 format as follows: When the working mode is the YCbCr420 normal mode, two lines of data are selected each time, and the Y component of the first line and the Cb and Cr components of the first and second lines are spliced in the YCbCr422 format as one line of data to be output; the Y component of the second line and the Cb and Cr components of the first and second lines are spliced in the YCbCr422 format as another line of data to be output; When the working mode is the YCbCr420 rotation mode, three lines of data are selected each time, and the data in the first line is used as the first line of data to be output; the Y component of the high byte of the data in the second line and the Cb and Cr components of the low byte of the data in the first line are spliced in accordance with the YCbCr422 format as the second line of data to be output; the Y component of the low byte of the data in the second line and the Cb and Cr components of the high byte of the data in the third line are spliced in accordance with the YCbCr422 format as the third line of data to be output; the high and low bytes of the data in the third line are swapped as the fourth line of data to be output.
6. The image rotation data processing device according to claim 1, characterized in that: When the storage control unit writes or reads each row of data to or from the memory, the read address and write address of each row are incremented according to a multiple of the page of the memory.
7. The image rotation data processing device according to claim 1, characterized in that: Also includes: The image post-processing unit is used to perform image scaling and image enhancement processing on the data received from the image rotation data restoration unit, and send the processed data to the terminal for display.
8. A display terminal, characterized in that: include: The image rotation data processing device according to any one of claims 1 to 7.
Citation Information
Patent Citations
Rapid self-adaptive frame rate conversion device and method
CN105872432A
Rapid multi-resolution video image mirroring rotation processing system
CN106817545A
Display picture rotating method and device, and display equipment
CN107333173A
DMA control device and image processor
CN108228498A
System for converting, scaling, rotating, and superimposing pipelined image chromaticity format
CN109146793A
