An image display method, program product, device and storage medium
Patent Information
- Application Number
- CN202610947733.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-09-01
AI Technical Summary
[0004]然而,第一种显示方式需要按行读取多张图像的整行像素数据,当多张图像存在重叠关系时需要交替输出不同图像的像素数据,因此需要为每张图像准备存储设备(如静态随机存取存储器,Static Random-Access Memory,SRAM)进行数据缓存,以避免数据阻塞问题,该方式虽然只占用一条读通道,但需要消耗较多的存储资源暂存返回的像素数据,且分辨率越高、图像数量越多,则占用的存储资源越多;第二种方式虽然无需通过存储设备按行存储读数据,但会同时占用较多的通道资源
[0015]As can be seen, this application acquires an image frame to be displayed, divides the image frame to be displayed into various regions according to the column edges of all images in the image frame; in the row direction, a single-channel DMA tile read command is initiated on a unit of a single region segment, and the received pixel data related to the tile read command is sent to the display, wherein the image frame to be displayed includes the pixel data.
Smart Images

Figure CN122672736A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image display technology, and in particular to an image display method, program product, device and storage medium. Background Technology
[0002] With the rapid development of computer technology, displays equipped with text, graphics, images, animation, and video display functions have been widely used in various fields (such as security monitoring, advertising, and entertainment playback). However, current displays have problems when displaying multiple images or video areas, including complex overlapping relationships between multiple images, easy interruption of real-time image output, and high cache resource consumption for prefetching images.
[0003] To address the aforementioned issues, the following display methods have been proposed: One method involves scanning each row of the current frame to be displayed sequentially from top to bottom, determining which images are located on the current scan row, and then generating DMA (Direct Memory Access) read commands for these images based on their starting address, position coordinates, width, height, and current row number. After all DMA read commands for the current scan row have been processed, the read pixel data is written to the storage device, and then the read data from the storage device is sequentially sent to the display screen for display. The other method involves creating independent DMA read channels for each image, allowing pixel data from different images to be read simultaneously through the DMA read channels. When sending the data to the display, the current coordinates are used to determine which image range the image falls within, thus receiving the pixel data from these channels and selecting the final output based on display priority.
[0004] However, the first display method requires reading entire rows of pixel data from multiple images line by line. When multiple images overlap, the pixel data of different images needs to be output alternately. Therefore, a storage device (such as Static Random-Access Memory, SRAM) is needed for each image to cache data and avoid data blocking. Although this method only occupies one read channel, it consumes a lot of storage resources to temporarily store the returned pixel data. The higher the resolution and the more images, the more storage resources are consumed. The second method, although it does not require storing read data line by line through a storage device, still consumes a lot of channel resources. In summary, the current display method cannot simultaneously balance channel resources and storage resources, and the resource consumption increases with the number of images displayed simultaneously. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide an image display method, program product, device, and storage medium that can display a single image or multiple images through a single read channel, thereby saving channel resources. Furthermore, it eliminates the need for additional storage devices for data caching, thus saving storage resources. In addition, it simultaneously considers both channel and storage resources, thereby reducing the cost of image display. The specific solution is as follows: In a first aspect, this application discloses an image display method, comprising: Obtain the image frame to be displayed, and divide the image frame to be displayed into various regions according to the column edges of all images in the image frame; In the row direction, a single-channel DMA tile read command is initiated on a unit of a single region segment, and the received pixel data related to the tile read command is sent to the display, wherein the image frame to be displayed includes the pixel data.
[0006] Optionally, the step of initiating a single-channel DMA tile read command in the row direction on a per-segment basis includes: The target image corresponding to each of the aforementioned regions is determined line by line, wherein the target image is the image to which the tile to be displayed in the corresponding region belongs; When determining the target image corresponding to each region segment in any row, a single-channel DMA tile read command is initiated sequentially to the target address where the corresponding target image is located, according to the arrangement order of each region segment.
[0007] Optionally, determining the target image corresponding to each of the aforementioned regions line by line includes: Determine whether each region segment is within each of the aforementioned images, line by line. If any region is within at least two of the images, the corresponding target image is determined according to the image overlay priority; If any region is within a single image, that single image is determined as the corresponding target image; If any region segment is not present in all images, the background of the image frame is determined as the corresponding target image.
[0008] Optionally, the step of determining whether each region segment is within each of the images line by line includes: Determine whether the row number is within the height range of each image; When a certain number of rows is within the height range of at least one image, the area segment covered by the height range of at least one image is determined based on the boundaries of each area segment.
[0009] Optionally, if any region segment is within at least two of the images, determining the corresponding target image according to the image overlay priority includes: If any region is located within at least two of the images, the image with the highest overlay priority among the at least two images is determined as the target image corresponding to that region.
[0010] Optionally, the step of sequentially initiating a single-channel DMA tile read command to the target address where the corresponding target image is located according to the arrangement order of the various region segments includes: When any region segment is selected, determine whether the corresponding target image is the background of the image frame; If the corresponding target image is not the background of the image frame, then a single-channel DMA tile read command is initiated to the target address where the corresponding target image is located according to the boundary of the current region segment and the row number of the current row; If the corresponding target image is the background of the image frame, then continue to select the next region segment until all regions in the current row have been selected.
[0011] Optionally, when executing the step of initiating a single-channel DMA tile read command in the row direction on a per-segment basis, and sending the received pixel data related to the tile read command to the display, the method further includes: Each time a tile read command is initiated, the command counter value is incremented by 1. Each time pixel data related to the tile read command is received, the command count value is decremented by 1. If the command count reaches the first count threshold, stop initiating single-channel DMA tile read commands on a per-segment basis, until the command count drops to the second count threshold, then continue initiating single-channel DMA tile read commands on a per-segment basis.
[0012] Secondly, this application discloses a computer program product, including a computer program that, when executed by a processor, implements the aforementioned image display method.
[0013] Thirdly, this application discloses an electronic device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the aforementioned image display method.
[0014] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned image display method.
[0015] As can be seen, this application acquires an image frame to be displayed, divides the image frame to be displayed into various regions according to the column edges of all images in the image frame; in the row direction, a single-channel DMA tile read command is initiated on a unit of a single region segment, and the received pixel data related to the tile read command is sent to the display, wherein the image frame to be displayed includes the pixel data.
[0016] This application first divides the image frame to be displayed into multiple regions according to the column edges of all images in the image frame. Then, in the row direction, it initiates a single-channel DMA tile read command on a per-region basis and sends the received pixel data related to the tile read command to the display. Through this method, single-image / multiple-image display can be achieved with only a single read channel, thus saving channel resources. Furthermore, this application specifically uses a single read channel for image data reading and caching, eliminating the need for additional storage devices for data caching, thereby saving storage resources. Therefore, this application can simultaneously consider both channel and storage resources, thus saving image display costs. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 This is a flowchart of an image display method disclosed in this application; Figure 2 This is a schematic diagram of a specific image frame to be displayed as disclosed in this application; Figure 3 This is a schematic diagram of a specific image frame division method disclosed in this application; Figure 4 This is a schematic diagram of a specific image frame scanning method disclosed in this application; Figure 5 This is a schematic diagram of a state machine-based block reading command sending process disclosed in this application; Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0019] 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.
[0020] This application discloses an image display method, see [link to relevant documentation] Figure 1 As shown, the method includes: Step S11: Obtain the image frame to be displayed, and divide the image frame to be displayed into various regions according to the column edges of all images in the image frame.
[0021] In this embodiment, the image frame to be displayed on the screen (i.e., the image frame to be displayed) is first obtained, see [link to relevant documentation]. Figure 2 As shown, there are three overlapping images in the image frame to be displayed, namely image A, image B and image C; then, the image frame to be displayed is divided according to the column edges (such as column boundaries) of the three images in the image frame to obtain multiple region segments (seg).
[0022] Specifically, dividing the image frame to be displayed into various regions according to the column edges of all images in the image frame may include: Obtain the column boundary coordinates of each image in the image frame; sort the column boundary coordinates of multiple images in ascending order to obtain sorted boundary coordinates; divide the image frame to be displayed into multiple regions based on the sorted boundary coordinates from left to right.
[0023] For example, see Figure 3 As shown, the three left boundary coordinates (st) and three right boundary coordinates (end) of images A, B, and C in the image frame to be displayed are obtained respectively. Then, the six boundary coordinates are sorted in ascending order, and the sorted six boundary coordinates are assigned to seg1_st, seg1_end, seg2_st, seg2_end, seg3_st, seg3_end, seg4_st, seg4_end, seg5_st, and seg5_end, thereby dividing the image frame to be displayed into five regions (seg1, seg2, seg3, seg4, and seg5).
[0024] Wherein, the value of seg1_st is the left boundary coordinate of image A, representing the left boundary of the first region segment (i.e., seg1); the value of seg1_end is the left boundary coordinate of image B, representing the right boundary of the first region segment (i.e., seg1). The value of seg2_st is the coordinate of the left boundary of image B, representing the left boundary of the second region segment (i.e., seg2); the value of seg2_end is the coordinate of the left boundary of image C, representing the right boundary of the second region segment (i.e., seg2). The value of seg3_st is the coordinate of the left boundary of image C, representing the left boundary of the third region segment (i.e., seg3); the value of seg3_end is the coordinate of the right boundary of image C, representing the right boundary of the third region segment (i.e., seg3). The value of seg4_st is the right boundary coordinate of image C, representing the left boundary of the fourth region segment (i.e., seg4); the value of seg4_end is the right boundary coordinate of image B, representing the right boundary of the fourth region segment (i.e., seg4). The value of seg5_st is the right boundary coordinate of image B, representing the left boundary of the fifth region segment (i.e., seg5); the value of seg5_end is the right boundary coordinate of image A, representing the right boundary of the fifth region segment (i.e., seg5).
[0025] It should be pointed out that, Figure 3 The leftmost and rightmost regions containing no images can be excluded from being divided into regions (segments). Furthermore, the left boundary coordinates of the same image are less than the right boundary coordinates.
[0026] Step S12: In the row direction, initiate a single-channel DMA tile read command on a per-segment basis, and send the received pixel data related to the tile read command to the display, wherein the image frame to be displayed includes the pixel data.
[0027] In this embodiment, Figure 3 After the image frame is divided into 5 segments (seg), these segments can be scanned row by row from top to bottom and left to right. During the scanning process, the image hit status is determined, such as whether the current segment is an image region or the highest priority image when multiple images overlap. If an image is hit (e.g., image A), a linear read command for the current image patch is sent to the read channel on a per-segment basis (e.g., seg1), so that the read channel can read the pixel data corresponding to the current image patch via DMA. Further, the pixel data corresponding to the current image patch read by the read channel is sent to the subsequent display chip to realize image display.
[0028] The image hit status can be obtained by determining whether the current scan line (cur_line) covers images A, B, and C. Specifically, the image hit status of a single scan line can be expressed as: cur_line_in_a = (line count >= left boundary of image A) && (line count <= right boundary of image A), cur_line_in_b = (line count >= left boundary of image B) && (line count <= right boundary of image B), or cur_line_in_c = (line count >= left boundary of image C) && (line count <= right boundary of image C). Here, the line count refers to the specific row number of the current scan line. cur_line_in_a represents the hit status of the current scan line on image A.
[0029] When a single scan line hits the image, the hit status of each region segment (seg) within the current scan line can be further determined. Specifically, this can be represented as: seg1_in_a = (seg1_st >= left boundary of Figure A) && (seg1_end <= right boundary of Figure A) && cur_line_in_a; seg1_in_b = (seg1_st >= left boundary of Figure B) && (seg1_end <= right boundary of Figure B) && cur_line_in_a; seg1_in_c = (seg1_st >= left boundary of Figure C) && (seg1_end <= right boundary of Figure C) && cur_line_in_a; seg2_in_a = (seg2_st >= left boundary of Figure A) && (seg2_end <= right boundary of Figure A) && cur_line_in_a; seg2_in_b = (seg2_st >= left boundary of Figure B) &&(seg2_end <= right boundary of Figure B) && cur_line_in_a; seg2_in_c = (seg2_st >= left boundary of Figure C) &&(seg2_end <= right boundary of Figure C) && cur_line_in_a; ...; seg5_in_a = (seg5_st >= left boundary of Figure A) && (seg5_end <= right boundary of Figure A) && cur_line_in_a; seg5_in_b = (seg5_st >= left boundary of Figure B) && (seg5_end <= right boundary of Figure B) && cur_line_in_a; seg5_in_c = (seg5_st >= left boundary of Figure C) && (seg5_end <= right boundary of Figure C) && cur_line_in_a. Where seg1_in_a represents the hit status of the first region segment (e.g., seg1) within the current scan line in image A.
[0030] It should be noted that when sorting the boundary coordinates in ascending order, if two or more left and right boundaries are equal, it means that the left boundary of some regions (i.e., seg) will be equal to the right boundary. In this case, these regions (i.e., seg) will not be visible when segmenting the image. To deal with this, when judging the coverage of each row's regions (i.e., seg) on the image, these regions (i.e., seg) can be directly excluded, that is, the hit mark is assigned a value of 0.
[0031] In this embodiment, initiating a single-channel DMA tile read command in the row direction, on a per-segment basis, may specifically include: The target image corresponding to each of the aforementioned regions is determined row by row. The target image is the image to which the tile to be displayed in the corresponding region belongs. When determining the target image corresponding to each region in any row, a single-channel DMA tile read command is initiated sequentially to the target address where the corresponding target image is located, according to the arrangement order of the aforementioned regions.
[0032] See Figure 4 As shown, the entire image frame to be displayed is scanned line by line from top to bottom and left to right. During the scanning process, five regions (seg) are scanned sequentially. During the scanning process, the image to be displayed in the currently scanned region segment of row P (such as seg1) is determined, thus obtaining the target image (i.e., Figure 1 ).
[0033] It should be noted that when determining the target image corresponding to each region segment (seg) in any row (such as row P), the read command can be initiated sequentially to the target address (i.e., the address where image A is stored) of the corresponding target image (such as image A) in the order of the region segments (seg) (i.e., seg1, seg2, seg3, seg4, seg5) using a single-channel DMA method.
[0034] In this embodiment, determining the target image corresponding to each of the aforementioned regions line by line may specifically include: Each region segment is determined line by line to see if it is within each of the images. If any region segment is within at least two images, the corresponding target image is determined according to the image overlay priority. If any region segment is within a single image, that single image is determined as the corresponding target image. If any region segment is not within any of the images, the background of the image frame is determined as the corresponding target image.
[0035] See Figure 4 As shown, during the process of scanning the entire image frame to be displayed line by line, it is determined whether each region segment (seg) in the current scan line (such as the P-th line) is within the image (i.e., whether it covers the image). If a region segment (such as seg2 in the P-th line) covers multiple images (image A and image B), the corresponding target image is determined according to the image overlay priority. If a region segment (such as seg1 in the P-th line) is within a single image (i.e., image A), the single image (i.e., image A) is determined as the corresponding target image. If a region segment (such as seg1 in the Q-th line) is not within all images, the background of the image frame is determined as the corresponding target image.
[0036] Specifically, the process of determining whether each region segment is within each of the images line by line may include: determining whether the number of its rows is within the height range of each of the images; and when the number of rows is determined to be within the height range of at least one image, determining the region segment covered by the height range of at least one image based on the boundary of each region segment.
[0037] In this embodiment, the height range of each image can be obtained first. For example, the height range of image A is from scan lines 10 to 22. When scanning each image frame line by line, it is determined whether the number of the current scan line is within the height range of one or more images. If it is within the height range of one or more images, the area segment covered by the height range of at least one image is further determined based on the left and right boundaries of each region segment (seg).
[0038] For example, see Figure 4 As shown, if the current scan line (such as line P) is within the height range of images A, B, and C, then the height range of image A is further determined to be seg1 to seg5, the height range of image B is seg2 to seg4, and the height range of image C is seg3, based on the left and right boundaries of each region segment (seg).
[0039] In this embodiment, the step of determining the corresponding target image according to the superposition priority of the images if any region segment is within at least two images can specifically include: if any region segment is within at least two images, determining the image with the highest superposition priority among the at least two images as the target image corresponding to that region segment.
[0040] For example, see Figure 4 As shown, if a certain region segment (such as seg2 in row P) covers multiple images (image A and image B), then the corresponding target image is determined as image B according to the image overlay priority (such as image C > image B > image A).
[0041] Specifically, the hit flag for each region segment (seg) can be obtained based on the display priority. If the current scan line covers multiple images within the same region segment (seg), the image that should actually be displayed in the current region segment (seg) is determined according to the image overlay priority; if no image is covered, it is marked as the background color. For example, when scanning line P, because the image overlay priority is C>B>A, seg1, seg2, seg3, seg4, and seg5 in line P are marked as A, B, C, B, and A, respectively. When scanning line Q, since images A and B are not covered, cur_line_in_a / b are both 0. In this case, there is a region segment (seg) that does not cover any image. For this case, it can be marked as 0, indicating that the target image is the background color. For example, seg1, seg2, seg3, seg4, and seg5 are marked as 0, 0, C, 0, and 0, respectively.
[0042] In this embodiment, the step of sequentially initiating a single-channel DMA tile read command to the target address where the corresponding target image is located according to the arrangement order of each of the aforementioned region segments can specifically include: when any region segment is selected, determining whether the corresponding target image is the background of an image frame; if the corresponding target image is not the background of an image frame, then initiating a single-channel DMA tile read command to the target address where the corresponding target image is located according to the boundary of the current region segment and the row number of the current row; if the corresponding target image is the background of an image frame, then continuing to select the next region segment until all region segments of the current row have been selected.
[0043] In this embodiment, whenever any region segment (seg) is selected, it is first determined whether the target image corresponding to that region segment (seg) is the background of the image frame. If it is not the background (e.g., ... Figure 4 If the current region (seg2) is defined in row P, then a read command is sent to the target address (i.e., the source address of the image) of the corresponding target image, based on the left and right boundaries of the current region (seg2) and the row number (P) of the current row, to retrieve the current image patch via single-channel DMA; if it is the background (e.g., ... Figure 4 If seg1 is in row Q, then continue to select the next segment (seg2) until all segments in the current row (seg1 to seg5) have been selected.
[0044] In this embodiment, the command generation timing of each row can be controlled by a state machine. The state machine can scan each region segment (seg) of each row from left to right to ensure that the read data and the sent display pixels are in the same order.
[0045] For details, see Figure 5As shown, multiple associated states can be set first: line_start -> seg1_state -> seg2_state -> seg3_state -> seg4_state -> seg5_state -> line_start. Then, read commands are generated using these associated states. For example, when scanning line P, the system first enters the line_start state and checks if the flag of seg1 is 0. If the flag of seg1 is not 0, it enters seg1_state; otherwise, if the flag of seg2 is not 0, it enters seg2_state, and so on. Next, it enters segN_state to generate a single-channel DMA read command. After receiving the DMA confirmation command, it switches to the next seg_state. It should be noted that when switching seg_states, it will not enter segs that have already been entered in the current scan line or segs with a flag of 0.
[0046] In one specific implementation, the generation of the single-channel DMA tile read command can be achieved as follows: When the image is in a certain region (i.e., segN_state), the current image to be displayed (e.g., image A) is determined based on the marker of that region (i.e., seg), and the address information of the image (including DMA read address, DMA read width, DMA read height, and DMA read depth) is calculated. Specifically, the DMA read address = image start address + offset address from the first row of the image to the current row + offset address from the first column of the image to the left boundary of seg; the DMA read width = segN_end – segN_st; and the DMA read height = 1 (since only one row is read at a time, it can be fixed at 1).
[0047] Next, based on the left and right boundaries of the current region segment and the row number of the current row, a single-channel DMA tile read command is initiated to the target address of the corresponding target image (i.e., the DMA read address in the address information above). The command type for the tile read command can be selected according to the actual application scenario. For example, a linear DMA read command can be selected, which ensures that the returned data is in pixels, facilitating direct display. It should be noted that linear DMA read commands require enabling command pre-buffering and decoupling the read command from the pixel data, allowing multiple commands to be in progress. This way, multiple read commands can be issued in advance, and the read data can be returned sequentially, ensuring a continuous stream of pixel data received from different read commands.
[0048] Understandably, since seg0 to seg5 are arranged from left to right, and the linear read commands for each segment are sent in this order, this aligns with the output order of the pixel data during display. This ensures that the returned pixel data is in the same order as the display data, thus avoiding data blocking issues. Furthermore, this application requires no additional storage resources (such as SRAM), significantly saving area overhead. Moreover, this application generates read commands in segments, avoiding the complex problem of simultaneous coverage of multiple images. Additionally, this application only requires a single DMA channel to complete the reading and display of multiple images, offering better compatibility and scalability when adjusting the number of images.
[0049] Specifically, when sending the returned pixel data to the display, scanning can start from the upper left corner of the actual display area. Before each output of pixel data, it is first determined whether the current pixel data is within any image range (i.e., the area corresponding to image A, image B, and image C). If it is within a certain image range, the returned pixel data is received and output as the pixel to be displayed. After receiving all the pixel data corresponding to a whole read command, it will continuously switch to the pixel data returned by the next read command. If it is not within any image range, the DMA is temporarily not received, that is, the pixel data returned by the DMA is not received, and only the background color is output.
[0050] In this embodiment, the step of executing a tile read command that initiates a single-channel DMA in the row direction on a per-segment basis, and sending the received pixel data related to the tile read command to the display, may further include: Each time a tile read command is initiated, the command count is incremented by 1; each time pixel data related to the tile read command is received, the command count is decremented by 1; if the command count reaches the first counting threshold, the initiation of single-channel DMA tile read commands on a per-region basis is stopped until the command count drops to the second counting threshold, at which point the initiation of single-channel DMA tile read commands on a per-region basis continues.
[0051] In this embodiment, during the line-by-line scanning process and the display of the current pixel data read via single-channel DMA, considering the limited number of outstanding commands in single-channel DMA, a counter can be set to count the number of commands that have been sent but whose return pixel data has not been fully received. Each time a tile read command is initiated, the command count is incremented by 1. Each time pixel data related to the tile read command is received, i.e., when a tile read command is completed, the command count is decremented by 1. When the command count reaches the first counting threshold (the threshold value is related to the outstanding capability of DMA), command sending is paused, i.e., single-channel DMA tile read commands are stopped from being initiated on a single region segment (seg). At this time, the state machine remains in the current state until the command count drops to the second counting threshold, at which point single-channel DMA tile read commands are resumed on a single region segment (seg). For example, a new command is not allowed to be sent until all the return data of the previous commands has been responded to.
[0052] For example, see Figure 4 As shown, when scanning line P, the process first enters the line_start state to determine the image hit status of seg1. Since seg1 hits image A, the process enters seg1_state, generating a single-channel DMA tile read command for seg1. Then, it checks if the flag of seg1 is 0. Since the flag of seg1 is A, the DMA read address is: the source address of image A + the line spacing stride of image A. (Current row count - first row of image A) + (seg1_st - left boundary of image A); DMA read width = seg1_end – seg1_st; DMA read height = 1 (fixed to 1). Next, see... Figure 5 As shown, the seg1 tile read command is sent and the system enters the rdma_ok state (remote direct memory access). The rdma_ok state will wait for the single-channel DMA to complete receiving the tile read command just sent (once the receiving is complete, there is no need to return to read the data immediately).
[0053] Furthermore, after the single-channel DMA reception is complete, the image hit status of seg2 is checked. Since seg2 hits images A and B (with higher priority than image A), the process enters seg2_state and generates a single-channel DMA tile read command for seg2. This command includes: DMA read address: source address of image B + stride of image B. (Current row count - first row of image B) + (seg2_st - left boundary of image B), DMA read width = seg2_end – seg2_st, DMA read height = 1 (fixed to 1).
[0054] Then, the tile read command for seg2 is sent, and the process enters rdma_ok. The rdma_ok state waits for the single-channel DMA to complete receiving the previously sent tile read command (reception is complete, no immediate return to read data is required). Once the single-channel DMA reception is complete, the image hit status of seg3 is checked. Since seg3 simultaneously hits three images, the process enters seg3_state again, and a single-channel DMA tile read command for seg3 is generated. This command includes: DMA read address: source address of image C + stride of image C. (Current row count - first row of image C) + (seg3_st - left boundary of image C), DMA read width = seg3_end – seg3_st, DMA read height = 1 (fixed to 1).
[0055] Furthermore, the tile read command for seg3 is sent, and the process enters rdma_ok. The rdma_ok state waits for the single-channel DMA to complete receiving the previously sent tile read command (reception is complete, no immediate return to read data is required). Once the single-channel DMA reception is complete, the image hit status of seg4 is checked. Since seg4 hits both images A and B (with higher priority than image A), the process enters seg4_state again and generates a single-channel DMA tile read command for seg4. This command includes: DMA read address: source address of image B + line spacing stride of image B. (Current row count - first row of image B) + (seg4_st - left boundary of image B), DMA read width = seg4_end – seg4_st, DMA read height = 1 (fixed to 1).
[0056] Next, the tile read command for seg4 is sent, and the process enters rdma_ok. The rdma_ok state waits for the single-channel DMA to complete receiving the previously sent tile read command (reception is complete, no immediate return to read data is required). Once the single-channel DMA reception is complete, the image hit status of seg5 is checked. Since seg5 hits image A, the process enters seg5_state again and generates a single-channel DMA tile read command for seg5. This command includes: DMA read address: source address of image A + stride of image A. (Current row count - first row of image A) + (seg5_st - left boundary of image A); DMA read width = seg5_end – seg5_st; DMA read height = 1 (fixed to 1).
[0057] Finally, the tile read command for seg5 is sent, and the rdma_ok state is entered. The rdma_ok state will wait for the single-channel DMA to complete receiving the tile read command just sent (receiving is complete, no need to return to read data immediately). When the single-channel DMA completes receiving, since seg1 to seg5 have all been judged, the line_start state is entered, and the command count value (i.e., the line count) is incremented by 1, thereby generating the read commands for each region segment (seg) of the next line.
[0058] In another specific implementation, see Figure 4 As shown, when scanning to line Q, the system first enters the line_start state to determine the image hit status of segment 1. Since neither segment 1 nor segment 2 has hit the image, it directly enters the segment 3_state, generating a single-channel DMA tile read command for segment 3. Then, it checks if the flag of segment 3 is 0. Since the flag of segment 3 is C, the DMA read address is: the source address of image C + the stride of image C. (Current line count - first line of image C) + (seg3_st - left boundary of image C); DMA read width = seg3_end – seg3_st; DMA read height = 1 (fixed to 1). Next, the tile read command for seg3 is sent, and the process enters rdma_ok. The rdma_ok state will wait for the single-channel DMA to complete receiving the tile read command just sent (receiving is complete, no need to immediately return to read data). When the single-channel DMA completes receiving, the image hit status of seg4 and seg5 is checked. Since neither seg4 nor seg5 hit the image, it is considered that seg1, seg2, seg3, seg4 and seg5 have been processed. At this time, the process enters the line_start state, and the command count value is incremented by 1.
[0059] It should be noted that since sending a read command before the display time is a prefetching behavior, if the pixel data returned by the previous command is not received in time, the command cache in the DMA may reach its outstanding maximum value. In this case, the DMA will refuse to receive new commands. This application can avoid this situation by setting a command count value, keeping the commands in transit within a controllable range. Furthermore, when the command count value reaches the threshold, it only needs to remain in the current segN_state state, waiting for the display to complete the reception of the return values of the previous commands. That is, after the previous command response is completed, the command count value decreases, and then a new command is issued.
[0060] As can be seen, this embodiment first divides the image frame to be displayed into multiple regions according to the column edges of all images in the image frame. Then, in the row direction, a single-channel DMA tile read command is initiated on a per-region basis, and the received pixel data related to the tile read command is sent for display. Through this method, single-image / multiple-image display can be achieved with only a single read channel, thus saving channel resources. Furthermore, this application specifically uses a single read channel for image data reading and caching, eliminating the need for additional storage devices for data caching, thus saving storage resources. Therefore, this application can simultaneously consider both channel and storage resources, thereby saving image display costs.
[0061] Accordingly, embodiments of this application also disclose an image display device, which includes: The acquisition module is used to acquire the image frame to be displayed; The segmentation module is used to divide the image frame to be displayed into various regions according to the column edges of all images in the image frame; The display module is used to initiate a single-channel DMA tile read command in the row direction, on a unit of a single region segment, and send the received pixel data related to the tile read command to the display, wherein the image frame to be displayed includes the pixel data.
[0062] The specific workflow of each of the above modules can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0063] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0064] Figure 6This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the image display method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0065] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0066] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0067] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the image display method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0068] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed image display method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0069] Furthermore, embodiments of this application also disclose a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the image display method disclosed above.
[0070] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0071] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0072] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0073] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0074] The above provides a detailed description of the image display method, program product, device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An image display method, characterized in that, include: Obtain the image frame to be displayed, and divide the image frame to be displayed into various regions according to the column edges of all images in the image frame; In the row direction, a single-channel DMA tile read command is initiated on a unit of a single region segment, and the received pixel data related to the tile read command is sent to the display, wherein the image frame to be displayed includes the pixel data.
2. The method according to claim 1, characterized in that, The step of initiating a single-channel DMA tile read command in the row direction, on a per-segment basis, includes: The target image corresponding to each of the aforementioned regions is determined line by line, wherein the target image is the image to which the tile to be displayed in the corresponding region belongs; When determining the target image corresponding to each region segment in any row, a single-channel DMA tile read command is initiated sequentially to the target address where the corresponding target image is located, according to the arrangement order of each region segment.
3. The method according to claim 2, characterized in that, The step of determining the target image corresponding to each of the aforementioned regions line by line includes: Determine whether each region segment is within each of the aforementioned images, line by line. If any region is within at least two of the images, the corresponding target image is determined according to the image overlay priority; If any region is within a single image, that single image is determined as the corresponding target image; If any region segment is not present in all images, the background of the image frame is determined as the corresponding target image.
4. The method according to claim 3, characterized in that, The step-by-step determination of whether each region segment is within each of the images includes: Determine whether the row number is within the height range of each image; When a certain number of rows is within the height range of at least one image, the area segment covered by the height range of at least one image is determined based on the boundaries of each area segment.
5. The method according to claim 3, characterized in that, If any region segment is located within at least two of the images, determining the corresponding target image according to the image overlay priority includes: If any region is located within at least two of the images, the image with the highest overlay priority among the at least two images is determined as the target image corresponding to that region.
6. The method according to claim 2, characterized in that, The step of sequentially initiating a single-channel DMA tile read command to the target address where the corresponding target image is located according to the arrangement order of each of the aforementioned region segments includes: When any region segment is selected, determine whether the corresponding target image is the background of the image frame; If the corresponding target image is not the background of the image frame, then a single-channel DMA tile read command is initiated to the target address where the corresponding target image is located according to the boundary of the current region segment and the row number of the current row; If the corresponding target image is the background of the image frame, then continue to select the next region segment until all regions in the current row have been selected.
7. The method according to any one of claims 1 to 6, characterized in that, When executing the step of initiating a single-channel DMA tile read command in the row direction on a per-segment basis, and sending the received pixel data related to the tile read command to the display, the method further includes: Each time a tile read command is initiated, the command counter value is incremented by 1. Each time pixel data related to the tile read command is received, the command count value is decremented by 1. If the command count reaches the first count threshold, stop initiating single-channel DMA tile read commands on a per-segment basis, until the command count drops to the second count threshold, then continue initiating single-channel DMA tile read commands on a per-segment basis.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the image display method as described in any one of claims 1 to 7.
9. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the image display method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the image display method as described in any one of claims 1 to 7.