Image overturning processing method and device, electronic equipment, storage medium and program product

By retrieving image data from the source storage area of ​​the memory chip and filling the data into the buffer, and calculating and storing the internal coordinates of the image data according to the flip mode, the problem of poor performance of the traditional image flip operator is solved and efficient image flip processing is achieved. .

CN118628358APending Publication Date: 2024-09-10SHANGHAI BIREN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410973899.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

When the traditional image flip operator processes images, due to the existence of padding data, the data rows are discontinuous and need to be processed multiple times. The access bandwidth is low and the performance is poor.

Method used

By fetching the associated data of the image to be flipped from the source storage area of ​​the memory chip to the buffer, including image data and filling data, the internal coordinates of the image data are calculated according to the flipping mode, and stored in the target storage area of ​​the memory chip, using the filling data Relative position relationships enable continuous storage and access.

Benefits of technology

The access bandwidth and system performance of image flip processing are improved, multiple loop processing is avoided, and processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628358A
    Figure CN118628358A
Patent Text Reader

Abstract

The invention provides an image flipping processing method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of chips, the method comprises the following steps: fishing associated data of a to-be-flipped image from a source storage area of a memory chip to a first on-chip buffer area; wherein the associated data comprises image data of the to-be-overturned image and filling data located around the image data and used for representing relative position information of the image data; calculating image internal coordinates after the image data is overturned according to the overturning mode, and storing the image data to a second on-chip buffer area according to the image internal coordinates; fishing second filling data corresponding to the distribution of the first filling data from a target storage area of the memory chip, and storing the second filling data in a second on-chip buffer area; wherein the relative position relationship between the second filling data in the second on-chip buffer area and the image data is the same as the relative position relationship between the first filling data in the first on-chip buffer area and the image data; and storing the image data of the second on-chip buffer area and the second filling data into a target storage area of the memory chip according to the address for fishing the second filling data. According to the image flipping processing method and device, the electronic equipment, the storage medium and the program product provided by the invention, the continuous storage data is fished to the on-chip buffer area and stored to the memory in the image flipping processing, the access bandwidth is improved, and the system performance is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and in particular to an image flipping processing method, device, electronic equipment, storage medium and program product. Background Art

[0002] For the image flip operator, the processed image includes image data and padding data located around the image data for indicating the relative position information of the image data. Since the display of the image is determined by the data content of the image, the image flip operator flips the image data in the image according to different modes when flipping the image, thereby realizing flipping of the image in different modes.

[0003] When performing image flipping, the traditional image flipping operator fetches the image data to be flipped from the source storage area of ​​the memory chip onto the chip, recalculates the flipping address of the image data in the target storage area of ​​the memory chip, and then stores the image data in the target storage area of ​​the memory chip.

[0004] In the traditional image flipping method, when retrieving and storing image data, due to the existence of padding data, the processed data rows are not continuous, and multiple cycles of processing are required, resulting in low access bandwidth and poor performance. Summary of the invention

[0005] The present invention provides an image flipping processing method, device, electronic equipment, storage medium and program product, which are used to solve the defect of poor system performance in image flipping processing in the prior art and improve system performance.

[0006] The present invention provides an image flipping processing method, comprising the following steps: extracting associated data of an image to be flipped from a source storage area of ​​a memory chip to a first on-chip buffer; wherein the associated data includes image data of the image to be flipped and first filling data located around the image data and used to represent relative position information of the image data, and the associated data is continuously stored data; according to a flipping mode, calculating the internal coordinates of the image after the image data is flipped, and storing the image data in a second on-chip buffer according to the internal coordinates of the image; extracting second filling data corresponding to the distribution of the first filling data from a target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; according to the address of extracting the second filling data, storing the image data and the second filling data in the second on-chip buffer to the target storage area of ​​the memory chip.

[0007] According to an image flipping processing method provided by the present invention, the associated data of the image to be flipped is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer, comprising: according to the flipping mode, respectively retrieving the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer through different streaming processing threads; wherein the part of the associated data processed by each of the streaming processing threads is continuously stored data.

[0008] According to an image flipping processing method provided by the present invention, according to the flipping mode, the allocated part of the associated data is respectively retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads, including: in response to the flipping mode being horizontal flipping, the allocated part of the associated data is respectively retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads in a top-to-bottom order; in response to the flipping mode including vertical flipping, the allocated part of the associated data is respectively retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads in a bottom-to-top order.

[0009] According to an image flipping processing method provided by the present invention, the internal coordinates of the image after the image data is flipped are calculated according to the flipping mode, and the image data is stored in a second on-chip buffer according to the internal coordinates of the image, including: for each of the streaming processing threads, the internal coordinates of the image after the image data in the allocated part of the associated data are calculated respectively, and the image data is stored in the second on-chip buffer according to the internal coordinates of the image; wherein the relative position relationship between the image data processed by each of the streaming processing threads in the first on-chip buffer and the second on-chip buffer remains unchanged.

[0010] According to an image flipping processing method provided by the present invention, the method also includes: each of the streaming processing threads executes in parallel the calculation of the internal coordinates of the image after the image data in the allocated part of the associated data is flipped, and stores the image data in the second on-chip buffer according to the internal coordinates of the image.

[0011] According to an image flipping processing method provided by the present invention, the method also includes: executing a first action and a second action in parallel; wherein the first action includes the action of retrieving associated data of the image to be flipped from a source storage area of ​​a memory chip to a first on-chip buffer; the second action includes the action of retrieving second filling data corresponding to the distribution of the first filling data from a target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer.

[0012] The present invention also provides an image flipping processing device, comprising the following modules: a first retrieval module, used to retrieve associated data of an image to be flipped from a source storage area of ​​a memory chip to a first on-chip buffer; wherein the associated data includes image data of the image to be flipped and first filling data located around the image data and used to represent relative position information of the image data, and the associated data is continuously stored data; a flipping module, used to calculate the internal coordinates of the image after the image data is flipped according to a flipping mode, and store the image data in a second on-chip buffer according to the internal coordinates of the image; a second retrieval module, used to retrieve second filling data corresponding to the distribution of the first filling data from a target storage area of ​​the memory chip, and store the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; a storage module, used to store the image data and the second filling data in the second on-chip buffer to the target storage area of ​​the memory chip according to the address of retrieving the second filling data.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned image flipping processing methods is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the image flipping processing method described above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the image flipping processing method described above is implemented.

[0016] The image flipping processing method, device, electronic device, storage medium and program product provided by the present invention extract the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer, the associated data includes the image data of the image to be flipped and the filling data located around the image data and used to represent the relative position information of the image data, calculate the internal coordinates of the image after the image data is flipped according to the flipping mode, store the image data in the second on-chip buffer according to the internal coordinates of the image, extract the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and store the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer, and store the image data and the second filling data in the second on-chip buffer in the target storage area of ​​the memory chip according to the address of extracting the second filling data, thereby realizing the extraction of continuous storage data to the on-chip buffer and storage in the memory in the image flipping processing, improving the access bandwidth and optimizing the system performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 This is one of the flow charts of the image flipping processing method provided by the present invention.

[0019] Figure 2 It is a schematic diagram of the processing flow between streaming processing threads when flipping in the vertical direction in the image flipping processing method provided by the present invention.

[0020] Figure 3 It is a schematic diagram of vertical image flip coordinate conversion in the image flip processing method provided by the present invention.

[0021] Figure 4 It is a schematic diagram of the coordinate conversion of image flipping in the horizontal and vertical directions in the image flipping processing method provided by the present invention.

[0022] Figure 5 This is the second flow chart of the image flipping processing method provided by the present invention.

[0023] Figure 6 It is a structural schematic diagram of the image flip processing device provided by the present invention.

[0024] Figure 7It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] Figure 1 FIG. 1 is one of the flow charts of the image flipping processing method provided by the present invention. Figure 1 As shown, the method includes: Step S1, fetching the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer; wherein the associated data includes the image data of the image to be flipped and first filling data located around the image data and used to represent the relative position information of the image data, and the associated data is continuously stored data.

[0027] The memory chip may be, for example, a CPU / GPU memory chip HBM. The source storage area of ​​the memory chip may be referred to as input memory. The associated data of the image to be flipped is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer, such as buffer1. In which, for the retrieval operation, the data in the source storage area is no longer retained. The associated data of the image to be flipped includes the image data of the image to be flipped and padding data (pad data) located around the image data and used to represent the relative position information of the image data. In which, the image data is valid data representing the image itself, such as channel-related data, which may be specifically embodied in numerical values. The padding data is located around the image data (it is not required to surround the image data) and is used to represent the relative position information of the image data, such as information including the relative position relative to the first address of the storage area, so as to clarify the specific position of the image data of the image to be flipped.

[0028] The associated data of the image to be flipped is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer, wherein the associated data includes image data and padding data, which are continuously stored data. Therefore, the image data and padding data in the associated data are processed simultaneously, avoiding the performance defects caused by the non-continuous storage data processing of only retrieving the image data. By simultaneously retrieving the image data and padding data from the source storage area of ​​the memory chip to the first on-chip buffer, the retrieval of continuously stored data is realized. For the processing of continuously stored data, one instruction can be used to implement it, avoiding multiple loop processing, which is conducive to improving the access bandwidth.

[0029] Step S2: Calculate the internal coordinates of the image after the image data is flipped according to the flip mode, and store the image data in a second on-chip buffer according to the internal coordinates of the image.

[0030] What actually changes when an image is flipped is the coordinates of the image data, which is reflected in the change in the positional relationship between the various data points of the image. For example, when flipping horizontally, the data points of the coordinates move to the right, and the data points on the right move to the left. Since the fill data represents the relative position information of the image data, the actual storage position of each data point in the image data can be determined by determining the coordinate position within the image.

[0031] According to the requirements of the flip mode, the internal coordinates of the image after the image data is flipped are calculated, and the image data is stored in the second on-chip buffer, such as buffer2, according to the internal coordinates of the image. Here, only the image data is processed, but the operation rate between the on-chips is faster.

[0032] Step S3, extracting second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer.

[0033] The target storage area of ​​the memory chip can be called an output memory. The target storage area of ​​the memory chip is a storage area for storing flipped image data. After the image to be flipped is flipped and stored in the target storage area, the filling data used to represent the relative position information of the image data needs to comply with the format requirements of the target storage area itself. The filling data can be directly retrieved from the target storage area to ensure that the format requirements are met. The second filling data retrieved from the target storage area is the same as the first filling data, and is used to represent the relative position relationship of the image data, and its distribution is the same as the first filling data.

[0034] The second padding data corresponding to the distribution of the first padding data is retrieved from the target storage area of ​​the memory chip, and the second padding data is stored in the second on-chip buffer. The second padding data is stored in the second on-chip buffer and is located around the image data. The relative position relationship between the second padding data and the image data in the second on-chip buffer is the same as the relative position relationship between the first padding data and the image data in the first on-chip buffer. Although the retrieval of the second padding data from the target storage area is a process of discontinuously storing data, since the padding data is very small compared to the image data, the impact on the final system performance is also small.

[0035] Step S4: storing the image data and the second filling data in the second on-chip buffer into the target storage area of ​​the memory chip according to the address of retrieving the second filling data.

[0036] According to the address of the second filling data, the image data and the second filling data of the second on-chip buffer are stored in the corresponding position of the target storage area of ​​the memory chip. The second filling data is stored in the address of the target storage area where the second filling data is retrieved. Since the second filling data and the image data are stored in the memory together, the continuous storage data is stored in the memory, which improves the access bandwidth. The image flip operator can be realized according to the image flip processing method provided by the present invention.

[0037] The image flipping processing method provided by the present invention extracts the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer, the associated data includes the image data of the image to be flipped and the filling data located around the image data and used to represent the relative position information of the image data, calculates the internal coordinates of the image after the image data is flipped according to the flipping mode, stores the image data in the second on-chip buffer according to the internal coordinates of the image, extracts the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and stores the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer, and stores the image data and the second filling data in the second on-chip buffer in the target storage area of ​​the memory chip according to the address of extracting the second filling data, thereby realizing the extraction of continuous storage data to the on-chip buffer and storage in the memory in the image flipping processing, improving the access bandwidth, and optimizing the system performance.

[0038] According to an image flipping processing method provided by the present invention, the associated data of the image to be flipped is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer, comprising: according to the flipping mode, respectively retrieving the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer through different streaming processing threads; wherein the part of the associated data processed by each of the streaming processing threads is continuously stored data.

[0039] When fetching the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer, different stream processing threads can process part of the data respectively, that is, different stream processing threads fetch the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer respectively. The stream processing thread can be a thread in the stream processor cluster SPC. The part of the associated data processed by each stream processing thread is continuously stored data, thereby improving the access bandwidth.

[0040] The image flipping processing method provided by the present invention is beneficial to improving processing efficiency by fetching the allocated part of associated data from the source storage area of ​​the memory chip to the first on-chip buffer through different stream processing threads according to the flipping mode.

[0041] According to an image flipping processing method provided by the present invention, according to the flipping mode, the allocated part of the associated data is respectively retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads, including: in response to the flipping mode being horizontal flipping, the allocated part of the associated data is respectively retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads in a top-to-bottom order; in response to the flipping mode including vertical flipping, the allocated part of the associated data is respectively retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads in a bottom-to-top order.

[0042] The flip modes include horizontal flip, vertical flip, and horizontal and vertical flip at the same time.

[0043] When the allocated part of the associated data is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads according to the flipping mode, if the flipping mode is horizontal flipping, there is no need for vertical flipping, and the allocated part of the associated data can be retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads in a top-to-bottom order. If the flipping mode includes vertical flipping, the image data originally at the bottom will be moved to the top, and the allocated part of the associated data is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer by different streaming processing threads in a bottom-to-top order. The data in the first on-chip buffer is stored from top to bottom, thereby retrieving the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer, thereby realizing the image flipping processing between streaming processing threads.

[0044] Figure 2 FIG. 1 is a schematic diagram of the processing flow between stream processing threads when vertical flipping occurs in the image flipping processing method provided by the present invention. Figure 2 As shown, the allocated part of the associated data is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer through different stream processing threads in a bottom-up order. Figure 2In the code, dealHPerSpc indicates the number of rows of image data first processed by the SPC thread in a bottom-up order. dealHPerSpcLast indicates the number of rows of image data last processed by the SPC thread in a bottom-up order. Preloadgmb indicates storing the image data and padding data in the first on-chip buffer. spc0 indicates the first SPC thread, and spcLast indicates the last SPC thread. start_h indicates the starting number of rows of image data processed by the SPC thread, and end_h indicates the ending number of rows of image data processed by the SPC thread. Different SPC threads have their own start_h and end_h. imgHeight indicates the total number of rows of the image to be flipped.

[0045] The image flipping processing method provided by the present invention, in response to the flipping mode being horizontal flipping, respectively fetches the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer through different streaming processing threads in a top-down order; in response to the flipping mode including vertical flipping, respectively fetches the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer through different streaming processing threads in a bottom-up order, thereby realizing the orderly processing of image flipping between streaming processing threads and improving the reliability of image flipping.

[0046] According to an image flipping processing method provided by the present invention, the internal coordinates of the image after the image data is flipped are calculated according to the flipping mode, and the image data is stored in a second on-chip buffer according to the internal coordinates of the image, including: for each of the streaming processing threads, the internal coordinates of the image after the image data in the allocated part of the associated data are calculated respectively, and the image data is stored in the second on-chip buffer according to the internal coordinates of the image; wherein the relative position relationship between the image data processed by each of the streaming processing threads in the first on-chip buffer and the second on-chip buffer remains unchanged.

[0047] The image data to be flipped is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer, realizing the image flipping process between the stream processing threads, but the image data in the part of the associated data processed by each stream processing thread has not yet been flipped. The flipping within the stream processing thread is realized by storing the image data from the first on-chip buffer to the second on-chip buffer.

[0048] When the internal coordinates of the image after the image data is flipped are calculated according to the flip mode, and the image data is stored in the second on-chip buffer according to the internal coordinates of the image, for each streaming processing thread, the internal coordinates of the image after the image data in the allocated part of the associated data is calculated respectively, and the corresponding image data is stored in the second on-chip buffer according to the internal coordinates of the image. In the first on-chip buffer and the second on-chip buffer, the relative position relationship between the image data processed by each streaming processing thread remains unchanged. That is, the image data of each process processing thread is still stored in sequence. Thus, the image flipping in the SPC is realized. At this point, the image data has been flipped according to the flip mode.

[0049] Figure 3 : is a schematic diagram of the vertical image flip coordinate conversion in the image flip processing method provided by the present invention. If the initial image internal coordinate is (i, j), the internal coordinate of the flipped image is (H-1-i, j). Wherein, H is the number of rows (height) occupied by the image data processed by the streaming processing thread. Figure 3 As shown, the number of rows occupied by the image data processed by spc0 is dealHPerSpc, and the number of rows occupied by the image data processed by spcLast is dealHPerSpcLast.

[0050] Figure 4 : This is a schematic diagram of the horizontal and vertical image flipping coordinate conversion in the image flipping processing method provided by the present invention. If the initial image internal coordinates are (i, j), the internal coordinates of the flipped image are (H-1-i, W-1-j). Among them, H is the number of rows (height) occupied by the image data processed by the streaming processing thread, and W is the number of columns (width) occupied by the image data processed by the streaming processing thread. Figure 4 As shown, the number of rows occupied by the image data processed by spc0 is dealHPerSpc, the number of rows occupied by the image data processed by spcLast is dealHPerSpcLast, and the number of columns occupied is imgWidth.

[0051] The image flipping processing method provided by the present invention realizes image flipping within the streaming processing thread by respectively calculating the internal coordinates of the image after the image data in the allocated part of the associated data is flipped for each streaming processing thread, and storing the image data in the second on-chip buffer according to the internal coordinates of the image.

[0052] According to an image flipping processing method provided by the present invention, the method also includes: each of the streaming processing threads executes in parallel the calculation of the internal coordinates of the image after the image data in the allocated part of the associated data is flipped, and stores the image data in the second on-chip buffer according to the internal coordinates of the image.

[0053] Each stream processing thread can perform the operations of calculating the internal coordinates of the image after flipping the image data in the allocated part of the associated data and storing the image data in the second on-chip buffer according to the internal coordinates of the image in parallel, thereby improving the processing speed.

[0054] The image flipping processing method provided by the present invention performs the operation of calculating the internal coordinates of the image after the image data in the allocated part of the associated data is flipped in parallel through streaming processing threads, and stores the image data in the second on-chip buffer according to the internal coordinates of the image, so as to give full play to the hardware parallel performance and improve the processing speed.

[0055] According to an image flipping processing method provided by the present invention, the method also includes: executing a first action and a second action in parallel; wherein the first action includes the action of retrieving associated data of the image to be flipped from a source storage area of ​​a memory chip to a first on-chip buffer; the second action includes the action of retrieving second filling data corresponding to the distribution of the first filling data from a target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer.

[0056] Since the associated data of the image to be flipped is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer and the second filling data corresponding to the distribution of the first filling data is retrieved from the target storage area of ​​the memory chip, there is no execution order constraint relationship between the processing of storing the second filling data in the second on-chip buffer, and the two can be executed in parallel, thereby further improving the processing speed.

[0057] The image flipping processing method provided by the present invention fully utilizes the hardware parallel performance and further improves the processing speed by parallelly executing the action of retrieving the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer and the action of retrieving the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip and storing the second filling data in the second on-chip buffer.

[0058] Figure 5 FIG. 2 is a flow chart of the image flipping processing method provided by the present invention. Figure 5 As shown, the method includes: If the vertical direction (H direction) is not flipped, data is fetched from the source storage area (srcHBM) of the memory chip to buffer1 from top to bottom along the H direction; if the vertical direction (H direction) is flipped, data is fetched from the source storage area (src HBM) of the memory chip to buffer1 from bottom to top along the H direction; According to different flipping modes, calculate the coordinates after flipping, and store the data to be flipped from buffer1 to buffer2; Get the pad data corresponding to H from the target storage area (dst HBM) of the memory chip to buffer2; Store buffer2 data to dst HBM.

[0059] The image flipping processing method provided by the present invention can improve the memory access bandwidth in actual scenarios by adopting the cooperation of multiple on-chip buffers; and improves the processing speed by first performing flipping between SPCs and then performing flipping within the SPCs in parallel according to different flipping modes.

[0060] The image flip processing device provided by the present invention is described below. The image flip processing device described below and the image flip processing method described above can be referred to each other.

[0061] Figure 6 Schematic diagram of the structure of the image flipping processing device provided by the present invention. Figure 6 As shown, the device includes a first retrieval module 10, a flip module 20, a second retrieval module 30 and a storage module 40, wherein: the first retrieval module 10: retrieves the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer; wherein the associated data includes the image data of the image to be flipped and the first filling data located around the image data and used to represent the relative position information of the image data, and the associated data is continuously stored data; the flip module 20 is used to: calculate the internal coordinates of the image after the image data is flipped according to the flip mode, and store the image data in the second on-chip buffer according to the internal coordinates of the image; the second retrieval module 30 is used to: retrieve the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and store the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; the storage module 40 is used to: store the image data and the second filling data in the second on-chip buffer to the target storage area of ​​the memory chip according to the address of retrieving the second filling data.

[0062] The image flipping processing device provided by the present invention retrieves the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer, the associated data includes the image data of the image to be flipped and the filling data located around the image data and used to represent the relative position information of the image data, calculates the internal coordinates of the image after the image data is flipped according to the flipping mode, stores the image data in the second on-chip buffer according to the internal coordinates of the image, retrieves the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and stores the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer, and stores the image data and the second filling data in the second on-chip buffer in the target storage area of ​​the memory chip according to the address of the second filling data, thereby realizing the retrieval of the continuously stored data to the on-chip buffer and the storage in the memory in the image flipping processing, improving the access bandwidth and optimizing the system performance.

[0063] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor (processor) 710 , a communication interface (Communications Interface) 720 , a memory (memory) 730 and a communication bus 740 , wherein the processor 710 , the communication interface 720 , and the memory 730 communicate with each other through the communication bus 740 . The processor 710 can call the logic instructions in the memory 730 to execute the image flipping processing method, which includes: fetching the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer; wherein the associated data includes the image data of the image to be flipped and the first filling data located around the image data and used to represent the relative position information of the image data, and the associated data is continuously stored data; according to the flipping mode, calculating the internal coordinates of the image after the image data is flipped, and storing the image data in the second on-chip buffer according to the internal coordinates of the image; fetching the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; according to the address of fetching the second filling data, storing the image data and the second filling data in the second on-chip buffer to the target storage area of ​​the memory chip.

[0064] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0065] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the image flipping processing method provided by the above methods, which includes: retrieving the associated data of the image to be flipped from the source storage area of ​​the memory chip to a first on-chip buffer; wherein the associated data includes the image data of the image to be flipped and first filling data located around the image data and used to represent the relative position information of the image data, and the associated data is continuously stored data; according to the flipping mode, calculating the internal coordinates of the image after the image data is flipped, and storing the image data in a second on-chip buffer according to the internal coordinates of the image; retrieving the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; according to the address of retrieving the second filling data, storing the image data and the second filling data in the second on-chip buffer to the target storage area of ​​the memory chip.

[0066] On the other hand, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the image flipping processing method provided by the above-mentioned methods, the method comprising: fetching the associated data of the image to be flipped from the source storage area of ​​the memory chip to a first on-chip buffer; wherein the associated data includes the image data of the image to be flipped and the first filling data located around the image data and used to represent the relative position information of the image data, and the associated data is continuously stored data; according to the flipping mode, calculating the internal coordinates of the image after the image data is flipped, and storing the image data in a second on-chip buffer according to the internal coordinates of the image; fetching the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; according to the address of fetching the second filling data, storing the image data and the second filling data in the second on-chip buffer to the target storage area of ​​the memory chip.

[0067] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image flipping processing method, characterized in that: include: fetching the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer; wherein the associated data includes the image data of the image to be flipped and first filling data located around the image data and used to represent the relative position information of the image data, and the associated data is continuously stored data; Calculating the internal coordinates of the image after the image data is flipped according to the flipping mode, and storing the image data in a second on-chip buffer according to the internal coordinates of the image; fetching second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; According to the address of retrieving the second filling data, the image data and the second filling data in the second on-chip buffer are stored in the target storage area of ​​the memory chip.

2. The image flipping processing method according to claim 1, characterized in that: The step of fetching the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer includes: According to the flip mode, different stream processing threads respectively retrieve the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer; wherein the part of the associated data processed by each stream processing thread is continuously stored data.

3. The image flipping processing method according to claim 2, characterized in that: According to the flip mode, fetching the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer through different stream processing threads respectively includes: In response to the flipping mode being horizontal flipping, fetching the allocated part of the associated data from the source storage area of ​​the memory chip to the first on-chip buffer through different stream processing threads in a top-to-bottom order; In response to the flipping mode including flipping in the vertical direction, the allocated part of the associated data is retrieved from the source storage area of ​​the memory chip to the first on-chip buffer through different stream processing threads in a bottom-up order.

4. The image flipping processing method according to claim 2, characterized in that: The step of calculating the internal coordinates of the image after the image data is flipped according to the flip mode, and storing the image data in the second on-chip buffer according to the internal coordinates of the image, comprises: For each of the streaming processing threads, the internal coordinates of the image after the image data in the allocated part of the associated data is flipped are calculated respectively, and the image data is stored in the second on-chip buffer according to the internal coordinates of the image; wherein the relative positional relationship between the image data processed by each of the streaming processing threads in the first on-chip buffer and the second on-chip buffer remains unchanged.

5. The image flipping processing method according to claim 4, characterized in that: The method further comprises: Each of the stream processing threads executes in parallel the action of calculating the internal coordinates of the image after the image data in the allocated part of the associated data is flipped, and storing the image data in the second on-chip buffer according to the internal coordinates of the image.

6. The image flipping processing method according to claim 1, characterized in that: The method further comprises: The first action and the second action are executed in parallel; wherein the first action includes the action of retrieving the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer; the second action includes the action of retrieving the second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and storing the second filling data in the second on-chip buffer.

7. An image flipping processing device, characterized in that: include: A first fetching module is used to fetch the associated data of the image to be flipped from the source storage area of ​​the memory chip to the first on-chip buffer; wherein the associated data includes the image data of the image to be flipped and first filling data located around the image data and used to represent the relative position information of the image data, and the associated data is continuously stored data; A flip module, used to: calculate the internal coordinates of the image after the image data is flipped according to the flip mode, and store the image data in a second on-chip buffer according to the internal coordinates of the image; a second fetching module, configured to fetch second filling data corresponding to the distribution of the first filling data from the target storage area of ​​the memory chip, and store the second filling data in the second on-chip buffer; wherein the relative position relationship between the second filling data and the image data in the second on-chip buffer is the same as the relative position relationship between the first filling data and the image data in the first on-chip buffer; The storage module is used to store the image data and the second filling data in the second on-chip buffer into the target storage area of ​​the memory chip according to the address of retrieving the second filling data.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the image flipping processing method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image flipping processing method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image flipping processing method according to any one of claims 1 to 6 is implemented.