Data reading method and data writing method

By optimizing storage space and address intervals in the image processing algorithm and utilizing SRAM for data reading and writing, the problem of image data storage address changes affecting processing efficiency is solved, achieving efficient image data processing and low-latency target image output.

CN116033092BActive Publication Date: 2026-05-01ZHONGXING ELECTRONICS CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHONGXING ELECTRONICS CO LTD
Filing Date
2022-12-30
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In image processing algorithms, changes in the storage address of image data during row-to-block or block-to-row conversion affect processing time, resulting in low processing efficiency of the target image and high system bandwidth consumption.

Method used

By determining the read or write address of the target image, optimizing the size and address interval of the storage space based on the height and width data of pixel blocks or pixel rows, and using static random access memory (SRAM) for data reading and writing, efficient processing of image data is achieved.

Benefits of technology

It enables efficient reading and writing of target image data of arbitrary size, reduces the occupation of storage space and hardware resources, and improves processing efficiency and frame rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116033092B_ABST
    Figure CN116033092B_ABST
Patent Text Reader

Abstract

The application provides a data reading method and a data writing method, and relates to the technical field of data processing. The data reading method comprises the following steps: in response to a data reading command, determining a reading address of image data of a target image, the image data of the target image comprising a pixel block or a pixel row corresponding to the target image; based on the reading address, acquiring the image data of the target image from a storage space; and sending the image data of the target image to a data processing unit. The embodiment of the application supports reading of the image data of the target image of any size, and reduces the occupation of the storage space and the hardware resources.
Need to check novelty before this filing date? Find Prior Art

Description

Data reading methods and data writing methods Technical Field

[0001] This application relates to the field of data processing technology, specifically to a data reading method and a data writing method. Background Technology

[0002] Currently, image processing algorithms typically require image data to be converted from row to block (writing pixel rows; reading pixel blocks) or from block to row (writing pixel blocks; reading pixel rows). During row-to-block or block-to-row conversion, the storage address of the image data changes, which in turn affects the processing time of the target image. Summary of the Invention

[0003] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide a data reading method and a data writing method.

[0004] In a first aspect, one embodiment of this application provides a data reading method, comprising: in response to a data reading command, determining a reading address where image data of a target image is located, wherein the image data of the target image includes pixel blocks or pixel rows corresponding to the target image; obtaining the image data of the target image from a storage space based on the reading address; and sending the image data of the target image to a data processing unit.

[0005] In conjunction with the first aspect, in some implementations of the first aspect, the data reading method further includes: if the data to be written in the storage space is a row of pixels and the data to be read in the storage space is a block of pixels, or if the data to be written in the storage space is a block of pixels and the data to be read in the storage space is a row of pixels, then the size of the storage space is determined based on the width data of the target image and the height data corresponding to the pixel blocks of the target image.

[0006] In conjunction with the first aspect, in some implementations of the first aspect, determining the read address of the image data of the target image includes: for each current pixel row included in the image data of the target image, if the written data in the storage space is a pixel block, the read data in the storage space is a pixel row, and the depth of the storage space is an integer power of 2, then based on the height data of the pixel block, the pixel block position data of the read current pixel row in the target image, and the depth of the storage space, the address interval corresponding to the current pixel row is determined, and the address interval is the address interval between the current pixel row and the pixel rows adjacent to the current pixel row; based on the address interval, the read address of the current pixel row is determined.

[0007] In conjunction with the first aspect, in some implementations of the first aspect, determining the read address of the image data of the target image further includes: if the depth of the storage space is not equal to an integer power of 2, obtaining the address intervals corresponding to the current pixel row and the adjacent pixel rows when the depth of the storage space is equal to an integer power of 2; determining the difference data between the coordinate data of the current pixel row in the target image and the pixel block position data of the current pixel row in the target image; determining the address interval corresponding to the current pixel row based on the address intervals corresponding to the current pixel row and the adjacent pixel rows when the depth of the storage space is equal to an integer power of 2, and the difference data; and determining the read address of the current pixel row based on the address interval.

[0008] In conjunction with the first aspect, in some implementations of the first aspect, determining the read address of the image data of the target image includes: for each current pixel block included in the image data of the target image, if the written data in the storage space is a pixel row, the read data in the storage space is a pixel block, and the depth of the storage space is an integer power of 2, then based on the width data of the pixel block, the width data of the target image, the pixel block position data of the read pixel row in the current pixel block in the target image, and the depth of the storage space, determining the address interval of the pixel row in the current pixel block, the address interval including the address interval between the pixel row in the current pixel block and the address interval between adjacent pixel rows; and based on the address interval, determining the read address of the pixel row in the current pixel block.

[0009] In conjunction with the first aspect, in some implementations of the first aspect, determining the read address of the image data of the target image further includes: if the depth of the storage space is not equal to an integer power of 2, obtaining the address intervals of the pixel rows in the current pixel block and the pixel rows adjacent to the pixel rows when the depth of the storage space is equal to an integer power of 2; determining the difference data between the coordinate data of the pixel rows in the current pixel block and the pixel block position data of the pixel rows in the target image; determining the address interval of the pixel rows in the current pixel block based on the address intervals and difference data of the pixel rows in the current pixel block and the pixel rows adjacent to the pixel rows when the depth of the storage space is equal to an integer power of 2, the width data of the target image and the width data of the current pixel block; and determining the read address of the pixel rows in the current pixel block based on the address intervals.

[0010] In conjunction with the first aspect, in some implementations of the first aspect, determining the read address where the image data of the target image is located includes: constructing an address interval table, which includes the address intervals corresponding to pixel rows; and obtaining the read address where the target image data is located based on the address interval table.

[0011] In conjunction with the first aspect, in some implementations of the first aspect, the storage space is the storage space in a static random access memory.

[0012] Secondly, one embodiment of this application provides a data writing method, including: in response to a data writing command, acquiring image data of a target image, the image data of the target image including pixel blocks or pixel rows corresponding to the target image; determining the writing address where the image data of the target image is located; and writing the image data of the target image into a storage space based on the writing address.

[0013] In conjunction with the second aspect, in some implementations of the second aspect, determining the write address of the image data of the target image includes: for each current pixel block included in the image data of the target image, if the write data in the storage space is a pixel block and the read data in the storage space is a pixel row, then based on the height data of the pixel block, the pixel block position data of the pixel row in the current pixel block in the target image, and the depth of the storage space, determining the address interval corresponding to the pixel row in the current pixel block, the address interval being the address interval between the pixel row in the current pixel block and the pixel row adjacent to the pixel row; and based on the address interval, determining the write address of the pixel row in the current pixel block.

[0014] In conjunction with the second aspect, in some implementations of the second aspect, determining the write address of the image data of the target image includes: for each current pixel row included in the image data of the target image, if the write data in the storage space is a pixel row and the read data in the storage space is a pixel block, then based on the width data of the pixel block, the width data of the target image, the pixel block position data of the current pixel row in the target image, and the depth of the storage space, the address interval of the current pixel row is determined; based on the address interval, the write address of the current pixel row is determined.

[0015] Thirdly, one embodiment of this application provides a data reading device, including: a determining module, configured to determine the reading address where the image data of a target image is located in response to a data reading command, wherein the image data of the target image includes pixel blocks or pixel rows corresponding to the target image; an acquiring module, configured to acquire the image data of the target image from a storage space based on the reading address; and a sending module, configured to send the image data of the target image to a data processing unit.

[0016] Fourthly, one embodiment of this application provides a data writing device, comprising: an acquisition module, configured to acquire image data of a target image in response to a data writing command, the image data of the target image including pixel blocks or pixel rows corresponding to the target image; a determination module, configured to determine the writing address where the image data of the target image is located; and a writing module, configured to write the image data of the target image into a storage space based on the writing address.

[0017] Fifthly, one embodiment of this application provides a computer-readable storage medium storing a computer program for performing the methods described in the first and second aspects.

[0018] In a sixth aspect, one embodiment of this application provides an electronic device, the electronic device comprising: a processor; a memory for storing processor-executable instructions; the processor being configured to perform the methods described in the first and second aspects.

[0019] The data reading method provided in this application, upon responding to a data reading command, determines the reading address where the image data of the target image is located. The image data of the target image includes pixel blocks or pixel rows corresponding to the target image. Further, based on the reading address, the image data of the target image is retrieved from the storage space and sent to the data processing unit. Through the solution in this application embodiment, image data of target images of any size can be read, while reducing the occupation of storage space and hardware resources. Attached Figure Description

[0020] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0021] Figure 1 is a flowchart illustrating a data reading method provided in an exemplary embodiment of this application.

[0022] Figure 2 is a flowchart illustrating a data writing method provided in an exemplary embodiment of this application.

[0023] Figure 3 is a schematic diagram of the structure of a data reading device provided in an exemplary embodiment of this application.

[0024] Figure 4 is a schematic diagram of the structure of a data writing device provided in an exemplary embodiment of this application.

[0025] Figure 5 shows a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] Image signal processing: refers to the unit that processes the output signal of the front-end image sensor, and usually includes multiple image processing algorithms.

[0028] Image processing algorithms refer to a series of methods for processing images, using these different methods to process and understand images in different ways. These include image denoising, image transformation, image analysis, image compression, image enhancement, and so on.

[0029] Pixel block: A pixel block is the basic unit of operation in image processing algorithms. A pixel block refers to an image region with a width of BW and a height of BH, containing BW×BH pixels.

[0030] Pixel row: The set of pixels in the horizontal direction of an image.

[0031] Image input / output timing: The order in which pixels of an image are transmitted in a unit of time, from left to right in the horizontal direction of the image pixels. After each row is transmitted, the next row is transmitted in the order from top to bottom.

[0032] Image input / output delay: Due to the algorithm window mechanism, data cache access time, and algorithm processing time, there is a certain delay in image output relative to image input.

[0033] Line-to-block conversion, block-to-line conversion: Due to the algorithm processing mechanism, some algorithms require image data to be provided in blocks, or the processed image data is output in blocks after processing.

[0034] Storage control includes storage enable control, read / write control, and address control.

[0035] Addressing algorithm: Accessing memory addresses according to certain rules.

[0036] Exemplary methods

[0037] Figure 1 is a schematic flowchart of a data reading method provided in an exemplary embodiment of this application. Exemplarily, the data reading method in this embodiment is applied to a reading control unit. As shown in Figure 1, the data reading method provided in this embodiment includes the following steps.

[0038] Step S110: In response to the data read command, determine the read address where the image data of the target image is located.

[0039] Specifically, the image data of the target image includes pixel blocks or pixel rows corresponding to the target image. For example, the target image is an image frame in the target video, with width data W and height data H. Pixel blocks are segmented from the target image, and the pixel blocks segmented from the target image are of the same size. Therefore, the width and height data of the pixel blocks are determined based on the width and height data of the target image. For example, the width data of the pixel block is BW, and the height data of the pixel block is BH, where B is a variable and can represent any value.

[0040] Step S120: Based on the read address, obtain the image data of the target image from the storage space.

[0041] For example, the storage space is the storage space in static random access memory (SRAM).

[0042] In this embodiment, unlike the method of storing image data using Double Data Rate SDRAM (DDR) in related technologies, the data read latency of this method is longer than that of SRAM, and the latency is affected by the busyness of DDR and bus access, making the latency time difficult to predict. This results in excessively long processing time for the target image or failure to obtain the corresponding processing data for the target image in a timely manner, ultimately leading to a low output frame rate of the target image and consuming a large amount of system bandwidth. In contrast, this application uses SRAM for image data reading, which can complete the output processing of image data in real time, with a smaller and more fixed latency and less storage resource consumption. In addition, the low input and output latency of the target image allows for a higher frame rate.

[0043] Furthermore, in an exemplary embodiment of this application, if the data written in the storage space is a row of pixels and the data read in the storage space is a block of pixels, or if the data written in the storage space is a block of pixels and the data read in the storage space is a row of pixels, then the size of the storage space is determined based on the width data of the target image and the height data corresponding to the pixel blocks of the target image.

[0044] Continuing with the previous example, when implementing input in pixel rows and output in pixel blocks, or input in pixel blocks and output in pixel rows, the size of the storage space is W × BH, where W represents the width data of the target image and BH represents the height data of the pixel block. For example, if W equals 520 and BH = 52, then the size of the storage space is 520 × 52.

[0045] In this embodiment, the size of the storage space is customized based on the width data and pixel block height data of the target image to ensure that algorithmic processing of the target image can be completed. The height of the storage space is the pixel block height data BH, which ensures that the data of all pixel blocks can be stored properly.

[0046] Furthermore, in an exemplary embodiment of this application, the bit width of the SRAM is the width data of the pixel block, and the depth of the SRAM is the width data of the target image divided by the width data of the pixel block multiplied by the height data of the pixel block, so as to ensure that the algorithm processing of the target image can be completed.

[0047] If the data to be read in the storage space is a pixel block, during the process of writing from the BH+1 pixel row to the H pixel row of the target image, every BW pixels are written, in response to the data read command, the read address of the image data of the target image is determined, and BW pixels are read from the SRAM at one time according to the read address.

[0048] Step S130: Send the image data of the target image to the data processing unit.

[0049] Specifically, the image data is sent to the data processing unit so that the image processing algorithm in the data processing unit can be used to process the image data. For example, the image data can be denoised, transformed, analyzed, compressed, enhanced, etc.

[0050] In this embodiment, upon responding to a data read command, the read address of the target image's image data is determined. The target image's image data includes pixel blocks or pixel rows corresponding to the target image. Further, based on the read address, the target image's image data is retrieved from the storage space and sent to the data processing unit. Through the solution in this embodiment, the reading of image data for target images of any size can be achieved, while reducing the occupation of storage space and hardware resources.

[0051] In an exemplary embodiment of this application, determining the read address of the image data of the target image specifically includes: for each current pixel row included in the image data of the target image, if the written data in the storage space is a pixel block, the read data in the storage space is a pixel row, and the depth of the storage space is an integer power of 2, then based on the height data of the pixel block, the pixel block position data of the read current pixel row in the target image, and the depth of the storage space, the address interval corresponding to the current pixel row is determined, and the address interval is the address interval between the current pixel row and the pixel rows adjacent to the current pixel row; based on the address interval, the read address of the current pixel row is determined.

[0052] Specifically, the read address of the current pixel row is determined based on the read address of the previous pixel row adjacent to the current pixel row and the address interval corresponding to the current pixel row.

[0053] For example, taking the target image with width W and height H, and the pixel block with width BW and height BH, and outputting pixel coordinates (x, y) as an example, the address changes at certain intervals each time data is read from SRAM.

[0054] Continuing with the previous example, if the depth of the storage space is W / BW×BH=2 n If n is a positive integer, then the address interval of the current pixel row read is inter_blk.

[0055]

[0056] in, 'n' represents the pixel block position data of the current pixel row in the target image. Pixel block position data refers to which pixel block in the target image the current pixel row is located in.

[0057] Furthermore, if the depth of the storage space is not equal to an integer power of 2, then obtain the address intervals corresponding to the current pixel row and its adjacent pixel rows when the depth of the storage space is equal to an integer power of 2; determine the difference between the coordinate data of the current pixel row in the target image and the pixel block position data of the current pixel row in the target image; based on the address intervals corresponding to the current pixel row and its adjacent pixel rows when the depth of the storage space is equal to an integer power of 2, and the difference data, determine the address interval corresponding to the current pixel row; and based on the address interval, determine the read address of the current pixel row.

[0058] Continuing with the previous example, if the depth of the storage space W / BW*BH ≠ 2 n If n is a positive integer, then the address interval of the current pixel row read is inter_blk_rd.

[0059]

[0060] inter_blk(n) represents the address interval of the current pixel row when the depth of the storage space is a power of 2, and inter_blk(n-1) represents the address interval of the left adjacent pixel row of the current pixel row when the depth of the storage space is a power of 2.

[0061] Furthermore, the read address is cleared to zero after reading BH pixels.

[0062] In an exemplary embodiment of this application, determining the read address of the image data of the target image specifically includes: for each current pixel block included in the image data of the target image, if the written data in the storage space is a pixel row, the read data in the storage space is a pixel block, and the depth of the storage space is an integer power of 2, then based on the width data of the pixel block, the width data of the target image, the pixel block position data of the read pixel row in the current pixel block in the target image, and the depth of the storage space, determining the address interval of the pixel row in the current pixel block, the address interval including the address interval between the pixel row in the current pixel block and the pixel row adjacent to the pixel row; and based on the address interval, determining the read address of the pixel row in the current pixel block.

[0063] Specifically, the read address of the pixel row in the current pixel block is determined based on the read address of the previous pixel row adjacent to the pixel row in the current pixel block and the address interval corresponding to the pixel row in the current pixel block.

[0064] Similarly, taking the target image's width data as W, height data as H, pixel block width data as BW, height data as BH, and output pixel coordinates (x, y) as an example, the address changes at certain intervals each time data is read from SRAM.

[0065] For example, if the depth of the storage space is W / BW*BH = 2 n If n is a positive integer, then the address interval of the current pixel row read is inter_blk.

[0066]

[0067] in, n represents the pixel block position data in the target image of the pixel row in the current pixel block.

[0068] Furthermore, if the depth of the storage space is not equal to an integer power of 2, then obtain the address intervals of the pixel rows in the current pixel block and the pixel rows adjacent to the pixel rows when the depth of the storage space is equal to an integer power of 2; determine the difference between the coordinate data of the pixel rows in the current pixel block and the pixel block position data of the pixel rows in the target image; based on the address intervals and difference data of the pixel rows in the current pixel block and the pixel rows adjacent to the pixel rows when the depth of the storage space is equal to an integer power of 2, as well as the width data of the target image and the width data of the current pixel block, determine the address interval of the pixel rows in the current pixel block; based on the address interval, determine the read address of the pixel rows in the current pixel block.

[0069] For example, if the depth of the storage space W / BW*BH≠2n If n is a positive integer, then the address interval of the current pixel row read is inter_blk_rd.

[0070]

[0071] Where inter_blk(n) represents the address interval of the pixel row in the current pixel block when the depth of the storage space is a power of 2, inter_blk(n-1) represents the address interval of the left adjacent pixel row in the current pixel block when the depth of the storage space is a power of 2, and y represents the coordinate data of the pixel row in the current pixel block in the target image. This represents the difference between the coordinates of the pixel row in the current pixel block within the target image and the pixel block position data of the pixel row within the target image.

[0072] Furthermore, the read address is cleared to zero after each BH pixel row is read.

[0073] In an exemplary embodiment of this application, determining the read address where the image data of the target image is located specifically includes: constructing an address interval table, which includes the address intervals corresponding to pixel rows; and obtaining the read address where the target image data is located based on the address interval table.

[0074] For example, the value of the address interval inter_blk is... By using a unit loop, the hardware can obtain the address interval by looking up the address interval table, thus reducing computational resources. Taking BH=32, BW=32, W=4096 as an example, the address interval table inter_blk is shown in Table 1.

[0075] Table 1 Address Interval Table

[0076] Write pixel block, read pixel row, write pixel row, read pixel block, ninter_blk, inter_blk111232128310244485125256166220487646482048291625610512811410241212832 surface

[0077] Figure 2 is a flowchart illustrating a data writing method provided in an exemplary embodiment of this application. Exemplarily, the data writing method provided in this embodiment is applied to a writing control unit. As shown in Figure 2, the data writing method provided in this embodiment includes the following steps.

[0078] Step S210: In response to the data write command, acquire the image data of the target image.

[0079] The image data of the target image includes pixel blocks or pixel rows corresponding to the target image. For a more detailed explanation of the image data of the target image, please refer to the embodiment shown in Figure 1.

[0080] Step S220: Determine the write address where the image data of the target image is located.

[0081] In one implementation, for each current pixel block included in the image data of the target image, if the data to be written in the storage space is a pixel block and the data to be read in the storage space is a pixel row, then based on the height data of the pixel block, the pixel block position data of the pixel row in the current pixel block in the target image, and the depth of the storage space, the address interval corresponding to the pixel row in the current pixel block is determined. The address interval is the address interval between the pixel row in the current pixel block and the pixel row adjacent to the pixel row. Based on the address interval, the write address of the pixel row in the current pixel block is determined.

[0082] Specifically, the write address corresponding to the pixel row in the current pixel block is determined based on the write address of the previous pixel row adjacent to the pixel row in the current pixel block and the address interval corresponding to the pixel row in the current pixel block.

[0083] In this embodiment, regardless of whether the depth of the storage space is a power of 2, the address interval of the pixel rows in the current pixel block is the same. For example, taking the target image's width data as W, height data as H, pixel block width data as BW, height data as BH, and outputting pixel coordinates (x, y) as an example, each time data is read from SRAM, the address changes at a certain interval, assuming the address interval is inter_blk.

[0084]

[0085] As mentioned above,

[0086] In another implementation, for each current pixel row included in the image data of the target image, if the data written in the storage space is a pixel row and the data read in the storage space is a pixel block, then the address interval of the current pixel row is determined based on the width data of the pixel block, the width data of the target image, the pixel block position data of the current pixel row in the target image, and the depth of the storage space; and the write address of the current pixel row is determined based on the address interval.

[0087] Specifically, the write address of the current pixel row is determined based on the write address of the previous pixel row adjacent to the current pixel row and the address interval corresponding to the current pixel row.

[0088] Similarly, regardless of whether the depth of the storage space is a power of 2, the address interval of the current pixel row is the same, which is inter_blk.

[0089]

[0090] As mentioned above,

[0091] Step S230: Based on the write address, write the image data of the target image into the storage space.

[0092] For example, the storage space is the storage space in SRAM.

[0093] Furthermore, the writing and reading of image data can be divided into three stages. In the first stage, rows 1 to BH of the target image are written to the storage space. In the second stage, rows BH+1 to H of the target image are written to the storage space. During the second stage, for every BW pixels written, the read control unit reads BW pixels from the SRAM. In the third stage, after writing row H, only a read operation is performed. In related technologies, image data is typically written to one storage space while image data is read from another storage space. This method consumes a significant amount of storage space and hardware resources.

[0094] In this embodiment, by selecting SRAM as the memory, data write latency can be reduced, ensuring the real-time performance of image data writing and avoiding excessive hardware resource consumption. Furthermore, this embodiment supports writing image data to target images of any size, and the addressing method is simple.

[0095] In one exemplary embodiment, the write control unit controls the writing of image data into the SRAM and the calculation of the write interval address; the read control unit controls the reading of image data from the SRAM and the calculation of the read interval address.

[0096] The method embodiments of this application have been described in detail above with reference to Figures 1 and 2. The apparatus embodiments of this application will be described in detail below with reference to Figures 3 and 4. It should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be referred to the preceding method embodiments.

[0097] Figure 3 is a schematic diagram of the structure of a data reading device provided in an exemplary embodiment of this application. As shown in Figure 3, the data reading device 30 provided in this embodiment includes:

[0098] The determination module 310 is used to determine the reading address where the image data of the target image is located in response to the data reading command. The image data of the target image includes the pixel blocks or pixel rows corresponding to the target image.

[0099] The acquisition module 320 is used to acquire image data of the target image from the storage space based on the read address;

[0100] The sending module 330 is used to send the image data of the target image to the data processing unit.

[0101] In one embodiment of this application, the determining module 310 is further configured to determine the size of the storage space based on the width data of the target image and the height data corresponding to the pixel blocks of the target image if the written data in the storage space is a pixel row and the read data in the storage space is a pixel block, or if the written data in the storage space is a pixel block and the read data in the storage space is a pixel row.

[0102] In one embodiment of this application, the determining module 310 is further configured to, for each current pixel row included in the image data of the target image, if the written data in the storage space is a pixel block, the read data in the storage space is a pixel row, and the depth of the storage space is an integer power of 2, determine the address interval corresponding to the current pixel row based on the height data of the pixel block, the pixel block position data of the read current pixel row in the target image, and the depth of the storage space, wherein the address interval is the address interval between the current pixel row and the pixel rows adjacent to the current pixel row; and determine the read address of the current pixel row based on the address interval.

[0103] In one embodiment of this application, the determining module 310 is further configured to, for each current pixel row included in the image data of the target image, if the written data in the storage space is a pixel block, the read data in the storage space is a pixel row, and the depth of the storage space is an integer power of 2, determine the address interval corresponding to the current pixel row based on the height data of the pixel block, the pixel block position data of the read current pixel row in the target image, and the depth of the storage space, wherein the address interval is the address interval between the current pixel row and the pixel rows adjacent to the current pixel row; and determine the read address of the current pixel row based on the address interval.

[0104] In one embodiment of this application, the determining module 310 is further configured to, for each current pixel block included in the image data of the target image, if the written data in the storage space is a pixel row, the read data in the storage space is a pixel block, and the depth of the storage space is an integer power of 2, determine the address interval of the pixel row in the current pixel block based on the width data of the pixel block, the width data of the target image, the pixel block position data of the read pixel row in the current pixel block in the target image, and the depth of the storage space, the address interval includes the address interval between the pixel row in the current pixel block and the pixel row adjacent to the pixel row; and determine the read address of the pixel row in the current pixel block based on the address interval.

[0105] In one embodiment of this application, the determining module 310 is further configured to: if the depth of the storage space is not equal to an integer power of 2, obtain the address intervals of the pixel rows in the current pixel block and the pixel rows adjacent to the pixel rows when the depth of the storage space is equal to an integer power of 2; determine the difference data between the coordinate data of the pixel rows in the current pixel block and the pixel block position data of the pixel rows in the target image; determine the address interval of the pixel rows in the current pixel block based on the address intervals and difference data of the pixel rows in the current pixel block and the pixel rows adjacent to the pixel rows when the depth of the storage space is equal to an integer power of 2, the width data of the target image and the width data of the current pixel block; and determine the read address of the pixel rows in the current pixel block based on the address intervals.

[0106] In one embodiment of this application, the determining module 310 is further configured to construct an address interval table, which includes the address intervals corresponding to pixel rows; and obtain the reading address where the target image data is located based on the address interval table.

[0107] In one embodiment of this application, the storage space is the storage space in a static random access memory.

[0108] Figure 4 is a schematic diagram of the structure of a data writing device provided in an exemplary embodiment of this application.

[0109] As shown in Figure 4, in this embodiment of the application, the data writing device 40 includes:

[0110] The acquisition module 410 is used to acquire image data of the target image in response to a data write command. The image data of the target image includes pixel blocks or pixel rows corresponding to the target image.

[0111] The determination module 420 is used to determine the write address where the image data of the target image is located;

[0112] The writing module 430 is used to write the image data of the target image into the storage space based on the writing address.

[0113] In one embodiment of this application, the determining module 420 is further configured to, for each current pixel block included in the image data of the target image, if the written data in the storage space is a pixel block and the read data in the storage space is a pixel row, determine the address interval corresponding to the pixel row in the current pixel block based on the height data of the pixel block, the pixel block position data of the pixel row in the current pixel block in the target image, and the depth of the storage space, wherein the address interval is the address interval between the pixel row in the current pixel block and the pixel row adjacent to the pixel row; and determine the write address of the pixel row in the current pixel block based on the address interval.

[0114] In one embodiment of this application, the determining module 420 is further configured to determine the write address where the image data of the target image is located, including: for each current pixel row included in the image data of the target image, if the write data in the storage space is a pixel row and the read data in the storage space is a pixel block, then based on the width data of the pixel block, the width data of the target image, the pixel block position data of the current pixel row in the target image, and the depth of the storage space, the address interval of the current pixel row is determined; based on the address interval, the write address of the current pixel row is determined.

[0115] The electronic device according to an embodiment of the present application will now be described with reference to FIG5. FIG5 is a schematic diagram of the structure of an electronic device provided in an exemplary embodiment of the present application.

[0116] As shown in Figure 5, the electronic device 50 includes one or more processors 501 and memory 502.

[0117] The processor 501 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device 50 to perform desired functions.

[0118] The memory 502 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 501 may execute the program instructions to implement the methods of the various embodiments of this application described above and / or other desired functions. The computer-readable storage medium may also store various contents such as data read commands, read addresses where image data is located, pixel blocks, pixel rows, data write commands, and write addresses where image data is located.

[0119] In one example, the electronic device 50 may also include an input device 503 and an output device 504, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0120] The input device 503 may include, for example, a keyboard, a mouse, etc.

[0121] The output device 504 can output various information to the outside, including data read commands, read addresses of image data, pixel blocks, pixel rows, data write commands, write addresses of image data, etc. The output device 504 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0122] Of course, for simplicity, Figure 5 only shows some of the components of the electronic device 50 that are relevant to this application, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 50 may include any other suitable components depending on the specific application.

[0123] In addition to the methods and apparatus described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods described above according to various embodiments of this application.

[0124] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this application. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0125] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods described above according to various embodiments of this application.

[0126] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0127] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.

[0128] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0129] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.

[0130] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0131] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A data reading method, characterized in that, include: In response to a data read command, the read address of the image data of the target image is determined, wherein the image data of the target image includes pixel blocks or pixel rows corresponding to the target image; Based on the read address, the image data of the target image is obtained from the storage space; The image data of the target image is sent to the data processing unit; The step of determining the read address of the image data of the target image includes: for each current pixel row included in the image data of the target image, if the written data in the storage space is the pixel block, the read data in the storage space is the pixel row, and the depth of the storage space is an integer power of 2, then based on the height data of the pixel block, the read pixel block position data of the current pixel row in the target image, and the depth of the storage space, determining the address interval corresponding to the current pixel row, wherein the address interval is the address interval between the current pixel row and the pixel rows adjacent to the current pixel row; if the depth of the storage space is not... If the depth of the storage space is a power of 2, then obtain the address intervals corresponding to the current pixel row and its adjacent pixel rows when the depth of the storage space is a power of 2; determine the difference between the coordinate data of the current pixel row in the target image and the pixel block position data of the current pixel row in the target image; based on the address intervals corresponding to the current pixel row and its adjacent pixel rows when the depth of the storage space is a power of 2, and the difference data, determine the address interval corresponding to the current pixel row; based on the address interval, determine the read address of the current pixel row.

2. The method according to claim 1, characterized in that, If the data written in the storage space is the pixel row and the data read in the storage space is the pixel block, or if the data written in the storage space is the pixel block and the data read in the storage space is the pixel row, then the size of the storage space is determined based on the width data of the target image and the height data corresponding to the pixel block of the target image.

3. The method according to claim 1 or 2, characterized in that, The step of determining the read address of the target image data includes: constructing an address interval table, which includes address intervals corresponding to pixel rows; and obtaining the read address of the target image data based on the address interval table.

4. The method according to claim 1 or 2, characterized in that, The storage space is the storage space in a static random access memory.

5. The method according to claim 1, characterized in that, Before determining the read address of the image data of the target image in response to the data read command, the method further includes: acquiring the image data of the target image in response to the data write command, wherein the image data of the target image includes pixel blocks or pixel rows corresponding to the target image; determining the write address of the image data of the target image; and writing the image data of the target image into a storage space based on the write address; wherein determining the write address of the image data of the target image includes: for each current pixel block included in the image data of the target image, if the write data in the storage space is the pixel block and the read data in the storage space is the pixel row, then based on the height data of the pixel block, the pixel block position data of the pixel row in the current pixel block in the target image, and the depth of the storage space, determining the address interval corresponding to the pixel row in the current pixel block, wherein the address interval is the address interval between the pixel row in the current pixel block and the pixel row adjacent to the pixel row; and determining the write address of the pixel row in the current pixel block based on the address interval.

6. The method according to claim 5, characterized in that, Determining the write address of the image data of the target image includes: for each current pixel row included in the image data of the target image, if the write data in the storage space is the pixel row and the read data in the storage space is the pixel block, then based on the width data of the pixel block, the width data of the target image, the pixel block position data of the current pixel row in the target image, and the depth of the storage space, determining the address interval of the current pixel row; and based on the address interval, determining the write address of the current pixel row.

7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for execution by a processor of the method described in any one of claims 1 to 6.

8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to perform the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data processing method and device

    CN108961147A