WO2016201793A1 - Data processing method and apparatus - Google Patents

Data processing method and apparatus Download PDF

Info

Publication number
WO2016201793A1
WO2016201793A1 PCT/CN2015/088991 CN2015088991W WO2016201793A1 WO 2016201793 A1 WO2016201793 A1 WO 2016201793A1 CN 2015088991 W CN2015088991 W CN 2015088991W WO 2016201793 A1 WO2016201793 A1 WO 2016201793A1
Authority
WO
WIPO (PCT)
Prior art keywords
data storage
storage area
image data
frames
data
Prior art date
Application number
PCT/CN2015/088991
Other languages
French (fr)
Chinese (zh)
Inventor
周导
陈世雷
李洋
Original Assignee
青岛海信信芯科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 青岛海信信芯科技有限公司 filed Critical 青岛海信信芯科技有限公司
Publication of WO2016201793A1 publication Critical patent/WO2016201793A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/32Handling requests for interconnection or transfer for access to input/output bus using combination of interrupt and burst mode transfer

Definitions

  • the present application relates to the field of image processing, and in particular, to a data processing method and apparatus.
  • the DMA controller performs separate write operations and read operations on the DDR buffer space, respectively, the DMA controller writes and reads DDR at different speeds, and therefore, when the DMA controller processes When the amount of image data is too large, the number of frames in which the image data is read by the DMA controller is larger than the number of frames of the image data written by the DMA, so that the read/write catch-up phenomenon occurs, and the transmitted image data is erroneous.
  • the embodiment of the present application provides a data processing method and apparatus, which solves the problem that the number of frames of DMA read image data is larger than the number of frames of image data written by DMA in the prior art, thereby causing read and write catch-up phenomenon, thereby causing transmission The problem with the image data is wrong.
  • a data processing method comprising:
  • a data processing apparatus including:
  • An acquisition module configured to acquire image data to be written to a memory, the image data to be written to the memory is image data input in an Nth frame, and the memory includes M data storage areas for Sequentially storing image data, each data storage area for storing one frame of image data;
  • a determining module configured to determine, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory, and according to the frame Determining the difference between the number N and the preset number of empty frames and the number M of the data storage areas, determining an address corresponding to the second data storage area where the image data of the corresponding number of frames to be read in the current image output format is located
  • the preset number of empty frames is a difference between an input frame number of image data stored in the second data storage area and the number of frames N;
  • a writing module configured to write image data to be written to the memory into the first data storage area according to an address corresponding to the first data storage area determined by the determining module;
  • FIG. 1 is a schematic flowchart diagram of a data processing method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a storage structure of a data storage area of a memory provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of writing and reading image data provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
  • the embodiment of the present application provides a data processing method.
  • the data processing apparatus in this embodiment may be a DMA controller or other processor that can perform operations of reading and writing data storage areas of the memory.
  • the data processing method specifically includes the following steps:
  • the data processing device acquires a frame of image data to be written to the memory.
  • the image data to be written to the memory is the image data input in the Nth frame, and the memory includes M data storage areas for storing image data in a preset order, each data storage area. Used to store one frame of image data.
  • a storage pattern diagram of a data storage area of the memory shown in FIG. 2 is known.
  • FIN0, FIN1, FIN2, and FIN3 respectively store four data storage areas of the memory, and each data storage area stores one frame of image data, and the memory can store four frames of image data.
  • image data per frame It includes three components: Y, U, and V. Specifically, assuming that the starting address of the memory is BASEADDR and the size of each frame of data is FSIZE, as shown in FIG. 2, correspondingly, the starting addresses of each data storage area are:
  • the data processing device determines, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written into the memory, and according to the number of frames N and the number of preset empty frames.
  • the difference between the data and the number M of data storage areas determines an address corresponding to the second data storage area in which the image data of the corresponding number of frames to be read in the current image output format is located.
  • the first data storage area and the second data storage area are data storage areas of the memory.
  • the preset number of null frames is set by the data processing device in order to prevent the image data read by the data processing device from being image data being written or older data written before, thereby causing the displayed image to rebound.
  • the difference between the preset number of empty frames and the number of data storage areas needs to be greater than or equal to 1.
  • the above image output format includes a 3D image.
  • the image output format described above is a 3D output format
  • the image data of two frames can be a 3D effect such as a left-right format, a top-bottom format, an interlaced format, etc.
  • the data processing apparatus needs to read in order to make a 3D image effect. Two frames of image data.
  • the corresponding preset empty frame number is preferably 1 or 2.
  • the data processing device frame number N and the data storage area number M, the address corresponding to the first data storage area that needs to be stored in the image data to be written to the memory includes:
  • the data processing apparatus determines the remainder Y1 between the number of frames N and the number M of data storage areas.
  • the data processing device acquires the address of the data storage area corresponding to the remainder Y1 from the first correspondence relationship according to the remainder Y1, and uses the data storage area corresponding to the remainder Y1 as the first image data to be written to the memory. Data storage area.
  • the first correspondence relationship is a correspondence between the remainder and the data storage area, and each remainder corresponds to an address of a data storage area.
  • the first correspondence relationship may be a first correspondence relationship table between the remainder and the address of the data storage area, where each value of 1 to M in the first correspondence table corresponds to an address of a data storage area.
  • the data processing apparatus determines, according to the difference between the number of frames N and the preset number of null frames and the number M of data storage areas, an image of a corresponding number of frames to be read in the current image output format.
  • the address corresponding to the second data storage area where the data is located specifically includes:
  • the data processing apparatus determines a difference between the number of frames N and a preset number of null frames and a remainder Y2 of the number M of data storage areas, and determines a frame number of the image data to be read corresponding to the current image output format.
  • the data processing device obtains the address of the data storage area corresponding to the remainder Y2 from the second correspondence relationship according to the remainder Y2 and the number of frames of the image data to be read, and stores the data storage area corresponding to the remainder Y2 as the second data storage. Area.
  • the image data stored in the second data storage area is the image data to be read, and the second correspondence is the correspondence between the remainder and the data storage interval, and each remainder corresponds to the number of frames of the image data to be read.
  • the address of the data store may be a second correspondence table between the remainder and the address of the data storage area, and different image output formats correspond to different second correspondence tables, and each image output format corresponds to the first
  • the number of addresses is the same as the number of frames of image data to be read corresponding to the image output format.
  • each of the values 1 to M in the second correspondence table may also correspond to only the address of one data storage area, so that when the data processing device acquires the address of the data storage area corresponding to the remainder Y2, the remainder may be obtained first.
  • Y2 corresponds to the address of the data storage area, and then according to the current image output format corresponding to the number of frames of image data to be read, based on the address of the data storage area corresponding to the remainder Y2, continue to acquire the next data of the data storage area The address of the storage area until the number of acquired addresses satisfies the number of frames of the image data to be read corresponding to the current image output format.
  • the data processing device writes image data to be written to the memory into the first data storage area according to an address corresponding to the first data storage area.
  • the data processing device reads the image data stored in the second data storage area according to the address corresponding to the second data storage area.
  • the number of frames of the currently input image data is N
  • the number of data storage areas of the memory is 4, the number of preset empty frames is 2, and the current image output format corresponds to image data to be read.
  • the number of frames is 2. Referring to the flow chart of the writing and reading of the image data shown in FIG. 3, when the data processing device receives one frame of image data from the LVDS receiver, the VIN interrupt is triggered, the counter starts counting, and the currently input image is counted. The number of frames of data N.
  • the storage location of the currently received image data of one frame is determined by the remainder of the number of frames N and the number of data storage areas being 4, and the storage location of the corresponding two frames of image data to be read is determined by the number of frames N and the threshold value.
  • the difference between the number of frames 2 is determined by the remainder of the number of data storage areas being four. If the remainder of N and 4 is 0, FIN3 is placed; if the remainder is 1, FIN2 is placed; if the remainder is 2, FIN1 is placed; if the remainder is 3, FIN0 is placed.
  • the data processing method provided by the embodiment of the present application acquires a frame of image data to be written to the memory, and the image data to be written to the memory is image data input in the Nth frame, and the memory includes M data storage areas.
  • Each data storage area stores one frame of image data, and then determines, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory, and according to The difference between the number of frames N and the preset number of empty frames and the number M of data storage areas are determined, and the second data storage area corresponding to the image data of the corresponding number of frames to be read in the current image output format is determined.
  • the image data to be written to the memory is written into the first data storage area according to the address corresponding to the first data storage area, and the second data storage area is read according to the address corresponding to the second data storage area.
  • Image data stored in . In this way, by pre-storing the memory and setting a counter to count the number of image data frames that have been input, and then determining the current according to the counted number of currently input image data frames and the number of data storage areas in the partitioned memory.
  • An embodiment of the present application provides a data processing apparatus for implementing the above data processing method, the data processing apparatus being applied to a terminal device, for example, a smart TV, a digital set top box, a network television box, a smart phone, a tablet Computers and personal digital assistants (English: Personal Digital Assistant, PDA for short).
  • the apparatus 2 includes: an obtaining module 21, a determining module 22, a writing module 23, and a reading module 24, wherein:
  • the obtaining module 21 is configured to acquire image data to be written to the memory, where the image data to be written to the memory is image data input in the Nth frame, and the memory includes M data storage areas for storing image data in a preset order, each data storage area for storing one frame of image data.
  • the determining module 22 is configured to determine, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written into the memory, and according to the number of frames N and the preset empty frame The difference between the numbers and the number M of data storage areas determine the address corresponding to the second data storage area in which the image data of the corresponding number of frames to be read in the current image output format is located.
  • the writing module 23 is configured to write image data to be written to the memory into the first data storage area according to the address corresponding to the first data storage area determined by the determining module 22.
  • the reading module 24 is configured to read the image data stored in the second data storage area according to the address corresponding to the second data storage area determined by the determining module 22.
  • the determining module 22 is specifically configured to: when determining, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory:
  • the image data to the memory needs to be stored in the first data storage area.
  • the first correspondence is the correspondence between the remainder and the data storage interval, and each remainder corresponds to the address of one data storage area.
  • the determining module 22 determines, according to the difference between the number of frames N and the preset number of null frames and the number M of data storage areas, the image data of the corresponding frame number that needs to be read in the current image output format.
  • the address corresponding to the second data storage area is specifically used for:
  • each remainder corresponds to the address of the data storage area of the frame of image data to be read.
  • the difference between the preset number of null frames and the number of data storage areas in this embodiment is greater than or equal to 1.
  • the data processing apparatus acquires a frame of image data to be written to the memory, and the image data to be written to the memory is image data input in the Nth frame, and the memory includes M data storage areas.
  • Each data storage area stores one frame of image data, and then determines, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory, and according to The difference between the number of frames N and the preset number of empty frames and the number M of data storage areas are determined, and the second data storage area corresponding to the image data of the corresponding number of frames to be read in the current image output format is determined.
  • the image data to be written to the memory is written into the first data storage area according to the address corresponding to the first data storage area, and the second data storage area is read according to the address corresponding to the second data storage area.
  • Image data stored in . In this way, by pre-storing the memory and setting a counter to count the number of image data frames that have been input, and then determining the current according to the counted number of currently input image data frames and the number of data storage areas in the partitioned memory.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device implementation described above The example is merely illustrative.
  • the division of the module or unit is only a logical function division.
  • multiple units or components may be combined or integrated into another system. , or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

Abstract

Provided are a data processing method and apparatus, which relate to the field of image processing. The method and apparatus solve the problem in the prior art of errors in transmitted image data due to a phenomenon of read-write chase since a frame number of image data read by DMA is greater than a frame number of image data written by the DMA. The method comprises: acquiring one frame of image data to be written into memory, wherein the image data is an Nth frame of input image data; according to the frame number N and the number of data storage areas M in the memory, determining an address corresponding to a first data storage area in which the image data to be written into the memory needs to be stored, and determining, according to a difference between the frame number N and a pre-set null frame number as well as the number of data storage areas M, an address corresponding to a second data storage area where the image data, which needs to be read, of the corresponding frame number is located under the current image output format; writing the image data to be written into the memory into the first data storage area; and reading the image data stored in the second data storage area.

Description

一种数据处理方法及装置Data processing method and device
本申请要求于2015年6月17日提交中国专利局、申请号为201510338064.7、申请名称为“一种数据处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201510338064.7, filed on Jun. 17, 2015, the entire disclosure of which is hereby incorporated by reference. .
技术领域Technical field
本申请涉及图像处理领域,尤其涉及一种数据处理方法及装置。The present application relates to the field of image processing, and in particular, to a data processing method and apparatus.
背景技术Background technique
直接内存存取(Direct Memory Access,简称DMA)控制器是一种传输装置,可以允许不同的硬件装置直接进行数据读写,而不需要CPU的大量中断来进行处理。由于DMA控制器能够将数据从一个地址空间复制到另外一个地址空间,因此,可以通过该DMA控制器来实现内存与外部设备之间的信息交互。具体的,当通过DMA控制器来访问双倍速率同步动态随机存储器(Double Data Rate,简称DDR)进行图像数据的传输时,由于在图像处理过程中,往往会在DDR中设置一定帧数的缓存空间,然后,通过DMA控制器将外部设备传入的图像数据写入DDR缓存空间中,并根据不同的图像输出格式要求从DDR的缓存空间中读取相应帧数的图像数据(例如,当前的图像输出格式为3D时,对应的需要读取两帧图像数据来实现图像的3D效果),从而实现图像数据的传输。The Direct Memory Access (DMA) controller is a transmission device that allows different hardware devices to directly read and write data without requiring a large amount of CPU interrupts for processing. Since the DMA controller can copy data from one address space to another, the information exchange between the memory and the external device can be realized by the DMA controller. Specifically, when the DMA controller is used to access the double-rate synchronous dynamic random access memory (Double Data Rate, DDR for short) for image data transmission, a certain number of frames of buffers are often set in the DDR during image processing. Space, then, the image data transmitted by the external device is written into the DDR buffer space by the DMA controller, and the image data of the corresponding frame number is read from the buffer space of the DDR according to different image output format requirements (for example, current When the image output format is 3D, the corresponding image data needs to be read to realize the 3D effect of the image, thereby realizing the transmission of the image data.
但是,由于DMA控制器对DDR的缓存空间的写操作和读操作是分开进行,分别操作的,因此,DMA控制器对DDR的写入和读出的速度不同,因此,当该DMA控制器处理的图像数据量过大时,由于DMA控制器读取图像数据的帧数大于DMA写入的图像数据的帧数,从而发生读写追赶现象,进而导致传输的图像数据错误。However, since the DMA controller performs separate write operations and read operations on the DDR buffer space, respectively, the DMA controller writes and reads DDR at different speeds, and therefore, when the DMA controller processes When the amount of image data is too large, the number of frames in which the image data is read by the DMA controller is larger than the number of frames of the image data written by the DMA, so that the read/write catch-up phenomenon occurs, and the transmitted image data is erroneous.
申请内容 Application content
本申请的实施例提供一种数据处理方法及装置,解决了现有技术中由于DMA读取图像数据的帧数大于DMA写入的图像数据的帧数,从而发生读写追赶现象,进而导致传输的图像数据错误的问题。The embodiment of the present application provides a data processing method and apparatus, which solves the problem that the number of frames of DMA read image data is larger than the number of frames of image data written by DMA in the prior art, thereby causing read and write catch-up phenomenon, thereby causing transmission The problem with the image data is wrong.
为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above objective, the embodiment of the present application adopts the following technical solutions:
第一方面,提供一种数据处理方法,包括:In a first aspect, a data processing method is provided, comprising:
获取一帧待写入至存储器的图像数据,所述待写入至存储器的图像数据是第N帧输入的图像数据,所述存储器包括M个数据存储区,用于按照预设顺序存储图像数据,每个数据存储区用于存储一帧图像数据;Obtaining a frame of image data to be written to a memory, the image data to be written to the memory is image data input in an Nth frame, the memory including M data storage areas for storing image data in a preset order Each data storage area is used to store one frame of image data;
根据所述帧数N以及所述数据存储区个数M,确定所述待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据所述帧数N与预设空帧数之间的差值以及所述数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址,所述预设空帧数为所述第二数据存储区中存储的图像数据的输入帧数与所述帧数N间的差值;Determining, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written into the memory, and according to the number of frames N and a preset a difference between the number of empty frames and the number M of the data storage area, determining an address corresponding to the second data storage area where the image data of the corresponding number of frames to be read in the current image output format is located, the preset The number of empty frames is a difference between the number of input frames of the image data stored in the second data storage area and the number of frames N;
根据所述第一数据存储区对应的地址将所述待写入至存储器的图像数据写入所述第一数据存储区中;Writing image data to be written to the memory into the first data storage area according to an address corresponding to the first data storage area;
根据所述第二数据存储区对应的地址读取所述第二数据存储区中存储的图像数据。And reading image data stored in the second data storage area according to an address corresponding to the second data storage area.
第二方面,提供一种数据处理装置,包括:In a second aspect, a data processing apparatus is provided, including:
获取模块,用于获取一帧待写入至存储器的图像数据,所述待写入至存储器的图像数据是第N帧输入的图像数据,所述存储器包括M个数据存储区,用于按照预设顺序存储图像数据,每个数据存储区用于存储一帧图像数据;An acquisition module, configured to acquire image data to be written to a memory, the image data to be written to the memory is image data input in an Nth frame, and the memory includes M data storage areas for Sequentially storing image data, each data storage area for storing one frame of image data;
确定模块,用于根据所述帧数N以及所述数据存储区个数M,确定所述待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据所述帧数N与预设空帧数之间的差值以及所述数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址,所述预设空帧数为所 述第二数据存储区中存储的图像数据的输入帧数与所述帧数N间的差值;a determining module, configured to determine, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory, and according to the frame Determining the difference between the number N and the preset number of empty frames and the number M of the data storage areas, determining an address corresponding to the second data storage area where the image data of the corresponding number of frames to be read in the current image output format is located The preset number of empty frames is a difference between an input frame number of image data stored in the second data storage area and the number of frames N;
写入模块,用于根据所述确定模块确定的所述第一数据存储区对应的地址将所述待写入至存储器的图像数据写入所述第一数据存储区中;a writing module, configured to write image data to be written to the memory into the first data storage area according to an address corresponding to the first data storage area determined by the determining module;
读取模块,用于根据所述确定模块确定的所述第二数据存储区对应的地址读取所述第二数据存储区中存储的图像数据。And a reading module, configured to read image data stored in the second data storage area according to an address corresponding to the second data storage area determined by the determining module.
本申请的实施例提供的数据处理方法及装置,获取一帧待写入至存储器的图像数据,该待写入至存储器的图像数据是第N帧输入的图像数据,该存储器包括M个数据存储区,每个数据存储区存储一帧图像数据,然后根据该帧数N以及数据存储区个数M,确定出待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据该帧数N与预设空帧数之间的差值与数据存储区个数M,确定出当前图像输出格式下需要读取的相应帧数的图像数据分别所处的第二数据存储区对应的地址,最后,根据该第一数据存储区对应的地址将待写入至存储器的图像数据写入第一数据存储区中,根据该第二数据存储区对应的地址读取第二数据存储区中存储的图像数据。这样通过预先对存储器进行分区,以及设置计数器来统计当前已输入的图像数据帧数,然后根据统计出的当前已输入的图像数据帧数以及分区后存储器中数据存储区的个数,确定出当前输入一帧图像数据需要写入的数据存储区的地址以及后续需要读取的两帧图像数据分别所处的数据存储区的地址,从而有效的控制了读写之间的速度差,保证了写入的图像数据的帧数与读取的图像数据的帧数间的关系满足当前图像输出格式的需求,避免了读写追赶问题。The data processing method and apparatus provided by the embodiment of the present application acquires a frame of image data to be written to a memory, and the image data to be written to the memory is image data input in an Nth frame, and the memory includes M data storages. a data storage area of each frame stores one frame of image data, and then determines an address corresponding to the first data storage area to be stored in the image data to be written to the memory according to the number of frames N and the number M of data storage areas. And determining, according to the difference between the number of frames N and the preset number of null frames and the number M of data storage areas, the second data storage in which the image data of the corresponding frame number to be read in the current image output format is respectively located Address corresponding to the area, and finally, the image data to be written to the memory is written into the first data storage area according to the address corresponding to the first data storage area, and the second data is read according to the address corresponding to the second data storage area. Image data stored in the storage area. In this way, by pre-storing the memory and setting a counter to count the number of image data frames that have been input, and then determining the current according to the counted number of currently input image data frames and the number of data storage areas in the partitioned memory. Inputting the address of the data storage area to be written by one frame of image data and the address of the data storage area where the two pieces of image data to be read are respectively located, thereby effectively controlling the speed difference between reading and writing, and ensuring writing The relationship between the number of frames of incoming image data and the number of frames of read image data satisfies the requirements of the current image output format, avoiding the problem of read and write catch-up.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于 本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only Is some embodiments of the present application, for Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1为本申请的实施例提供的一种数据处理方法的流程示意图;FIG. 1 is a schematic flowchart diagram of a data processing method according to an embodiment of the present application;
图2为本申请的实施例提供的存储器的数据存储区的存储格局示意图;2 is a schematic diagram of a storage structure of a data storage area of a memory provided by an embodiment of the present application;
图3为本申请的实施例提供的图像数据的写入与读取的流程示意图;3 is a schematic flowchart of writing and reading image data provided by an embodiment of the present application;
图4为本申请的实施例提供的一种数据处理装置的结构示意图。FIG. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
本申请的实施例提供一种数据处理方法,本实施例中的数据处理装置可以为DMA控制器或其他可以对存储器的数据存储区进行读写的操作的处理器。如图1所示,该数据处理方法具体包括如下步骤:The embodiment of the present application provides a data processing method. The data processing apparatus in this embodiment may be a DMA controller or other processor that can perform operations of reading and writing data storage areas of the memory. As shown in FIG. 1 , the data processing method specifically includes the following steps:
101、数据处理装置获取一帧待写入至存储器的图像数据。101. The data processing device acquires a frame of image data to be written to the memory.
其中,上述的待写入至存储器的图像数据是第N帧输入的图像数据,存储器包括M个数据存储区,这M个数据存储区用于按照预设顺序存储图像数据,每个数据存储区用于存储一帧图像数据。The image data to be written to the memory is the image data input in the Nth frame, and the memory includes M data storage areas for storing image data in a preset order, each data storage area. Used to store one frame of image data.
示例性的,参照图2所示的存储器的数据存储区的存储格局示意图可知。该存储器按照4个数据存储区进行分区时,FIN0、FIN1、FIN2、FIN3分别该存储器的4个数据存储区,每个数据存储区中存储一帧图像数据,该存储器中可存储4帧图像数据,每帧图像数据 包括Y,U,V三个分量。具体的,假定该存储器的起始地址为BASEADDR,每帧数据的大小为FSIZE,则如图2所示,对应的,每个数据存储区的起始地址分别为:For example, a storage pattern diagram of a data storage area of the memory shown in FIG. 2 is known. When the memory is partitioned according to four data storage areas, FIN0, FIN1, FIN2, and FIN3 respectively store four data storage areas of the memory, and each data storage area stores one frame of image data, and the memory can store four frames of image data. , image data per frame It includes three components: Y, U, and V. Specifically, assuming that the starting address of the memory is BASEADDR and the size of each frame of data is FSIZE, as shown in FIG. 2, correspondingly, the starting addresses of each data storage area are:
FIN0:BASEADDR;FIN0: BASEADDR;
FIN1:BASEADDR+FSIZE;FIN1: BASEADDR+FSIZE;
FIN2:BASEADDR+2*FSIZE;FIN2: BASEADDR+2*FSIZE;
FIN3:BASEADDR+3*FSIZE。FIN3: BASEADDR+3*FSIZE.
102、数据处理装置根据帧数N以及数据存储区个数M,确定待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据帧数N与预设空帧数之间的差值以及数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址。102. The data processing device determines, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written into the memory, and according to the number of frames N and the number of preset empty frames. The difference between the data and the number M of data storage areas determines an address corresponding to the second data storage area in which the image data of the corresponding number of frames to be read in the current image output format is located.
其中,上述的第一数据存储区与第二数据存储区为该存储器的数据存储区。上述的预设空帧数是数据处理装置为了避免该数据处理装置读取的图像数据为正在写入的图像数据或者是之前写入的比较旧的数据从而导致显示的图像发生回跳现象而设置的,上述的预设空帧数与数据存储区个数间的差值需要大于等于1。The first data storage area and the second data storage area are data storage areas of the memory. The preset number of null frames is set by the data processing device in order to prevent the image data read by the data processing device from being image data being written or older data written before, thereby causing the displayed image to rebound. The difference between the preset number of empty frames and the number of data storage areas needs to be greater than or equal to 1.
而上述的图像输出格式包括3D图像。例如,当上述的图像输出格式为3D输出格式时,由于两帧的图像数据可以做左右格式、上下格式、隔行格式等3D效果,因此,为了做出3D图像效果,该数据处理装置需要读取两帧的图像数据。The above image output format includes a 3D image. For example, when the image output format described above is a 3D output format, since the image data of two frames can be a 3D effect such as a left-right format, a top-bottom format, an interlaced format, etc., the data processing apparatus needs to read in order to make a 3D image effect. Two frames of image data.
优选的,当该数据处理装置预先对存储器进行分区后,得到的数据存储区的个数为4时,且当前图像输出格式为3D输出格式时,对应的预设空帧数优选为1或2。Preferably, when the data processing device partitions the memory in advance, and the number of the obtained data storage area is 4, and the current image output format is a 3D output format, the corresponding preset empty frame number is preferably 1 or 2. .
示例性的,上述的步骤102中数据处理装置帧数N以及数据存储区个数M,确定待写入至存储器的图像数据需要存入的第一数据存储区对应的地址具体包括:Illustratively, in the foregoing step 102, the data processing device frame number N and the data storage area number M, the address corresponding to the first data storage area that needs to be stored in the image data to be written to the memory includes:
a1、数据处理装置确定帧数N与数据存储区个数M间的余数Y1。 A1. The data processing apparatus determines the remainder Y1 between the number of frames N and the number M of data storage areas.
示例性的,数据处理装置从LVDS接收器接收到一帧图像数据后,会触发VIN中断,此时该数据处理装置在每次触发VIN中断时通过帧计数器统计已输入的图像数据帧数。具体的,该数据处理装置通过公式一(Y1=N mod M)计算余数Y1,其中Y1∈1,2,……,M。Illustratively, after receiving a frame of image data from the LVDS receiver, the data processing device triggers a VIN interrupt. At this time, the data processing device counts the number of input image data frames by the frame counter each time the VIN interrupt is triggered. Specifically, the data processing apparatus calculates the remainder Y1 by Equation 1 (Y1=N mod M), where Y1∈1, 2, . . . , M.
a2、数据处理装置根据余数Y1,从第一对应关系中,获取余数Y1对应的数据存储区的地址,将余数Y1对应的数据存储区作为待写入至存储器的图像数据需要存入的第一数据存储区。A2. The data processing device acquires the address of the data storage area corresponding to the remainder Y1 from the first correspondence relationship according to the remainder Y1, and uses the data storage area corresponding to the remainder Y1 as the first image data to be written to the memory. Data storage area.
其中,上述的第一对应关系为余数与数据存储区的对应关系,每个余数对应一个数据存储区的地址。示例性的,上述的第一对应关系可以为余数与数据存储区的地址间的第一对应关系表,该第一对应关系表中1至M中的每个数值对应一个数据存储区的地址。The first correspondence relationship is a correspondence between the remainder and the data storage area, and each remainder corresponds to an address of a data storage area. Exemplarily, the first correspondence relationship may be a first correspondence relationship table between the remainder and the address of the data storage area, where each value of 1 to M in the first correspondence table corresponds to an address of a data storage area.
示例性的,上述的步骤102中数据处理装置根据帧数N与预设空帧数之间的差值以及数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址具体包括:Exemplarily, in the foregoing step 102, the data processing apparatus determines, according to the difference between the number of frames N and the preset number of null frames and the number M of data storage areas, an image of a corresponding number of frames to be read in the current image output format. The address corresponding to the second data storage area where the data is located specifically includes:
b1、数据处理装置确定该帧数N和预设空帧数间的差值与数据存储区的个数M的余数Y2,并确定当前图像输出格式对应需要读取的图像数据的帧数。B1. The data processing apparatus determines a difference between the number of frames N and a preset number of null frames and a remainder Y2 of the number M of data storage areas, and determines a frame number of the image data to be read corresponding to the current image output format.
示例性的,若数据处理装置预置的预设空帧数为X时,通过公式二(R=(N-X)mod M)计算余数Y2,其中Y1∈1,2,……,M。Exemplarily, if the preset number of null frames preset by the data processing device is X, the remainder Y2 is calculated by Equation 2 (R=(N−X) mod M), where Y1∈1, 2, . . . , M.
b2、数据处理装置根据余数Y2以及需要读取的图像数据的帧数,从第二对应关系中,获取余数Y2对应的数据存储区的地址,将余数Y2对应的数据存储区作为第二数据存储区。B2. The data processing device obtains the address of the data storage area corresponding to the remainder Y2 from the second correspondence relationship according to the remainder Y2 and the number of frames of the image data to be read, and stores the data storage area corresponding to the remainder Y2 as the second data storage. Area.
其中,上述的第二数据存储区中存储的图像数据为需要读取的图像数据,该第二对应关系为余数与数据存储区间的对应关系,每个余数对应需要读取的图像数据的帧数个数据存储区的地址。示例性的,上述的第二对应关系可以为余数与数据存储区的地址间的第二对应关系表,且不同的图像输出格式对应不同的第二对应关系表,每种图像输出格式对应的第二对应关系表中余数对应的数据存储区 的地址的个数与该图像输出格式对应的需要读取的图像数据的帧数相同。当然,该第二对应关系表中1至M中的每个数值也可以仅对应一个数据存储区的地址,这样,当数据处理装置获取余数Y2对应的数据存储区的地址时,可以首先获取余数Y2对应的数据存储区的地址,然后按照当前图像输出格式对应需要读取的图像数据的帧数,以该余数Y2对应的数据存储区的地址为基准,继续获取该数据存储区的下一数据存储区的地址,直到获取的地址个数满足当前图像输出格式对应需要读取的图像数据的帧数为止。The image data stored in the second data storage area is the image data to be read, and the second correspondence is the correspondence between the remainder and the data storage interval, and each remainder corresponds to the number of frames of the image data to be read. The address of the data store. Exemplarily, the second correspondence relationship may be a second correspondence table between the remainder and the address of the data storage area, and different image output formats correspond to different second correspondence tables, and each image output format corresponds to the first The data storage area corresponding to the remainder in the second correspondence table The number of addresses is the same as the number of frames of image data to be read corresponding to the image output format. Certainly, each of the values 1 to M in the second correspondence table may also correspond to only the address of one data storage area, so that when the data processing device acquires the address of the data storage area corresponding to the remainder Y2, the remainder may be obtained first. Y2 corresponds to the address of the data storage area, and then according to the current image output format corresponding to the number of frames of image data to be read, based on the address of the data storage area corresponding to the remainder Y2, continue to acquire the next data of the data storage area The address of the storage area until the number of acquired addresses satisfies the number of frames of the image data to be read corresponding to the current image output format.
103、数据处理装置根据第一数据存储区对应的地址将待写入至存储器的图像数据写入第一数据存储区中。103. The data processing device writes image data to be written to the memory into the first data storage area according to an address corresponding to the first data storage area.
104、数据处理装置根据第二数据存储区对应的地址读取第二数据存储区中存储的图像数据。104. The data processing device reads the image data stored in the second data storage area according to the address corresponding to the second data storage area.
示例性的,若当前已输入的图像数据的帧数为N,存储器的数据存储区的个数为4,预设空帧数为2,且当前图像输出格式对应的需要读取的图像数据的帧数为2时。参照图3所示的图像数据的写入与读取的流程示意图可知,当数据处理装置从LVDS接收器接收到一帧图像数据后,会触发VIN中断,计数器开始计数,统计当前已输入的图像数据的帧数N。然后,当前接收的一帧图像数据的存储位置由帧数N与数据存储区的个数为4的余数决定,而对应的需要读取的两帧图像数据的存储位置由帧数N与阈值空帧个数2间的差值与数据存储区的个数为4的余数决定。若N与4的余数为0,则放入FIN3;若余数为1,则放入FIN2;若余数为2,则放入FIN1;若余数为3,则放入FIN0。若(N-2)与4的余数为0,则读取FIN2和FIN3;若余数为1,则读取FIN2和FIN1;若余数为2,则读取FIN0和FIN1;若余数为3,则读取FIN0和FIN3。若确定出当前接收的一帧图像数据的存储位置为数据存储区FIN3,对应的需要读取的两帧图像数据的存储位置分别为数据存储区FIN1和FIN0时,则将写入操作对应的FIN3的地址写入到DMA控制器寄存器中,通过DMA控制器控制图像数据经总线传输到该指定的地址,该过程即为 WDMA0。在WDMA0工作的同时,vout中断被调用,在vout中断中,将读取操作对应的FIN1和FIN0的地址写入到DMA控制器中,DMA控制器分别从FIN1和FIN0中读取图像数据,该过程即为RDMA0和RDMA1。Exemplarily, if the number of frames of the currently input image data is N, the number of data storage areas of the memory is 4, the number of preset empty frames is 2, and the current image output format corresponds to image data to be read. When the number of frames is 2. Referring to the flow chart of the writing and reading of the image data shown in FIG. 3, when the data processing device receives one frame of image data from the LVDS receiver, the VIN interrupt is triggered, the counter starts counting, and the currently input image is counted. The number of frames of data N. Then, the storage location of the currently received image data of one frame is determined by the remainder of the number of frames N and the number of data storage areas being 4, and the storage location of the corresponding two frames of image data to be read is determined by the number of frames N and the threshold value. The difference between the number of frames 2 is determined by the remainder of the number of data storage areas being four. If the remainder of N and 4 is 0, FIN3 is placed; if the remainder is 1, FIN2 is placed; if the remainder is 2, FIN1 is placed; if the remainder is 3, FIN0 is placed. If the remainder of (N-2) and 4 is 0, FIN2 and FIN3 are read; if the remainder is 1, FIN2 and FIN1 are read; if the remainder is 2, FIN0 and FIN1 are read; if the remainder is 3, then Read FIN0 and FIN3. If it is determined that the storage location of the currently received image data is the data storage area FIN3, and the storage locations of the corresponding two image data to be read are the data storage areas FIN1 and FIN0, respectively, the FIN3 corresponding to the write operation is performed. The address is written into the DMA controller register, and the image data is controlled by the DMA controller to be transferred to the specified address via the bus. WDMA0. While WDMA0 is working, the vout interrupt is called. In the vout interrupt, the addresses of FIN1 and FIN0 corresponding to the read operation are written to the DMA controller, and the DMA controller reads image data from FIN1 and FIN0, respectively. The process is RDMA0 and RDMA1.
本申请的实施例提供的数据处理方法,获取一帧待写入至存储器的图像数据,该待写入至存储器的图像数据是第N帧输入的图像数据,该存储器包括M个数据存储区,每个数据存储区存储一帧图像数据,然后根据该帧数N以及数据存储区个数M,确定出待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据该帧数N与预设空帧数之间的差值与数据存储区个数M,确定出当前图像输出格式下需要读取的相应帧数的图像数据分别所处的第二数据存储区对应的地址,最后,根据该第一数据存储区对应的地址将待写入至存储器的图像数据写入第一数据存储区中,根据该第二数据存储区对应的地址读取第二数据存储区中存储的图像数据。这样通过预先对存储器进行分区,以及设置计数器来统计当前已输入的图像数据帧数,然后根据统计出的当前已输入的图像数据帧数以及分区后存储器中数据存储区的个数,确定出当前输入一帧图像数据需要写入的数据存储区的地址以及后续需要读取的两帧图像数据分别所处的数据存储区的地址,从而有效的控制了读写之间的速度差,保证了写入的图像数据的帧数与读取的图像数据的帧数间的关系满足当前图像输出格式的需求,避免了读写追赶问题。The data processing method provided by the embodiment of the present application acquires a frame of image data to be written to the memory, and the image data to be written to the memory is image data input in the Nth frame, and the memory includes M data storage areas. Each data storage area stores one frame of image data, and then determines, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory, and according to The difference between the number of frames N and the preset number of empty frames and the number M of data storage areas are determined, and the second data storage area corresponding to the image data of the corresponding number of frames to be read in the current image output format is determined. And finally, the image data to be written to the memory is written into the first data storage area according to the address corresponding to the first data storage area, and the second data storage area is read according to the address corresponding to the second data storage area. Image data stored in . In this way, by pre-storing the memory and setting a counter to count the number of image data frames that have been input, and then determining the current according to the counted number of currently input image data frames and the number of data storage areas in the partitioned memory. Inputting the address of the data storage area to be written by one frame of image data and the address of the data storage area where the two pieces of image data to be read are respectively located, thereby effectively controlling the speed difference between reading and writing, and ensuring writing The relationship between the number of frames of incoming image data and the number of frames of read image data satisfies the requirements of the current image output format, avoiding the problem of read and write catch-up.
本申请的实施例提供一种数据处理装置,该数据处理装置用于实现上述的数据处理方法,该数据处理装置应用于终端设备,例如,智能电视、数字机顶盒、网络电视盒子、智能手机、平板电脑以及个人数字助理(英文:Personal Digital Assistant,简称PDA)等。如图4所示,该装置2包括:获取模块21、确定模块22、写入模块23以及读取模块24,其中:An embodiment of the present application provides a data processing apparatus for implementing the above data processing method, the data processing apparatus being applied to a terminal device, for example, a smart TV, a digital set top box, a network television box, a smart phone, a tablet Computers and personal digital assistants (English: Personal Digital Assistant, PDA for short). As shown in FIG. 4, the apparatus 2 includes: an obtaining module 21, a determining module 22, a writing module 23, and a reading module 24, wherein:
获取模块21,用于获取一帧待写入至存储器的图像数据,该待写入至存储器的图像数据是第N帧输入的图像数据,该存储器包括 M个数据存储区,用于按照预设顺序存储图像数据,每个数据存储区用于存储一帧图像数据。The obtaining module 21 is configured to acquire image data to be written to the memory, where the image data to be written to the memory is image data input in the Nth frame, and the memory includes M data storage areas for storing image data in a preset order, each data storage area for storing one frame of image data.
确定模块22,用于根据帧数N以及数据存储区个数M,确定待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据帧数N与预设空帧数之间的差值以及数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址。The determining module 22 is configured to determine, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written into the memory, and according to the number of frames N and the preset empty frame The difference between the numbers and the number M of data storage areas determine the address corresponding to the second data storage area in which the image data of the corresponding number of frames to be read in the current image output format is located.
写入模块23,用于根据确定模块22确定的第一数据存储区对应的地址将待写入至存储器的图像数据写入第一数据存储区中。The writing module 23 is configured to write image data to be written to the memory into the first data storage area according to the address corresponding to the first data storage area determined by the determining module 22.
读取模块24,用于根据确定模块22确定的第二数据存储区对应的地址读取第二数据存储区中存储的图像数据。The reading module 24 is configured to read the image data stored in the second data storage area according to the address corresponding to the second data storage area determined by the determining module 22.
可选的,确定模块22在根据帧数N以及数据存储区个数M,确定待写入至存储器的图像数据需要存入的第一数据存储区对应的地址时具体用于:Optionally, the determining module 22 is specifically configured to: when determining, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory:
确定帧数N与数据存储区个数M间的余数Y1;根据余数Y1,从第一对应关系中,获取余数Y1对应的数据存储区的地址,将余数Y1对应的数据存储区作为待写入至存储器的图像数据需要存入的第一数据存储区,该第一对应关系为余数与数据存储区间的对应关系,每个余数对应一个数据存储区的地址。Determining the remainder Y1 between the number of frames N and the number M of data storage areas; according to the remainder Y1, obtaining the address of the data storage area corresponding to the remainder Y1 from the first correspondence, and using the data storage area corresponding to the remainder Y1 as the to-be-written The image data to the memory needs to be stored in the first data storage area. The first correspondence is the correspondence between the remainder and the data storage interval, and each remainder corresponds to the address of one data storage area.
可选的,确定模块22在根据帧数N与预设空帧数之间的差值以及数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址时具体用于:Optionally, the determining module 22 determines, according to the difference between the number of frames N and the preset number of null frames and the number M of data storage areas, the image data of the corresponding frame number that needs to be read in the current image output format. The address corresponding to the second data storage area is specifically used for:
确定帧数N与预设空帧数之间的差值与数据存储区个数间M的余数Y2,并确定当前图像输出格式对应需要读取的图像数据的帧数。Determining the difference between the number of frames N and the preset number of empty frames and the remainder Y2 of the number of data storage areas, and determining the number of frames of the image data to be read in the current image output format.
根据余数Y2以及需要读取的图像数据的帧数,从第二对应关系中,获取余数Y2对应的数据存储区的地址,将余数Y2对应的数据存储区作为第二数据存储区,该第二数据存储区中存储的图像数据为需要读取的图像数据,该第二对应关系为余数与数据存储区间 的对应关系,每个余数对应需要读取的图像数据的帧数个数据存储区的地址。Obtaining, according to the remainder Y2 and the number of frames of the image data to be read, the address of the data storage area corresponding to the remainder Y2 from the second correspondence, and the data storage area corresponding to the remainder Y2 as the second data storage area, the second The image data stored in the data storage area is image data to be read, and the second correspondence is a remainder and a data storage interval. Correspondence relationship, each remainder corresponds to the address of the data storage area of the frame of image data to be read.
其中,本实施例中的预设空帧数与数据存储区个数间的差值大于等于1。The difference between the preset number of null frames and the number of data storage areas in this embodiment is greater than or equal to 1.
本申请的实施例提供的数据处理装置,获取一帧待写入至存储器的图像数据,该待写入至存储器的图像数据是第N帧输入的图像数据,该存储器包括M个数据存储区,每个数据存储区存储一帧图像数据,然后根据该帧数N以及数据存储区个数M,确定出待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据该帧数N与预设空帧数之间的差值与数据存储区个数M,确定出当前图像输出格式下需要读取的相应帧数的图像数据分别所处的第二数据存储区对应的地址,最后,根据该第一数据存储区对应的地址将待写入至存储器的图像数据写入第一数据存储区中,根据该第二数据存储区对应的地址读取第二数据存储区中存储的图像数据。这样通过预先对存储器进行分区,以及设置计数器来统计当前已输入的图像数据帧数,然后根据统计出的当前已输入的图像数据帧数以及分区后存储器中数据存储区的个数,确定出当前输入一帧图像数据需要写入的数据存储区的地址以及后续需要读取的两帧图像数据分别所处的数据存储区的地址,从而有效的控制了读写之间的速度差,保证了写入的图像数据的帧数与读取的图像数据的帧数间的关系满足当前图像输出格式的需求,避免了读写追赶问题。The data processing apparatus provided by the embodiment of the present application acquires a frame of image data to be written to the memory, and the image data to be written to the memory is image data input in the Nth frame, and the memory includes M data storage areas. Each data storage area stores one frame of image data, and then determines, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory, and according to The difference between the number of frames N and the preset number of empty frames and the number M of data storage areas are determined, and the second data storage area corresponding to the image data of the corresponding number of frames to be read in the current image output format is determined. And finally, the image data to be written to the memory is written into the first data storage area according to the address corresponding to the first data storage area, and the second data storage area is read according to the address corresponding to the second data storage area. Image data stored in . In this way, by pre-storing the memory and setting a counter to count the number of image data frames that have been input, and then determining the current according to the counted number of currently input image data frames and the number of data storage areas in the partitioned memory. Inputting the address of the data storage area to be written by one frame of image data and the address of the data storage area where the two pieces of image data to be read are respectively located, thereby effectively controlling the speed difference between reading and writing, and ensuring writing The relationship between the number of frames of incoming image data and the number of frames of read image data satisfies the requirements of the current image output format, avoiding the problem of read and write catch-up.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be clearly understood by those skilled in the art that for the convenience and brevity of the description, only the division of each functional module described above is exemplified. In practical applications, the above function assignment can be completed by different functional modules as needed. The internal structure of the device is divided into different functional modules to perform all or part of the functions described above. For the specific working process of the system, the device and the unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施 例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device implementation described above The example is merely illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated into another system. , or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。 The above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still The technical solutions described in the embodiments are modified, or the equivalents of the technical features are replaced by the equivalents. The modifications and substitutions of the embodiments do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (8)

  1. 一种数据处理方法,其特征在于,包括:A data processing method, comprising:
    获取一帧待写入至存储器的图像数据,所述待写入至存储器的图像数据是第N帧输入的图像数据,所述存储器包括M个数据存储区,用于按照预设顺序存储图像数据,每个数据存储区用于存储一帧图像数据;Obtaining a frame of image data to be written to a memory, the image data to be written to the memory is image data input in an Nth frame, the memory including M data storage areas for storing image data in a preset order Each data storage area is used to store one frame of image data;
    根据所述帧数N以及所述数据存储区个数M,确定所述待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据所述帧数N与预设空帧数之间的差值以及所述数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址;Determining, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written into the memory, and according to the number of frames N and a preset a difference between the number of empty frames and the number M of the data storage area, determining an address corresponding to the second data storage area where the image data of the corresponding number of frames to be read in the current image output format is located;
    根据所述第一数据存储区对应的地址将所述待写入至存储器的图像数据写入所述第一数据存储区中;Writing image data to be written to the memory into the first data storage area according to an address corresponding to the first data storage area;
    根据所述第二数据存储区对应的地址读取所述第二数据存储区中存储的图像数据。And reading image data stored in the second data storage area according to an address corresponding to the second data storage area.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述帧数N以及所述数据存储区个数M,确定所述待写入至存储器的图像数据需要存入的第一数据存储区对应的地址具体包括:The method according to claim 1, wherein the determining, according to the number of frames N and the number M of data storage areas, the first data storage to be stored in the image data to be written to the memory The corresponding address of the area specifically includes:
    确定所述帧数N与所述数据存储区个数M间的余数Y1;Determining a remainder Y1 between the number of frames N and the number M of data storage areas;
    根据所述余数Y1,从第一对应关系中,获取所述余数Y1对应的数据存储区的地址,将所述余数Y1对应的数据存储区作为所述待写入至存储器的图像数据需要存入的第一数据存储区,所述第一对应关系为余数与数据存储区间的对应关系,每个余数对应一个数据存储区的地址。Obtaining, according to the remainder Y1, the address of the data storage area corresponding to the remainder Y1 from the first correspondence, and storing the data storage area corresponding to the remainder Y1 as the image data to be written into the memory needs to be stored The first data storage area, the first correspondence relationship is a correspondence between a remainder and a data storage interval, and each remainder corresponds to an address of a data storage area.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述帧数N与预设空帧数之间的差值以及所述数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址具体包括:The method according to claim 1, wherein the determining the current image output format requires reading according to the difference between the number of frames N and the preset number of empty frames and the number M of data storage areas. The address corresponding to the second data storage area where the image data of the corresponding frame number is located specifically includes:
    确定所述帧数N与预设空帧数之间的差值与所述数据存储区个 数M的余数Y2,并确定当前图像输出格式对应需要读取的图像数据的帧数;Determining a difference between the number of frames N and a preset number of null frames and the data storage area a remainder Y2 of the number M, and determining the current image output format corresponding to the number of frames of the image data to be read;
    根据所述余数Y2以及所述需要读取的图像数据的帧数,从第二对应关系中,获取所述余数Y2对应的数据存储区的地址,将所述余数Y2对应的数据存储区作为第二数据存储区,所述第二数据存储区中存储的图像数据为需要读取的图像数据,所述第二对应关系为余数与数据存储区间的对应关系,每个余数对应所述需要读取的图像数据的帧数个数据存储区的地址。Obtaining an address of the data storage area corresponding to the remainder Y2 from the second correspondence relationship according to the remainder Y2 and the number of frames of the image data to be read, and using the data storage area corresponding to the remainder Y2 as the first In the data storage area, the image data stored in the second data storage area is image data to be read, and the second correspondence relationship is a correspondence between the remainder and the data storage interval, and each remainder corresponds to the need to read The number of frames of image data is the address of the data storage area.
  4. 根据权利要求1或3所述的方法,其特征在于,所述预设空帧数与所述数据存储区个数间的差值大于等于1。The method according to claim 1 or 3, wherein the difference between the preset number of null frames and the number of data storage areas is greater than or equal to one.
  5. 一种数据处理装置,其特征在于,包括:A data processing device, comprising:
    获取模块,用于获取一帧待写入至存储器的图像数据,所述待写入至存储器的图像数据是第N帧输入的图像数据,所述存储器包括M个数据存储区,用于按照预设顺序存储图像数据,每个数据存储区用于存储一帧图像数据;An acquisition module, configured to acquire image data to be written to a memory, the image data to be written to the memory is image data input in an Nth frame, and the memory includes M data storage areas for Sequentially storing image data, each data storage area for storing one frame of image data;
    确定模块,用于根据所述帧数N以及所述数据存储区个数M,确定所述待写入至存储器的图像数据需要存入的第一数据存储区对应的地址,并根据所述帧数N与预设空帧数之间的差值以及所述数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址;a determining module, configured to determine, according to the number of frames N and the number M of data storage areas, an address corresponding to the first data storage area to be stored in the image data to be written to the memory, and according to the frame Determining the difference between the number N and the preset number of empty frames and the number M of the data storage areas, determining an address corresponding to the second data storage area where the image data of the corresponding number of frames to be read in the current image output format is located ;
    写入模块,用于根据所述确定模块确定的所述第一数据存储区对应的地址将所述待写入至存储器的图像数据写入所述第一数据存储区中;a writing module, configured to write image data to be written to the memory into the first data storage area according to an address corresponding to the first data storage area determined by the determining module;
    读取模块,用于根据所述确定模块确定的所述第二数据存储区对应的地址读取所述第二数据存储区中存储的图像数据。And a reading module, configured to read image data stored in the second data storage area according to an address corresponding to the second data storage area determined by the determining module.
  6. 根据权利要求5所述的装置,其特征在于,所述确定模块在根据所述帧数N以及所述数据存储区个数M,确定所述待写入至存储器的图像数据需要存入的第一数据存储区对应的地址时具体用于:The apparatus according to claim 5, wherein the determining module determines, according to the number of frames N and the number M of data storage areas, that the image data to be written to the memory needs to be stored The address corresponding to a data storage area is specifically used to:
    确定所述帧数N与所述数据存储区个数M间的余数Y1; Determining a remainder Y1 between the number of frames N and the number M of data storage areas;
    根据所述余数Y1,从第一对应关系中,获取所述余数Y1对应的数据存储区的地址,将所述余数Y1对应的数据存储区作为所述待写入至存储器的图像数据需要存入的第一数据存储区,所述第一对应关系为余数与数据存储区间的对应关系,每个余数对应一个数据存储区的地址。Obtaining, according to the remainder Y1, the address of the data storage area corresponding to the remainder Y1 from the first correspondence, and storing the data storage area corresponding to the remainder Y1 as the image data to be written into the memory needs to be stored The first data storage area, the first correspondence relationship is a correspondence between a remainder and a data storage interval, and each remainder corresponds to an address of a data storage area.
  7. 根据权利要求5所述的装置,其特征在于,所述确定模块在根据所述帧数N与预设空帧数之间的差值以及所述数据存储区个数M,确定当前图像输出格式下需要读取的相应帧数的图像数据所处的第二数据存储区对应的地址时具体用于:The apparatus according to claim 5, wherein the determining module determines the current image output format according to a difference between the number of frames N and a preset number of null frames and the number M of data storage areas. The address corresponding to the second data storage area in which the image data of the corresponding frame number to be read is located is specifically used for:
    确定所述帧数N与预设空帧数之间的差值与所述数据存储区个数间M的余数Y2,并确定当前图像输出格式对应需要读取的图像数据的帧数;Determining a difference between the difference between the number of frames N and the preset number of empty frames and the remainder Y2 of the number of data storage areas, and determining the number of frames of the image data that need to be read in the current image output format;
    根据所述余数Y2以及所述需要读取的图像数据的帧数,从第二对应关系中,获取所述余数Y2对应的数据存储区的地址,将所述余数Y2对应的数据存储区作为第二数据存储区,所述第二数据存储区中存储的图像数据为需要读取的图像数据,所述第二对应关系为余数与数据存储区间的对应关系,每个余数对应所述需要读取的图像数据的帧数个数据存储区的地址。Obtaining an address of the data storage area corresponding to the remainder Y2 from the second correspondence relationship according to the remainder Y2 and the number of frames of the image data to be read, and using the data storage area corresponding to the remainder Y2 as the first In the data storage area, the image data stored in the second data storage area is image data to be read, and the second correspondence relationship is a correspondence between the remainder and the data storage interval, and each remainder corresponds to the need to read The number of frames of image data is the address of the data storage area.
  8. 根据权利要求6或7所述的装置,其特征在于,所述预设空帧数与所述数据存储区个数间的差值大于等于1。 The apparatus according to claim 6 or 7, wherein the difference between the preset number of empty frames and the number of the data storage areas is greater than or equal to one.
PCT/CN2015/088991 2015-06-17 2015-09-06 Data processing method and apparatus WO2016201793A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510338064.7A CN104932994B (en) 2015-06-17 2015-06-17 A kind of data processing method and device
CN201510338064.7 2015-06-17

Publications (1)

Publication Number Publication Date
WO2016201793A1 true WO2016201793A1 (en) 2016-12-22

Family

ID=54120165

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/088991 WO2016201793A1 (en) 2015-06-17 2015-09-06 Data processing method and apparatus

Country Status (2)

Country Link
CN (1) CN104932994B (en)
WO (1) WO2016201793A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117423B (en) * 2017-06-23 2022-05-03 阿里巴巴集团控股有限公司 Table partition configuration method, device and system of database system
CN110399976B (en) * 2018-04-25 2022-04-05 华为技术有限公司 Computing device and computing method
CN112346681B (en) * 2019-08-09 2023-01-10 西安诺瓦星云科技股份有限公司 Image display control method, device and system and computer readable medium
CN113079336A (en) * 2020-01-03 2021-07-06 深圳市春盛海科技有限公司 High-speed image recording method and device
CN112001836A (en) * 2020-07-03 2020-11-27 北京博雅慧视智能技术研究院有限公司 Image processing device
CN111885410B (en) * 2020-07-30 2022-08-30 京东方科技集团股份有限公司 Image data processing device, method and display device
CN112115096A (en) * 2020-09-16 2020-12-22 天津津航计算技术研究所 Data transmission control method based on embedded microprocessor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003632A (en) * 2007-06-20 2009-01-08 Panasonic Corp Image processing system
CN101552916A (en) * 2009-05-05 2009-10-07 北京红旗胜利科技发展有限责任公司 DMA transfer method, device and DMA controller for YUV video data
CN101639817A (en) * 2009-03-13 2010-02-03 青岛海信信芯科技有限公司 Memory control method, memory controller and memory control system
CN103399720A (en) * 2013-07-16 2013-11-20 青岛海信信芯科技有限公司 Data processing method and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1464685A (en) * 2002-06-13 2003-12-31 优创科技(深圳)有限公司 Method for processing acoustic frequency flow playback in network terminal buffer
CN101303845A (en) * 2007-05-10 2008-11-12 智多微电子(上海)有限公司 Apparatus and method for controlling image data to write into and read from buffer unit
CN101446932A (en) * 2008-12-24 2009-06-03 北京中星微电子有限公司 Method and device for transmitting audio data
CN104102594B (en) * 2014-07-15 2017-10-13 上海龙晶科技有限公司 Realize that view data caches the system and method for Read-write Catrol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003632A (en) * 2007-06-20 2009-01-08 Panasonic Corp Image processing system
CN101639817A (en) * 2009-03-13 2010-02-03 青岛海信信芯科技有限公司 Memory control method, memory controller and memory control system
CN101552916A (en) * 2009-05-05 2009-10-07 北京红旗胜利科技发展有限责任公司 DMA transfer method, device and DMA controller for YUV video data
CN103399720A (en) * 2013-07-16 2013-11-20 青岛海信信芯科技有限公司 Data processing method and electronic equipment

Also Published As

Publication number Publication date
CN104932994A (en) 2015-09-23
CN104932994B (en) 2018-12-07

Similar Documents

Publication Publication Date Title
WO2016201793A1 (en) Data processing method and apparatus
CN101930416B (en) Hardware assisted inter-processor communication
US8736695B2 (en) Parallel image processing using multiple processors
US9128633B2 (en) Semiconductor memory device and method of operating the semiconductor memory device
EP3470971B1 (en) Method, apparatus, and system for accessing memory device
CN103686314A (en) Demultiplex device and method adopting HD (high definition) video channel to transmit SD (standard definition) videos
CN108241477B (en) Data transfer device and data transfer method
US20170294176A1 (en) Image processing apparatus, image processing method, and storage medium
US9343177B2 (en) Accessing control registers over a data bus
TW202009731A (en) Multi-processor system having distributed mailbox architecture and processor error checking method thereof
US10346323B2 (en) Data transfer device and data transfer method for smoothing data to a common bus
CN113840174A (en) Image display method, system and storage medium
CN103019645A (en) Arbitration control method of CCD signal processing circuit high speed data flow
TW487845B (en) Apparatus for memory resource arbitration based on dedicated time slot allocation
CN104469241A (en) Device for achieving video frame rate change
US20110153923A1 (en) High speed memory system
US10546558B2 (en) Request aggregation with opportunism
US20140237195A1 (en) N-dimensional collapsible fifo
US20170329574A1 (en) Display controller
US20140089604A1 (en) Bipolar collapsible fifo
CN103500564A (en) Image display control unit, image display control method and image display system
WO2023201731A1 (en) Read timing control method and apparatus, and computer-readable storage medium
TWI516854B (en) Projection apparatus and image data accessing method thereof
CN105550976B (en) For the sporadic insufficient image data real-time reception fault-tolerance approach of bus bandwidth
US20230342314A1 (en) Memory Request Timeouts Using a Common Counter

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15895366

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15895366

Country of ref document: EP

Kind code of ref document: A1