Summary of the invention
Embodiments of the invention provide a kind of data processing method and device, solve the frame number of the view data being greater than DMA write in prior art due to the frame number of DMA reads image data, thus phenomenon is caught up with in generation read-write, and then cause the problem of the view data mistake transmitted.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, provides a kind of data processing method, comprising:
Obtain the frame view data to storer to be written, the described view data to storer to be written is the view data of N frame input, described storer comprises M data storage area, and for storing view data according to preset order, each data storage area is for storing a frame image data;
According to described frame number N and described data storage area number M, determine the described view data to storer to be written need stored in address corresponding to the first data storage area, and according to the difference between described frame number N and default empty frame number and described data storage area number M, need the address that second data storage area residing for view data of the corresponding frame number read is corresponding under determining present image output format, described default empty frame number is the difference between the input frame number of the view data stored in described second data storage area and described frame number N;
The described view data to storer to be written writes in described first data storage area by the address corresponding according to described first data storage area;
The view data stored in described second data storage area is read in the address corresponding according to described second data storage area.
Second aspect, provides a kind of data processing equipment, comprising:
Acquisition module, for obtaining the frame view data to storer to be written, the described view data to storer to be written is the view data of N frame input, described storer comprises M data storage area, for storing view data according to preset order, each data storage area is for storing a frame image data;
Determination module, for according to described frame number N and described data storage area number M, determine the described view data to storer to be written need stored in address corresponding to the first data storage area, and according to the difference between described frame number N and default empty frame number and described data storage area number M, need the address that second data storage area residing for view data of the corresponding frame number read is corresponding under determining present image output format, described default empty frame number is the difference between the input frame number of the view data stored in described second data storage area and described frame number N;
Writing module, the described view data to storer to be written writes in described first data storage area by the address that described first data storage area for determining according to described determination module is corresponding;
Read module, the view data stored in described second data storage area is read in the address that described second data storage area for determining according to described determination module is corresponding.
The data processing method that embodiments of the invention provide and device, obtain the frame view data to storer to be written, this view data to storer to be written is the view data of N frame input, this storer comprises M data storage area, each data storage area stores a frame image data, then according to this frame number N and data storage area number M, determine the view data to storer to be written need stored in address corresponding to the first data storage area, and according to the difference between this frame number N and default empty frame number and data storage area number M, the address that the second data storage area residing for the view data of the corresponding frame number read difference is corresponding is needed under determining present image output format, finally, view data to storer to be written writes in the first data storage area by the address corresponding according to this first data storage area, the view data stored in the second data storage area is read in the address corresponding according to this second data storage area.Like this by carrying out subregion to storer in advance, and counter is set to add up the current view data frame number inputted, then according to the number of data storage area in the current view data frame number that inputted counted and subregion background storage, determine the address of the data storage area residing for two frame image datas difference that current input one frame image data needs the address of the data storage area of write and follow-up needs to read, thus the velocity contrast effectively controlled between read-write, relation between the frame number that ensure that the frame number of the view data of write and the view data of reading meets the demand of present image output format, avoid read-write Rethinking Catching-Up Issues.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments of the invention provide a kind of data processing method, the data processing equipment in the present embodiment can for dma controller or other can to the processor of the operation that the data storage area of storer is read and write.As shown in Figure 1, this data processing method specifically comprises the steps:
101, data processing equipment obtains the frame view data to storer to be written.
Wherein, the above-mentioned view data to storer to be written is the view data of N frame input, storer comprises M data storage area, and this M data storage area is used for storing view data according to preset order, and each data storage area is for storing a frame image data.
Exemplary, the memory configuration schematic diagram with reference to the data storage area of the storer shown in Fig. 2 is known.When this storer carries out subregion according to 4 data storage areas, 4 data storage areas of FIN0, FIN1, FIN2, FIN3 this storer respectively, store a frame image data in each data storage area, 4 frame image datas can be stored in this storer, every frame image data comprises Y, U, V tri-components.Concrete, assuming that the start address of this storer is BASEADDR, the size of every frame data is FSIZE, then as shown in Figure 2, corresponding, the start address of each data storage area is respectively:
FIN0:BASEADDR;
FIN1:BASEADDR+FSIZE;
FIN2:BASEADDR+2*FSIZE;
FIN3:BASEADDR+3*FSIZE。
102, data processing equipment is according to frame number N and data storage area number M, determine the view data to storer to be written need stored in address corresponding to the first data storage area, and according to the difference between frame number N and default empty frame number and data storage area number M, under determining present image output format, need the address that second data storage area residing for view data of the corresponding frame number read is corresponding.
Wherein, the first above-mentioned data storage area and the second data storage area are the data storage area of this storer.Above-mentioned default empty frame number data processing equipment is the view data write or the older data write before in order to avoid view data that this data processing equipment reads thus causes the image generation rebound phenomenon shown to arrange, and the difference between above-mentioned default empty frame number and data storage area number needs to be more than or equal to 1.
And above-mentioned image output format comprises 3D rendering.Such as, when above-mentioned image output format is 3D output format, because the view data of two frames can do the 3D effects such as left-right format, top-down format, interlaced format, therefore, in order to make 3D rendering effect, this data processing equipment needs the view data of reading two frame.
Preferably, after this data processing equipment carries out subregion to storer in advance, when the number of the data storage area obtained is 4, and when present image output format is 3D output format, corresponding default empty frame number is preferably 1 or 2.
Exemplary, data processing equipment frame number N and data storage area number M in above-mentioned step 102, determine the view data to storer to be written need stored in address corresponding to the first data storage area specifically comprise:
Remainder Y1 between a1, data processing equipment determination frame number N and data storage area number M.
Exemplary, after data processing equipment receives a frame image data from LVDS receiver, can trigger VIN and interrupt, now this data processing equipment adds up by frame counter the view data frame number inputted when each VIN of triggering interrupts.Concrete, this data processing equipment calculates remainder Y1, wherein Y1 ∈ 1,2 by formula one (Y1=N mod M) ..., M.
A2, data processing equipment, according to remainder Y1, from the first corresponding relation, obtain the address of data storage area corresponding to remainder Y1, using data storage area corresponding for remainder Y1 as the view data to storer to be written need stored in the first data storage area.
Wherein, the first above-mentioned corresponding relation is the corresponding relation of remainder and data storage area, the address of the corresponding data storage area of each remainder.Exemplary, the first above-mentioned corresponding relation can be the first mapping table between the address of remainder and data storage area, the address of the corresponding data storage area of each numerical value in this first mapping table in 1 to M.
Exemplary, in above-mentioned step 102, data processing equipment is according to the difference between frame number N and default empty frame number and data storage area number M, needs address corresponding to second data storage area residing for view data of the corresponding frame number read specifically to comprise under determining present image output format:
The remainder Y2 of the number M of this frame number N and the difference preset between empty frame number and data storage area determined by b1, data processing equipment, and determines that present image output format is to the frame number in requisition for the view data read.
Exemplary, if when the preset default empty frame number of data processing equipment is X, calculate remainder Y2, wherein Y1 ∈ 1,2 by formula two (R=(N-X) mod M) ..., M.
B2, data processing equipment, according to remainder Y2 and the frame number needing the view data read, from the second corresponding relation, obtain the address of data storage area corresponding to remainder Y2, using data storage area corresponding for remainder Y2 as the second data storage area.
Wherein, the view data stored in the second above-mentioned data storage area is the view data needing to read, this second corresponding relation is the corresponding relation between remainder and data storage area, and each remainder is to the address of the frame number data storage area in requisition for the view data read.Exemplary, the second above-mentioned corresponding relation can be the second mapping table between the address of remainder and data storage area, and the second mapping table that different image output format is corresponding different, the frame number of the view data that the needs that in the second mapping table that often kind of image output format is corresponding, the number of the address of the data storage area that remainder is corresponding is corresponding with this image output format read is identical.Certainly, each numerical value in this second mapping table in 1 to M also can the address of an only corresponding data storage area, like this, when data processing equipment obtains the address of data storage area corresponding to remainder Y2, first the address of data storage area corresponding to remainder Y2 can be obtained, then according to the frame number of present image output format to the view data in requisition for reading, with the address of data storage area corresponding to this remainder Y2 for benchmark, continue the address of next data storage area obtaining this data storage area, until the address number obtained meets present image output format to the frame number in requisition for the view data read.
View data to storer to be written writes in the first data storage area by the address that 103, data processing equipment is corresponding according to the first data storage area.
104, the view data stored in the second data storage area is read in the address that data processing equipment is corresponding according to the second data storage area.
Exemplary, if the frame number of the view data inputted current is N, and the number of the data storage area of storer is 4, and presetting empty frame number is 2, and when the frame number of view data that needs corresponding to present image output format read is 2.Schematic flow sheet with reference to write and the reading of the view data shown in Fig. 3 is known, and after data processing equipment receives a frame image data from LVDS receiver, can trigger VIN and interrupt, counter starts to count, and adds up the frame number N of the current view data inputted.Then, the remainder that the memory location of one frame image data of current reception is 4 by the number of frame number N and data storage area determines, and the remainder that the memory location of two frame image datas that the needs of correspondence read is 4 by the number of the difference between frame number N and the empty frame number 2 of threshold value and data storage area determines.If the remainder of N and 4 is 0, then put into FIN3; If remainder is 1, then put into FIN2; If remainder is 2, then put into FIN1; If remainder is 3, then put into FIN0.If (N-2) with 4 remainder be 0, then read FIN2 and FIN3; If remainder is 1, then read FIN2 and FIN1; If remainder is 2, then read FIN0 and FIN1; If remainder is 3, then read FIN0 and FIN3.If determine, the memory location of a frame image data of current reception is data storage area FIN3, when the memory location of two frame image datas that corresponding needs read is respectively data storage area FIN1 and FIN0, then the address of FIN3 corresponding for write operation is written in dma controller register, by the address that dma controller control view data is specified to this through bus transfer, this process is WDMA0.While WDMA0 work, vout interrupts called, in vout interrupts, is written in dma controller by the address of FIN1 and FIN0 corresponding for read operation, dma controller is reads image data from FIN1 and FIN0 respectively, and this process is RDMA0 and RDMA1.
The data processing method that embodiments of the invention provide, obtain the frame view data to storer to be written, this view data to storer to be written is the view data of N frame input, this storer comprises M data storage area, each data storage area stores a frame image data, then according to this frame number N and data storage area number M, determine the view data to storer to be written need stored in address corresponding to the first data storage area, and according to the difference between this frame number N and default empty frame number and data storage area number M, the address that the second data storage area residing for the view data of the corresponding frame number read difference is corresponding is needed under determining present image output format, finally, view data to storer to be written writes in the first data storage area by the address corresponding according to this first data storage area, the view data stored in the second data storage area is read in the address corresponding according to this second data storage area.Like this by carrying out subregion to storer in advance, and counter is set to add up the current view data frame number inputted, then according to the number of data storage area in the current view data frame number that inputted counted and subregion background storage, determine the address of the data storage area residing for two frame image datas difference that current input one frame image data needs the address of the data storage area of write and follow-up needs to read, thus the velocity contrast effectively controlled between read-write, relation between the frame number that ensure that the frame number of the view data of write and the view data of reading meets the demand of present image output format, avoid read-write Rethinking Catching-Up Issues.
Embodiments of the invention provide a kind of data processing equipment, this data processing equipment is for realizing above-mentioned data processing method, this data processing equipment is applied to terminal device, such as, intelligent television, top box of digital machine, Web TV box, smart mobile phone, panel computer and personal digital assistant (English: Personal Digital Assistant, to be called for short PDA) etc.As shown in Figure 4, this device 2 comprises: acquisition module 21, determination module 22, writing module 23 and read module 24, wherein:
Acquisition module 21, for obtaining the frame view data to storer to be written, this view data to storer to be written is the view data of N frame input, this storer comprises M data storage area, for storing view data according to preset order, each data storage area is for storing a frame image data.
Determination module 22, for according to frame number N and data storage area number M, determine the view data to storer to be written need stored in address corresponding to the first data storage area, and according to the difference between frame number N and default empty frame number and data storage area number M, under determining present image output format, need the address that second data storage area residing for view data of the corresponding frame number read is corresponding.
Writing module 23, the view data to storer to be written writes in the first data storage area by the address that the first data storage area for determining according to determination module 22 is corresponding.
Read module 24, the view data stored in the second data storage area is read in the address that the second data storage area for determining according to determination module 22 is corresponding.
Optionally, determination module 22 according to frame number N and data storage area number M, determine the view data to storer to be written need stored in address corresponding to the first data storage area time specifically for:
Determine the remainder Y1 between frame number N and data storage area number M; According to remainder Y1, from the first corresponding relation, obtain the address of data storage area corresponding to remainder Y1, using data storage area corresponding for remainder Y1 as the view data to storer to be written need stored in the first data storage area, this first corresponding relation is the corresponding relation between remainder and data storage area, the address of the corresponding data storage area of each remainder.
Optionally, determination module 22 according to frame number N and the difference preset between empty frame number and data storage area number M, during the address needing second data storage area residing for view data of the corresponding frame number read corresponding under determining present image output format specifically for:
Determine frame number N and the remainder Y2 of M between the difference preset between empty frame number and data storage area number, and determine that present image output format is to the frame number in requisition for the view data read.
According to remainder Y2 and the frame number needing the view data read, from the second corresponding relation, obtain the address of data storage area corresponding to remainder Y2, using data storage area corresponding for remainder Y2 as the second data storage area, the view data stored in this second data storage area is the view data needing to read, this second corresponding relation is the corresponding relation between remainder and data storage area, and each remainder is to the address of the frame number data storage area in requisition for the view data read.
Wherein, the default empty frame number in the present embodiment and the difference between data storage area number are more than or equal to 1.
The data processing equipment that embodiments of the invention provide, obtain the frame view data to storer to be written, this view data to storer to be written is the view data of N frame input, this storer comprises M data storage area, each data storage area stores a frame image data, then according to this frame number N and data storage area number M, determine the view data to storer to be written need stored in address corresponding to the first data storage area, and according to the difference between this frame number N and default empty frame number and data storage area number M, the address that the second data storage area residing for the view data of the corresponding frame number read difference is corresponding is needed under determining present image output format, finally, view data to storer to be written writes in the first data storage area by the address corresponding according to this first data storage area, the view data stored in the second data storage area is read in the address corresponding according to this second data storage area.Like this by carrying out subregion to storer in advance, and counter is set to add up the current view data frame number inputted, then according to the number of data storage area in the current view data frame number that inputted counted and subregion background storage, determine the address of the data storage area residing for two frame image datas difference that current input one frame image data needs the address of the data storage area of write and follow-up needs to read, thus the velocity contrast effectively controlled between read-write, relation between the frame number that ensure that the frame number of the view data of write and the view data of reading meets the demand of present image output format, avoid read-write Rethinking Catching-Up Issues.
Those skilled in the art can be well understood to, for convenience and simplicity of description, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different functional modules, to complete all or part of function described above.The system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that disclosed apparatus and method can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described module or unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, the indirect coupling of device or unit or communication connection.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
The above, above embodiment only in order to the technical scheme of the application to be described, is not intended to limit; Although with reference to previous embodiment to present application has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of each embodiment technical scheme of the application.