A kind of LCD control circuit and method of supporting picture-in-picture function under the multiple output formats
Technical field
The present invention relates to a kind of liquid crystal display control circuit and method, in particular, a kind ofly can support multiple output format, particularly support the liquid crystal display control circuit device and method of RGB and MPU.
Background technology
In the prior art, mobile multimedia processor has been widely used in various handheld devices, as mobile phone, MP4 player etc., and in these handheld devices, various performance index such as the size of LCD (liquid crystal display liquid crystal display) screen and color depth are all improving constantly, so this is to the demands for higher performance of LCD control circuit in the mobile multimedia processor.
The mobile multimedia processor circuit is different with existing TV treatment circuit, because its equipment volume is less, the design concept of circuit is different with TV, therefore, the picture-in-picture circuit of prior art to the design of mobile multimedia processor without any reference.
The major function of LCD control circuit is: will need that the image that shows and picture raw data are carried out a series of format conversion, size scaling, picture-in-picture is synthetic and the processing such as generation of standard interface sequential, deliver to outside LCD chip for driving by MPU interface or rgb interface at last, finish the display driver that LCD is shielded by chip for driving again.
Picture-in-picture function is that different input pictures or picture are simultaneously displayed on the LCD screen, general picture-in-picture function is all finished by the LCD chip for driving, the LCD control circuit of prior art only is used to support different signal modes, as RGB and MPU pattern etc., but and the picture-in-picture function that is unrealized.
In the prior art, the RGB pattern mainly comprises following signal: Hsync (line synchronizing signal), Vsync (frame synchronizing signal), Gate (data useful signal), CLK (clock output), DATA, above-mentioned for having general interface now, be used for carrying out data communication with the LCD screen, the realization of itself and picture-in-picture is irrelevant, its data width can be 24bit, 16bit, 8bit etc. according to external LCD panel and different.
The MPU output mode of prior art mainly comprises following signal: CS (chip selection signal), RS (command selection signal), WR (writing enable signal), RD (reading enable signal), DATA (18/16/8 bit), these all are the general-purpose interfaces of prior art, be used for carrying out data communication with the LCD screen, itself is irrelevant with the realization of picture-in-picture.
The difference of above-mentioned RGB and MPU interface is that there is a buffer that can deposit a frame image data lcd driver IC inside in the control circuit of MPU pattern, so MPU does not have the IC height of rgb interface to the rate request that refreshes; And the driver IC inside of rgb interface does not have such buffer, and therefore as long as the LCD screen is in running order, the lcd controller just must refresh it always, generally will reach per second 60 frames.Refresh chip internal DMA bandwidth occupancy too greatly so fast, especially be operated in picture-in-picture mode following time, the relation of how adequate solution bandwidth and refresh rate and balance are very crucial and difficult.
The realization of picture-in-picture function in the Lcd controller mainly contains two kinds of implementations at present, and a kind of is several times different images to be refreshed away, utilizes the limitation on people's naked eyes to realize picture-in-picture; Another kind utilizes the a-blending technology to realize, has all given an a value for each pixel, and each point to the different images imported merges calculating then.
The shortcoming of above-mentioned first kind of way is: refresh rate is slow, does not realize picture-in-picture truly, and its accommodation that should use is very limited; Though second kind of implementation method effect is fine, hardware implementation cost is bigger.
Therefore, also there is defective in prior art, and awaits improving and development.
Summary of the invention
The object of the present invention is to provide a kind of LCD control circuit and method of supporting picture-in-picture function under the multiple output formats, utilize distinctive window system, hyperchannel hardware configuration and picture-in-picture to synthesize control strategy, realize cheaply picture-in-picture function truly.
Technical scheme of the present invention comprises:
A kind of LCD control circuit of supporting picture-in-picture function under the multiple output formats wherein, comprises at least one background picture DMA data buffer and at least one foreground picture DMA data buffer that connect a DMA interface; Described background picture DMA data buffer connects a background picture picture-in-picture data buffer, and, described foreground picture DMA data buffer is connected with an image zooming module, and with after the foreground picture data processing, is stored into a foreground picture picture-in-picture data buffer; Described background picture picture-in-picture data buffer and foreground picture picture-in-picture data buffer show that through a picture-in-picture synthesis module outputs to a data output buffer district after synthetic, and connect rgb interface circuit and MPU interface circuit respectively.
Described circuit, wherein, described foreground picture DMA data buffer is set to a plurality of, thus described DMA interface is set to a plurality of passages, corresponding described background picture and a plurality of foreground picture.
A kind of LCD control method of supporting picture-in-picture function under the multiple output formats, it may further comprise the steps:
A, the data of background picture are saved in background picture picture-in-picture data buffer by the DMA interface respective channel;
B, with the data of at least one foreground picture respective channel by DMA interface, carry out convergent-divergent after, be saved in foreground picture picture-in-picture data buffer;
C, described background picture picture-in-picture data and described foreground picture picture-in-picture data are synthesized according to the position output to the data output buffer district;
D, output to the LCD display of associative mode respectively through rgb interface circuit or MPU interface circuit from the data in described data output buffer district.
Described method, wherein, described foreground picture is set to a plurality of, shows on background picture according to diverse location.
Described method wherein, also comprises: when showing on the LCD screen, described control circuit control according to certain scanning sequency, is sent the pixel data after synthesizing from the off one by one.
Described method, wherein, the control procedure of described control circuit is included in the DMA process that same scanning sequency moving data enters the corresponding data buffer zone according to output the time.
A kind of LCD control circuit and method of supporting picture-in-picture function under the multiple output formats provided by the present invention owing to adopted DMA hyperchannel hardware circuit, realized a kind of LCD display control circuit of lower-cost picture-in-picture function.
Description of drawings
Fig. 1 is an electrical block diagram of the present invention;
Fig. 2 is the realization synoptic diagram of picture-in-picture function window system of the present invention;
Fig. 3 is the tactful synoptic diagram of the synthetic control of picture-in-picture of the present invention.
Embodiment
Below in conjunction with accompanying drawing, will be described in more detail each preferred embodiment of the present invention.
A kind of LCD control circuit of supporting picture-in-picture function under the multiple output formats of the present invention, circuit structure as shown in Figure 1, it comprises DMA interface (Direct Memory Access, the direct memory access interface, hereinafter to be referred as: DMA) and connect the background picture DMA data buffer of this DMA interface and at least one foreground picture DMA data buffer, be picture 1DMA data buffer and the picture 2DMA data buffer in the present embodiment, above-mentioned buffer zone is connected with the picture-in-picture data buffer respectively, the DMA data buffer is to be used for cushioning the data that the DMA transmission comes, and the picture-in-picture data buffer is to be used for buffering, view data after storage is handled through convergent-divergent is last synthetic preparing simultaneously; Wherein, described background picture DMA data buffer transfers data to background picture picture-in-picture data buffer, and the data of picture 1 or 2DMA data buffer are transferred to picture 1 or 2 picture-in-picture data buffers respectively; Be to realize picture-in-picture function, be provided with corresponding picture 1 or 2 Zoom modules between described picture 1 or 2DMA data buffer and corresponding picture 1 or the 2 picture-in-picture data buffers, be used for picture 1 or 2 is carried out convergent-divergent.Above-mentioned background picture picture-in-picture data buffer and picture 1 or 2 picture-in-picture data buffers are connected to a picture-in-picture simultaneously and show synthesis module, output to a data output buffer district then, this data output buffer district is connected with rgb interface circuit and MPU interface circuit respectively, is used for RGB pattern or MPU pattern synthetic picture-in-picture being outputed to the LCD screen.
In conjunction with circuit structure shown in Figure 1, the data handling procedure of circuit of the present invention is as follows: at first background picture is read in the inner buffer zone by DMA (direct memory visit) passage, carry out data width conversion then, the data that the data of 16 r, g, b form are combined into 24 bit widths are directly exported.
It is half-full until the picture-in-picture data buffer of passage separately to read background picture and picture 1, picture 2 from the DMA passage at first, earlier in turn; Also can select part full, such as 60%, but common way is half-full, and this size with buffer zone buffer is also relevant with the length of each DMA simultaneously.Simultaneously, picture-in-picture according to the present invention in the window system synthesizes control algolithm, the pixel of determining current output is picture 1, picture 2 or background picture, thereby send the enable signal of reading of FIFO (push-up storage) in corresponding D MA request and the respective channel, read corresponding pixel data output, thereby 3 width of cloth input pictures are synthesized a width of cloth and export to the LCD demonstration, so just finished picture-in-picture function truly.
Simultaneously, circuit of the present invention can be supported local refresh function by the relevant setting that shows controlled variable, that is to say that if this two field picture is compared with previous frame, just the part changes to some extent, the present invention can only transmit these regional data that change, and has so just improved refresh rate greatly.
Window system of the present invention is the core of whole LCD control circuit (supporting picture-in-picture function under RGB and the MPU output format), and its synoptic diagram as shown in Figure 2.
The principle of work of window system of the present invention is that under picture-in-picture mode, background picture does not need frequent renewal, its size is exactly the size of whole picture-in-picture window, before needs upgrade, the DMA passage of closing it by the configuration related register, thus reduce taking to bandwidth.
The size of two width of cloth images of picture-in-picture must not exceed this window in addition, position that shows in each comfortable window according to them and the parameters such as size behind the convergent-divergent, and the present invention can obtain the information such as reference position of final pip image after compound; Then from the off, according to certain scanning sequency, send the data of pixel one by one.
According to demonstration control algolithm of the present invention, can according to certain rule judge all that in each output effective pixel points the present invention the data of picture 1, picture 2 or the respective pixel point of background picture are sent in decision.
For what guarantee to send is the data of corresponding pixel, the present invention has adopted the triple channel structure on hardware, wherein the two passes specific assigned is given picture 1 and picture 2, and in the process of DMA also be according to when output same scanning sequency moving data enter FIFO, carry out image zoom and yuv format conversion then respectively, and the RGB output FIFO that finally puts into separately is stand-by to rgb.Have two types in the LCD interface, a kind of is MPU, and a kind of is RGB, and these two kinds of interfaces all are the data of the rgb form of transmission.(yuv is two kinds of different data layouts with rgb, and the rgb here is not a notion with the rgb interface of front) is so the present invention must become the data conversion of the yuv form in the processing procedure data of rgb form, output then earlier.
Picture-in-picture of the present invention synthetic display strategy as shown in Figure 3, the synthetic control of picture-in-picture is the core of lcd controller of the present invention, the mode with legend is illustrated its synthetic display strategy below:
At first, system reset, and LCD carried out init state, and judge whether to begin to refresh, as not waiting for, in this way, then begin to carry out refresh process.
Described refresh process comprises: refreshed primary state, judged to refresh and whether finish, if, return above-mentioned initial step, LCD is carried out initialization, judge whether to begin to refresh; If not, judge then whether each data buffer reaches half-full, and judge the present position of refreshing.
If refresh the position, then carry out the refresh flow of background: at first, enter background and refresh preparing state, judge whether non-NULL of each data buffer in background; If, then enter background and refresh attitude, send the background data of current location, take out the corresponding data of picture one and picture two simultaneously and abandon; Then, enter background and refresh preparing state once more, judge to refresh and whether finish, if not, judge that next refreshes the position at present and refreshes background, picture one or picture two, and get back to and refreshed primary state and carry out mutually deserved refresh flow.
If refresh the position, then carry out corresponding refresh flow and be: at first enter the corresponding preparing state that refreshes, and judge whether non-NULL of each data buffer at picture one or picture two; If, then carry out the attitude that refreshes of corresponding picture one or picture two: promptly send the data of the picture one or the picture two of current location, simultaneously, judge whether it also is the zone of picture two or picture one, if the corresponding data of taking-up picture two or picture one and background also abandons; Then, what enter picture one or picture two refreshes preparing state once more: judge to refresh whether finish, if not, then carry out next and refresh position refresh process once more at present, judge that the zone of refreshing is background, picture one or picture two, and correspondence turns back to and refreshed primary state, carries out the refresh flow in corresponding zone.
Scan synthesis control strategy of the present invention and hardware configuration have guaranteed efficiently and accurately, have realized picture-in-picture function at low cost.
The technology of the present invention will be widely used in many moneys mobile multimedia processor of An Kai company, from actual effect, can well support the LCD screen of 320x240 size, and displaying video is clear, stable, smooth.Even under the most abominable situation, promptly each frame all comprises a full-scale background and a full-scale foreground image, and each frame refresh all, also can guarantee 30fps.
To sum up, circuit arrangement of the present invention has been realized picture-in-picture function truly in the LCD control circuit, owing to do not do unnecessary complex fusion computing when synthesizing, has improved arithmetic speed, has reduced hardware cost.
Should be understood that above-mentioned description at specific embodiment is comparatively detailed, can not therefore be interpreted as the restriction to scope of patent protection of the present invention, scope of patent protection of the present invention should be as the criterion with claims.