Upsample block data processing method
Through the Upsample block data processing method, the FILL_ZERO or NEARST mode is selected and the calculation is only performed in the effective area of the image, which solves the problem of large amount of data but limited effective area in the prior art, and realizes efficient data processing.
Patent Information
- Application Number
- CN202310815571.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, the data volume is large but the neural network only focuses on some effective areas of the image, resulting in wasted computing resources, and Upsample operations cannot efficiently process feature data in some areas.
Using Upsample block data processing method, by selecting FILL_ZERO or NEARST mode, only calculates in the area of interest, and other areas are filled with 0 or the same data, and the processing is accelerated by using SIMD instructions to reduce invalid calculations.
It improves data processing efficiency, reduces calculations, and only performs detailed calculations in required areas, reducing resource consumption.
Smart Images

Figure CN119295303A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data processing, and in particular relates to an Upsample block data processing method. Background Art
[0002] In the prior art, Upsample is used to expand the feature map according to the kernel. The Upsample implementation logic is to supplement the nearest neighbor or the specified position. SIMD: single instruction multiple data, a single instruction stream multiple data stream, a single operation instruction can execute multiple data streams, which can improve the operation speed of the program. (Each register has a 512-bit width) Simd parallel computing: multiple data streams are parallelized to improve computing efficiency.
[0003] However, the main drawback of the existing technology is that the data volume is large, but only part of the valid area needs to be calculated. In other words, the data volume is large, but the area of interest of the neural network only exists in a part of the valid interval of the entire image; for example, in a picture, the area of interest is only the middle face area.
[0004] In addition, common terms in the prior art include:
[0005] 1. feature_shape: the shape of the input data, abstractly understood as multi-dimensional data, from left to right, from high dimension to low dimension (NDHWC) N: the number of FeatureMaps processed at a time, set to 1; D: the number of 32 groups of input channels, H: the height of the input data, W: the width of the input data, C: 32.
[0006] 2. IC, OC: input channel and output channel, generally used for channel description of convolution kernel;
[0007] 3. NEARST: All areas within the kernel are filled with the same input data;
[0008] 4. FILL_ZERO: Fill the specified position in the kernel with input data, and fill the remaining positions with pad data (default pad = 0). Summary of the invention
[0009] In order to solve the above problems, the purpose of this application is: if a picture has only the middle face area in the area of interest, and some narration areas have fewer features, deleting them will not affect the overall result, so the present invention supports block processing of the output image. That is,
[0010] The Upsample calculation results retain part of the valid area:
[0011] 1) Calculate the input index according to the index that needs to be retained;
[0012] 2) Process the first row of data separately, and calculate the remaining data in a loop, using SIMD instructions for acceleration.
[0013] Specifically, the present invention provides an Upsample block data processing method, in which the Upsample implementation logic is to enlarge the original image according to the kernel in a required manner, and the required manner includes filling 0 at a specified position and filling the same data completely; wherein,
[0014] FILL_ZERO: fill kenerl area with 0;
[0015] NEARST: fill in the input data in the kernel area. This selection method can select the required upsampling method according to the actual training needs;
[0016] The method further comprises the following steps:
[0017] S1, input data:
[0018] 1 2 3 4
[0019] S2, according to the actual training requirements, select step S3 or step S4;
[0020] S3, FILL_ZERO: fill 0 mode, fill the specified position, and fill the rest of the positions with 0, that is, fill 0 within a kernel, and jump to the next kernel after calculating a kernel.
[0021] 1 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[0022] S4, NEARST: Nearest neighbor mode, fill the kernel area with the mapped input data, and each calculation is performed on the data in a kernel:
[0023] 1 1 1 2 2 2 1 1 1 2 2 2 1 1 1 2 2 2 3 3 3 4 4 4 3 3 3 4 4 4 3 3 3 4 4 4
[0024] Mask0: 0xffffffff NEARST, nearest neighbor mode, set to 0xffffffff to keep the original data, fill 0 mode, set to 0x00000000 to remove the original data;
[0025] Mask1: pad NEARST, nearest neighbor mode, set to 0x00000000, the original data is not effective; FILL_ZERO, fill 0 mode, set the mask according to the parameter pad, assuming that pad is 5; Mask1: 0x5
[0026] Oh_start: output the starting position of h;
[0027] Ksize_h: height of the convolution kernel;
[0028] Ksize_w: width of the convolution kernel;
[0029] Ih_start=(oh_start+ksize_h-1) / ksize_h Input h is the starting position of 1 row of input, which can map ksize_h rows of output;
[0030] a) There will be a situation where a single row is removed;
[0031] b) FILL_ZERO can randomly fill the specified position;
[0032] c) NEARST does not need to consider the output first address;
[0033] As shown in the table below: Keep the data in the shaded area. In FILL_ZERO mode, the input data starts from ih=1 to reduce the amount of calculation.
[0034]
[0035] As shown in the table below: In NEARST, all data must be calculated, and the oh_start position is calculated from oh=0; the oh_start position can be calculated in advance based on the mode and fill position
[0036]
[0037] The NEARST mode: all points in the kernel area are filled with the same data Kernel: 3*3,
[0038] MASK0: 0xffff, input data "AND" operation mask, and it can retain the original data; MASK_pad: 0, input and mask0'AND' the result and MASK_pad for 'OR' operation;
[0039] Assumption: pad = 5; input data val = 3;
[0040] FILL_ZERO mode: MASK0=0, MASK_pad=5;
[0041] Val = 0x3 & 0x0 = 0;
[0042] Val=0x0|0x5=0x5; this value is used to fill the remaining positions of kenerl in FILL_ZERO mode;
[0043] NEARST mode: MASK0 = 0xffffffff, MASK_pad = 0;
[0044] Val = 0x3 & 0xffffffff = 0x3;
[0045] Val=0x3|0x0=0x3; This value is used to fill the remaining positions of kenerl in NEARST mode to ensure that all numerical data are the same;
[0046] MASK0 and MASK_pad can be set to determine the mode before calculation.
[0047] The NEARST mode further includes:
[0048] Step 1: Perform AND operation on the original data and MASK0 to keep the original data;
[0049] Step 2: In NEARST mode, the mask of pad is set to 0, and an OR operation is performed to obtain location_val. In this mode, location_val is equal to the input data and will not be modified. Step 3: Fill all locations in the kernel with input data, and fill the specified location with location_val value according to the address offset. If it is NEARST mode, this val is equal to the input data and will not be modified.
[0050] Step 4: According to the number of rows oh_start that the output needs to be split into, determine the kernel loop, process the first row of input separately, and divide the entire loop into two parts;
[0051] Part 1: Assume: oh_start=1; input 1 line, map output 3 lines, keep 2 lines. In this mode, all lines are consistent, no need to consider whether the valid data will be split; current kernel_h=3-1; calculate 2 lines, output address offset 2 lines; if oh_start>kernel_h, it indicates that the input address needs to be updated: jump to oh_start / kernel_h line;
[0052] Part 2: The input address is offset by one line, the output address is offset by two lines, kernel=3*3 calculates the subsequent h direction data, and obtains the final result.
[0053] The FILL_ZERO mode: the kernel area is filled with valid data at specified points, and the rest of the data is filled with 0;
[0054] Kernel: 3*3
[0055] MASK0:0
[0056] MASK_pad: pad;
[0057] Further including:
[0058] Step 1: Specify the location index calculation. The value is set by the user according to their own needs and can be set to any number within the kernel:
[0059] Assume location = 5, indicating that the 5th number is filled with specified data, and the rest of the points are filled with pad data.
[0060] kh_location=5 / ksize_w, locate to a specific row number;
[0061] kw_location=5%ksize_w, locate the specific number of columns;
[0062] Locate and fill the specified data in 2 rows and 2 columns, and fill the rest of the data with pad;
[0063] 0 0 0 0 val 0 0 0 0
[0064] The address of each output point needs to be added with the offset to complete the update of the specified position;
[0065] Step 2: Cutting position index calculation. The input of some lines is invalid. It is necessary to calculate the address obtained by normal calculation and the address after cutting to get the required address offset.
[0066] Rail_oh = oh_start% ksize_h; the number of rows in a kernel;
[0067] rail_oh*oline_size, output address offset;
[0068] Step 3: Data filling, AND the input with MASK0 to ensure the data is retained or cleared; then perform an OR operation with MASK_PAD to ensure that loaction_val is the PAD value or the original data; expressed as:
[0069] ANDV(VR0,MASK0,VAL); VR0 stores the result of the first step 'AND';
[0070] ORV(VR1,MASK_PAD,VR0); VR1 and pad value 'OR' operation;
[0071] Now fill all the locations of a kernel with location_val, and finally reassign the input data to the specified area according to the location coordinate position, expressed as: SA (o, VR1, 0, ptr, 0), store the data in VR1 into the specified location coordinate position, and ensure that the upsampled data is successfully filled:
[0072]
[0073] Step4: Overall logical calculation, divided into two steps: It is necessary to consider whether the assignment at the specified position will be split, and the Pad uses the default value 0:
[0074] The first part:
[0075] Assume oh_start = 2; Input 1 line, map and output 3 lines, retain 1 line; In this mode, it is necessary to consider whether the input data is split; Currently, loc_kernel_h = 3 - oh_start; Only 1 line needs to be calculated; Since location = 5, this data is filled at the position of oh = 1 and is split and deleted, so there is no need to assign values to the specified area in this area, jump out of the loop, and the output address is offset by 1 line; It is expressed as: rail_oh = oh_start % kernel_h;
[0076] kn_h = location / kernel_w
[0077] / * Calculate the first line separately * /
[0078] if(rail_oh > kn_h){
[0079] Continue;
[0080] }else{
[0081] LA(o, VR0, 0, in_ptr, 0); Read data from the input address and store it in the VR0 register
[0082] SA(o, VR0, 0, out_ptr, 0); Read data from the VR0 register and store it in the output address
[0083] };
[0084] The second part: The input address is offset by 1 line, the output address is offset by 1 line, and the kernel = 3 * 3 is used to calculate the subsequent data in the h direction. Get the final result, and this logic is the same as NEARST;
[0085] eps: When pad = 0, initialize the output space to 0 in advance. When kn_loction < rail_h, in the NEARST mode, it is necessary to fill data for the remaining lines, and directly jump in the FILL_ZERO mode and enter the second part of the loop calculation; It is expressed as:
[0086] h_idx is the offset of the input height calculated in the first part, for(h_idx=ih_start; h_idx <in_height;h_idx++){
[0087] Calculate the correct fill value and fill it in the specified position
[0088] }.
[0089] The oh_start can be any output height value. If oh_start<0 or oh_start>out_height, it means that the parameter setting is wrong and the error status is directly returned.
[0090] Therefore, the advantage of the present application is that data processing efficiency is improved through a simple method. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0092] Figure 1 It is a flow chart of the present application method. DETAILED DESCRIPTION
[0093] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.
[0094] like Figure 1 As shown, the embodiment of the present application relates to an Upsample block data processing method, wherein the Upsample implementation logic is: the original image is enlarged according to the required method according to the kernel, wherein,
[0095] FILL_ZERO: fill the kenerl area with 0,
[0096] NEARST: Fill the kernel area with input data. This selection method can be selected according to the actual training needs. You can select the upsample method you need to fill the specified position with 0 and fill all with the same data. S1, input data:
[0097] 1 2 3 4
[0098] S2, according to the actual training requirements, select step S3 or step S4;
[0099] S3, FILL_ZERO: fill 0 mode, fill the specified position, and fill the rest of the positions with 0. For example, the upper left 3*3 grid in the following table represents a kernel. A kernel is filled with 0. After calculating a kernel, jump to the next kernel. For example, jump from number 1, size 3x3 kernel to number 2, size 3x3 kernel:
[0100] 1 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[0101] S4, NEARST: Nearest neighbor mode, in the kernel area, the input data mapped is calculated for each kernel data. As shown in the following table, in the kernel bold area, the input data mapped by a kernel is:
[0102] 1 1 1 2 2 2 1 1 1 2 2 2 1 1 1 2 2 2 3 3 3 4 4 4 3 3 3 4 4 4 3 3 3 4 4 4
[0103] Mask0: 0xffffffff NEARST, nearest neighbor mode, set to 0xffffffff to retain the original data fill 0 mode, set to 0x00000000 to remove the original data
[0104] Mask1: pad NEARST, nearest neighbor mode, set to 0x00000000, the original data is not effective; FILL_ZERO, fill 0 mode, set the mask according to the parameter pad, for example, pad is 5; Mask1: 0x55555555
[0105] Oh_start: output the starting position of h;
[0106] Ksize_h: height of the convolution kernel;
[0107] Ksize_w: width of the convolution kernel;
[0108] Ih_start=(oh_start+ksize_h-1) / ksize_h Input h starting position 1 row input, can map ksize_h rows of output;
[0109] a) There will be cases where a single row is removed;
[0110] b) FILL_ZERO can randomly fill the specified position;
[0111] c) NEARST does not need to consider the output first address.
[0112] As shown in the table below: Keep the shaded area. In FILL_ZERO mode, the input data starts from ih=1 to reduce the amount of calculation.
[0113]
[0114] As shown in the table below: In NEARST, all data must be calculated, and the oh_start position is calculated from oh=0; the oh_start position can be calculated in advance based on the mode and fill position
[0115]
[0116] The NEARST mode: all points in the kernel area are filled with the same data MASK0: 0xffff, input data "AND" operation mask, and AND with it, the original data can be retained; MASK_pad: 0, input and mask0 'AND' after the result and MASK_pad 'OR' operation;
[0117] For example: pad = 5; input data val = 3;
[0118] FILL_ZERO mode: MASK0=0, MASK_pad=5;
[0119] Val = 0x3 & 0x0 = 0;
[0120] Val=0x0|0x5=0x5; this value is used to fill the remaining positions of kenerl in FILL_ZERO mode.
[0121] NEARST mode: MASK0 = 0xffffffff, MASK_pad = 0;
[0122] Val = 0x3 & 0xffffffff = 0x3;
[0123] Val=0x3|0x0=0x3; this value is used to fill the remaining positions of kenerl in NEARST mode to ensure that all numerical data are the same.
[0124] MASK0 and MASK_pad can be set to determine the mode before calculation.
[0125] Further including:
[0126] Step 1: Perform AND operation on the original data and MASK0 to keep the original data;
[0127] Step 2: In NEARST mode, the mask of pad is set to 0, and an OR operation is performed to obtain location_val. In this mode, location_val is equal to the input data and will not be modified. Step 3: Fill all locations in the kernel with input data, and fill the specified location with location_val value according to the address offset. If it is NEARST mode, this val is equal to the input data and will not be modified.
[0128] Step 4: According to the number of rows oh_start that the output needs to be split into, determine the kernel loop, process the first row of input separately, and divide the entire loop into two parts;
[0129] Part 1: Example: oh_start=1; input 1 line, map output 3 lines, keep 2 lines. In this mode, all lines are consistent, no need to consider whether the valid data will be split; current kernel_h=3-1; calculate two lines, output address offset two lines; if oh_start>kernel_h, it indicates that the input address needs to be updated: jump to oh_start / kernel_h line;
[0130] Part 2: Input address offset by one line, output address offset by two lines, kernel=3*3 calculates subsequent h direction data. Get the final result
[0131] The FILL_ZERO mode: the kernel area is filled with valid data at specified points, and the rest of the data is filled with 0;
[0132] Kernel: 3*3
[0133] MASK0:0
[0134] MASK_pad: pad;
[0135] Further including:
[0136] Step 1: Specify the location index calculation. This value is set by the user according to their needs and can be set to any number within a kernel:
[0137] For example, location=5, which means the 5th number is filled with specified data, and the rest of the points are filled with pad data kh_location=5 / ksize_w, which is located at a specific row number;
[0138] kw_location=5%ksize_w, locate the specific number of columns;
[0139] Locate and fill the specified data in 2 rows and 2 columns, and fill the rest of the data with pad;
[0140] 0 0 0 0 val 0 0 0 0
[0141] The address of each output point needs to be added with the offset to complete the update of the specified position;
[0142] Step 2: Cutting position index calculation. The input of some lines is invalid. It is necessary to calculate the address obtained by normal calculation and the address after cutting to get the required address offset.
[0143] Rail_oh = oh_start% ksize_h; the number of rows in a kernel;
[0144] rail_oh*oline_size, output address offset.
[0145] Step 3: Data filling, AND the input with MASK0 to ensure the data is retained or cleared; then perform an OR operation with MASK_PAD to ensure that loaction_val is the PAD value or the original data; expressed as:
[0146] ANDV(VR0,MASK0,VAL); VR0 saves the result of the first step 'AND' ORV(VR1,MASK_PAD,VR0); VR1 and pad value 'OR' operation;
[0147] Now fill all positions of a kernel with location_val, and finally reassign the input data to the specified area according to the location coordinates to ensure that the upsampled data is successfully filled:
[0148]
[0149] Step 4: The overall logical calculation is divided into two steps: It is necessary to consider whether the assigned value at the specified position will be split (Pad uses the default value 0):
[0150] Part I:
[0151] Example: oh_start=2; input 1 line, map output 3 lines, keep 1 line; in this mode, it is necessary to consider whether the input data is segmented; current kernel_h=3-oh_start; only 1 line needs to be calculated; because location=5, the data is filled in the position of oh=1, which is segmented and deleted, and there is no need to assign a value to the specified area, jump out of the loop, and the output address is offset by 1 line; it is expressed as: rail_oh=oh_start%kernel_h;
[0152] kn_h = location / kernel_w
[0153] / *First line, calculate separately* /
[0154] if(rail_oh>kn_h){
[0155] Continue;
[0156] }else{
[0157] LA(o, VR0, 0, in_ptr, 0); Read data from the input address and store it in the VR0 register. SA(o, VR0, 0, out_ptr, 0); Read data from the VR0 register and store it in the output address.
[0158] };
[0159] oh_start can be any value of the output height. If <0 or > out_height, it means the parameter setting is incorrect, and directly return the error status;
[0160] The second part: Offset the input address by 1 line, offset the output address by 1 line, and calculate the subsequent data in the h direction with kernel = 3 * 3. Get the final result, and this logic is the same as NEARST.
[0161] eps: When pad = 0, initialize the output space to 0 in advance. When kn_loction < rail_h and in the NEARST mode, it is necessary to fill in data for the remaining lines. In the FILL_ZERO mode, directly jump to enter the second part of the loop calculation, which is expressed as:
[0162] h_idx is the offset of the input height obtained after the first part of the calculation.
[0163] for(h_idx = ih_start; h_idx < in_height; h_idx++){
[0164] Calculate the correct filling value and fill it in the specified position;
[0165] };
[0166] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An Upsample block data processing method, characterized in that: The Upsample implementation logic in the method is to enlarge the original image according to the kernel in a desired manner, including filling the specified position with 0 or filling the entire position with the same data; wherein, FILL_ZERO: fill kenerl area with 0; NEARST: fill in the input data in the kernel area. This selection method can select the required upsampling method according to the actual training needs; The method further comprises the following steps: S1, input data: Assume S2, according to the actual training requirements, select step S3 or step S4; S3, FILL_ZERO: fill 0 mode, fill the specified position, fill the rest of the kernel area with 0, that is, fill 0 within a kernel. After calculating a kernel, jump to the next kernel. The bold area is a kernel, as shown in the following table: S4, NEARST: Nearest neighbor mode, fill in the kernel area with the mapped input data, and each calculation is performed on the data in a kernel, as shown in the following table: Mask0: 0xffffffff NEARST, nearest neighbor mode, set to 0xffffffff to keep the original data, fill 0 mode, set to 0x00000000 to remove the original data; Mask1: pad NEARST, nearest neighbor mode, set to 0x00000000, the original data is not effective; FILL_ZERO, fill 0 mode, set the mask according to the parameter pad, assuming that pad is 5, Mask is 32bit, Mask1: 0x5 Oh_start: output the starting position of h; Ksize_h: height of the convolution kernel; Ksize_w: width of the convolution kernel; Ih_start=(oh_start+ksize_h-1) / ksize_h Input h starting position 1 line of input can map ksize_h lines of output; a) There will be a situation where a single row is removed; b) FILL_ZERO can randomly fill the specified position; c) NEARST does not need to consider the output first address; As shown in the table below: Keep the data in the shaded area. In FILL_ZERO mode, the input data starts from ih=1 to reduce the amount of calculation. As shown in the table below: In NEARST, all data must be calculated, and the oh_start position is calculated from oh=0; the oh_start position can be calculated in advance based on the mode and fill position:
2. The Upsample block data processing method according to claim 1, characterized in that: The NEARST mode: all points in the kernel area are filled with the same data Kernel: 3*3, MASK0: 0xffff, input data "AND" operation mask, and it can retain the original data; MASK_pad: 0, input and mask0'AND' the result and MASK_pad for 'OR' operation; Assumption: pad = 5; input data val = 3; FILL_ZERO mode: MASK0=0, MASK_pad=5; Val = 0x3 & 0x0 = 0; Val=0x0|0x5=0x5; this value is used to fill the remaining positions of kenerl in FILL_ZERO mode; NEARST mode: MASK0 = 0xffffffff, MASK_pad = 0; Val = 0x3 & 0xffffffff = 0x3; Val=0x3|0x0=0x3; This value is used to fill the remaining positions of kenerl in NEARST mode to ensure that all numerical data are the same; MASK0 and MASK_pad can be set to determine the mode before calculation.
3. The Upsample block data processing method according to claim 2, characterized in that: The NEARST mode further includes: Step 1: Perform AND operation on the original data and MASK0 to keep the original data; Step 2: In NEARST mode, the mask of pad is set to 0, and an OR operation is performed to obtain location_val. In this mode, location_val is equal to the input data and will not be modified. Step 3: Fill all locations in the kernel with input data, and fill the specified location with the location_val value according to the address offset. If it is NEARST mode, the val is equal to the input data and will not be modified; Step 4: According to the number of rows oh_start that the output needs to be split into, determine the kernel loop, process the first row of input separately, and divide the entire loop into two parts; Part 1: Assume: oh_start=1; input 1 line, map output 3 lines, keep 2 lines. In this mode, all lines are consistent, no need to consider whether the valid data will be split; current kernel_h=3-1; calculate 2 lines, output address offset 2 lines; if oh_start>kernel_h, it indicates that the input address needs to be updated: jump to oh_start / kernel_h line; Part 2: The input address is offset by one line, the output address is offset by two lines, kernel=3*3 calculates the subsequent h direction data, and obtains the final result.
4. The Upsample block data processing method according to claim 1, characterized in that: The FILL_ZERO mode: the kernel area is filled with valid data at specified points, and the rest of the data is filled with 0; Kernel: 3*3 MASK0:0 MASK_pad: pad; Further including: Step 1: Specify the location index calculation. The value is set by the user according to their own needs and can be set to any number within the kernel: Assume location = 5, indicating that the 5th number is filled with specified data, and the rest are filled with pad data, kh_location = 5 / ksize_w, positioning to a specific row number; kw_location=5%ksize_w, locate the specific number of columns; Locate and fill the specified data in 2 rows and 2 columns, and fill the rest of the data with pad; The address of each output point needs to be added with the offset to complete the update of the specified position; Step2: Calculation of cutting position index. The input number of partial lines is invalid. It is necessary to perform an operation based on the address obtained by normal calculation and the address after segmentation to obtain the required address offset. Rail_oh = oh_start % ksize_h; The number of lines segmented in one kernel. rail_oh * oline_size, the output address offset. Step3: Data filling. AND the input with MASK0 to determine the retained data or clear it; then perform an OR operation with MASK_PAD to ensure that loaction_val is the PAD value or the original data. It is expressed as: ANDV(VR0, MASK0, VAL); VR0 stores the result after the first 'AND' operation. ORV(VR1, MASK_PAD, VR0); Perform an OR operation between VR1 and the pad value. Now fill all positions of one kernel with location_val, and finally reassign the input data to the specified area according to the location coordinate position. It is expressed as: SA(o, VR1, 0, ptr, 0), store the data in VR1 at the specified location coordinate position to ensure successful filling of the upsampled data. Step4: Overall logical calculation, divided into two steps: It is necessary to consider whether the assignment at the specified position will be segmented, and the Pad uses the default value 0. The first part: Assume oh_start = 2; Input 1 line, map to output 3 lines, retain 1 line; In this mode, it is necessary to consider whether the input data is segmented; Currently, loc_kernel_h = 3 - oh_start; Only need to calculate 1 line; Since location = 5, this data is filled at the position of oh = 1 and is segmented and deleted. There is no need to assign to the specified area for this area, jump out of the loop, and the output address offset is 1 line. It is expressed as: The second part: The input address is offset by 1 line, the output address is offset by 1 line, and kernel = 3 * 3 is used to calculate the subsequent data in the h direction; Obtain the final result, and this logic is the same as NEARST. eps: When pad = 0, initialize the output space to 0 in advance. When kn_loction < rail_h, in the NEARST mode, it is necessary to fill data for the remaining lines, and directly jump in the FILL_ZERO mode to enter the loop calculation of the second part. It is expressed as: h_idx is the offset of the input height obtained after the first part of the calculation. for (h_idx = ih_start; h_idx < in_height; h_idx++) { Calculate the correct filling value and fill it into the specified position. }。 5. The Upsample block data processing method according to claim 4, characterized in that: In the first part of Step4 in the FILL_ZERO mode: oh_start can be any value of the output height. If oh_start < 0 or oh_start > out_height, it means that the parameter setting is incorrect, and directly return the error status.